Commit Graph
16139 Commits
Author SHA1 Message Date
John Chilton 40fd72a198 Allow rescheduling of single workflow steps.
Implement maximum_workflow_jobs_per_scheduling_iteration to test this and mitigate memory issues associated with scheduling large workflow steps (maybe).

Fixes #3883.
2017-11-30 10:02:02 -05: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 53cba4aa74 Refactor collection manager into smaller, more focused methods.
Stronger assertions to verify arguments are correct.
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 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 8c1658f61a Mixin for uses create and update time. 2017-11-30 10:02:01 -05:00
John Chilton 0e0894bbba Refactoring history contents API. 2017-11-30 10:02:01 -05:00
Dannon Baker baba3417d0 Merge pull request #5056 from erasche/sentry-stuff
Support separate DSN for job sentry error reports
2017-11-29 07:55:49 -05:00
Marius van den Beek 75a6d434ee Merge pull request #4993 from guerler/replace_history_import
Replace history import form
2017-11-29 13:25:58 +01:00
guerler 081cbc4bb0 Add quotes 2017-11-28 13:11:12 -05:00
Nicola Soranzo 59f44cf2be Update get_fileobj() to use utf-8 encoding in text mode
Also, merge its 3 parameters `gzip_only`, `bz2_only`, `zip_only` into
`compressed_formats` (a list of allowed formats).

As a consequence of the changes in `get_fileobj()`, update:
- `files_diff()`
- `get_file_peek()`, which now determines that a file is binary when a
  `UnicodeDecodeError` exception is raised and doesn't need
  `is_multi_byte` any more
- `iter_headers()` and `get_headers()`, which now return Unicode and don't
  need `is_multi_byte` parameter any more

As a consequence of the changes in `get_file_peek()`, update:
- `set_peek()`, which now doesn't need `is_multi_byte` any more

As a consequence of the changes in `get_headers()`, update:
- `guess_ext` and `is_column_based()`, which now determine that a file is
  binary when a `UnicodeDecodeError` exception is raised and don't need
  `is_multi_byte` any more

As a consequence of the changes to `guess_ext`, update:
- `handle_uploaded_dataset_file() doesn't need `is_multi_byte` any more

Also, remove duplicated calls to `get_file_peek()` in
lib/galaxy/datatypes/molecules.py and lib/galaxy/datatypes/msa.py

The `is_multi_byte` was not removed from the signature of `get_file_peek()`
and `set_peek()` in order to preserve compatibility for ToolShed datatypes,
thanks @jmchilton for the review.
2017-11-28 17:46:32 +00:00
guerler 9800013ec2 Switch to transparent readmode for history tarfiles 2017-11-28 12:36:30 -05:00
Nicola Soranzo 6b730ae961 Add a datatype to sniff_order only if it has a sniff() method
This reduces the number of default sniffers from 412 to 246.
2017-11-28 17:17:44 +00:00
Nicola Soranzo 5a2cb85469 Fix SnpSiftDbNSFP.generate_primary_file() to return a string
Also use a `with` statement to open/close a file in
`SnpSiftDbNSFP.regenerate_primary_file()` .
2017-11-28 17:17:43 +00:00
Nicola Soranzo 0df99d89d7 Improve and test the PDF sniffer
Read just the first 4 bytes in binary mode.
2017-11-28 17:13:18 +00:00
Nicola Soranzo 1ba863d4d6 Remove duplicated functions
Added in commits 777d6a155c and
917d5a72e8
2017-11-28 17:13:18 +00:00
Nicola Soranzo c4a2d8c218 Fix html sniffer to not return True in case of exception 2017-11-28 17:13:18 +00:00
guerler fa661bf7b0 Merge branch 'dev' into replace_history_import 2017-11-28 11:46:33 -05:00
John Chilton 68795e415c Merge pull request #5027 from guerler/edit_info
Metadata parameters rely on their own optional setting not on the field attribute
2017-11-28 09:29:47 -05:00
John Chilton fac65894d3 Merge pull request #5078 from mvdbeek/fail_if_job_output_collection_fails
Fail job if job output collection fails
2017-11-28 08:54:55 -05:00
John Chilton c6c55e1046 Merge pull request #4475 from natefoo/job-handler-mules
Run Galaxy fully under uWSGI, including job handlers
2017-11-28 08:51:00 -05:00
mvdbeek f58ef13616 Fix import by url for history archive import tool 2017-11-28 14:37:36 +01:00
mvdbeek 13f6eeecf0 Add new runner state for 'Job output not returned from cluster'
This would allow adimns to write resubmit conditions for this specific failure.
2017-11-28 12:52:48 +01:00
mvdbeek cacd6eadc5 Mark job wrapper as failed in a more direct way 2017-11-28 10:44:05 +01:00
mvdbeek 73454e12df Fix undefined exit_code_str problem (thx @nsoranzo) 2017-11-27 17:54:25 +01:00
Aysam Guerler 3303fab75b Restore admin form routes (#5065) 2017-11-24 20:49:32 +01:00
guerler 78508e200a Merge branch 'dev' into replace_history_import 2017-11-24 11:32:55 -05:00
John Chilton e03ea6d781 Merge pull request #4996 from guerler/remove_unused_workflow_endpoint
Revise workflow create form, remove unused rename endpoint
2017-11-24 11:26:35 -05:00
Eric Rasche 5c6e4a5c77 Merge pull request #4894 from mtekman/linkage
Add Classical linkage and haplotype datatypes
2017-11-24 12:51:52 +00:00
Mehmet Tekman 0ce67da13c enumerated lines, removed eof_res, header_check 2017-11-24 11:18:51 +01:00
mvdbeek b476cc4c57 Fail job if job output collection fails
We now set a non-zero exit code to actually set a job to failed.
I belive this is a reasonable action, and it avoids green, empty datasets
with log messages like:
```
galaxy.jobs.runners ERROR 2017-11-14 13:32:06,469 (19020/860246.torque6.curie.fr) Job output not returned from cluster: [Errno 2] No such file or directory: '/data/users/mvandenb/gx
124/tmp_nfs/jwd/019/19020/galaxy_19020.o'
galaxy.jobs.runners DEBUG 2017-11-14 13:32:06,491 (19020/860246.torque6.curie.fr) Unable to cleanup /data/users/mvandenb/gx124/tmp_nfs/jwd/019/19020/galaxy_19020.o: [Errno 2] No suc
h file or directory: '/data/users/mvandenb/gx124/tmp_nfs/jwd/019/19020/galaxy_19020.o'
galaxy.jobs.runners DEBUG 2017-11-14 13:32:06,503 (19020/860246.torque6.curie.fr) Unable to cleanup /data/users/mvandenb/gx124/tmp_nfs/jwd/019/19020/galaxy_19020.e: [Errno 2] No suc
h file or directory: '/data/users/mvandenb/gx124/tmp_nfs/jwd/019/19020/galaxy_19020.e'
galaxy.jobs.runners DEBUG 2017-11-14 13:32:06,513 (19020/860246.torque6.curie.fr) Unable to cleanup /data/users/mvandenb/gx124/tmp_nfs/jwd/019/19020/galaxy_19020.ec: [Errno 2] No su
ch file or directory: '/data/users/mvandenb/gx124/tmp_nfs/jwd/019/19020/galaxy_19020.ec'
```
2017-11-23 12:02:31 +01:00
E Rasche c6bf20df68 ok, test cases require this to pass 2017-11-23 09:43:41 +01:00
guerler 2623bf369c Merge branch 'dev' into replace_history_import 2017-11-22 09:22:46 -05:00
guerler 4a3dca504e Merge branch 'dev' into remove_unused_workflow_endpoint 2017-11-22 09:18:38 -05:00
Aysam Guerler 4d416dcb21 Merge pull request #4978 from dannon/bibtex-replacement-lib
Vue integration, bibtex replacement
2017-11-22 09:13:14 -05:00
guerler 8f7dee460e Merge branch 'dev' into replace_history_import 2017-11-22 09:04:40 -05:00
E Rasche ef8ed0ec3f support separate dsn for sentry 2017-11-22 10:51:41 +01:00
Dannon Baker ce4584956b Merge pull request #5050 from erasche/fix-ufr-7036
Safely handle possible None value encountered in processing and execution of post-job action arguments
2017-11-21 13:19:52 -05:00
Dannon Baker 8426158499 Merge remote-tracking branch 'upstream/dev' into bibtex-replacement-lib 2017-11-21 13:10:34 -05:00
E Rasche 070ab533bd Address comments 2017-11-21 17:21:41 +01:00
E Rasche ddfbf2c3f0 Handle None v 2017-11-21 15:58:07 +01:00
Nate Coraor a3346e2fb7 Fix unit tests 2017-11-20 23:39:19 -05:00
Dannon Baker 76f0eb4172 Bundle admin toolshed beta interface. 2017-11-20 21:13:22 -05:00
Dannon Baker c92d958c0a Bundle libraries. 2017-11-20 20:32:16 -05:00
Dannon Baker 380e82c5dc Bundle trackster/circster together as 'viz'. 2017-11-20 19:53:37 -05:00
Dannon Baker 8d9998c50f Trackster app entrypoint fix. 2017-11-20 18:51:17 -05:00
Nate Coraor 4b2c177ae5 Attempt to deal with job_conf.xml handlers in a backwards-compatible
way.
2017-11-20 15:44:26 -05:00
Nate Coraor 2764fe0b5c Fix/improve server name manipulation 2017-11-20 15:43:07 -05:00
guerler 59e4d401a0 Augment form wrapper redirect, load workflow editor after creation 2017-11-20 13:54:39 -05:00
John Chilton efd762e18c Cleanup SA objects between workflow invocation scheduling attempts.
This would seem to be a fairly serious memory leak in the abstract but I don't have data that it fixes anything. None the less if it gets into dev and the tests seem to pass I'll open a PR to backport it to at least 17.05 and maybe back even more.
2017-11-20 10:54:14 -05:00