singularity
singularity copied to clipboard
--workdir does not create or mount $HOME from the working directory
Version of Singularity:
2.4+
Expected behavior
-W/--workdir Working directory to be used for /tmp, /var/tmp and
$HOME (if -c/--contain was also used)
I would expect this create a directory for $HOME inside the specified working directory and mount that inside the container for $HOME.
Actual behavior
This properly creates directories for and mounts both /tmp and /var/tmp, but does not do $HOME
https://github.com/singularityware/singularity/blob/master/src/lib/runtime/mounts/home/home.c#L116 After line 116 here, there are no additional checks if WORKDIR was set. If WORKDIR is set, use that instead of session_dir.
Steps to reproduce behavior
singularity shell -C -W /some/dir something.simg
This issue references 2.4, but this is still the case in 3.3.
singularity -d shell -c -W /tmp/workdir ~/test.sif
Singularity test.sif:~> touch homeblah
Singularity test.sif:~> touch /tmp/tmpblah
Singularity test.sif:~> touch /var/tmp/vartmpblah
Singularity test.sif:~> exit
And on the host:
[rherban@test]:/tmp/workdir$ tree
.
├── tmp
│ └── tmpblah
└── var_tmp
└── vartmpblah
Re-invoking the container has an empty $HOME, but /tmp and /var/tmp have the aforementioned files.
@mem @ikaneshiro @tri-adam
Hello,
This is a templated response that is being sent out to all open issues. We are working hard on 'rebuilding' the Singularity community, and a major task on the agenda is finding out what issues are still outstanding.
Please consider the following:
- Is this issue a duplicate, or has it been fixed/implemented since being added?
- Is the issue still relevant to the current state of Singularity's functionality?
- Would you like to continue discussing this issue or feature request?
Thanks, Carter
@jekriske-lilly We're looking into the issue carefully, soon will bring to community and discuss ways to better solve as well address this. Thankyou for keeping the interest in the subject.
Singularity repo is now retired as the code base is now moved to Apptainer. We are closing all the old issues under the old Singularity repo. For further assistance please open a new issue under the new Apptainer repo. Thanks for your support.