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/lib/galaxy/jobs/__init__.py b/lib/galaxy/jobs/__init__.py index fb1dace8e20..b340e870701 100644 --- a/lib/galaxy/jobs/__init__.py +++ b/lib/galaxy/jobs/__init__.py @@ -771,6 +771,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 @@ -803,13 +804,19 @@ 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 strict_shell(self): return self.tool.strict_shell @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 c1322d692b4..b52a777c79f 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, 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` diff --git a/templates/webapps/galaxy/workflow/run.mako b/templates/webapps/galaxy/workflow/run.mako index e4d0851687d..a0c529d5b31 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 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 c8f5a34211e..c0b9769a588 100644 --- a/test/unit/tools_support.py +++ b/test/unit/tools_support.py @@ -111,6 +111,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"),