Commit Graph
173 Commits
Author SHA1 Message Date
John Chilton b878835ea3 Add a legacy_job_state mode to restore 17.09 workflow invocation behavior. 2018-08-08 11:11:48 -04:00
John Chilton 272c6b071d Test case to clarify workflow API a bit in simple cases. 2018-08-08 11:11:47 -04:00
mvdbeek ba47188f5e Introduce test for auto-labelling subworkflow workflow outputs 2018-08-06 15:55:27 +02:00
Nicola Soranzo efb0f02d34 Hide replacement datasets when rerunning a failed dataset in a mapped-over collection 2018-05-14 19:36:18 +01:00
Nicola Soranzo 85e5d7fcd3 Fix required tools to run workflow API tests 2018-05-14 19:28:57 +01:00
mvdbeek f1dd060d73 Test rename PJA when resuming a failed job 2018-03-13 12:38:41 +01:00
John Chilton 8e32e93d6d Implement more collection workflow post job actions.
Implement hide, delete, add tag, and remove tag for output collections and mapped over collections.

Fixes https://github.com/galaxyproject/galaxy/issues/1680.
2018-02-02 13:29:57 -05:00
John Chilton f6f9f9a891 Extend mapped collection output rename PJAs to include # replacements.
Also make sure output collections in non-mapping scenarios are also properly renamed as well.
2018-02-02 09:52:44 -05:00
John Chilton 2b8df110d0 Apply rename PJA to collection outputs including $ replacements.
Update PJA collection test to test HDCA is renamed also.
2018-02-02 09:52:44 -05:00
mvdbeek cad17b07c3 Revert "Revert extra assertions that are causing unrelated issues to surface."
This reverts commit 4925660ab4.
2018-01-30 19:04:10 +01:00
mvdbeek da3e48faa5 Mark rerun_with_use_cached_job as flakey
Sometimes it does not pick up the equivalent job that should exist. Will need
to dig into this, but in the meantime we can allow the test to fail.
2018-01-09 15:53:22 +01:00
mvdbeek 2f6cc22384 Copy element_identifier to resumed job
This fixes #5269.
2018-01-05 17:32:09 +02:00
mvdbeek 81c3b8cc4d Include more information in assertion 2017-12-31 18:06:49 +02:00
mvdbeek c327594ed7 Simplify use_cached_jobs workflow tests 2017-12-31 18:06:49 +02:00
mvdbeek 78c37d32d9 Assert that histories contains same dataset ids 2017-12-31 18:06:49 +02:00
mvdbeek 9d38219d65 Pass use_cached_jobs on to subworkflow invoker 2017-12-31 18:06:49 +02:00
mvdbeek 1c4476a6af Add a test for skipping jobs in workflow context
This is using the simplest of workflows. I had to
remove the chromInfo part from the workflow, because the
path referenced would be changed dynamically and so the
job search wouldn't recognize this as being equivalent.
2017-12-31 18:06:48 +02:00
mvdbeek c0dbace7bb Replace collection elements with re-run output
This specifically addresses the problem where some jobs of a mapped-over
collection have failed. Instead of filtering the failed collection and
restarting the workflow at this position (involving a lot of copy-paste ...)
the user can now limit the rerun to the problematic jobs and the workflow
should resume from there.
Should fix https://github.com/galaxyproject/galaxy/issues/2235.

This is one possible implementation, it would also be feasible to not
manipulate the original collection, but to copy the HDCA and then to replace
collection elements and replace all references for jobs that depend on the HDCA,
as we do for HDAs. This implementation seems simpler, but let me know if you
see problems with this approach.
2017-12-31 14:08:26 +02:00
mvdbeek 9fdf0a6269 Add job resume test with HDCA input to paused dataset
I am slightly surprised that this worked without change,
but it appears that the remapping occurs via the HDAs that
the HDCA is composed of.
2017-12-31 14:08:26 +02:00
mvdbeek 39073b4b4c Add test for resume job functionality
This test runs a workflow whose first step fails, followed by a tool that uses
the first step's output as an input, which is behind a nested conditional. This
recapitulates the bug described in https://github.com/galaxyproject/galaxy/issues/5222.
2017-12-31 14:07:42 +02:00
Björn Grüning c8d45dd4b3 Merge pull request #5143 from jmchilton/fix_missing_outputs
Re-allow workflow outputs that aren't produced during workflow scheduling.
2017-12-07 16:23:28 +01:00
John Chilton 4925660ab4 Revert extra assertions that are causing unrelated issues to surface.
The unrelated issues are serious problems though and I've created an issue to track them https://github.com/galaxyproject/galaxy/issues/5146.
2017-12-06 16:13:12 -05:00
John Chilton b1d6c017d0 Fixes for handling delayed steps within subworkflows.
With new test case to verify this fix is needed. The previous test case that was verifying collection mapping and rescheduling of subworkflows turned out to really be testing the connections with respect to the outer workflow since only the last step of the subworkflow required rescheduling iterations. This newer test case verifies the connections within the subworkflow also - in addition to re-testing the connections and mapping in the outer workflow.
2017-12-06 15:16:10 -05:00
John Chilton b7be4162bd Re-allow workflow outputs that aren't produced during workflow scheduling.
These are sort of an error in the workflow definition but we don't have a means to competently display this information to the user via the UI so I think we need to just allow this to happen.

I've attached a test case that exhibits this behavior and passes under 17.09 but fails under the current dev branch without these fixes. This was broken in https://github.com/galaxyproject/galaxy/commit/d5f98f49045bca351e982f17cac9386308089eeb when we started to actually persist pointers to workflow invocation outputs (as part of https://github.com/galaxyproject/galaxy/pull/5013).
2017-12-06 14:26:20 -05:00
Nicola Soranzo 48aca7dce8 Update to flake8-import-order 0.16 2017-12-01 11:09:57 +00:00
John Chilton 78babab645 Pre-build collections during mapping to be more recoverable.
Create mapped over collections ahead of time instead of at the end only if they are valid.

- This way if there is a problem that problem can be reported in the state of the mapped collection.
- This way datasets can just be hidden instead of displayed and then hidden (fixes #1790).
- I think this should improve performance and prevent locks because we no longer have conflicting threads trying to write dataset state.
- We populate the collection as we go so we can recover and continue scheduling the mapped step (needed for #3883)
2017-11-30 10:02:02 -05:00
John Chilton 9e471d3e97 Allow mapping over empty collections.
If one maps a tool over an empty collection, one should get an empty output collection for each of the tool's outputs.

This should have always been a valid operation I think, the code just wasn't quite structured right when the collection work was merged - there were too many places I was assuming the existence of at least one actual output or input that was mapped over to continue going. This reworks all of that and seems to handle empty collections appropriately.

Fixes #4025 (not being informing the user of the operation, but actually by allowing the operation - which it should be allowed I think).
2017-11-30 10:02:02 -05:00
John Chilton 0185e04a5b Test recover_mapping in conjunction with subworkflow executions. 2017-11-30 10:02:02 -05:00
John Chilton 64835c1e72 Three new worklfow test cases to verify mapping over workflows is possible.
- Simple mapping over an input dataset.
- Mapping that produces nested collections.
- Mapping over subworkflows.
2017-11-30 10:02:02 -05:00
John Chilton d5f98f4904 Formalize workflow invocation and invocation step outputs.
Workflow Invocations
--------------------

The workflow invocation outputs half of this is relatively straight forward. It is modelled somewhat on job outputs, output datasets and output dataset collections are now tracked for each workflow invocation and exposed via the workflow invocation API. This required adding new tables (linked to WorkflowInvocations and WorkflowOutputs) that track these output associations.

Previously one could imagine backtracking this information for simple tool steps via the WorkflowInvocationStep -> Job table, but for steps that have many jobs (i.e. mapping over a collection) or for non-tool steps such information was more difficult to recover (and simply couldn't be recovered from the API at all or even internally without significant knowledge of the underlying workflow).

Workflow Invocation Steps
-------------------------

Tracking the outputs of WorkflowInvocationSteps was not previously done at all, one would have to follow the Job table as well. A signficant downside to this is that one cannot map over empty collections in a workflow - since no such job would exist. Tracking job outputs for WorkflowInvocationSteps is not a simple matter of just attaching outputs to an existing table because we had no concept of a workflow step tracked - since there could be many WorklfowInvocationSteps corresponding to the same combination of WorkflowInvocation and WorkflowStep. That should feel wrong and that is because it is - when collections were added the possiblity of having many jobs for the same combination of WorkflowInvocation and WorkflowStep was added. I should have split WorkflowInvocationSteps into WorkflowInvocationSteps and WorkflowInvocationStepJobAssociations at that time but didn't. This commit now does it - effectively normalizing the ``workflow_invocation_step`` table by introducing the new ``workflow_invocation_step_job_association`` table.

Splitting up the WorkflowInvocationStep table this way allows recovering the mapped over output (e.g. the implicitly created collection from all the jobs) as well the outputs from the individual jobs (by walking WorkflowInvocationStep -> WorkflowInvocationStepJobAssociation -> Job -> JobToOutput*Association).

This split up involves failrly substantial changes to the workflow module interface. Any place a list of WorkflowInvocationSteps was assumed, I reworked it to just expect a single WorkflowInvocationStep. I vastly simplified recover_mapping to just use the persisted outputs (this was needed in order to also implment empty collection mapping in workflows). This also fixes a bug (or implements a missing feature) where Subworkflow moudles had no recover_mapping methods - so for instance if a tool that produces dynamic collections appeared anywhere in a workflow after a subworkflow step - that workflow would not complete scheduling properly.

Now that we have a way to reference the set of jobs corresponding to a workflow step within an invocation, we can start to track partial scheduling of such steps. This is outlined in https://github.com/galaxyproject/galaxy/issues/3883 and refactoring toward this goal is included here - including adding a state to WorkflowInvocationStep so Galaxy can determine if it has started scheduling this step and an index when scheduling jobs so it can tell how far into a scheduling things have gone as well as augmenting the tool executor to take a maximum number of jobs to execute and allow recovery of existing jobs for collection building purposes.

*Applications*

These changes will enable:

- A simple, consistent API for finding workflow outputs that can be consumed by Planemo for testing workflows.
- Mapping over empty collections in workflows.
- Re-scheduling workflow invocations that include subworkflow steps.
- Partial scheduling within steps requiring a large number of jobs when scheduling workflow invocations.
2017-11-30 10:02:01 -05:00
John Chilton c076b3b6c5 Refactor workflow testing toward reuse via "populators".
Should allow more functionality to be shared between vanilla API tests and integration tests for various workflow scheduling options.
2017-11-30 10:02:01 -05:00
John Chilton 0ff639a29c More debugging in workflows API tests. 2017-11-30 10:02:01 -05:00
Marius van den Beek a9685d3acd Merge pull request #5017 from jmchilton/test_renaming_multiple_workflows
Test renaming multiple different outputs in workflows.
2017-11-16 17:51:59 +01:00
John Chilton d3b5fac751 Test renaming multiple different outputs in workflows.
Attempting to exercise a bug reported by @lparsons.
2017-11-15 13:46:01 -05:00
E Rasche 0f311470d9 Backport of hardening fixes to 17.09 2017-10-18 13:03:49 -04:00
Nicola Soranzo 9b1832abb1 Fix import order for cron/, scripts/ and test/ 2017-09-25 23:44:39 +01:00
E Rasche 32b85ecb59 Only permit yaml.safe_loading of data
Event trusted data, belt + suspenders method.
2017-09-25 11:39:12 +02:00
John Chilton 7efe561867 Rework invocation state tracking in API tests.
At the insistence of @nsoranzo, be more explicit about waiting for workflow test in API tests. While I was in there I also setup new abstractions for waiting on state and updated various workflow cancelling tests to use test_history context for better error reporting.
2017-09-11 16:08:29 -04:00
John Chilton 5da62ca264 Cancel workflow invocations when histories are deleted.
With test case, rebased with spelling fixes thanks to @nsoranzo.

xref #3555 (third point)
2017-09-11 16:07:37 -04:00
John Chilton 5142509f13 Make a couple workflow invocation tests more robust.
Less random sleeping, wait for actual invocation. I think this is likely the cause this transient failure (https://jenkins.galaxyproject.org/job/docker-api/8215/testReport/junit/api.test_workflows/WorkflowsApiTestCase/test_workflow_run_output_collection_mapping/) picking up the input as the last dataset in the history instead of the output - I bet the workflow just hadn't been invoked yet.
2017-08-31 09:07:03 -04:00
mvdbeek 0a4203ed92 Fix test to use invocation_id instead of history_id 2017-08-19 14:45:58 +02:00
mvdbeek 912da2f3b9 Fix checking WorkflowInvocation for published workflows 2017-08-19 14:45:58 +02:00
Nicola Soranzo 03df496540 Fix API tests broken in #4434 2017-08-17 13:44:51 +01:00
Nicola Soranzo a353b2e88f Fix E127 errors introduced by previous commit
using:
```
autopep8 -i -r --exclude $(sed -e 's|^|./|' -e 's|/$||' .ci/flake8_blacklist.txt | paste -sd,) --select E127 .
```
2017-08-17 11:35:39 +01:00
Nicola Soranzo 21b44bf348 Fix all E201 and E202 style errors
using the following command:
```
autopep8 -i -r --exclude $(sed -e 's|^|./|' -e 's|/$||' .ci/flake8_blacklist.txt | paste -sd,) --select E201,E202 .
```
2017-08-17 11:35:39 +01:00
Matt Chambers 03a3d34f1e Remove (imported from API) suffix from test 2017-08-16 10:05:04 -05:00
John Chilton 7dd3ddccaf Require admin for new import_tools function in workflows API.
Includes test case.
2017-08-10 13:29:44 -04:00
Dannon Baker 8acea34450 Merge pull request #3983 from jmchilton/collection_rename
Add test case clarifying datasets do get "renamed" by rename PJA in collections.
2017-05-08 18:04:00 -04:00
John Chilton 8b21e65196 Improve implicit workflow connection test case.
I think https://jenkins.galaxyproject.org/job/docker-api/7316/testReport/junit/api.test_workflows/WorkflowsApiTestCase/test_run_with_implicit_connection/ may be the first time I have seen it fail - but still it has some other problems.

- Eliminate the sleep - instead wait on explicitly on the desired condition (first two jobs are complete and the workflow is ready for unpause). This is likely why the test case failed.
- Improve the other assertions to provide more details in the test case ever fails again.
2017-04-28 09:01:00 -04:00
John Chilton 614d032f12 Add test case clarifying datasets do get "renamed" by rename PJA in collections.
xref #1675

This is of limited utility since we don't really expose the name - and intentionally so. Related open bugs/enhancements that still need to be addressed are:

 - Applying rename to the collection (in addition to the elements) - #1680.
 - Download of collection elements with element identifier instead of the name: #2023 / #2140.
2017-04-27 09:17:23 -04:00