Skip to content

Commit 3f79fc2

Browse files
oestebaneffigiesyarikoptic
authored
Apply suggestions from code review
Co-authored-by: Chris Markiewicz <[email protected]> Co-authored-by: Yaroslav Halchenko <[email protected]>
1 parent c66ae8e commit 3f79fc2

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

docs/apps/datalad.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,15 @@ we will need to ensure the following settings are observed:
2929

3030
!!! tip "Check *ReproNim* if the suggestions here did not work"
3131

32-
The actions suggested here are relatively fundamental, and your
33-
settings may showcase specific circumstances that render them
34-
insufficient.
35-
For a more detailed discussion about orchestrating containers, version
36-
control, and reproducible pipelines, please check
37-
[the *ReproNim* guidelines](https://www.repronim.org/).
32+
The actions suggested here are expected to work in most circumstances,
33+
but your system may have specific circumstances that require additional
34+
or alternative approaches.
35+
For instance, [the *ReproNim* project](https://www.repronim.org/) maintains
36+
[ReproNim/containers](https://github.com/ReproNim/containers), a
37+
*DataLad* dataset with ready-to-use Singularity images for released *BIDS Apps*, *NeuroDesktop* applications,
38+
and other containers.
39+
Its [`README.md`](https://github.com/ReproNim/containers?tab=readme-ov-file#runnable-script) guides through an approach via that dataset with *built-in* execution helper taking care about bind-mounts,
40+
proxying critical *Git* configuration and potentially executing *Singularity* images via *Docker* (e.g., under OSX).
3841

3942
In the particular case of *MRIQC*, please consider updating (if necessary)
4043
and fetching the required data before execution and then

docs/apps/docker.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ If you need a finer control over the container execution, or you feel comfortabl
9393

9494
### Accessing filesystems in the host within the container
9595

96-
Containers are confined in a sandbox, so they can't access the host
97-
in any ways unless you explicitly prescribe acceptable accesses
98-
to the host.
96+
Containers are confined in a sandbox, so they can't access the data on the host
97+
unless explicitly enabled.
9998
The Docker Engine provides mounting filesystems into the container with the `-v` argument and the following syntax:
10099
`-v some/path/in/host:/absolute/path/within/container:ro`,
101100
where the trailing `:ro` specifies that the mount is read-only.
@@ -121,9 +120,10 @@ $ docker run -ti --rm \
121120
participant
122121
```
123122

124-
When **debugging** or **reusing pre-cached intermediate results**,
125-
you'll also need to mount some working directory that otherwise
126-
is not exposed by the application.
123+
We recommend mounting a work (or scratch) directory for intermediate workflow results.
124+
This is particularly useful for **debugging** or **reusing pre-cached intermediate results**,
125+
but can also be useful to control where these (large) directories get created,
126+
as the default location for files created inside a docker container may not have sufficient space.
127127
In the case of *NiPreps*, we typically inform the *BIDS Apps*
128128
to override the work directory by setting the `-w`/`--work-dir`
129129
argument (please note that this is not defined by the *BIDS Apps*
@@ -155,12 +155,10 @@ $ docker run -ti --rm \
155155

156156
``` {.shell hl_lines="4 5 9"}
157157
$ docker run -ti --rm \
158-
-v path/to/data:/data:ro \
159-
-v path/to/output:/out \
160-
-v $PWD:$PWD \
161-
-w $PWD \ # DO NOT confuse with the application's work directory
158+
-v $PWD:$PWD \ # Mount the current directory with its own name
159+
-w $PWD \ # DO NOT confuse with the application's work directory
162160
nipreps/fmriprep:<latest-version> \
163-
/data /out/out \
161+
inputs/raw-data outputs/fmriprep \ # With YODA, the inputs are inside the working directory
164162
participant
165163
-w $PWD/work
166164
```
@@ -185,7 +183,7 @@ $ docker run -ti --rm \
185183
for atlases and templates management may require
186184
the *TemplateFlow Archive* be mounted from the host.
187185
Mounting the *Archive* from the host is an effective way
188-
to preempt the download of your favorite templates in every run:
186+
to prevent multiple downloads of templates that are not bundled in the image:
189187

190188
``` {.shell hl_lines="5 6"}
191189
$ docker run -ti --rm \
@@ -226,21 +224,21 @@ account in *Linux*.
226224
In other words, by default *Docker* will use the superuser account
227225
to execute the container and will write files with the corresponding
228226
uid=0 unless configured otherwise.
229-
Executing as superuser may derive in permissions and security issues,
227+
Executing as superuser may result in permissions and security issues,
230228
for example, [with *DataLad* (discussed later)](datalad.md#).
231229
One paramount example of permissions issues where beginners typically
232230
run into is deleting files after a containerized execution.
233231
If the uid is not overridden, the outputs of a containerized execution
234232
will be owned by **root** and group **root**.
235233
Therefore, normal users will not be able to modify the output and
236-
superuser permissions will be required to deleted data generated
234+
superuser permissions will be required to delete data generated
237235
by the containerized application.
238236
Some shared systems only allow running containers as a normal user
239-
because the user will not be able to action on the outputs otherwise.
237+
because the user will not be able to operate on the outputs otherwise.
240238

241-
Either way (whether the container is available with default settings
242-
or the execution has been customized to normal users),
243-
running as a normal user allows preempting these permissions issues.
239+
Whether the container is available with default settings,
240+
or the execution has been customized to normal users,
241+
running as a normal user avoids these permissions issues.
244242
This can be achieved with
245243
[*Docker*'s `-u`/`--user` option](https://docs.docker.com/engine/containers/run/#user):
246244

@@ -286,8 +284,8 @@ command line follows the interface defined by the specific
286284
[*fMRIPrep*](https://fmriprep.readthedocs.io/en/latest/usage.html)
287285
or [*MRIQC*](https://mriqc.readthedocs.io/en/latest/running.html#command-line-interface)).
288286

289-
The first section of a call comprehends arguments specific to *Docker*,
290-
and configure the execution of the container:
287+
The first section of a call consists of arguments specific to *Docker*,
288+
which configure the execution of the container:
291289

292290
``` {.shell hl_lines="1-7"}
293291
$ docker run -ti --rm \

0 commit comments

Comments
 (0)