From b62a0dc70338909cf227f92024cfce49f1bbf516 Mon Sep 17 00:00:00 2001 From: Oleg Zharkov Date: Tue, 11 May 2021 20:20:55 +0200 Subject: [PATCH 1/6] fix dowpdown close --- client/src/components/Masthead/MastheadItem.vue | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/client/src/components/Masthead/MastheadItem.vue b/client/src/components/Masthead/MastheadItem.vue index f98a3eb2ccc..ec7877ae9ca 100644 --- a/client/src/components/Masthead/MastheadItem.vue +++ b/client/src/components/Masthead/MastheadItem.vue @@ -22,6 +22,7 @@ this.hideDropdown()); }, destroyed() { - if (this.$refs.dropdown && this.galaxyIframe) { - this.galaxyIframe.removeEventListener("load", this.iframeListener); - } + window.removeEventListener("blur", () => this.hideDropdown()); }, methods: { - iframeListener() { - return this.galaxyIframe.contentDocument.addEventListener("click", this.hideDropdown); - }, hideDropdown() { if (this.$refs.dropdown) this.$refs.dropdown.hide(); }, From cef6bd4fb265b526da25213e2c6ef310c799c140 Mon Sep 17 00:00:00 2001 From: Oleg Zharkov Date: Tue, 11 May 2021 20:24:17 +0200 Subject: [PATCH 2/6] simlify listener --- client/src/components/Masthead/MastheadItem.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/src/components/Masthead/MastheadItem.vue b/client/src/components/Masthead/MastheadItem.vue index ec7877ae9ca..8221f9a8300 100644 --- a/client/src/components/Masthead/MastheadItem.vue +++ b/client/src/components/Masthead/MastheadItem.vue @@ -22,7 +22,6 @@ this.hideDropdown()); + window.addEventListener("blur", this.hideDropdown); }, destroyed() { - window.removeEventListener("blur", () => this.hideDropdown()); + window.removeEventListener("blur", this.hideDropdown); }, methods: { hideDropdown() { From f466edda9acc188519533690c3b69a4bdbff1d2a Mon Sep 17 00:00:00 2001 From: Simon Bray <32272674+simonbray@users.noreply.github.com> Date: Wed, 12 May 2021 13:06:56 +0200 Subject: [PATCH 3/6] force galaxy_id to string in galactic_job_json --- lib/galaxy/tool_util/cwl/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/tool_util/cwl/util.py b/lib/galaxy/tool_util/cwl/util.py index f8fcc038e4c..411df08965a 100644 --- a/lib/galaxy/tool_util/cwl/util.py +++ b/lib/galaxy/tool_util/cwl/util.py @@ -172,7 +172,7 @@ def galactic_job_json( def replacement_file(value): if value.get('galaxy_id'): - return {"src": "hda", "id": value['galaxy_id']} + return {"src": "hda", "id": str(value['galaxy_id'])} file_path = value.get("location", None) or value.get("path", None) # format to match output definitions in tool, where did filetype come from? filetype = value.get("filetype", None) or value.get("format", None) @@ -281,7 +281,7 @@ def galactic_job_json( def replacement_collection(value): if value.get('galaxy_id'): - return {"src": "hdca", "id": value['galaxy_id']} + return {"src": "hdca", "id": str(value['galaxy_id'])} assert "collection_type" in value collection_type = value["collection_type"] elements = to_elements(value, collection_type) From d6992b2bc57539d3faeba2378e9ec3a58446b589 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 12 May 2021 18:30:34 +0200 Subject: [PATCH 4/6] Update default base images and make DEFAULT_CHANNELS configurable via env var --- lib/galaxy/tool_util/deps/mulled/invfile.lua | 2 +- lib/galaxy/tool_util/deps/mulled/mulled_build.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/tool_util/deps/mulled/invfile.lua b/lib/galaxy/tool_util/deps/mulled/invfile.lua index a883abdd297..26a586c04a7 100644 --- a/lib/galaxy/tool_util/deps/mulled/invfile.lua +++ b/lib/galaxy/tool_util/deps/mulled/invfile.lua @@ -60,7 +60,7 @@ end local destination_base_image = VAR.DEST_BASE_IMAGE if destination_base_image == '' then - destination_base_image = 'bgruening/busybox-bash:0.1' + destination_base_image = 'quay.io/bioconda/base-glibc-busybox-bash:latest' end local verbose = VAR.VERBOSE diff --git a/lib/galaxy/tool_util/deps/mulled/mulled_build.py b/lib/galaxy/tool_util/deps/mulled/mulled_build.py index e5e1f21e40f..41345a0b676 100644 --- a/lib/galaxy/tool_util/deps/mulled/mulled_build.py +++ b/lib/galaxy/tool_util/deps/mulled/mulled_build.py @@ -46,9 +46,12 @@ from ..conda_compat import MetaData log = logging.getLogger(__name__) DIRNAME = os.path.dirname(__file__) -DEFAULT_BASE_IMAGE = "bgruening/busybox-bash:0.1" -DEFAULT_EXTENDED_BASE_IMAGE = "bioconda/extended-base-image:latest" -DEFAULT_CHANNELS = ["conda-forge", "bioconda"] +DEFAULT_BASE_IMAGE = os.environ.get("DEFAULT_BASE_IMAGE", "quay.io/bioconda/base-glibc-busybox-bash:latest") +DEFAULT_EXTENDED_BASE_IMAGE = os.environ.get("DEFAULT_EXTENDED_BASE_IMAGE", "quay.io/bioconda/base-glibc-debian-bash:latest") +if 'DEFAULT_MULLED_CONDA_CHANNELS' in os.environ: + DEFAULT_CHANNELS = os.environ['DEFAULT_MULLED_CONDA_CHANNELS'].split(',') +else: + DEFAULT_CHANNELS = ["conda-forge", "bioconda"] DEFAULT_REPOSITORY_TEMPLATE = "quay.io/${namespace}/${image}" DEFAULT_BINDS = ["build/dist:/usr/local/"] DEFAULT_WORKING_DIR = '/source/' From fd03c446c0347517fb483fc4c65700ca9b342411 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 14 May 2021 18:22:15 +0200 Subject: [PATCH 5/6] Fix mulled singularity building This used to fail with ``` [May 13 12:53:06] DEBU Container [8a432293fb2f step-adb59c6b2d] started, waiting for completion [May 13 12:53:06] SERR mkdir: missing operand [May 13 12:53:06] SERR Try 'mkdir --help' for more information. [May 13 12:53:06] ERRO Task processing failed: Unexpected exit code [1] of container [8a432293fb2f step-adb59c6b2d], container preserved ``` Involucro interpretes comma-separated arguments in `.run` as individual commands. You can see the full error in https://github.com/BioContainers/multi-package-containers/pull/1713/checks?check_run_id=2575472382 Broke in https://github.com/mvdbeek/galaxy/commit/71a70ea1f12cca48c33ee5569bd74035f96376f7 --- lib/galaxy/tool_util/deps/mulled/invfile.lua | 8 ++++---- test/unit/tool_util/mulled/test_mulled_build.py | 9 +++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/galaxy/tool_util/deps/mulled/invfile.lua b/lib/galaxy/tool_util/deps/mulled/invfile.lua index 26a586c04a7..db1abe49df6 100644 --- a/lib/galaxy/tool_util/deps/mulled/invfile.lua +++ b/lib/galaxy/tool_util/deps/mulled/invfile.lua @@ -101,11 +101,11 @@ inv.task('build') if VAR.SINGULARITY ~= '' then inv.task('singularity') .using(singularity_image) - .withHostConfig({binds = {"build:/data", "'" .. singularity_image_dir .. "':/import"}, privileged = true}) + .withHostConfig({binds = {"build:/data", singularity_image_dir .. ":/import"}, privileged = true}) .withConfig({entrypoint = {'/bin/sh', '-c'}}) - .run('mkdir', '-p', '/usr/local/var/singularity/mnt/container') - .run('singularity', 'build', '/import/' .. VAR.SINGULARITY_IMAGE_NAME, '/import/Singularity.def') - .run('chown', VAR.USER_ID, '/import/' .. VAR.SINGULARITY_IMAGE_NAME) + .run('mkdir -p /usr/local/var/singularity/mnt/container && ' + .. 'singularity build /import/' .. VAR.SINGULARITY_IMAGE_NAME .. ' /import/Singularity.def && ' + .. 'chown ' .. VAR.USER_ID .. ' /import/' .. VAR.SINGULARITY_IMAGE_NAME) end inv.task('cleanup') diff --git a/test/unit/tool_util/mulled/test_mulled_build.py b/test/unit/tool_util/mulled/test_mulled_build.py index 2aead594a72..7ef5cedfcf0 100644 --- a/test/unit/tool_util/mulled/test_mulled_build.py +++ b/test/unit/tool_util/mulled/test_mulled_build.py @@ -5,6 +5,7 @@ from galaxy.tool_util.deps.mulled.mulled_build import ( build_target, DEFAULT_BASE_IMAGE, DEFAULT_EXTENDED_BASE_IMAGE, + mull_targets, ) from ..util import external_dependency_management @@ -18,3 +19,11 @@ from ..util import external_dependency_management def test_base_image_for_targets(target, version, base_image): target = build_target(target, version=version) assert base_image_for_targets([target]) == base_image + + +@external_dependency_management +def test_mulled_build_files_cli(tmpdir): + singularity_image_dir = tmpdir.mkdir('singularity_image_dir') + target = build_target('zlib') + mull_targets([target], command='build-and-test', singularity=True, singularity_image_dir=singularity_image_dir) + assert singularity_image_dir.join('zlib').exists() From 8184ab089eba2d71a98b8e6af7a2a3bb073d9976 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 14 May 2021 21:32:22 +0200 Subject: [PATCH 6/6] Test with space in path --- test/unit/tool_util/mulled/test_mulled_build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/tool_util/mulled/test_mulled_build.py b/test/unit/tool_util/mulled/test_mulled_build.py index 7ef5cedfcf0..568a713d9f7 100644 --- a/test/unit/tool_util/mulled/test_mulled_build.py +++ b/test/unit/tool_util/mulled/test_mulled_build.py @@ -23,7 +23,7 @@ def test_base_image_for_targets(target, version, base_image): @external_dependency_management def test_mulled_build_files_cli(tmpdir): - singularity_image_dir = tmpdir.mkdir('singularity_image_dir') + singularity_image_dir = tmpdir.mkdir('singularity image dir') target = build_target('zlib') mull_targets([target], command='build-and-test', singularity=True, singularity_image_dir=singularity_image_dir) assert singularity_image_dir.join('zlib').exists()