Commit Graph
410 Commits
Author SHA1 Message Date
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 55aa7bce55 Test cases for mapping for outputs with filter statements.
Checked through tools-iuc and I couldn't find any tools that use the actual input data parameters in filter statements so I think it is a fairly good approximation to assume that all mapped jobs will either filter or not at least with current execution model.
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 4e9ee22ebc More verbose workflow extraction test cases. 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
John Chilton db2c3a43e2 Merge pull request #5018 from martenson/api-for-admin-decode
add API that allows admins to decode galaxy objects' ids
2017-11-19 20:40:34 -05:00
Martin Cech b5864ad4f7 Merge pull request #5004 from jmchilton/collection_copy_api
More HDCA copying tests, add option to copy HDAs into new history.
2017-11-16 14:37:56 -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
Martin Cech 8a35b940de add API that allows admins to decode galaxy objects' ids 2017-11-15 14:09:01 -05: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
John Chilton abe1b240c3 Fix broken library test I recently added. 2017-11-15 12:49:21 -05:00
John Chilton 4773765974 Merge remote-tracking branch 'jmchilton/dev' into lib-to-colllection 2017-11-14 22:26:10 -05:00
Nicola Soranzo 2cd95c48f6 Fix import order everywhere
- Add flake8-import-order to flake8 Pipfile and remove py27-lint-imports
  and py27-lint-imports-include-list tox envs
- Fix most E201 and E202 errors reported by flake8-import-order v0.15,
  but pin flake8-import-order to v0.14.3 until
  https://github.com/PyCQA/flake8-import-order/issues/123
  is fixed

This let us drop 2 jobs on Travis per each job.
2017-11-14 19:42:39 +00:00
John Chilton a0643e0385 More HDCA copying tests, add option to copy HDAs into new history. 2017-11-14 11:09:57 -05:00
John Chilton 25e53e1345 API tests for creating HDCAs from LDDA elements. 2017-11-14 09:30:55 -05:00
John Chilton 5609bfc307 More API library testing. 2017-11-14 09:24:10 -05:00
John Chilton 4d2a3c6074 Test both endpoints for collection creation in history contents API. 2017-11-09 05:20:03 -05:00
mvdbeek 611b667aa9 Fix downloading of arbitrarily-nested collections
This should work for any level of nesting and includes tests for the list:list
and list:list:list case. That's a first step towards https://github.com/galaxyproject/galaxy/issues/4415.
2017-11-05 19:37:40 +01:00
John Chilton 005f9d70f3 Improve error handling for incorrect datatype upload. 2017-11-02 16:21:21 -04:00
John Chilton 162bddd96c Simple tests for data source responses.
- Verify a simple data source works when responding via the API.
- Verify a data source sending back a file:// parameter is blocked (GX-2017-0004/GX-2017-0003 - it is tracked different ways in the commit message and in the security issue tracker).
2017-10-25 14:46:16 -04:00
E Rasche 0f311470d9 Backport of hardening fixes to 17.09 2017-10-18 13:03:49 -04:00
John Chilton bce4da7bc8 Add another upload test this time with no dbkey param.
Works fine...
2017-10-11 15:09:03 -04:00
John Chilton 108e94c9c2 FTP upload integration tests.
Test various configuration options (ftp_upload_dir, ftp_upload_identifier, ftp_upload_dir_template) and various upload API parameters (space_to_tab, to_posix_lines, auto_decompress).
2017-10-04 09:16:19 -04:00
John Chilton 8eac80a51b More upload API tests. 2017-10-04 09:16:19 -04:00
John Chilton 78d1dda69e Refactor API upload tests into their own test class. 2017-10-04 09:16:19 -04:00
John Chilton 1fa4ea2a8a Allow multiple simulatenous uploads via single POST.
The upload.py tool itself already allowed this and update upload dataset grouping to handle this.
2017-10-02 14:59:35 -04:00
John Chilton 4b7bd98b30 Merge pull request #4665 from mvdbeek/extend_job_search
Extend job search for hdcas
2017-09-29 08:38:28 -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
mvdbeek 9e3ceaa7f3 Don't return jobs with deleted HDAs/HDCAs from job_search 2017-09-22 16:52:19 +02:00
mvdbeek df91074a3f Test deleting HDCAs and finding equivalent jobs 2017-09-22 08:33:15 +02:00
mvdbeek 64cf60b502 Test deleting input datasets and recovering jobs from search
This revealed a wrong query filter (comparing
JobToInputDatasetAssociation.dataset_id == HistoryDatasetAssociation.id,
instead of JobToInputDatasetAssociation.dataset_id ==
HistoryDatasetAssociation.dataset_id).
2017-09-22 08:33:15 +02:00
mvdbeek 04754c4c4d Allow job_search to find job even if current HDCA was copied from another HDCA and make sure that jobs with same inputs matched to different job parameter inputs are not considered as a match 2017-09-22 08:33:15 +02:00
mvdbeek 7089de8142 Reduce job_search test copypaste 2017-09-22 08:33:15 +02:00
mvdbeek 2b7a163128 Add job_search tests for other collection types 2017-09-22 08:33:15 +02:00
mvdbeek 1d37c7d458 Check JobParameter match
Matching the JobParameters will prevent returning jobs where a job uses the
same input datasets, but where the inputs are used in a different order (and
hence the result may differ)
2017-09-22 08:33:15 +02:00
mvdbeek 92b48412c5 Extend job search for HDCA input 2017-09-22 08:33:15 +02:00
mvdbeek cf9e191e27 Move wait for dataset_collection to populators.py 2017-09-20 21:42:04 +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
Dannon Baker 6e6845b498 Merge pull request #4534 from jmchilton/collection_import_export_test_case
Refactor history import/export tests to allow collection testing.
2017-09-05 08:59:04 -04:00
Martin Cech 9b4cd096e1 Merge pull request #4505 from jmchilton/composite_upload_refine
Tests and clarifications for composite uploads.
2017-09-04 21:02:40 -04:00
John Chilton 3d9809a50d Merge pull request #4512 from martenson/improving-datalibraries
A round of data libraries improvements.
2017-09-04 00:21:51 -04:00
John Chilton cfefeebdd7 Refactor history import/export tests to allow collection testing (not yet implemented).
xref #4345, #4532
2017-08-31 13:15:55 -04:00
John Chilton 5a7a15d161 Test and clarifications for composite uploads.
- Add an API test for datatype-defined composite uploads - including exercising newline conversion and the space_to_tab parameter.
- Add a test decorator skip_without_datatype to mirror skip_without_tool for this test, improve both decorators.
- The ftype parameter in the composite test tools does nothing - drop it and drop it from the XSD spec.
- Slightly improve the documentation for these composite_data elements in the XSD.
2017-08-31 12:47:40 -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