Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use non-root location #429

Merged
merged 3 commits into from
Mar 15, 2017
Merged

use non-root location #429

merged 3 commits into from
Mar 15, 2017

Conversation

satra
Copy link
Contributor

@satra satra commented Mar 15, 2017

change to use a non-root location to help with singularity

satra and others added 3 commits March 15, 2017 10:24
change to use a non-root location to help with singularity
@@ -25,7 +25,7 @@ dependencies:
test:
override:
# Test mriqcp
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ${CIRCLE_TEST_REPORTS}:/scratch -w /root/src/mriqc --entrypoint="/usr/bin/run_tests" mriqc:py35 :
- docker run -i -v /etc/localtime:/etc/localtime:ro -v ${CIRCLE_TEST_REPORTS}:/scratch -w /opt/src/mriqc --entrypoint="/usr/bin/run_tests" mriqc:py35 :
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oesteban - do you want the workdir to be /src/mriqc or sth like /workdir ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a preference, it is ok right now

@chrisgorgo
Copy link
Collaborator

chrisgorgo commented Mar 15, 2017 via email

@satra
Copy link
Contributor Author

satra commented Mar 15, 2017

singularity shows a root folder but as a user we don't have access.

@chrisgorgo
Copy link
Collaborator

So this is more of permissions issue then. MRIQC operates under root user so even if you put the code in /opt it might not solve the issue.

Both docker2singularity and docker2singularity.py change permissions when importing containers from docker hub to avoid such problems.

@satra
Copy link
Contributor Author

satra commented Mar 15, 2017

the docker user doesn't matter in singularity context, but /root is special.

@chrisgorgo
Copy link
Collaborator

Doesn't Dockerfile user influence the ownership of files in the container image deposited on Docker Hub which would be a problem when those files are downloaded by singularity?

@satra
Copy link
Contributor Author

satra commented Mar 15, 2017

not really, because we are using singularity as an executable effectively, so as long as things are readable we are ok. now if you try to write to some location that's not accessible to the user, they one can run into issues, but containers should be very clear as to where they are writing.

@oesteban oesteban merged commit 93791a2 into nipreps:master Mar 15, 2017
@satra satra deleted the patch-1 branch March 15, 2017 17:58
@chrisgorgo
Copy link
Collaborator

Sorry to drag this on. I'm still trying to understand this since a) we did not run into this problem when running mriqc with singularity b) I need to know if we need to change anything about BIDS Apps.

  1. Why is /root special? What is special about it?
  2. What do you mean by "using singularity as an executable"? Is there another way to use it?

@satra
Copy link
Contributor Author

satra commented Mar 15, 2017

re: 1
/root is special with respect to bootstrap. since all creation/editing commands are run as root

essentially host /root gets mounted in during bootstrap. therefore /root from the container doesn't show up during the bootstrap post process.

also for docker images, i just learned that %setup executes before downloading docker layers, so i can't use it (at least presently) to even move the src out.

re: 2

well one can violate singularity's isolation using paths and other things. so we generally recommend the -c flag by default to prevent things like PYTHONPATH and external executables from contaminating the environment. we create the mental image of an immutable binary file.

@chrisgorgo
Copy link
Collaborator

chrisgorgo commented Mar 15, 2017 via email

@satra
Copy link
Contributor Author

satra commented Mar 15, 2017

re: 1 - yes it will be handled post 2.3 release

re: 2 - you can still use -B to mount writable end points. we are just recommending that people take away automatic mapping.

i agree variables will go through but are likely to have less impact without $HOME, which is often used as a place for storing things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants