Commit Graph
156 Commits
Author SHA1 Message Date
John Chilton 4dcfe4c561 Some very basic unit tests and docs for workflow modules.
Just a start - I need to keep going with this and test and document all methods.
2014-08-26 10:02:49 -04:00
Dannon Baker 1417d967f2 Merged in jmchilton/galaxy-central-fork-1 (pull request #465)
Dynamic destination enhancements aimed at enabling co-locating data and (cloud) bursting.
2014-08-18 15:05:18 -04:00
John Chilton a5a13547cd Extract some mixin's out of trans allowing trans-like functionilty outside web threads...
In particular break out mixins defining context-based utilities for interacting with app, an user, and a history. In downstream work on workflow scheduling this proves nessecary and sufficient to create an context for 'execute'-ing tools (create jobs) outside of web threads in response to workflow requests.

Unit tests for some of this.
2014-08-18 10:28:40 -04:00
John Chilton b0673d1dd2 Dynamic destinations - easier, high-level reasoning about bursting.
Add utility to RuleHelper to simplify bursting reasoning slightly, setup a stock rule for bursting between two static job destinations - mostly for demonstration purprose but it might be useful in some settings.
2014-08-17 18:43:54 -04:00
John Chilton a497fb8467 Dynamic destinations - easier, high-level reasoning about data locality.
... if only in a limitted sort of way. Provide ability to hash jobs by history, workflow, user, etc... and choose among various destinations semi-randomly based on that to distribute work across destinations based on these factors.

Add a stock rule as in the form of a new dynamic destination type ("choose_one") that demonstrate using this to quickly proxy to some fixed static destinations. Add examples to job_conf.xml.sample_advanced.
2014-08-17 18:43:54 -04:00
John Chilton f9be760b28 Dynamic destinations - allow dispatching on workflow invocation.
Generate a workflow invocation UUID that is stored with each job in the workflow and allow dynamic job destinations to consume these. Should allow for grouping jobs from the same workflow together during resource allocation (a sort of first attempt at dealing with data locality in workflows).
2014-08-17 18:43:54 -04:00
John Chilton fbe27016f7 Dynamic destinations - pass job_conf.xml params to rule functions.
In other words, send extra job destination parameters to dynamic rule functions as arguments (in addition to those dynamically populated by Galaxy itself). This enables greater parameterization of rule functions and should lead to cleaner separation of logic and data (i.e. sites can program rules that restrict access to users, but which users can be populated at a higher level in `job_conf.xml`).

For example the following dynamic job rule:

    def cluster1(app, memory="4096", cores="1", hours="48"):
        native_spec = "--time=%s:00:00 --nodes=1 --ntasks=%s --mem=%s" % ( hours, cores, memory )
        return JobDestination( "cluster1", params=dict( native_specification=native_spec ) )

Could then be called with various parameters in job_conf.xml as follows:

    <destination id="short_job" type="dyanmic">
      <param id="function">cluster1</param>
      <param id="hours">1</param>
    </destination>

    <destination id="big_job" type="dynamic">
      <param id="function">cluster1</param>
      <param id="cores">8</param>
      <param id="memory">32768</param>
    </destination>
2014-08-17 18:43:54 -04:00
John Chilton 56566a2dbe Dynamic destinations - extend RuleHelper for reasoning about groups of destinations...
If multiple destinations map to the same underlying resource (a very typical case), this could allow rule developer to reason about cluster as a whole - though perhaps clunkily - by supplying all destination ids mapping to that cluster.
2014-08-17 18:43:54 -04:00
John Chilton c7e717c527 Improved error handling for dynamic job destinations.
More and more verbose error messages with updated terminology and error conditions unit tested.
2014-08-17 16:38:34 -04:00
John Chilton 33bcfa173a Job mapping unit tests.
A bunch of unit tests for galaxy.jobs.mapper and galaxy.jobs.rule_helper testing various aspects of static and dynamic job mapping and the utility class (RuleHelper) that can be supplied to dynamic job rules.
2014-08-17 16:38:34 -04:00
John Chilton 1909516474 Add unit test to merely walk through new workflow render module...
...small fix found by test.
2014-08-13 21:36:10 -04:00
John Chilton 95d62d7c73 Normalize workflow input dataset dict earlier...
... this will allow linking to actual steps (referential integrity) if/when we store workflow requests in the database and failing faster.

Also more unit tests.
2014-08-10 14:05:31 -04:00
John Chilton adfc7cec81 Normalize workflow step parameters earlier...
... this will allow linking to actual steps (referential integrity) if/when we store workflow requests in the database.

Also unit tests.
2014-08-10 14:05:31 -04:00
John Chilton 88eecd3c6a Fix failing test test/unit/workflows/test_extract_summary.py. 2014-08-10 14:05:31 -04:00
John Chilton 64915e9716 Merge next-stable. 2014-08-04 15:02:01 -04:00
John Chilton fe0c53c930 Fix new Tool.get_externally_referenced_paths to find imported macro files.
Should fix this bug https://trello.com/c/TeguDYSq discovered by Bjoern... on stage at the GCC.
2014-08-04 12:18:00 -04:00
John Chilton daaf2c8cf0 Restructure tool external file logic in load_tool_from_tmp_config in ToolValidator...
... so internals of tool XML description are only utilized in the galaxy.tools module (and submodules). Add some unit tests for this new method for finding externally referenced files.
2014-08-04 12:18:00 -04:00
John Chilton 8f2434e2ca Merge next-stable. 2014-08-04 09:34:07 -04:00
John Chilton ac91ae8419 Ensure topological sorting is 'stable' w.r.t to first element of tuple.
This improves correctness of 64a25838085978c250a0486b516bb2c8e7c3b850.
2014-08-04 09:33:40 -04:00
Ira Cooke d2c4af3e0a Merged galaxy/galaxy-central into default 2014-07-31 09:58:21 +10:00
John Chilton 10fd2279ee Fix some basic citation unit tests missing from PR #440. 2014-07-28 19:18:40 -04:00
Nate Coraor dfc08662cc Remove hardcoded path to builds.txt from util, fix unit test that relies on this. 2014-07-27 02:59:24 -04:00
Ira Cooke add894400e Merged galaxy/galaxy-central into default 2014-07-25 11:06:45 +10:00
Ira Cooke b751b8aa1a Better sqlite query whitelisting via the sqlparse library 2014-07-25 11:02:53 +10:00
John Chilton ba04c4ab9a More collection-y state update tests. 2014-07-24 14:30:11 -05:00
John Chilton 8bc6f91950 Create sqlite util module from sqlite data provider code.
Write tests against this module to make me feel more confident white-listing is only allowing select statements as well as tests to make me feel more confident that actual SELECT statements cannot be turned into update statements or access external resources.
2014-07-24 09:24:02 -05:00
John Chilton b6be01a5b5 Fix tool multi-run inside conditionals and repeats during state updates.
Fixes multirun inside of conditional, repeats if tool form state updated (e.g. because conditional param updated or repeat block added).

More tests - ugly tests - but tests.
2014-07-03 20:41:09 -05:00
John Chilton 5f5cc36950 Fix unit tests broken with 4de240e. 2014-07-03 20:41:09 -05:00
John Chilton 7c0026a6df Fix failing unit tests for 60d8de4. 2014-06-13 00:58:23 -05:00
John Chilton 0e585cc360 Rework type-differentiated history contents routes.
url_for now can produce the routes I build by hand in say bioblend and the GUI.
2014-06-11 15:16:05 -05:00
John Chilton 7382944df0 Introduce unit(-ish) tests for routes.
Allows testing both how URLs are going to map to controllers and actions as well as testing what paths will be produced by url_for.

Requires some refactoring of Galaxy framework classes and buildapp to allow stubbing out actual instantiation of controllers, etc....
2014-06-11 15:16:05 -05:00
John Chilton 93ac4b7633 Fix unit tests for 46a487e. 2014-06-03 12:48:18 -05:00
John Chilton 7dc073a8b7 Mechanism to define site-specific parameters to aid defining job destinations.
This is based on work by Hector del Risco at the University of Florida.

Various tool-style parameters can be defined in job_resource_params_conf.xml (see sample) and these define the pool of all possible resource parameters that can be injected into a tool. These can be groupped together and assigned to tools in job_conf.xml (see documented changes to job_conf.xml.sample_advanced).

A conditional is then injected into each tool that gives the end-user the ability to select these parameters. The values of these parameters (as a dict) can then be obtained by dynamic job destination that define a 'resource_params' argument.

Lots here still needs to be tested/verified - can workflows exported from Galaxies without resource parameters (or different ones, be reused in Galaxies with resource parameters) (I think yes?)? can workflows exported with resource parameters be used in other Galaxies (I think yes?), how best to present UI while running workflows? (maybe nothing needs to be changed), should exported job parameter data be swept clean (say when exporting a workflow for instance).

A great extension to this would be to support conditional when defining parameters.

Finally, the Galaxy team will make a reasonable effort to support this syntax for job_conf.xml, job_resource_params_conf.xml, and internal interface for job parameters for sometime once this changeset has reached -stable but until these interfaces may change.
2014-06-03 12:48:18 -05:00
John Chilton d0f33bc14e Fix unit tests for 315997f. 2014-06-01 18:30:44 -05:00
John Chilton 533cdb9ce7 Unit tests for RunnerParams.
Small changes to make this easier - mostly just defining constants.
2014-05-29 00:15:38 -05:00
Greg Von Kuster 390d05bbd1 Eliminate the Tool Shed's td_common_util.py module by moving the functions to appropriate classes. 2014-05-28 15:49:02 -04:00
John Chilton e6a5f06066 More stdio handling tests. 2014-05-21 11:11:39 -05:00
Daniel Blankenberg 75aa0a2a9b First pass at allowing dbkeys / genome builds to be loaded from Tool Data Tables. 2014-05-19 15:08:26 -04:00
John Chilton cb87cf4c27 Merged in jmchilton/galaxy-central-fork-1 (pull request #384)
Local Job Runner Enhancements
2014-05-18 21:12:36 -05:00
John Chilton f33bb43025 Merged in jmchilton/galaxy-central-fork-1 (pull request #389)
Small Column Parameter Enhancements
2014-05-15 13:49:44 -05:00
Greg Von Kuster 5b3e02d5c3 Phase 2 of the tool dependency package installation framework rewrite: 1) rename the RecipeManager class to be the StepManager class and add a new TagManager class, both of which are contained in the recipe_manager.py module. 2) Add appropriate new classes for handling recipe tag sets to a new tag_handler.py module. Add a new InstallManager class with functions for installing tool dependencies. Eliminate the use of fabric_util.py and install_util.py. 2014-05-14 14:55:31 -04:00
John Chilton c79e4dcc40 Fix duplicated names in on_text when using multiple data inputs.
Unit tests verifing the fixed, correct behavior included. Bug introduced in e8c84dd715782e7c1d709d8068e6033b835f7f39 as an unintended consequence of duplicating the first dataset in the dictionary of input datasets generated by the tool action code.

Fixes https://trello.com/c/LCEKxImR.
2014-05-13 17:47:57 -05:00
John Chilton 22bddab240 Implement serializable class that can describe full dependency context for remote dependency resolution.
Previously LWR jut serialized tool requirements, by transitioning to this class LWR should be able to resolve tool shed installed packages as well - requiring the additional repository and tool dependency context.
2014-05-13 00:13:02 -05:00
John Chilton 40f19d2a0f Allow c to appear in default value for Column parameters, allow specification with value attribute.
Ideas purposed by Peter Cock here - http://dev.list.galaxyproject.org/Default-value-for-data-column-not-working-tp4139574p4664492.html.
2014-05-12 12:01:14 -05:00
John Chilton dc5563371a Unit test case for tool column parameters.
Ever more duplication in these parameters tests, I need to find some time to refactor...
2014-05-12 12:01:14 -05:00
John Chilton 2f8970a6a7 Bugfix: Rework collection matching logic so it properly matches combined collection/subcollection mapping.
With functional test to verify it works end-to-end with tool execution and unit tests to verify different kinds of collection combinations.
2014-05-07 15:39:03 -05:00
John Chilton a8d5d60da6 Rework encode_all_ids in BaseController so it can be used outside of controllers.
Moved into SecurityHelper. Also fixed up style, elminated unconditional exception handling, and added unit tests.
2014-05-06 08:54:31 -05:00
John Chilton 704446ea24 Dataset collections - tools API returns implicitly created collections.
Use improvements to write better functional tests, ensure element identifiers preserved.
2014-05-06 08:54:31 -05:00
John Chilton cf206e1692 Dataset collections - implicit "map" creates collections.
When running normal tools with normal data inputs across dataset collections in parallel - a collection will be created for each output with a "structure" matching that of the input (for instance pairs will create pairs, lists will create lists with the same identifiers, etc...). A previous changeset added the ability to run the tool in parallel - this changeset extends that functionality to create analogous collections from these parallel runs.

For example, if one filters a pair of FASTQ files a pair is created out of the result. Likewise, if one filters a list of FASTQ files - a list collection with same cardinality is built from the results.

There is a lot left TODO here - for one a lot of this logic should be moved into the dataset_collection module. The matching needs to be exact right now - not a problem for pairs (every 'element' has name 'left' or 'right') but for lists with element names - these have to match exactly - but a 'list' like samp1_l, samp2_l, samp3_l should be able to match against samp1_r, samp2_r, samp3_r and create a new list samp1, samp2, and samp3. Even if there is no matching prefixes a new 'unlabeled' list should be able to be created.
2014-05-06 08:54:30 -05:00
John Chilton 8168334297 Dataset collections - "map" with existing tools (backend).
Allow replacing data parameter inputs with collections - this will cause the tool to produce multiple jobs for the submission - one for each combination of input parameters after being matched up (linked). In addition to various unit tests, functional tests demonstrate the API usage in `test/functional/api/test_tools.py`.
2014-05-06 08:54:30 -05:00