From 78c866fd34181ecda09488b6d19d2e37f6c69d02 Mon Sep 17 00:00:00 2001 From: guerler Date: Sat, 4 Jun 2016 07:16:46 -0400 Subject: [PATCH 1/8] Relax validation condition --- lib/galaxy/tools/parameters/basic.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/tools/parameters/basic.py b/lib/galaxy/tools/parameters/basic.py index 9ab8a1d2ac6..cc9ff69fc4d 100644 --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -894,7 +894,11 @@ class SelectToolParameter( ToolParameter ): def from_json( self, value, trans, other_values={} ): legal_values = self.get_legal_values( trans, other_values ) - if len(list(legal_values)) == 0 and trans.workflow_building_mode: + workflow_building_mode = trans.workflow_building_mode + for context_value in other_values.itervalues(): + if isinstance( context_value, RuntimeValue ): + workflow_building_mode = True + if len( list( legal_values ) ) == 0 and workflow_building_mode: if self.multiple: # While it is generally allowed that a select value can be '', # we do not allow this to be the case in a dynamically From a44f30140990c93aa92b8cb5f0f87b819942b116 Mon Sep 17 00:00:00 2001 From: guerler Date: Sun, 5 Jun 2016 10:48:36 -0400 Subject: [PATCH 2/8] Revise contradicting test case, workflow injection through api attempts full validation without available datasets --- test/unit/tools/test_select_parameters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/tools/test_select_parameters.py b/test/unit/tools/test_select_parameters.py index 226cd088a63..7789d3881f7 100644 --- a/test/unit/tools/test_select_parameters.py +++ b/test/unit/tools/test_select_parameters.py @@ -33,7 +33,7 @@ class SelectToolParameterTestCase( BaseParameterTestCase ): def test_validated_datasets( self ): self.options_xml = '''''' try: - self.param.from_json( model.HistoryDatasetAssociation(), self.trans, { "input_bam": basic.RuntimeValue() } ) + self.param.from_json( model.HistoryDatasetAssociation(), self.trans, { "input_bam": None } ) except ValueError, err: assert str(err) == "Parameter my_name requires a value, but has no legal values defined." return From d9d51d362e8ef3197e01c0440289e60a50ad85e8 Mon Sep 17 00:00:00 2001 From: guerler Date: Mon, 6 Jun 2016 11:52:48 -0400 Subject: [PATCH 3/8] Add break to interrupt loop --- lib/galaxy/tools/parameters/basic.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/galaxy/tools/parameters/basic.py b/lib/galaxy/tools/parameters/basic.py index cc9ff69fc4d..7f12691565b 100644 --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -898,6 +898,7 @@ class SelectToolParameter( ToolParameter ): for context_value in other_values.itervalues(): if isinstance( context_value, RuntimeValue ): workflow_building_mode = True + break if len( list( legal_values ) ) == 0 and workflow_building_mode: if self.multiple: # While it is generally allowed that a select value can be '', From 7610f82a421edb422b8ba8f7731a1ae23fb9ac41 Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Thu, 9 Jun 2016 15:38:57 -0400 Subject: [PATCH 4/8] fix markup for button links on sharing template (ff would fail to generate images) turn of autocomplete --- templates/webapps/galaxy/workflow/sharing.mako | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/templates/webapps/galaxy/workflow/sharing.mako b/templates/webapps/galaxy/workflow/sharing.mako index a0b633d6eb6..d77e781ecd4 100644 --- a/templates/webapps/galaxy/workflow/sharing.mako +++ b/templates/webapps/galaxy/workflow/sharing.mako @@ -233,11 +233,9 @@

Export

@@ -273,11 +271,11 @@ method="POST">
- +
- +
@@ -290,11 +288,9 @@ <%def name="render_more(item)"> ## Add link to render as SVG image. ## Add form to export to myExperiment. From 574740d0b299d9cd84d9065f4746204f6399d891 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Fri, 10 Jun 2016 19:39:22 +0100 Subject: [PATCH 5/8] Reset exception retries after successful job status check --- lib/galaxy/jobs/runners/drmaa.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/galaxy/jobs/runners/drmaa.py b/lib/galaxy/jobs/runners/drmaa.py index abf1c58571a..e64832e7e93 100644 --- a/lib/galaxy/jobs/runners/drmaa.py +++ b/lib/galaxy/jobs/runners/drmaa.py @@ -22,6 +22,8 @@ log = logging.getLogger( __name__ ) __all__ = [ 'DRMAAJobRunner' ] +RETRY_EXCEPTIONS_LOWER = frozenset(['invalidjobexception', 'internalexception']) + class DRMAAJobRunner( AsynchronousJobRunner ): """ @@ -34,12 +36,11 @@ class DRMAAJobRunner( AsynchronousJobRunner ): """Start the job runner""" global drmaa - runner_param_specs = dict( - drmaa_library_path=dict( map=str, default=os.environ.get( 'DRMAA_LIBRARY_PATH', None ) ), - invalidjobexception_state=dict( map=str, valid=lambda x: x in ( model.Job.states.OK, model.Job.states.ERROR ), default=model.Job.states.OK ), - invalidjobexception_retries=dict( map=int, valid=lambda x: int >= 0, default=0 ), - internalexception_state=dict( map=str, valid=lambda x: x in ( model.Job.states.OK, model.Job.states.ERROR ), default=model.Job.states.OK ), - internalexception_retries=dict( map=int, valid=lambda x: int >= 0, default=0 ) ) + runner_param_specs = { + 'drmaa_library_path': dict( map=str, default=os.environ.get( 'DRMAA_LIBRARY_PATH', None ) ) } + for retry_exception in RETRY_EXCEPTIONS_LOWER: + runner_param_specs[retry_exception + '_state'] = dict( map=str, valid=lambda x: x in ( model.Job.states.OK, model.Job.states.ERROR ), default=model.Job.states.OK ) + runner_param_specs[retry_exception + '_retries'] = dict( map=int, valid=lambda x: int >= 0, default=0 ) if 'runner_param_specs' not in kwargs: kwargs[ 'runner_param_specs' ] = dict() @@ -246,12 +247,15 @@ class DRMAAJobRunner( AsynchronousJobRunner ): try: assert external_job_id not in ( None, 'None' ), '(%s/%s) Invalid job id' % ( galaxy_id_tag, external_job_id ) state = self.ds.job_status( external_job_id ) + # Reset exception retries + for retry_exception in RETRY_EXCEPTIONS_LOWER: + setattr( ajs, retry_exception + '_retries', 0) except ( drmaa.InternalException, drmaa.InvalidJobException ) as e: ecn = type(e).__name__ retry_param = ecn.lower() + '_retries' state_param = ecn.lower() + '_state' retries = getattr( ajs, retry_param, 0 ) - log.warning("(%s/%s) unable to check job status because of %s exception for %d tries: %s", galaxy_id_tag, external_job_id, ecn, retries + 1, e) + log.warning("(%s/%s) unable to check job status because of %s exception for %d consecutive tries: %s", galaxy_id_tag, external_job_id, ecn, retries + 1, e) if self.runner_params[ retry_param ] > 0: if retries < self.runner_params[ retry_param ]: # will retry check on next iteration From 4cf8d691e525142125af56b0627f804eb1bddd7c Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Fri, 10 Jun 2016 16:02:58 -0400 Subject: [PATCH 6/8] fix image generation for workflows with missing tools currently this ends up with a server error --- lib/galaxy/webapps/galaxy/controllers/workflow.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/galaxy/controllers/workflow.py b/lib/galaxy/webapps/galaxy/controllers/workflow.py index 7fe372a1561..30a1e939865 100644 --- a/lib/galaxy/webapps/galaxy/controllers/workflow.py +++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py @@ -512,8 +512,14 @@ class WorkflowController( BaseUIController, SharableMixin, UsesStoredWorkflowMix @web.require_login( "use Galaxy workflows" ) def gen_image( self, trans, id ): stored = self.get_stored_workflow( trans, id, check_ownership=True ) + try: + svg = self._workflow_to_svg_canvas( trans, stored ) + except Exception: + status = 'error' + message = 'Galaxy is unable to create the svg image. Please check your workflow, there might be missing tools.' + return trans.fill_template( "/workflow/sharing.mako", use_panels=True, item=stored, status=status, message=message ) trans.response.set_content_type("image/svg+xml") - return self._workflow_to_svg_canvas( trans, stored ).tostring() + return svg.tostring() @web.expose @web.require_login( "use Galaxy workflows" ) @@ -1282,6 +1288,8 @@ class WorkflowController( BaseUIController, SharableMixin, UsesStoredWorkflowMix for step in workflow.steps: # Load from database representation module = module_factory.from_workflow_step( trans, step ) + if not module: + raise Exception module_name = module.get_name() module_data_inputs = module.get_data_inputs() module_data_outputs = module.get_data_outputs() From fdf9520783ae55795a01e4092b1d6718c5fca5b4 Mon Sep 17 00:00:00 2001 From: Martin Cech Date: Fri, 10 Jun 2016 20:42:12 -0400 Subject: [PATCH 7/8] drop unnecessary raise and fix capitalization incorporate comments of Bjoern and Nicola --- lib/galaxy/webapps/galaxy/controllers/workflow.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/controllers/workflow.py b/lib/galaxy/webapps/galaxy/controllers/workflow.py index 30a1e939865..c0e3623e825 100644 --- a/lib/galaxy/webapps/galaxy/controllers/workflow.py +++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py @@ -516,7 +516,7 @@ class WorkflowController( BaseUIController, SharableMixin, UsesStoredWorkflowMix svg = self._workflow_to_svg_canvas( trans, stored ) except Exception: status = 'error' - message = 'Galaxy is unable to create the svg image. Please check your workflow, there might be missing tools.' + message = 'Galaxy is unable to create the SVG image. Please check your workflow, there might be missing tools.' return trans.fill_template( "/workflow/sharing.mako", use_panels=True, item=stored, status=status, message=message ) trans.response.set_content_type("image/svg+xml") return svg.tostring() @@ -1288,8 +1288,6 @@ class WorkflowController( BaseUIController, SharableMixin, UsesStoredWorkflowMix for step in workflow.steps: # Load from database representation module = module_factory.from_workflow_step( trans, step ) - if not module: - raise Exception module_name = module.get_name() module_data_inputs = module.get_data_inputs() module_data_outputs = module.get_data_outputs() From 0017b3e9405e5e77904364025889c88cf0991744 Mon Sep 17 00:00:00 2001 From: Bjoern Gruening Date: Sat, 11 Jun 2016 18:17:39 +0200 Subject: [PATCH 8/8] add IUC channel to the list --- lib/galaxy/tools/deps/__init__.py | 2 +- lib/galaxy/tools/deps/resolvers/conda.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/tools/deps/__init__.py b/lib/galaxy/tools/deps/__init__.py index 555e54cc8ec..7cba2d8df79 100644 --- a/lib/galaxy/tools/deps/__init__.py +++ b/lib/galaxy/tools/deps/__init__.py @@ -20,7 +20,7 @@ EXTRA_CONFIG_KWDS = { 'conda_prefix': None, 'conda_exec': None, 'conda_debug': None, - 'conda_ensure_channels': 'r,bioconda', + 'conda_ensure_channels': 'r,bioconda,iuc', 'conda_auto_install': False, 'conda_auto_init': False, } diff --git a/lib/galaxy/tools/deps/resolvers/conda.py b/lib/galaxy/tools/deps/resolvers/conda.py index e2ac9c69d58..17b7aa601e1 100644 --- a/lib/galaxy/tools/deps/resolvers/conda.py +++ b/lib/galaxy/tools/deps/resolvers/conda.py @@ -28,7 +28,7 @@ from ..conda_util import ( DEFAULT_BASE_PATH_DIRECTORY = "_conda" DEFAULT_CONDARC_OVERRIDE = "_condarc" -DEFAULT_ENSURE_CHANNELS = "r,bioconda" +DEFAULT_ENSURE_CHANNELS = "r,bioconda,iuc" import logging log = logging.getLogger(__name__)