Skip to content

Inline expressions #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 261 commits into from
Nov 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
261 commits
Select commit Hold shift + click to select a range
333924b
* Docker running works! Supports bind mounting input and output dire…
Nov 13, 2014
28d6dfa
Update setup.py so that package version numbering is more flexible.
cure Nov 18, 2014
4ccf283
Remove yaml from ref_resolver, only support JSON in cwltool.
Nov 18, 2014
e48f139
Change paths to refer to rabix/common-workflow-language instead of cu…
Nov 18, 2014
736fc20
Add version constraints to setup.py
Nov 18, 2014
e47522b
Populate the 'fetched' cache of ref_resolver with schemas so they do …
Nov 19, 2014
42445bc
Example documents were being read in with an overly permissive json p…
Nov 19, 2014
77aa8ff
Javascript expressions now run in a Node.js sandbox. Drop dependency on
Nov 25, 2014
b9c7446
Initial support for "outputs" section of tool file in reference cwltool.
Nov 28, 2014
e2ce606
"glob" adapter only returns first hit unless type is "array"
Nov 28, 2014
3752a88
Require that tool description documents say what tool schema version …
Dec 5, 2014
da45892
Spec defines $ref, $mixin and $expr. Decided $expr didn't need a "la…
Dec 5, 2014
5fcb67f
See previous commit
boysha Dec 15, 2014
5891091
Fix uri in bwa example. Cwltool now runs "docker pull" before runnin…
Jan 23, 2015
02b17c7
Add $import and $apply directives, expressionlib and generatefiles se…
Jan 23, 2015
b3ca4ce
fixed jsons, most conformance tests passing
boysha Jan 30, 2015
bad48f0
passing conformance tests with tool_new
boysha Feb 4, 2015
b397ea7
updated examples, added @context
boysha Feb 5, 2015
99bb846
context in expressions
boysha Feb 5, 2015
616982f
added @context to examples
boysha Feb 6, 2015
dd5feb7
Completed avro schema. Added Avro validate function that reports bet…
Feb 9, 2015
2a6125e
Renamed "tool.py" to "draft1tool.py"
Feb 9, 2015
08e47b2
Working on generating cli from binding
Feb 10, 2015
67e6d56
Still working on CLI generation
Feb 10, 2015
79c918f
Stuff runs now, need to port examples forward.
Feb 10, 2015
b5c2eb6
Conformance tests updated and all pass!
Feb 10, 2015
99f4e04
Tweak implementation of ordering for arrays.
Feb 16, 2015
df7f590
Reorganize examples/tests into draft-1 and draft-2 directories. Upda…
Feb 23, 2015
770635f
Add draft-1 examples and tests back in.
Mar 4, 2015
1eb7979
Working on adding testing running actual containers not just command …
Mar 4, 2015
18d6b2e
Can now have tests actually run tools.
Mar 5, 2015
b7d51e3
Added: ExpressionTool, loadContents flag, more conformance tests.
Mar 5, 2015
3efa076
Fix json-ld contexts to point to master branch.
Mar 6, 2015
4b883fe
Change "port" to "id", "requirementType"/"expressionType" to "class".
Mar 6, 2015
1d0f1ca
Work-in-progress workflow runner!
Mar 6, 2015
d994fb9
Can now run count-lines2-wf.json
Mar 7, 2015
6bbda41
Renamed files to .cwl and added #!/usr/bin/env cwl-runner so that cwl…
Mar 9, 2015
765a479
Support external process definitions.
Mar 9, 2015
fa97a41
Better error reporting, allow plain strings in arguments
Mar 9, 2015
e0972ab
Add basic type checking for data links.
Mar 10, 2015
633a340
Support fanout workflow steps and multiple incoming connections on a …
Mar 10, 2015
09ca5b7
Example workflow with externally defined sub-workflow.
Mar 10, 2015
ac59237
Add contributers section.
Mar 11, 2015
7105645
Fix Python package generation. Fix path mapping.
Mar 17, 2015
332870c
Add "environmentDefs" to specify environment variables.
Mar 18, 2015
41ca2e6
Add --print-rdf to cwltool to print rdf graph corresponding to a work…
Mar 18, 2015
3d65774
Fix Python packaging to use correct git log for package time/version …
Mar 24, 2015
fbb9374
Fix Python packaging to use correct git log for package time/version …
Mar 24, 2015
d3d1fde
Removed very misleading 'include_package_data' option from setup.py
Mar 24, 2015
cf63d32
setup.py workaround to ensure that schema files are included in sdist
Mar 24, 2015
af0c00e
revert to copy workaround
Mar 24, 2015
70f4b89
Check for source tree or install.
Mar 24, 2015
708635a
Tools for generating specification documentation.
Mar 26, 2015
dcf636d
Now embedding major documenation directly in schema. Lots of progres…
Mar 26, 2015
4acb2e8
Run document generation as a workflow.
Mar 27, 2015
a83dc12
Finished documentation for command line tool, added documentation for…
Mar 30, 2015
c963b3e
New explicit scatter. Incomplete, only "dotproduct" method implement…
Apr 7, 2015
a231fb9
Use iterator-based inversion of control to separate job generation fr…
Apr 8, 2015
1b9e6f5
Move "examples" to "conformance" since they are really test cases. A…
Apr 9, 2015
65f3232
Propagate requirements and hints. Greatly improve validation error m…
Apr 9, 2015
e73f3c3
Pluggable expression engine work in progress.
Apr 12, 2015
9e4d5bc
Pluggable expression engine works. Test cases are updated. Also add…
Apr 15, 2015
960f29e
improvements to doc organization
May 4, 2015
782f28a
consolodated schema stuff into avro_ld
May 5, 2015
0cb5537
Build and run cwltool in Docker
May 8, 2015
46e6103
Fix Docker loading from http. Add secondaryFiles support.
May 11, 2015
8d30574
Scatter specified as requirement
May 11, 2015
bd56b03
Moved avro-ld under cwltool. Fixing tests.
May 12, 2015
09f5112
Updating to load on "id" instead of draft-1 "$ref"
May 12, 2015
59b8144
Switch to avro_ld.makedoc for generating specification.
May 12, 2015
95c667d
Use css media query to adjust behavior of table of contents based on …
May 12, 2015
f7a6f6d
Merge branch 'makedoc'
May 12, 2015
42a7b4a
Add thin border between TOC and main.
May 12, 2015
32f114e
Merge branch 'master' into origin-draft2-updates
May 14, 2015
0d01ea6
Refactored features into CreateFilesRequirement, EnvironmentVarRequir…
May 14, 2015
a5c49ce
Merge branch 'draft2-updates' of github.com:common-workflow-language/…
May 19, 2015
cde6c96
Add 'docAfter' (alternative to docParent) to organize of the spec.
May 19, 2015
045befc
Fix docAfter
May 19, 2015
967a21d
Implement issue #36 and #40, updating test cases in progress.
May 19, 2015
a724b56
Added missing 'mistune' dependency.
May 20, 2015
4d3a95c
All tests pass again with most recent schema changes
May 22, 2015
303986a
Merge pull request #45 from StarvingMarvin/master
tetron May 22, 2015
2c0addb
Implement issue #42: require "class: File" for file-type input objects.
May 25, 2015
bbbd146
Merge branch 'master' of github.com:common-workflow-language/common-w…
May 25, 2015
fd4412d
Merge branch 'master' into ref-id
May 25, 2015
b57b23f
Work in progress on 'id' loading. Fixing tests and reference code.
May 25, 2015
f7c7a14
Restore sandboxjs.py. Fix docker images to use commonworkflowlanguag…
May 27, 2015
f0809b6
Refactoring work in progress
May 28, 2015
326e84a
make error message on wrong glob less confusing
porterjamesj May 28, 2015
adbbc5d
Refactoring resolved, updating tests
May 28, 2015
dedfe61
Merge branch 'master' into ref-id
May 28, 2015
bc4c427
Fixing tests and working on reducing boilerplate.
May 28, 2015
57ada14
Improve command line binding algorithm.
May 29, 2015
fc1cdd0
Introduce "import" and "include". Validate document cross references.
May 30, 2015
781f404
Rewrite ref_resolver, supports link checking, update tests
Jun 1, 2015
5204093
Fix path mapping.
Jun 1, 2015
c001654
Delete obsolete files.
Jun 1, 2015
7f92b18
Restore symlink
Jun 1, 2015
cbbaa2e
Add successCodes, temporaryFailCodes, permanentFailCodes. Return pro…
Jun 1, 2015
0590ccd
Fix unit test
Jun 1, 2015
fe41643
Remove references to jsonschema
Jun 1, 2015
5be2b4a
Fix makedoc bug and reorganize spec using docParent and docAfter.
Jun 1, 2015
6a80653
Support "Any" datatype (validates any non-null value).
Jun 2, 2015
ab31445
Fix interaction of union types with schemaDefs.
Jun 2, 2015
5d13797
Add workflow to generate web site. Fix pathmapper bug.
Jun 4, 2015
4f0b451
Web site generation works using specification/cwlsite.cwl
Jun 5, 2015
bbb8b9b
Updating specification work in progress. Adding examples.
Jun 5, 2015
81c0317
Continuing to update spec. Reorganized reference section to top-down
Jun 6, 2015
f42ce03
Cranking through spec updates.
Jun 8, 2015
a096673
fix binding / schema typo
porterjamesj Jun 12, 2015
e3fd14c
fix unqualified name
porterjamesj Jun 12, 2015
ff7250f
Add explicit merge methods for multiple inbound links (issue #52).
Jun 21, 2015
954380d
Change ExpressionEngineRequirements "expressionDefs" to "engineConfig…
Jun 21, 2015
32b03ae
Fix schema support for "Any" type.
Jun 22, 2015
d74bfdd
Move scatter and scatterMethod to WorkflowStep and rename Scatter req…
Jun 22, 2015
6499096
Support subworkflows directly in workflow steps, enabled with
Jun 22, 2015
bc4e42c
Use id fragment naming convention to map input and output parameters for
Jun 22, 2015
fa5a65d
Mark inherited fields of objects in specification. issue #44
Jun 23, 2015
757d664
Fix revsort example for specification updates. Improve output directory
Jun 24, 2015
af73d82
Merge pull request #61 from porterjamesj/fix-secondaryFiles-bug
tetron Jun 24, 2015
65f793c
Merge pull request #50 from porterjamesj/less-confusing-error-msg
tetron Jun 24, 2015
fa2d914
Special validation handling for hints.
Jun 24, 2015
d7222fd
Support CreateFileRequirements linking input files into output direct…
Jun 24, 2015
8333f3e
Merge branch 'master' of github.com:common-workflow-language/common-w…
Jun 24, 2015
ca37900
Hopefully fixed setup.py to do the right thing to include schemas in the
Jun 26, 2015
40207dd
Add a README for cwl-runner package.
Jun 26, 2015
4cb42da
Fix README
Jun 26, 2015
b3ff4ed
Remove wfdesc predicates and use only cwl predicates because CWL is n…
Jun 27, 2015
825b038
Refactoring for Arvados support
Jun 29, 2015
048f764
Conformance test add compare function with special handling for files…
Jun 30, 2015
2b1b5d1
DefaultFsAccess renamed to StdFsAccess
Jul 1, 2015
428a4ba
Correctly yield 'None' from Workflow when there's nothing ready to run.
Jul 1, 2015
f8c8104
Fix chained callbacks so that yielding multiple runnable jobs works a…
Jul 1, 2015
8b2e813
Fix workflows not to submit the same step over and over.
Jul 1, 2015
27e62b4
Don't raise exception when workflow step result is missing, just fail.
Jul 2, 2015
e04bd94
Improve error handling and reporting. Fix schema to validate use of …
Jul 3, 2015
1ebe6f2
Fix tests broken by removal of chdir from jobs.py.
Jul 6, 2015
d9fbce6
Documentation fixes from @brainstorm recommending use of plain "pytho…
Jul 6, 2015
bc2b224
Bugfix: use fs_access to check for existence of secondary files.
Jul 7, 2015
72812f3
wrap --print-jsonld-context within @context
stain Jul 8, 2015
f24c133
boot2docker compatibility
sinisa88 Jul 8, 2015
81490d8
Merge branch 'master' of github.com:sinisa88/common-workflow-language
sinisa88 Jul 8, 2015
441bde8
Capture possible exceptions on the executor function. Print workflow …
guillermo-carrasco Jul 8, 2015
3342637
Add temporary output prefix. Fix workflow in boot2docker
guillermo-carrasco Jul 9, 2015
83c440a
Check if prefixes exist. Fix tests to work on MacOSX
guillermo-carrasco Jul 9, 2015
9009bd1
Add some documentation about use with boot2docker
guillermo-carrasco Jul 9, 2015
dda566e
Fix some rst syntax
guillermo-carrasco Jul 9, 2015
c593eb2
Fixups
Jul 9, 2015
c248d75
Better error handling around checking if docker is available and acce…
Jul 9, 2015
45f6717
Support retrieving docker instances via 'docker import'
chapmanb Jul 9, 2015
92c0f2e
use fresh loader from create_loader()
stain Jul 9, 2015
1f106d0
Fixes the printing of command_line arguments
jrandall Jul 10, 2015
5eb2b30
Merge pull request #93 from jrandall/fix/issue-92
tetron Jul 11, 2015
b9d8d1e
Support defaults in nested records. Improve handling of named types.
Jul 12, 2015
b27f8aa
Fix for non-Docker expression engine.
Jul 12, 2015
62947fc
Copy spec over to draft 3.
Jul 13, 2015
01d165d
Add --version. Remove spurious logging.
Jul 13, 2015
c73df1d
Add --quiet.
Jul 13, 2015
0c7797d
Merge branch 'master' of github.com:common-workflow-language/common-w…
Jul 13, 2015
fa1bec9
Merge branch 'dockerimport' of https://github.com/chapmanb/common-wor…
Jul 13, 2015
e43108f
Merge pull request #91 from stain/loader
tetron Jul 13, 2015
f4985d6
Moved testing framework into cwltool. Setup.py now installs addition…
Jul 14, 2015
08bc27c
Merge branch 'master' of github.com:common-workflow-language/common-w…
Jul 14, 2015
092d4b2
Bugfix: don't fail on nested type definitions with no `name` field.
Jul 15, 2015
bc0b904
Bugfix: fix typo in output on test failure
Jul 17, 2015
49e93d1
Make validation aware of defaults, validate default (if provided) whe…
Jul 20, 2015
0894eec
Use argparse mutually exclusive groups for either/or options.
Jul 22, 2015
2c7c2af
Generate command line parser from input schema.
Jul 22, 2015
8344823
Improved command line handling, support for arrays.
Jul 23, 2015
2f1fd9c
Command line handling fixups. Can now provide a input object to job and
Jul 28, 2015
02a80cb
Fix issue #95 (expression in CreateFileRequirement "filename") and ad…
Aug 8, 2015
023e35d
Use UID of docker user in boot2docker/docker-machine if running
dleehr Aug 12, 2015
2e42a38
Use tmp_outdir_prefix when setting Workflow outdir
dleehr Aug 13, 2015
45a5f4a
Minor style change to match preceding code
dleehr Aug 13, 2015
0092516
Default basedir is absolute path to CWD instead of '.'
Aug 13, 2015
73d0055
Merge branch 'master' of github.com:common-workflow-language/common-w…
Aug 14, 2015
db85440
Merge pull request #110 from dleehr/fix-subworkflow-outdir-prefix
tetron Aug 14, 2015
a0a2796
Fix call to undefined function when running docker_uid.py as script
dleehr Sep 8, 2015
300ecbb
null duplication #122
portah Sep 9, 2015
0deb1b9
Checking if c is a list
portah Sep 9, 2015
da9f361
better condition definition
portah Sep 9, 2015
f3cc3e8
the final desicion?
portah Sep 9, 2015
fe4721b
Adds --preserve-environment switch
dleehr Sep 10, 2015
ac86247
Remove avro_ld, rebase on schema salad!
Sep 14, 2015
1b8258e
`--preserve-environment` requires variable names per @tetron's sugges…
dleehr Sep 14, 2015
aaa4089
cwltool supporting both draft-2 and draft-3 (auto update draft-2 to d…
Sep 15, 2015
890edf5
Tests pass for cwltool on both draft-2 and draft-3
Sep 15, 2015
ba18c6b
Fixups to make cwl web site generation workflow work.
Sep 16, 2015
ccdd23b
More fixup cwlsite generation.
Sep 16, 2015
e23f24b
Merge branch 'master' into salad_schema
Sep 16, 2015
35d4d56
Refactor tool loading
Sep 16, 2015
edfd2da
Fix bugs in cwlVersion updater using relative paths.
Sep 18, 2015
6fe9549
Refactor so that workflows process input bindings (primarily secondar…
Sep 20, 2015
b446a52
More fixups to process inputBindings on Workflows. Works now.
Sep 20, 2015
fc103b0
Identifiers on workflow steps are now required. 2-to-3 updater now a…
Sep 23, 2015
11a1062
Add MultipleInputFeatureRequirement
Sep 25, 2015
5ac5c4d
Conformance tests can now signal unsupported feature by exiting 33.
Sep 28, 2015
8ea560f
Pathmapper understands file:// URIs.
Sep 28, 2015
6a7cad3
Fix more file:// pathmapping bugs.
Sep 28, 2015
3c7207d
Delete symlink to schemas
Sep 29, 2015
098db83
Add 'cwltool/schemas/' from commit '1acf6ba987e5cdb625ae17476344b80d1…
Sep 29, 2015
18aa6d0
Update schema salad dependency.
Oct 7, 2015
d4447de
Merge commit '2aaf58d14220d5de26938c90c5fbfce8eeaad73b'
Oct 7, 2015
87c1e46
Only include schemas and not everything else.
Oct 7, 2015
688af7f
Convert OSError (for missing files) into validation error.
Oct 7, 2015
3d65e4b
Improve error handling, don't print backtrace for WorkflowException b…
Oct 7, 2015
1f07f19
Bugfix dockerImport. Add utility functions checkRequirements and adj…
Oct 8, 2015
b3ebdc1
Merge commit '454c3e4d9f998a75fdba88f14b1421a6a28ecde0'
Oct 8, 2015
d2bd3db
Merge commit 'ae5e67cdbe5605aefbf0e69b271e2004afa0a0c2'
Oct 8, 2015
6f6feeb
Remove redundant validation of individual process items, since whole-…
Oct 9, 2015
2fbdb90
Integrating inline expressions into workflow evaluation.
Oct 9, 2015
08b540a
Merge commit 'cd5fec20f2941577b4785190e816aeeaa11f1efb' into inline-e…
Oct 9, 2015
01d4caa
Merge commit '71bdbfd6ab71efa36c58dbce7fbf522b580229a6' into inline-e…
Oct 9, 2015
5ca3077
Merge commit 'da3e5e3936ca5bffb427c8c28048b296a5f12518' into inline-e…
Oct 9, 2015
10ac9b4
empty_subtree handles dangling symlinks.
Oct 11, 2015
d25fff0
Fix scanner, include necessary script header.
Oct 11, 2015
cd703af
Merge commit '671d02955e91abb955396139dab8d867e8a4f78d' into inline-e…
Oct 11, 2015
e7ba888
Merge commit 'db8fc22aaf47fdbddd7eb3be122abf332c099f54' into inline-e…
Oct 11, 2015
1c259a3
Raise schema load errors.
Oct 12, 2015
6abfb3a
Merge commit '3024cf0ab72f356ecf9894b8b4c240029c4f1e90' into inline-e…
Oct 12, 2015
6008fa3
Merge commit '19a8de89d1736a9116bbaa12685354cf7441c1cf' into inline-e…
Oct 12, 2015
5af8db3
Standard JavascriptEngine works.
Oct 12, 2015
66e5ba2
Remove spurious debug print.
Oct 12, 2015
daa8b60
Merge commit '3601b792247af3f17631cd9ea9d223a8c7298890' into shell-co…
Oct 12, 2015
d1f1032
Suppor for ShellCommandRequirement to generate shell command line
Oct 12, 2015
c4f1c7f
Support job_order of '-' to read from stdin.
Oct 12, 2015
0293da2
Re-add --print-pre option.
Oct 12, 2015
f92ffe4
cwltool accepts alternate stdin/stdout.
Oct 13, 2015
84f0189
Add ability to capture stderr from main.
Oct 13, 2015
68422a6
Adjust logging handler to avoid redundant output.
Oct 13, 2015
e28c276
Merge commit 'fc899cfc088f81531c665913fcc363e4c2570e66'
Oct 14, 2015
28d8996
correct install instructions
mr-c Oct 22, 2015
2cc0843
Merge branch 'master' of github.com:common-workflow-language/cwltool
Oct 26, 2015
9fffdd9
Improve error handling a bit around globs.
Nov 4, 2015
fd72f70
Improve error handling for tool loading errors & exceptions thrown …
Nov 4, 2015
48830c2
Merge commit 'b9bed114315e5204b7618775383ca12207b41ba7' into shell-co…
Nov 10, 2015
5637775
Merge branch 'shell-commands'
Nov 10, 2015
2e492fa
Merge branch 'master' into inline-expressions
Nov 10, 2015
09280f1
Fix conflicts
Nov 10, 2015
4506b44
Merge commit '8661aae524fc95b9c8c60a22dcb5a59fc53de86c' into inline-e…
Nov 10, 2015
13e3642
Updates JsonPointer (tested) & javascript (not tested)
Nov 10, 2015
6c45b23
More updating from draft-2 to draft-3.dev2
Nov 10, 2015
1d2a340
Merge commit '8d91f4deb539a240d0f27b6d45775a1f5b013058' into inline-e…
Nov 10, 2015
a0c3976
Strip leading/trailing whitespace before interpolating.
Nov 10, 2015
495e0e6
Handle jsonpointer to context.
Nov 11, 2015
3d1fa17
Merge commit '31dbd19007690724cfe3e88a64201afca724c681' into inline-e…
Nov 12, 2015
ebc433c
Pure-Python parameter interpolation
Nov 13, 2015
f3490d3
Fixes for inline parameters. Better error handling/reporting for cwl…
Nov 17, 2015
c464a11
Symbol match on alphanumerics for parameter references instead of try…
Nov 19, 2015
2c61c48
Merge commit 'b0701278de2bab6c830df1e07ea481dd3335b18e' into inline-e…
Nov 19, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
==================================================================
Common workflow language tool description reference implementation
==================================================================

This is the reference implementation of the Common Workflow Language. It is
intended to be feature complete and provide comprehensive validation of CWL
files as well as provide other tools related to working with CWL.

This is written and tested for Python 2.7.

The reference implementation consists of two packages. The "cwltool" package
is the primary Python module containing the reference implementation in the
"cwltool" module and console executable by the same name.

The "cwl-runner" package is optional and provides an additional entry point
under the alias "cwl-runner", which is the implementation-agnostic name for the
default CWL interpreter installed on a host.

Install
-------

Installing the official package from PyPi (will install "cwltool" package as well)::

pip install cwl-runner

Or from source::

git clone https://github.com/common-workflow-language/cwltool.git
cd cwltool && python setup.py install
cd cwl-runner && python setup.py install

Run on the command line
-----------------------

``cwl-runner [tool] [job]``

Import as a module
----------------

Add::

import cwltool

to your script.

Use with boot2docker
--------------------
boot2docker is running docker inside a virtual machine and it only mounts ``Users``
on it. The default behavoir of CWL is to create temporary directories under e.g.
``/Var`` which is not accessible to Docker containers.

To run CWL successfully with boot2docker you need to set the ``--tmpdir-prefix``
and ``--tmp-outdir-prefix`` to somewhere under ``/Users``::

$ cwl-runner --tmp-outdir-prefix=/Users/username/project --tmpdir-prefix=/Users/username/project wc-tool.cwl wc-job.json
14 changes: 14 additions & 0 deletions build-cwl-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

restore=0
if test -L cwltool/schemas ; then
rm cwltool/schemas
cp -r ../schemas cwltool/schemas
restore=1
fi
docker build --file=cwltool_module.Dockerfile --tag=commonworkflowlanguage/cwltool_module .
docker build --file=cwltool.Dockerfile --tag=commonworkflowlanguage/cwltool .
if test $restore = 1 ; then
rm -r cwltool/schemas
ln -s ../../schemas cwltool/schemas
fi
3 changes: 3 additions & 0 deletions build-node-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

docker build --file=node-expr-engine.Dockerfile --tag=commonworkflowlanguage/nodejs-engine .
3 changes: 3 additions & 0 deletions cwl-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
docker run --name=cwl-docker -v /var/lib/docker -i -t fedora-data true
docker run --privileged -ti --volume=$PWD:$PWD -w=$PWD commonworkflowlanguage/cwltool $*
4 changes: 4 additions & 0 deletions cwl-runner/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This an optional companion package to "cwltool" which provides provides an
additional entry point under the alias "cwl-runner", which is the
implementation-agnostic name for the default CWL interpreter installed on a
host.
29 changes: 29 additions & 0 deletions cwl-runner/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python

import os
import sys
import setuptools.command.egg_info as egg_info_cmd
import shutil

from setuptools import setup, find_packages

SETUP_DIR = os.path.dirname(__file__)
README = os.path.join(SETUP_DIR, 'README')

setup(name='cwl_runner',
version='1.0',
description='Common workflow language reference implementation',
long_description=open(README).read(),
author='Common workflow language working group',
author_email='common-workflow-language@googlegroups.com',
url="https://github.com/common-workflow-language/common-workflow-language",
download_url="https://github.com/common-workflow-language/common-workflow-language",
license='Apache 2.0',
install_requires=[
'cwltool'
],
entry_points={
'console_scripts': [ "cwl-runner=cwltool.main:main" ]
},
zip_safe=True
)
5 changes: 5 additions & 0 deletions cwltool.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM commonworkflowlanguage/cwltool_module
MAINTAINER peter.amstutz@curoverse.com

VOLUME /var/lib/docker
ENTRYPOINT ["wrapdocker", "cwltool"]
1 change: 1 addition & 0 deletions cwltool/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__author__ = 'peter.amstutz@curoverse.com'
4 changes: 4 additions & 0 deletions cwltool/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import main
import sys

sys.exit(main.main())
5 changes: 5 additions & 0 deletions cwltool/aslist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def aslist(l):
if isinstance(l, list):
return l
else:
return [l]
159 changes: 159 additions & 0 deletions cwltool/builder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
import copy
from aslist import aslist
import expression
import avro
import schema_salad.validate as validate

CONTENT_LIMIT = 64 * 1024

def substitute(value, replace):
if replace[0] == "^":
return substitute(value[0:value.rindex('.')], replace[1:])
else:
return value + replace

class Builder(object):

def bind_input(self, schema, datum, lead_pos=[], tail_pos=[]):
bindings = []
binding = None
if "inputBinding" in schema and isinstance(schema["inputBinding"], dict):
binding = copy.copy(schema["inputBinding"])

if "position" in binding:
binding["position"] = aslist(lead_pos) + aslist(binding["position"]) + aslist(tail_pos)
else:
binding["position"] = aslist(lead_pos) + [0] + aslist(tail_pos)

if "valueFrom" in binding:
binding["do_eval"] = binding["valueFrom"]
binding["valueFrom"] = datum

# Handle union types
if isinstance(schema["type"], list):
for t in schema["type"]:
if isinstance(t, basestring) and self.names.has_name(t, ""):
avsc = self.names.get_name(t, "")
elif isinstance(t, dict) and "name" in t and self.names.has_name(t["name"], ""):
avsc = self.names.get_name(t["name"], "")
else:
avsc = avro.schema.make_avsc_object(t, self.names)
if validate.validate(avsc, datum):
schema = copy.deepcopy(schema)
schema["type"] = t
return self.bind_input(schema, datum, lead_pos=lead_pos, tail_pos=tail_pos)
raise validate.ValidationException("'%s' is not a valid union %s" % (datum, schema["type"]))
elif isinstance(schema["type"], dict):
st = copy.deepcopy(schema["type"])
if binding and "inputBinding" not in st and "itemSeparator" not in binding and st["type"] in ("array", "map"):
st["inputBinding"] = {}
bindings.extend(self.bind_input(st, datum, lead_pos=lead_pos, tail_pos=tail_pos))
else:
if schema["type"] in self.schemaDefs:
schema = self.schemaDefs[schema["type"]]

if schema["type"] == "record":
for f in schema["fields"]:
if f["name"] in datum:
bindings.extend(self.bind_input(f, datum[f["name"]], lead_pos=lead_pos, tail_pos=f["name"]))
else:
datum[f["name"]] = f.get("default")

if schema["type"] == "map":
for n, item in datum.items():
b2 = None
if binding:
b2 = copy.deepcopy(binding)
b2["valueFrom"] = [n, item]
bindings.extend(self.bind_input({"type": schema["values"], "inputBinding": b2},
item, lead_pos=n, tail_pos=tail_pos))
binding = None

if schema["type"] == "array":
for n, item in enumerate(datum):
b2 = None
if binding:
b2 = copy.deepcopy(binding)
b2["valueFrom"] = item
bindings.extend(self.bind_input({"type": schema["items"], "inputBinding": b2},
item, lead_pos=n, tail_pos=tail_pos))
binding = None

if schema["type"] == "File":
self.files.append(datum)
if binding:
if binding.get("loadContents"):
with self.fs_access.open(datum["path"], "rb") as f:
datum["contents"] = f.read(CONTENT_LIMIT)

if "secondaryFiles" in binding:
if "secondaryFiles" not in datum:
datum["secondaryFiles"] = []
for sf in aslist(binding["secondaryFiles"]):
if isinstance(sf, dict):
sfpath = self.do_eval(sf, context=datum["path"])
else:
sfpath = {"path": substitute(datum["path"], sf), "class": "File"}
if isinstance(sfpath, list):
datum["secondaryFiles"].extend(sfpath)
self.files.extend(sfpath)
else:
datum["secondaryFiles"].append(sfpath)
self.files.append(sfpath)

# Position to front of the sort key
if binding:
for bi in bindings:
bi["position"] = binding["position"] + bi["position"]
bindings.append(binding)

return bindings

def tostr(self, value):
if isinstance(value, dict) and value.get("class") == "File":
if "path" not in value:
raise WorkflowException("File object must have \"path\": %s" % (value))
return value["path"]
else:
return str(value)

def generate_arg(self, binding):
value = binding["valueFrom"]
if "do_eval" in binding:
value = self.do_eval(binding["do_eval"], context=value)

prefix = binding.get("prefix")
sep = binding.get("separate", True)

l = []
if isinstance(value, list):
if binding.get("itemSeparator"):
l = [binding["itemSeparator"].join([self.tostr(v) for v in value])]
elif binding.get("do_eval"):
return ([prefix] if prefix else []) + value
elif prefix:
return [prefix]
else:
return []
elif isinstance(value, dict) and value.get("class") == "File":
l = [value]
elif isinstance(value, dict):
return [prefix] if prefix else []
elif value is True and prefix:
return [prefix]
elif value is False or value is None:
return []
else:
l = [value]

args = []
for j in l:
if sep:
args.extend([prefix, self.tostr(j)])
else:
args.append(prefix + self.tostr(j))

return [a for a in args if a is not None]

def do_eval(self, ex, context=None, pull_image=True):
return expression.do_eval(ex, self.job, self.requirements, self.outdir, self.tmpdir, context=context, pull_image=pull_image)
80 changes: 80 additions & 0 deletions cwltool/cwlrdf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import json
from rdflib import Graph, plugin
from rdflib.serializer import Serializer

def printrdf(workflow, wf, ctx, sr):
wf["@context"] = ctx
g = Graph().parse(data=json.dumps(wf), format='json-ld', location=workflow)
print(g.serialize(format=sr))

def printdot(workflow, wf, ctx, sr):
wf["@context"] = ctx
g = Graph().parse(data=json.dumps(wf), format='json-ld', location=workflow)

print "digraph {"

#g.namespace_manager.qname(predicate)

def lastpart(uri):
uri = str(uri)
if "/" in uri:
return uri[uri.rindex("/")+1:]
else:
return uri

qres = g.query(
"""SELECT ?step ?run
WHERE {
?step cwl:run ?run .
}""")

for step, run in qres:
print '"%s" [label="%s"]' % (lastpart(step), "%s (%s)" % (lastpart(step), lastpart(run)))

qres = g.query(
"""SELECT ?step ?inp ?source
WHERE {
?wf cwl:steps ?step .
?step cwl:inputs ?inp .
?inp cwl:source ?source .
}""")

for step, inp, source in qres:
print '"%s" [shape=box]' % (lastpart(inp))
print '"%s" -> "%s" [label="%s"]' % (lastpart(source), lastpart(inp), "")
print '"%s" -> "%s" [label="%s"]' % (lastpart(inp), lastpart(step), "")

qres = g.query(
"""SELECT ?step ?out
WHERE {
?wf cwl:steps ?step .
?step cwl:outputs ?out .
}""")

for step, out in qres:
print '"%s" [shape=box]' % (lastpart(out))
print '"%s" -> "%s" [label="%s"]' % (lastpart(step), lastpart(out), "")

qres = g.query(
"""SELECT ?out ?source
WHERE {
?wf cwl:outputs ?out .
?out cwl:source ?source .
}""")

for out, source in qres:
print '"%s" [shape=octagon]' % (lastpart(out))
print '"%s" -> "%s" [label="%s"]' % (lastpart(source), lastpart(out), "")

qres = g.query(
"""SELECT ?inp
WHERE {
?wf rdf:type cwl:Workflow .
?wf cwl:inputs ?inp .
}""")

for (inp,) in qres:
print '"%s" [shape=octagon]' % (lastpart(inp))


print "}"
Loading