From 7cff7b47af9274714d7fb0ce27a72f78d43ba5ef Mon Sep 17 00:00:00 2001 From: Ruben Vorderman Date: Mon, 5 Aug 2024 11:10:30 +0200 Subject: [PATCH] Remove erroneous mount home functionality This should be determined by the tool profile --- lib/galaxy/config/sample/job_conf.xml.sample_advanced | 6 ------ lib/galaxy/tool_util/deps/container_classes.py | 1 - lib/galaxy/tool_util/deps/singularity_util.py | 7 +++---- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/galaxy/config/sample/job_conf.xml.sample_advanced b/lib/galaxy/config/sample/job_conf.xml.sample_advanced index b91f6e5425a7..0ae9c855d3be 100644 --- a/lib/galaxy/config/sample/job_conf.xml.sample_advanced +++ b/lib/galaxy/config/sample/job_conf.xml.sample_advanced @@ -647,12 +647,6 @@ singularity_ipc to `false`. --> - - diff --git a/lib/galaxy/tool_util/deps/container_classes.py b/lib/galaxy/tool_util/deps/container_classes.py index 55acaae81b86..e00c005e5275 100644 --- a/lib/galaxy/tool_util/deps/container_classes.py +++ b/lib/galaxy/tool_util/deps/container_classes.py @@ -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(), ) diff --git a/lib/galaxy/tool_util/deps/singularity_util.py b/lib/galaxy/tool_util/deps/singularity_util.py index 1eee5abdb74f..cd4d69161a54 100644 --- a/lib/galaxy/tool_util/deps/singularity_util.py +++ b/lib/galaxy/tool_util/deps/singularity_util.py @@ -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 [] @@ -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]) @@ -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)