From 65476e6e32f9dd06983fb57db6deade1bb5ba821 Mon Sep 17 00:00:00 2001 From: Nuwan Goonasekera <2070605+nuwang@users.noreply.github.com> Date: Wed, 6 May 2020 23:34:31 +0530 Subject: [PATCH] Force container image names to lower case to satisfy Docker --- lib/galaxy/tool_util/deps/requirements.py | 3 ++- .../tools/mulled_example_invalid_case.xml | 24 +++++++++++++++++++ test/functional/tools/samples_tool_conf.xml | 1 + test/integration/test_containerized_jobs.py | 6 +++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 test/functional/tools/mulled_example_invalid_case.xml diff --git a/lib/galaxy/tool_util/deps/requirements.py b/lib/galaxy/tool_util/deps/requirements.py index 275e24e8721..3511dd24435 100644 --- a/lib/galaxy/tool_util/deps/requirements.py +++ b/lib/galaxy/tool_util/deps/requirements.py @@ -166,7 +166,8 @@ class ContainerDescription(object): resolve_dependencies=DEFAULT_CONTAINER_RESOLVE_DEPENDENCIES, shell=DEFAULT_CONTAINER_SHELL, ): - self.identifier = identifier + # Force to lowercase because container image names must be lowercase + self.identifier = identifier.lower() if identifier else None self.type = type self.resolve_dependencies = resolve_dependencies self.shell = shell diff --git a/test/functional/tools/mulled_example_invalid_case.xml b/test/functional/tools/mulled_example_invalid_case.xml new file mode 100644 index 00000000000..f3d912bd53b --- /dev/null +++ b/test/functional/tools/mulled_example_invalid_case.xml @@ -0,0 +1,24 @@ + + + + bwa + quay.io/biocontainers/BwA:0.7.15--0 + + + + + $output_1 2>&1 + ]]> + + + + + + + + + \ No newline at end of file diff --git a/test/functional/tools/samples_tool_conf.xml b/test/functional/tools/samples_tool_conf.xml index 29efbafd487..1422d60bb18 100644 --- a/test/functional/tools/samples_tool_conf.xml +++ b/test/functional/tools/samples_tool_conf.xml @@ -202,6 +202,7 @@ + diff --git a/test/integration/test_containerized_jobs.py b/test/integration/test_containerized_jobs.py index 6d6791e8ce8..c643d9c4d8d 100644 --- a/test/integration/test_containerized_jobs.py +++ b/test/integration/test_containerized_jobs.py @@ -30,6 +30,12 @@ class MulledJobTestCases(object): output = self.dataset_populator.get_history_dataset_content(self.history_id, timeout=EXTENDED_TIMEOUT) assert "0.7.15-r1140" in output + def test_mulled_explicit_invalid_case(self): + self.dataset_populator.run_tool("mulled_example_invalid_case", {}, self.history_id) + self.dataset_populator.wait_for_history(self.history_id, assert_ok=True) + output = self.dataset_populator.get_history_dataset_content(self.history_id, timeout=EXTENDED_TIMEOUT) + assert "0.7.15-r1140" in output + class ContainerizedIntegrationTestCase(integration_util.IntegrationTestCase):