
--
You received this message because you are subscribed to a topic in the Google Groups "cpax_forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cpax_forum/0dzk9MDqK_E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cpax_forum+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cpax_forum/9b740322-906c-4093-97c3-cd003987ad77n%40googlegroups.com.


and be able to write to that path, but that path won't exist if the container is launched from a working directory outside of /media
--
You received this message because you are subscribed to the Google Groups "cpax_forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cpax_forum+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cpax_forum/cbee45c8-3dd9-4b05-b13f-d33232f72dd7n%40googlegroups.com.
1. “Containers isolate software from its environment;” the containers are created somewhere not intended for human use, that location depends on your container platform configuration, and you typically shouldn’t need to know or care where the container is created (e.g., if the container location is on a partition with inadequate space).
The root tree in the current latest C-PAC container image looks like
.
and /media is empty. cpac (the command line interface) tries to bind all the local paths you’ll need in your container, mostly at matching names (the path names don’t have to match). When a local path is bound to a path in a container, any files or subdirectories in that local path are also accessible at that path in the container and vice versa. Any changes locally are reflected in the container, and any changes in the container are reflected locally but only at bound paths. When you run cpac, your terminal will print a little table at the top that tells you which paths locally are bound to which paths in the container and what the access mode is for the binding.
For any unspecified paths that cpac thinks C-PAC might need, cpac assumes the current working directory, so in most cases the current working directory is bound at runtime by cpac in a C-PAC container to a matching path and to C-PAC's working directory.
2. The in-container working directory is defined in the pipeline configuration under pipeline_setup.working_directory.path. For the default configuration, this path is set to /tmp (and in most cases this path shouldn’t matter from a user's perspective).
3. According to the BIDS-app specification, output_dir (positional argument #2) “is the only directory the pipeline should write to,” so this directory has to be writable.
4. By default, bids_dir (positional argument #1) is read-only, output_dir (positional argument #2) and the logging and working directories are read-write, and any custom bindings that aren’t specified read-only are defaulted to read-write.
5. Yes.
Running from the home directory with /media/12T/ABIDE/any_dir as the read-only bids_dir makes /media/12T and its descendant directories read-only, preventing the output directory, a child of /media/12T, from being created. If the output directory (/media/12T/ABIDE/case1_s3_default_output) already existed, that run may have succeeded. I’m not sure if a child of a local directory bound read-only can be bound read-write ― the failure you reported was the attempt to create a read-write child in a read-only directory.
Running from /media/12T/ABIDE that directory is bound read-write to paths in the container that aren’t otherwise specified (itself as the current working directory and /tmp as the C-PAC working directory), so cpac is able to create a child directory within that path.
We (the development team) could resequence these bindings so that read-only directories are bound last, but I'm concerned that would make accidentally writing to a directory that should be read-only too easy.
6.
cpac utils data_config build binds your current working directory to
a matching path and to /output inside the container.

(The table that prints to terminal will say
Loading 🐳 Docker
Loading 🐳 fcpindi/c-pac:latest with these directory bindings:
local Docker mode
---------------- ---------------- ------
/media/12T/ABIDE /media/12T/ABIDE rw
/media/12T/ABIDE /output rw
Logging messages will refer to the Docker paths.
)
In your container your root file tree will include
/
├──
media
│
└── 12T
│ └── ABIDE
│ └── «
files and directories in local /media/12T/ABIDE »
└──
output
└── «
files and directories in local /media/12T/ABIDE »
And any changes in your local /media/12T/ABIDE or your in-container /media/12T/ABIDE or your in-container /output will be reflected in all three locations. Any other paths in your local /media/12T or local /media will be unknown in your container environment.
Hopefully these answers help. Please ask more questions if you need more clarification.
Thanks,
Jon