diff --git a/client/src/components/Panels/ToolBoxWorkflow.vue b/client/src/components/Panels/ToolBoxWorkflow.vue index 010f624233f..64e98721273 100644 --- a/client/src/components/Panels/ToolBoxWorkflow.vue +++ b/client/src/components/Panels/ToolBoxWorkflow.vue @@ -40,6 +40,7 @@ v-if="hasWorkflowSection" :category="workflowSection" :key="workflowSection.name" + section-name="workflows" operation-icon="fa fa-files-o" operation-title="Insert individual steps." :query-filter="query" diff --git a/client/src/components/Workflow/Editor/Node.vue b/client/src/components/Workflow/Editor/Node.vue index 908673387eb..fd1c7fd8ecc 100644 --- a/client/src/components/Workflow/Editor/Node.vue +++ b/client/src/components/Workflow/Editor/Node.vue @@ -321,7 +321,7 @@ export default { }, setData(data) { this.config_form = data.config_form; - this.content_id = this.config_form?.id; + this.content_id = data.config_form?.id || data.content_id; this.tool_state = data.tool_state; this.errors = data.errors; this.annotation = data.annotation; diff --git a/lib/galaxy/selenium/navigation.yml b/lib/galaxy/selenium/navigation.yml index 06b9d2e17cf..7aff33ff980 100644 --- a/lib/galaxy/selenium/navigation.yml +++ b/lib/galaxy/selenium/navigation.yml @@ -406,6 +406,9 @@ workflow_editor: tool_menu: '.toolMenuContainer' tool_menu_section_link: '.tool-menu-section-${section_name} a span' tool_menu_item_link: 'a.tool-menu-item-${item_name}' + workflow_link: + type: xpath + selector: '//a[contains(., "${workflow_title}")]' connect_icon: 'div.ui-form-element[tour_id="${name}"] .ui-form-connected-icon' collapse_icon: 'div.ui-form-element[tour_id="${name}"] .ui-form-collapsible-icon' diff --git a/lib/galaxy/tools/execute.py b/lib/galaxy/tools/execute.py index 70f6ec56a5c..99d4328fa2f 100644 --- a/lib/galaxy/tools/execute.py +++ b/lib/galaxy/tools/execute.py @@ -31,7 +31,7 @@ def execute(trans, tool, mapping_params, history, rerun_remap_job_id=None, colle Execute a tool and return object containing summary (output data, number of failures, etc...). """ - if max_num_jobs: + if max_num_jobs is not None: assert invocation_step is not None if rerun_remap_job_id: assert invocation_step is None @@ -93,7 +93,7 @@ def execute(trans, tool, mapping_params, history, rerun_remap_job_id=None, colle execution_slice = None for i, execution_slice in enumerate(execution_tracker.new_execution_slices()): - if max_num_jobs and jobs_executed >= max_num_jobs: + if max_num_jobs is not None and jobs_executed >= max_num_jobs: has_remaining_jobs = True break else: diff --git a/lib/galaxy/tools/toolbox/base.py b/lib/galaxy/tools/toolbox/base.py index 729cac2f168..9871e075588 100644 --- a/lib/galaxy/tools/toolbox/base.py +++ b/lib/galaxy/tools/toolbox/base.py @@ -319,9 +319,13 @@ class AbstractToolBox(Dictifiable, ManagesIntegratedToolPanelMixin): def get_shed_config_dict_by_filename(self, filename): filename = os.path.abspath(filename) + dynamic_tool_conf_paths = [] for shed_config_dict in self._dynamic_tool_confs: - if shed_config_dict['config_filename'] == filename: + dynamic_tool_conf_path = os.path.abspath(shed_config_dict['config_filename']) + dynamic_tool_conf_paths.append(dynamic_tool_conf_path) + if dynamic_tool_conf_path == filename: return shed_config_dict + log.warning("'{}' not among installable tool config files ({})".format(filename, ', '.join(dynamic_tool_conf_paths))) return None def update_shed_config(self, shed_conf): diff --git a/lib/galaxy/workflow/run.py b/lib/galaxy/workflow/run.py index c261f23e7e2..f9402424fb2 100644 --- a/lib/galaxy/workflow/run.py +++ b/lib/galaxy/workflow/run.py @@ -173,7 +173,12 @@ class WorkflowInvoker: remaining_steps = self.progress.remaining_steps() delayed_steps = False + max_jobs_per_iteration_reached = False for (step, workflow_invocation_step) in remaining_steps: + max_jobs_to_schedule = self.progress.maximum_jobs_to_schedule_or_none + if max_jobs_to_schedule is not None and max_jobs_to_schedule <= 0: + max_jobs_per_iteration_reached = True + break step_delayed = False step_timer = ExecutionTimer() try: @@ -208,7 +213,7 @@ class WorkflowInvoker: if not step_delayed: log.debug(f"Workflow step {step.id} of invocation {workflow_invocation.id} invoked {step_timer}") - if delayed_steps: + if delayed_steps or max_jobs_per_iteration_reached: state = model.WorkflowInvocation.states.READY else: state = model.WorkflowInvocation.states.SCHEDULED diff --git a/lib/galaxy_test/selenium/test_workflow_editor.py b/lib/galaxy_test/selenium/test_workflow_editor.py index e5909de1149..64423feab0d 100644 --- a/lib/galaxy_test/selenium/test_workflow_editor.py +++ b/lib/galaxy_test/selenium/test_workflow_editor.py @@ -2,6 +2,7 @@ import json from galaxy_test.base.workflow_fixtures import ( WORKFLOW_NESTED_SIMPLE, + WORKFLOW_OPTIONAL_TRUE_INPUT_COLLECTION, WORKFLOW_SIMPLE_CAT_TWICE, WORKFLOW_SIMPLE_MAPPING, WORKFLOW_WITH_INVALID_STATE, @@ -358,6 +359,36 @@ steps: self.assert_modal_has_text("Using version '0.2' instead of version '0.0.1'") self.screenshot("workflow_editor_tool_upgrade") + @selenium_test + def test_editor_embed_workflow(self): + workflow_populator = self.workflow_populator + child_workflow_name = self._get_random_name() + workflow_populator.upload_yaml_workflow(WORKFLOW_OPTIONAL_TRUE_INPUT_COLLECTION, name=child_workflow_name) + parent_workflow_id = workflow_populator.upload_yaml_workflow("""class: GalaxyWorkflow +inputs: [] +steps: + - tool_id: multiple_versions + tool_version: 0.1 + label: multiple_versions + state: + foo: bar + """) + self.workflow_index_open() + self.workflow_index_click_option("Edit") + editor = self.components.workflow_editor + editor.canvas_body.wait_for_visible() + editor.tool_menu.wait_for_visible() + editor.tool_menu_section_link(section_name="workflows").wait_for_and_click() + editor.workflow_link(workflow_title=child_workflow_name).wait_for_and_click() + self.sleep_for(self.wait_types.UX_RENDER) + self.assert_has_changes_and_save() + self.sleep_for(self.wait_types.UX_RENDER) + workflow = self.workflow_populator.download_workflow(parent_workflow_id) + subworkflow_step = workflow['steps']['1'] + assert subworkflow_step['name'] == child_workflow_name + assert subworkflow_step['type'] == 'subworkflow' + assert subworkflow_step['subworkflow']['a_galaxy_workflow'] == 'true' + @selenium_test def test_editor_invalid_tool_state(self): workflow_populator = self.workflow_populator diff --git a/test/integration/test_workflow_scheduling_options.py b/test/integration/test_workflow_scheduling_options.py index 50a2809554b..d8f24232413 100644 --- a/test/integration/test_workflow_scheduling_options.py +++ b/test/integration/test_workflow_scheduling_options.py @@ -61,7 +61,7 @@ class MaximumWorkflowJobsPerSchedulingIterationTestCase(integration_util.Integra def handle_galaxy_config_kwds(cls, config): config["maximum_workflow_jobs_per_scheduling_iteration"] = 1 - def test(self): + def test_collection_explicit_and_implicit(self): workflow_id = self.workflow_populator.upload_yaml_workflow(""" class: GalaxyWorkflow steps: @@ -89,3 +89,40 @@ steps: self.workflow_populator.wait_for_workflow(history_id, workflow_id, invocation_id) self.dataset_populator.wait_for_history(history_id, assert_ok=True) self.assertEqual("a\nc\nb\nd\ne\ng\nf\nh\n", self.dataset_populator.get_history_dataset_content(history_id, hid=0)) + + def test_scheduling_rounds(self): + with self.dataset_populator.test_history() as history_id: + invocation_response = self.workflow_populator.run_workflow(""" +class: GalaxyWorkflow +inputs: + input1: data + text_input: text +steps: + first_cat: + tool_id: cat1 + in: + input1: input1 + second_cat: + tool_id: cat1 + in: + input1: first_cat/out_file1 + collection_creates_dynamic_list_of_pairs: + tool_id: collection_creates_dynamic_list_of_pairs + in: + file: second_cat/out_file1 + count_multi_file: + tool_id: count_multi_file + in: + input1: collection_creates_dynamic_list_of_pairs/list_output +outputs: + wf_output_1: + outputSource: collection_creates_dynamic_list_of_pairs/list_output +""", test_data=""" +input1: + value: 1.fasta + type: File + name: fasta1 +text_input: foo +""", history_id=history_id) + invocation = self._get("/invocations/{}".format(invocation_response.invocation_id)).json() + assert 'wf_output_1' in invocation['output_collections']