From 568f8f5a5d36a9c28783c90aaa2bb722301c1d4c Mon Sep 17 00:00:00 2001 From: Nolan Woods Date: Wed, 17 Mar 2021 11:42:20 -0700 Subject: [PATCH 1/2] Revert "always mount a job tmp rw" This reverts commit e9f2b3a0 --- lib/galaxy/tool_util/deps/container_classes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/tool_util/deps/container_classes.py b/lib/galaxy/tool_util/deps/container_classes.py index 4702ccecfa5..e2da1e211eb 100644 --- a/lib/galaxy/tool_util/deps/container_classes.py +++ b/lib/galaxy/tool_util/deps/container_classes.py @@ -200,6 +200,7 @@ class HasDockerLikeVolumes: add_var("library_import_dir", self.app_info.library_import_dir) add_var('tool_data_path', self.app_info.tool_data_path) add_var('shed_tool_data_path', self.app_info.shed_tool_data_path) + if self.job_info.job_directory and self.job_info.job_directory_type == "pulsar": # We have a Pulsar job directory, so everything needed (excluding index # files) should be available in job_directory... @@ -247,6 +248,7 @@ class HasDockerLikeVolumes: if end_index < 0: end_index = len(volumes_str) volumes_str = volumes_str[0:tool_directory_index] + volumes_str[end_index:len(volumes_str)] + return volumes_str @@ -297,9 +299,8 @@ class DockerContainer(Container, HasDockerLikeVolumes): # and Galaxy. if self.job_info.tmp_directory is not None: volumes.append(DockerVolume.from_str("%s:/tmp:rw" % self.job_info.tmp_directory)) - else: - volumes.append(DockerVolume.from_str("$_GALAXY_JOB_TMP_DIR:$_GALAXY_JOB_TMP_DIR:rw")) volumes_from = self.destination_info.get("docker_volumes_from", docker_util.DEFAULT_VOLUMES_FROM) + docker_host_props = self.docker_host_props cached_image_file = self.__get_cached_image_file() From a7d273a93ca3c3c3109cab1044646957156a7081 Mon Sep 17 00:00:00 2001 From: Nolan Woods Date: Wed, 17 Mar 2021 11:48:45 -0700 Subject: [PATCH 2/2] Refactor default mounting of $tmp_directory in containers --- lib/galaxy/tool_util/deps/container_classes.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/galaxy/tool_util/deps/container_classes.py b/lib/galaxy/tool_util/deps/container_classes.py index e2da1e211eb..e9cc48803ec 100644 --- a/lib/galaxy/tool_util/deps/container_classes.py +++ b/lib/galaxy/tool_util/deps/container_classes.py @@ -218,6 +218,12 @@ class HasDockerLikeVolumes: defaults += ",$job_directory/configs:rw" if self.job_info.tmp_directory is not None: defaults += ",$tmp_directory:rw" + # If a tool definitely has a temp directory available set it to /tmp in container for compat. + # with CWL. This is part of that spec and should make it easier to share containers between CWL + # and Galaxy. + defaults += ",$tmp_directory:/tmp:rw" + else: + defaults += ",$_GALAXY_JOB_TMP_DIR:rw" if self.job_info.home_directory is not None: defaults += ",$home_directory:rw" if self.app_info.outputs_to_working_directory: @@ -294,11 +300,6 @@ class DockerContainer(Container, HasDockerLikeVolumes): preprocessed_volumes_list = preprocess_volumes(volumes_raw, self.container_type) # TODO: Remove redundant volumes... volumes = [DockerVolume.from_str(v) for v in preprocessed_volumes_list] - # If a tool definitely has a temp directory available set it to /tmp in container for compat. - # with CWL. This is part of that spec and should make it easier to share containers between CWL - # and Galaxy. - if self.job_info.tmp_directory is not None: - volumes.append(DockerVolume.from_str("%s:/tmp:rw" % self.job_info.tmp_directory)) volumes_from = self.destination_info.get("docker_volumes_from", docker_util.DEFAULT_VOLUMES_FROM) docker_host_props = self.docker_host_props