Skip to content

Commit a2a30fe

Browse files
committed
fix: added privileges principle from @dmd, added binding issues pointed out by @utooley, fixed typos (@JoffJones)
1 parent 3b005c1 commit a2a30fe

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676

7777
# General information about the project.
7878
project = 'fmriprep'
79-
author = 'The FMRIPREP developers'
79+
author = 'The fMRIPrep developers'
8080
copyright = '2016-%s, %s' % (datetime.now().year, author)
8181

8282
# The version info for the project you're documenting, acts as replacement for

docs/singularity.rst

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ prefix ``SINGULARITYENV_``.
9797
Accessing the host's filesystem
9898
-------------------------------
9999
Depending on how Singularity is configured on your cluster it might or might not
100-
automatically bind (mount or expose) host folders to the container.
100+
automatically bind (mount or expose) host's folders to the container (e.g., ``/scratch``,
101+
or ``$HOME``).
101102
This is particularly relevant because, *if you can't run Singularity in privileged
102103
mode* (which is almost certainly true in all the scenarios), **Singularity containers
103104
are read only**.
@@ -110,13 +111,42 @@ In addition, Singularity generally allows binding the necessary folders with
110111
the ``-B <host_folder>:<container_folder>[:<permissions>]`` Singularity argument.
111112
For example: ::
112113

113-
$ singularity run --cleanenv -B /work:/work fmriprep.smig \
114+
$ singularity run --cleanenv -B /work:/work fmriprep.simg \
114115
/work/my_dataset/ /work/my_dataset/derivatives/fmriprep \
115116
participant \
116117
--participant-label 387 --nthreads 16 \
117118
--omp-nthreads 16
118119

119-
**Relevant aspects of the ``$HOME`` directory within the container**.
120+
.. warning::
121+
122+
If your Singularity installation doesn't allow you to bind non-existent bind points,
123+
you'll get an error saying ``WARNING: Skipping user bind, non existent bind point
124+
(directory) in container``.
125+
In this scenario, you can either try to bind things onto some other bind point you
126+
know it exists in the image or rebuild your singularity image with ``docker2singularity``
127+
as follows:
128+
::
129+
130+
$ docker run --privileged -ti --rm -v /var/run/docker.sock:/var/run/docker.sock \
131+
-v $PWD:/output singularityware/docker2singularity \
132+
-m "/gpfs /scratch /work /share /lscratch /opt/templateflow"
133+
134+
In the example above, the following bind points are created: ``/gpfs``, ``/scratch``,
135+
``/work``, ``/share``, ``/opt/templateflow``.
136+
137+
.. note::
138+
139+
One great feature of containers is their confinement or isolation from the host
140+
system.
141+
Binding mount points breaks this principle, as the container has now access to
142+
create changes in the host.
143+
Therefore, it is generally recommended to use binding scarcely and granting
144+
very limited access to the minimum necessary resources.
145+
In other words, it is preferred to bind just one subdirectory of ``$HOME`` than
146+
the full ``$HOME`` directory of the host (see `\#1778 (comment)
147+
<https://github.com/poldracklab/fmriprep/issues/1778#issuecomment-538009563>`_).
148+
149+
**Relevant aspects of the** ``$HOME`` **directory within the container**.
120150
By default, Singularity will bind the user's ``$HOME`` directory in the host
121151
into the ``/home/$USER`` (or equivalent) in the container.
122152
Most of the times, it will also redefine the ``$HOME`` environment variable and
@@ -130,6 +160,7 @@ argument (``--home``) as follows: ::
130160
$ singularity run -B $HOME:/home/fmriprep --home /home/fmriprep \
131161
--cleanenv fmriprep.simg <fmriprep arguments>
132162

163+
133164
.. _singularity_tf:
134165

135166
*TemplateFlow* and Singularity
@@ -190,7 +221,7 @@ For example:
190221
$ export SINGULARITYENV_https_proxy=http://<ip or proxy name>:<port>
191222

192223
``requests.exceptions.SSLError: HTTPSConnectionPool ...``.
193-
In this case, you container seems to be able to reach the Internet, but unable to use SSL
224+
In this case, your container seems to be able to reach the Internet, but unable to use SSL
194225
encription.
195226
There are two potential solutions to the issue.
196227
The `recommended one <https://neurostars.org/t/problems-using-pediatric-template-from-templateflow/4566/17>`__

0 commit comments

Comments
 (0)