singularity icon indicating copy to clipboard operation
singularity copied to clipboard

--workdir does not create or mount $HOME from the working directory

Open jekriske-lilly opened this issue 7 years ago • 3 comments

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

jekriske-lilly avatar Nov 11 '17 18:11 jekriske-lilly

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

rherban avatar Jul 09 '19 22:07 rherban

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:

  1. Is this issue a duplicate, or has it been fixed/implemented since being added?
  2. Is the issue still relevant to the current state of Singularity's functionality?
  3. Would you like to continue discussing this issue or feature request?

Thanks, Carter

carterpeel avatar May 15 '21 16:05 carterpeel

@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.

pedroalvesbatista avatar Jul 15 '21 00:07 pedroalvesbatista

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.

kmuriki avatar Oct 17 '22 03:10 kmuriki