Skip to content

Commit

Permalink
Remove erroneous mount home functionality
Browse files Browse the repository at this point in the history
This should be determined by the tool profile
  • Loading branch information
rhpvorderman committed Aug 5, 2024
1 parent dc07e50 commit 7cff7b4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
6 changes: 0 additions & 6 deletions lib/galaxy/config/sample/job_conf.xml.sample_advanced
Original file line number Diff line number Diff line change
Expand Up @@ -647,12 +647,6 @@
singularity_ipc to `false`.
-->
<!-- <param id="singularity_ipc">true</param> -->
<!-- Singularity mounts $HOME by default. This can be problematic if home
contains sensitive data, is shared across nodes or has configuration
files affecting reproducibility. Therefore Galaxy passes the `contain`
argument to isolate $HOME. If $HOME must be mounted, it can be
turned on by setting singularity_mount_home to `true`. -->
<!-- <param id="singularity_mount_home">false</param> -->
<!-- Pass extra arguments to the singularity exec command not covered by the
above options. -->
<!-- <param id="singularity_run_extra_arguments"></param> -->
Expand Down
1 change: 0 additions & 1 deletion lib/galaxy/tool_util/deps/container_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,6 @@ def containerize_command(self, command: str) -> str:
cleanenv=asbool(self.prop("cleanenv", singularity_util.DEFAULT_CLEANENV)),
ipc=asbool(self.prop("ipc", singularity_util.DEFAULT_IPC)),
pid=asbool(self.prop("pid", singularity_util.DEFAULT_PID)),
mount_home=asbool(self.prop("mount_home", singularity_util.DEFAULT_MOUNT_HOME)),
no_mount=self.prop("no_mount", singularity_util.DEFAULT_NO_MOUNT),
**self.get_singularity_target_kwds(),
)
Expand Down
7 changes: 3 additions & 4 deletions lib/galaxy/tool_util/deps/singularity_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def build_singularity_run_command(
cleanenv: bool = DEFAULT_CLEANENV,
ipc: bool = DEFAULT_IPC,
pid: bool = DEFAULT_PID,
mount_home: bool = DEFAULT_MOUNT_HOME,
no_mount: Optional[List[str]] = DEFAULT_NO_MOUNT,
) -> str:
volumes = volumes or []
Expand All @@ -104,8 +103,8 @@ def build_singularity_run_command(
command_parts.append("exec")
# Singularity mounts some directories, such as $HOME and $PWD by default.
# using --contain disables this behaviour and only allows explicitly
# requested volumes to be mounted. Since galaxy already mounts $PWD and
# mount_home can be activated, a switch for --contain is redundant.
# requested volumes to be mounted. This gives fully full-control over
# the mounting behavior.
command_parts.append("--contain")
if working_directory:
command_parts.extend(["--pwd", working_directory])
Expand All @@ -119,7 +118,7 @@ def build_singularity_run_command(
command_parts.extend(["--no-mount", ",".join(no_mount)])
for volume in volumes:
command_parts.extend(["-B", str(volume)])
if mount_home and home is not None:
if home is not None:
command_parts.extend(["--home", f"{home}:{home}"])
if run_extra_arguments:
command_parts.append(run_extra_arguments)
Expand Down

0 comments on commit 7cff7b4

Please sign in to comment.