@@ -97,7 +97,8 @@ prefix ``SINGULARITYENV_``.
97
97
Accessing the host's filesystem
98
98
-------------------------------
99
99
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 ``).
101
102
This is particularly relevant because, *if you can't run Singularity in privileged
102
103
mode * (which is almost certainly true in all the scenarios), **Singularity containers
103
104
are read only **.
@@ -110,13 +111,42 @@ In addition, Singularity generally allows binding the necessary folders with
110
111
the ``-B <host_folder>:<container_folder>[:<permissions>] `` Singularity argument.
111
112
For example: ::
112
113
113
- $ singularity run --cleanenv -B /work:/work fmriprep.smig \
114
+ $ singularity run --cleanenv -B /work:/work fmriprep.simg \
114
115
/work/my_dataset/ /work/my_dataset/derivatives/fmriprep \
115
116
participant \
116
117
--participant-label 387 --nthreads 16 \
117
118
--omp-nthreads 16
118
119
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 **.
120
150
By default, Singularity will bind the user's ``$HOME `` directory in the host
121
151
into the ``/home/$USER `` (or equivalent) in the container.
122
152
Most of the times, it will also redefine the ``$HOME `` environment variable and
@@ -130,6 +160,7 @@ argument (``--home``) as follows: ::
130
160
$ singularity run -B $HOME:/home/fmriprep --home /home/fmriprep \
131
161
--cleanenv fmriprep.simg <fmriprep arguments>
132
162
163
+
133
164
.. _singularity_tf :
134
165
135
166
*TemplateFlow * and Singularity
@@ -190,7 +221,7 @@ For example:
190
221
$ export SINGULARITYENV_https_proxy=http://<ip or proxy name>:<port>
191
222
192
223
``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
194
225
encription.
195
226
There are two potential solutions to the issue.
196
227
The `recommended one <https://neurostars.org/t/problems-using-pediatric-template-from-templateflow/4566/17 >`__
0 commit comments