Skip to content

Commit

Permalink
Merge pull request #10 from NBISweden/instructions
Browse files Browse the repository at this point in the history
Add some basic instructions for usage
  • Loading branch information
pontus authored Jan 10, 2025
2 parents e533ed9 + 6a92a94 commit 0d3e26b
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 6 deletions.
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,48 @@ This repository provides a FUSE file system driver for the sensitive data
archive. The intended use is to provide an easy way to use the archive
off-platform.

## FUSE driver
## About

This should work as user (privilegeless) installation on any modern system
providing the FUSE stack (i.e. fusermount3).
### FUSE driver

This should work as user (without additional privileges) installation on any
modern system providing the FUSE stack (i.e. `fusermount3`).

This should be usable. There are some possible improvements regarding cache
handling that can be done and it hasn't currently been tested for very large
datasets

## CSI
### CSI

We also aim to provide a CSI to allow usage with kubernetes. This is still
work in progress and should not be expected to be usable at this point in time.

## Usage

To be usable, you need to have been granted access to datasets, for bigpicture
you can view available datasets and apply for access in
[REMS](https://bp-rems.sd.csc.fi/).

Once you have been granted access, you can download a configuration file with
access credentials from the
[login site](https://login.bp.nbis.se/).

Armed with you configuration (e.g. in `~/Download/s3cmd.conf`), you can launch
`sdafs` at `/where/you/want/to/mount` as so:

```bash
sdafs --credentialsfile ~/Download/s3cmd.conf /where/you/want/to/mount
```

### Troubleshooting

By default, `sdafs` will daemonize after some rudimentary checks. After that,
additional messages can be seen in the log file (`sdafs.log` in the current
directory unless overridden when running in the background). Alternatively,
`sdafs` can be run without detaching with by passing `--foreground`.

### Permissions

By default, `sdafs` will not allow access from other users. For use cases where
that is not enough (e.g. running some tool in a container solution), the flag
`--open` will allow access from all users.
19 changes: 17 additions & 2 deletions cmd/sdafs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,19 @@ func detachIfNeeded(c mainConfig) {
}
}

func checkMountDir(m mainConfig) {
st, err := os.Stat(m.mountPoint)

if err != nil {
log.Fatalf("Error while checking desired mount point %s: %v",
m.mountPoint, err)
}

if !st.IsDir() {
log.Fatalf("Error while checking mount point %s: not a directory", m.mountPoint)
}
}

func main() {
c := getConfigs()
mountConfig := &fuse.MountConfig{
Expand All @@ -122,14 +135,16 @@ func main() {
VolumeName: fmt.Sprintf("SDA mount of %s", c.sdafsconf.RootURL),
}

repointLog(c)
detachIfNeeded(c)
checkMountDir(c)

fs, err := sdafs.NewSDAfs(c.sdafsconf)
if err != nil {
log.Fatalf("Error while creating sda fs: %v", err)
}

repointLog(c)
detachIfNeeded(c)

mount, err := fuse.Mount(c.mountPoint, fs.GetFileSystemServer(), mountConfig)
if err != nil {
log.Fatalf("Mount of sda at %s failed: %v", c.sdafsconf.RootURL, err)
Expand Down

0 comments on commit 0d3e26b

Please sign in to comment.