Skip to content

Commit d9fdd09

Browse files
authored
Merge pull request #56 from bedroge/cvmfs_unprivileged
Add section about Singularity/cvmfsexec
2 parents c463035 + 24fd79c commit d9fdd09

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

docs/05_advanced.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,47 @@ making some changes to the repository at `/cvmfs/repo.organization.tld`, and the
306306
cvmfs_server publish repo.organization.tld
307307
```
308308

309-
## 5.5 Using a configuration repository
309+
## 5.5 Mounting CernVM-FS repositories as an unprivileged user
310+
311+
The default way of installing and configuring the CernVM-FS client requires you to have root privileges.
312+
In case you want to use CernVM-FS repositories on systems where you do not have these, there are still some ways to install the client and mount repositories.
313+
We will show two different methods: using a [Singularity](https://sylabs.io/singularity/) container, and [cvmfsexec](https://github.com/cvmfs/cvmfsexec).
314+
315+
### 5.5.1 Singularity
316+
317+
Recent versions of Singularity offer a `--fusemount` option that allow you to mount CernVM-FS repositories.
318+
In order for this to work, you will need to install the `cvmfs` and `cvmfs-fuse3` package inside your container,
319+
and add the right configuration files and public keys for the repositories.
320+
Furthermore, you need two make two directories on the host system that will store the CernVM-FS cache and sockets;
321+
these need to be made available via a bind mount inside the container at `/var/lib/cvmfs` and `/var/run/cvmfs`, respectively.
322+
323+
As an example, you can run the [EESSI pilot client container](https://eessi.github.io/docs/pilot/#accessing-the-eessi-pilot-repository-through-singularity) (which was built using [this Dockerfile](https://github.com/EESSI/filesystem-layer/blob/master/containers/Dockerfile.EESSI-client-pilot-centos7-x86_64)) using Singularity by doing:
324+
```
325+
mkdir -p /tmp/$USER/{var-lib-cvmfs,var-run-cvmfs}
326+
export SINGULARITY_BIND="/tmp/$USER/var-run-cvmfs:/var/run/cvmfs,/tmp/$USER/var-lib-cvmfs:/var/lib/cvmfs"
327+
export EESSI_CONFIG="container:cvmfs2 cvmfs-config.eessi-hpc.org /cvmfs/cvmfs-config.eessi-hpc.org"
328+
export EESSI_PILOT="container:cvmfs2 pilot.eessi-hpc.org /cvmfs/pilot.eessi-hpc.org"
329+
singularity shell --fusemount "$EESSI_CONFIG" --fusemount "$EESSI_PILOT" docker://eessi/client-pilot:centos7-$(uname -m)
330+
```
331+
332+
Note that you have to be careful when launching multiple containers on the same machine:
333+
in this case, they all need a separate location for the cache, as it cannot be shared across containers.
334+
335+
### 5.5.2 cvmfsexec
336+
As an alternative, especially when Singularity is not available on your host system, you can try [cvmfsexec](https://github.com/cvmfs/cvmfsexec).
337+
Depending on the availability of `fusermount` and user namespaces on the host system, it has several mechanisms for mounting CernVM-FS repositories,
338+
either in a user's own file space or even under `/cvmfs`.
339+
340+
An advantage of this method is that the cache can be shared by several processes running on the same machines, even if you bind the mountpoint into multiple container instances.
341+
342+
!!! note
343+
This currently only works on RHEL 6/7/8 and its derivatives, and SUSE 15 and its derivatives.
344+
345+
Besides the `cvmfsexec` script itself, there is also a `singcvmfs` script that can be used to easily launch Singularity containers with a CernVM-FS mount;
346+
this also uses the aforementiond `--fusemount` flag.
347+
More information about this script can be found on the [README page of the `cvmfsexec` GitHub repository](https://github.com/cvmfs/cvmfsexec#singcvmfs-command).
348+
349+
## 5.6 Using a configuration repository
310350

311351
In the [first hands-on part of this tutorial](02_stratum0_client.md#22-setting-up-a-client) we have manually
312352
configured our CernVM-FS client.

0 commit comments

Comments
 (0)