From 8ee3b902b3fa0daf888e9815c1c0937d5c27035d Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Wed, 5 Jun 2024 17:59:13 +0200 Subject: [PATCH 01/10] Make repo permissions world-readable --- lib/tool_shed/util/repository_util.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tool_shed/util/repository_util.py b/lib/tool_shed/util/repository_util.py index 7d4ead78a148..624c67c8bb14 100644 --- a/lib/tool_shed/util/repository_util.py +++ b/lib/tool_shed/util/repository_util.py @@ -208,6 +208,9 @@ def create_repository( dir=app.config.file_path, prefix=f"{repository.user.username}-{repository.name}", ) + # Created directory is readable, writable, and searchable only by the creating user ID, + # but we need to make it world-readable so non-shed user can serve files (e.g. hgweb run as different user). + os.chmod(repository_path, util.RWXR_XR_X) # Create the local repository. init_repository(repo_path=repository_path) # Create a .hg/hgrc file for the local repository. From c49a9ef35fdee98444f191ced47b62d357566d78 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 6 Jun 2024 11:20:02 +0200 Subject: [PATCH 02/10] Fix seek in slurm memory check Fixes https://sentry.galaxyproject.org/share/issue/e196a12836fe40da83c5e9e24c4c8329/: ``` UnsupportedOperation: can't do nonzero end-relative seeks File "galaxy/jobs/runners/slurm.py", line 217, in __check_memory_limit f.seek(-2048, os.SEEK_END) ``` which has probably been broken since we moved to python 3. --- lib/galaxy/jobs/runners/slurm.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/galaxy/jobs/runners/slurm.py b/lib/galaxy/jobs/runners/slurm.py index 98c373d96645..b8764ddea7de 100644 --- a/lib/galaxy/jobs/runners/slurm.py +++ b/lib/galaxy/jobs/runners/slurm.py @@ -7,7 +7,10 @@ from galaxy import model from galaxy.jobs.runners.drmaa import DRMAAJobRunner -from galaxy.util import commands +from galaxy.util import ( + commands, + unicodify, +) from galaxy.util.custom_logging import get_logger log = get_logger(__name__) @@ -212,12 +215,12 @@ def __check_memory_limit(self, efile_path): """ try: log.debug("Checking %s for exceeded memory message from SLURM", efile_path) - with open(efile_path) as f: + with open(efile_path, "rb") as f: if os.path.getsize(efile_path) > 2048: f.seek(-2048, os.SEEK_END) f.readline() for line in f.readlines(): - stripped_line = line.strip() + stripped_line = unicodify(line) if stripped_line == SLURM_MEMORY_LIMIT_EXCEEDED_MSG: return OUT_OF_MEMORY_MSG elif any(_ in stripped_line for _ in SLURM_MEMORY_LIMIT_EXCEEDED_PARTIAL_WARNINGS): From cf322eb531ca6ae4a3852138123a08019563f93e Mon Sep 17 00:00:00 2001 From: Marius van den Beek Date: Thu, 6 Jun 2024 12:47:34 +0200 Subject: [PATCH 03/10] restore line.strip() Co-authored-by: Nicola Soranzo --- lib/galaxy/jobs/runners/slurm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/jobs/runners/slurm.py b/lib/galaxy/jobs/runners/slurm.py index b8764ddea7de..db1ed9b3d002 100644 --- a/lib/galaxy/jobs/runners/slurm.py +++ b/lib/galaxy/jobs/runners/slurm.py @@ -220,7 +220,7 @@ def __check_memory_limit(self, efile_path): f.seek(-2048, os.SEEK_END) f.readline() for line in f.readlines(): - stripped_line = unicodify(line) + stripped_line = unicodify(line.strip()) if stripped_line == SLURM_MEMORY_LIMIT_EXCEEDED_MSG: return OUT_OF_MEMORY_MSG elif any(_ in stripped_line for _ in SLURM_MEMORY_LIMIT_EXCEEDED_PARTIAL_WARNINGS): From c01904803c239f090e44ae864917ed546782952e Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Fri, 7 Jun 2024 09:47:06 +0200 Subject: [PATCH 04/10] Allow filtering by type-id in DataDialog --- client/src/components/DataDialog/DataDialog.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/src/components/DataDialog/DataDialog.vue b/client/src/components/DataDialog/DataDialog.vue index fd0f86201ea4..0a0d90d5564c 100644 --- a/client/src/components/DataDialog/DataDialog.vue +++ b/client/src/components/DataDialog/DataDialog.vue @@ -24,6 +24,7 @@ interface Props { allowUpload?: boolean; callback?: (results: Array) => void; filterOkState?: boolean; + filterByTypeIds?: string[]; format?: string; library?: boolean; modalStatic?: boolean; @@ -36,6 +37,7 @@ const props = withDefaults(defineProps(), { allowUpload: true, callback: () => {}, filterOkState: false, + filterByTypeIds: undefined, format: "download", library: true, modalStatic: false, @@ -96,6 +98,9 @@ function getHistoryUrl() { if (props.filterOkState) { queryString += "&q=state-eq&qv=ok"; } + if (props.filterByTypeIds.length > 0) { + queryString += `&q=type_id-in&qv=${props.filterByTypeIds.join(",")}`; + } return `${getAppRoot()}api/histories/${props.history}/contents?v=dev${queryString}`; } From 2389bc4d7ec9dcb69859e511654392e5c9130f7f Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Fri, 7 Jun 2024 09:48:50 +0200 Subject: [PATCH 05/10] Display only compatible datasets in DataDialog for Visualizations --- .../components/Panels/VisualizationPanel.vue | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/client/src/components/Panels/VisualizationPanel.vue b/client/src/components/Panels/VisualizationPanel.vue index fedc8dfab1fd..d9fbf144aa2c 100644 --- a/client/src/components/Panels/VisualizationPanel.vue +++ b/client/src/components/Panels/VisualizationPanel.vue @@ -1,5 +1,6 @@