From 1aa1d6164a63438b49beb2fd6cc4b80a57bbdb5d Mon Sep 17 00:00:00 2001 From: Marius van den Beek Date: Thu, 25 Feb 2016 18:35:34 +0100 Subject: [PATCH 1/5] Fix workflow parameters not rendered when tool parameter wrapped in conditional. --- templates/webapps/galaxy/workflow/run.mako | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/templates/webapps/galaxy/workflow/run.mako b/templates/webapps/galaxy/workflow/run.mako index 2e499621ec0..8ded5960742 100644 --- a/templates/webapps/galaxy/workflow/run.mako +++ b/templates/webapps/galaxy/workflow/run.mako @@ -388,16 +388,23 @@ from galaxy.jobs.actions.post import ActionBox import re import colorsys import random +from six import string_types + +def get_wf_parms(v, wf_parms): + if isinstance(v, dict): + [ get_wf_parms(value, wf_parms) for value in v.values() ] + elif isinstance(v, string_types): + for rematch in re.findall('\$\{.+?\}', v): + if rematch[2:-1] not in wf_parms: + wf_parms[rematch[2:-1]] = "" used_accumulator = [] - wf_parms = {} + for step in steps: for v in [ActionBox.get_short_str(pja) for pja in step.post_job_actions] + step.state.inputs.values(): - if isinstance(v, basestring): - for rematch in re.findall('\$\{.+?\}', v): - if rematch[2:-1] not in wf_parms: - wf_parms[rematch[2:-1]] = "" + get_wf_parms(v, wf_parms) + if wf_parms: hue_offset = 1.0 / len(wf_parms) hue = 0.0 From 56076db848459cb1da39b04dc635538ff013d3a9 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 26 Feb 2016 12:15:56 +0000 Subject: [PATCH 2/5] Disable command isolation for Pulsar... ... it builds its own job script - no need to have Galaxy do this isolation on the Galaxy end. The more Pulsar can handle the better. --- lib/galaxy/jobs/__init__.py | 9 ++++++++- lib/galaxy/jobs/runners/pulsar.py | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/jobs/__init__.py b/lib/galaxy/jobs/__init__.py index 4759fa8f1b4..be0577f90ae 100644 --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -768,6 +768,7 @@ class JobWrapper( object ): if use_persisted_destination: self.job_runner_mapper.cached_job_destination = JobDestination( from_job=job ) + self.__commands_in_new_shell = self.app.config.commands_in_new_shell self.__user_system_pwent = None self.__galaxy_system_pwent = None @@ -793,9 +794,15 @@ class JobWrapper( object ): def shell(self): return self.job_destination.shell or getattr(self.app.config, 'default_job_shell', DEFAULT_JOB_SHELL) + def disable_commands_in_new_shell(self): + """Provide an extension point to disable this isolation, + Pulsar builds its own job script so this is not needed for + remote jobs.""" + self.__commands_in_new_shell = False + @property def commands_in_new_shell(self): - return self.app.config.commands_in_new_shell + return self.__commands_in_new_shell @property def galaxy_lib_dir(self): diff --git a/lib/galaxy/jobs/runners/pulsar.py b/lib/galaxy/jobs/runners/pulsar.py index 62a1557d99c..6b33adc8deb 100644 --- a/lib/galaxy/jobs/runners/pulsar.py +++ b/lib/galaxy/jobs/runners/pulsar.py @@ -278,6 +278,7 @@ class PulsarJobRunner( AsynchronousJobRunner ): compute_tool_directory=remote_tool_directory, compute_job_directory=remote_job_directory, ) + job_wrapper.disable_commands_in_new_shell() command_line = build_command( self, job_wrapper=job_wrapper, From cb19630bd4e04b21653a2cb9848e888805dfabcc Mon Sep 17 00:00:00 2001 From: John Chilton Date: Fri, 26 Feb 2016 12:25:34 +0000 Subject: [PATCH 3/5] Fix unit tests for 56076db848459cb1da39b04dc635538ff013d3a9 --- test/unit/jobs/test_job_wrapper.py | 23 ----------------------- test/unit/tools_support.py | 1 + 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/test/unit/jobs/test_job_wrapper.py b/test/unit/jobs/test_job_wrapper.py index 2e73be47fb0..8a0311ca8ff 100644 --- a/test/unit/jobs/test_job_wrapper.py +++ b/test/unit/jobs/test_job_wrapper.py @@ -12,9 +12,6 @@ from galaxy.util.bunch import Bunch from galaxy.tools import evaluation from tools_support import UsesApp -# from tools_support import MockTool - -# from ..tools_and_jobs_helpers import MockApp TEST_TOOL_ID = "cufftest" TEST_VERSION_COMMAND = "bwa --version" @@ -123,26 +120,6 @@ class MockJobDispatcher(object): pass -class MockApp(object): - - def __init__(self, object_store, test_directory, model_objects): - self.object_store = object_store - self.toolbox = MockToolbox(MockTool(self)) - self.config = Bunch( - outputs_to_working_directory=False, - new_file_path=os.path.join(test_directory, "new_files"), - tool_data_path=os.path.join(test_directory, "tools"), - root=os.path.join(test_directory, "galaxy"), - datatypes_registry=Bunch( - integrated_datatypes_configs=os.path.join(test_directory, "datatypes_conf.xml"), - ), - ) - self.job_config = Bunch( - dynamic_params=None, - ) - self.model = Bunch(context=MockContext(model_objects)) - - class MockContext(object): def __init__(self, model_objects): diff --git a/test/unit/tools_support.py b/test/unit/tools_support.py index 0249cb2bf88..d1d77e00fda 100644 --- a/test/unit/tools_support.py +++ b/test/unit/tools_support.py @@ -106,6 +106,7 @@ class MockApp( object ): self.config = Bunch( outputs_to_working_directory=False, + commands_in_new_shell=True, new_file_path=os.path.join(test_directory, "new_files"), tool_data_path=os.path.join(test_directory, "tools"), root=os.path.join(test_directory, "galaxy"), From 865f2d49bd04b636552002cd0e4830f2dbad5c75 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 29 Feb 2016 11:42:04 +0000 Subject: [PATCH 4/5] Fix create/manage db scripts to respect GALAXY_VIRTUAL_ENV. --- create_db.sh | 8 +++++--- manage_db.sh | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/create_db.sh b/create_db.sh index 2f3243420ec..976d279e09b 100755 --- a/create_db.sh +++ b/create_db.sh @@ -1,9 +1,11 @@ #!/bin/sh -if [ -d .venv ]; +: ${GALAXY_VIRTUAL_ENV:=.venv} + +if [ -d "$GALAXY_VIRTUAL_ENV" ]; then - printf "Activating virtualenv at %s/.venv\n" $(pwd) - . .venv/bin/activate + printf "Activating virtualenv at $GALAXY_VIRTUAL_ENV\n" + . "$GALAXY_VIRTUAL_ENV/bin/activate" fi cd `dirname $0` diff --git a/manage_db.sh b/manage_db.sh index 7472c014899..6d4f3423d9b 100755 --- a/manage_db.sh +++ b/manage_db.sh @@ -5,10 +5,12 @@ # sh manage_db.sh downgrade --version=3 ####### -if [ -d .venv ]; +: ${GALAXY_VIRTUAL_ENV:=.venv} + +if [ -d "$GALAXY_VIRTUAL_ENV" ]; then - printf "Activating virtualenv at %s/.venv\n" $(pwd) - . .venv/bin/activate + printf "Activating virtualenv at $GALAXY_VIRTUAL_ENV\n" + . "$GALAXY_VIRTUAL_ENV/bin/activate" fi cd `dirname $0` From 5bc55f9fa2fd6af9142df644bf82e830b56f9ce4 Mon Sep 17 00:00:00 2001 From: guerler Date: Tue, 19 Jan 2016 12:37:52 -0500 Subject: [PATCH 5/5] Add js for mako based masthead --- templates/webapps/tool_shed/base_panels.mako | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/templates/webapps/tool_shed/base_panels.mako b/templates/webapps/tool_shed/base_panels.mako index 48149204112..8bfcde8b403 100644 --- a/templates/webapps/tool_shed/base_panels.mako +++ b/templates/webapps/tool_shed/base_panels.mako @@ -5,6 +5,28 @@ <%def name="javascripts()"> ${parent.javascripts()} + ## Masthead