Files
galaxy/test/unit/tool_util/test_singularity_util.py
T
Matthias Bernt 9e48ceb169 containers: do not mount /tmp/
fixes https://github.com/galaxyproject/galaxy/issues/15673

- singularity: add `--no_mount tmp` (analogous to docker's default)
- do not bind `$TMPDIR:rw,$TMP:rw,$TEMP:rw` by default
- instead (by default )provide a writable `/tmp` via
  `$_GALAXY_JOB_TMP_DIR/:/tmp:rw` note that this dir is still also
  available as `$_GALAXY_JOB_TMP_DIR:rw`
2023-06-14 15:28:38 +01:00

19 lines
585 B
Python

from galaxy.tool_util.deps.singularity_util import build_singularity_run_command
def test_build_singularity_run_command_defaults():
cmd = build_singularity_run_command(
container_command="echo hi",
image="busybox",
)
assert cmd == "singularity -s exec --cleanenv --no-mount tmp busybox echo hi"
def test_build_singularity_run_command_no_cleanenv():
cmd = build_singularity_run_command(
container_command="echo hi",
image="busybox",
cleanenv=False,
)
assert cmd == "singularity -s exec --no-mount tmp busybox echo hi"