Skip to content

Commit abcfc09

Browse files
authored
Merge pull request #182 from common-workflow-language/cwl-v1.1.0-dev1
CWL v1.1.0-dev1 with stdin shortcut
2 parents 42f7318 + 3c538dd commit abcfc09

File tree

327 files changed

+121834
-134
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

327 files changed

+121834
-134
lines changed

cwltool/load_tool.py

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,38 @@ def _convert_stdstreams_to_files(workflowobj):
4747

4848
if isinstance(workflowobj, dict):
4949
if ('class' in workflowobj
50-
and workflowobj['class'] == 'CommandLineTool'
51-
and 'outputs' in workflowobj):
52-
for out in workflowobj['outputs']:
53-
for streamtype in ['stdout', 'stderr']:
54-
if out['type'] == streamtype:
55-
if 'outputBinding' in out:
50+
and workflowobj['class'] == 'CommandLineTool'):
51+
if 'outputs' in workflowobj:
52+
for out in workflowobj['outputs']:
53+
for streamtype in ['stdout', 'stderr']:
54+
if out['type'] == streamtype:
55+
if 'outputBinding' in out:
56+
raise ValidationException(
57+
"Not allowed to specify outputBinding when"
58+
" using %s shortcut." % streamtype)
59+
if streamtype in workflowobj:
60+
filename = workflowobj[streamtype]
61+
else:
62+
filename = Text(uuid.uuid4())
63+
workflowobj[streamtype] = filename
64+
out['type'] = 'File'
65+
out['outputBinding'] = {'glob': filename}
66+
if 'inputs' in workflowobj:
67+
for inp in workflowobj['inputs']:
68+
if inp['type'] == 'stdin':
69+
if 'inputBinding' in inp:
5670
raise ValidationException(
57-
"Not allowed to specify outputBinding when"
58-
" using %s shortcut." % streamtype)
59-
if streamtype in workflowobj:
60-
filename = workflowobj[streamtype]
71+
"Not allowed to specify inputBinding when"
72+
" using stdin shortcut.")
73+
if 'stdin' in workflowobj:
74+
raise ValidationException(
75+
"Not allowed to specify stdin path when"
76+
" using stdin type shortcut.")
6177
else:
62-
filename = Text(uuid.uuid4())
63-
workflowobj[streamtype] = filename
64-
out['type'] = 'File'
65-
out['outputBinding'] = {'glob': filename}
78+
workflowobj['stdin'] = \
79+
"$(inputs.%s.path)" % \
80+
inp['id'].rpartition('#')[2]
81+
inp['type'] = 'File'
6682
else:
6783
for entry in workflowobj.itervalues():
6884
_convert_stdstreams_to_files(entry)

cwltool/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ def main(argsl=None,
607607
return 0
608608

609609
tool = make_tool(document_loader, avsc_names, metadata, uri,
610-
makeTool, {})
610+
makeTool, vars(args))
611611
except (validate.ValidationException) as exc:
612612
_logger.error(u"Tool definition failed validation:\n%s", exc,
613613
exc_info=args.debug)

cwltool/process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def get_schema(version):
9191

9292
cache = {}
9393
version = version.split("#")[-1]
94-
if 'dev' in version:
94+
if '.dev' in version:
9595
version = ".".join(version.split(".")[:-1])
9696
for f in cwl_files:
9797
try:

cwltool/schemas/README.md

Lines changed: 58 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,80 @@
11
Common Workflow Language
22
========================
33

4-
The Common Workflow Language (CWL) is an informal, multi-vendor working group
5-
consisting of various organizations and individuals that have an interest in
6-
portability of data analysis workflows. Our goal is to create specifications
7-
that enable data scientists to describe analysis tools and workflows that are
8-
powerful, easy to use, portable, and support reproducibility.
4+
[![GitHub stars](https://img.shields.io/github/stars/common-workflow-language/common-workflow-language.svg)](https://github.com/common-workflow-language/common-workflow-language/stargazers) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/common-workflow-language/common-workflow-language?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
95

10-
CWL builds on technologies such as [JSON-LD](http://json-ld.org)
11-
for data modeling and [Docker](http://docker.com) for portable runtime\
12-
environments.
13-
14-
CWL is designed to express workflows for data-intensive science, such as
15-
Bioinformatics, Medical Imaging, Chemistry, Physics, and Astronomy.
6+
The Common Workflow Language (CWL) is a specification for describing analysis
7+
workflows and tools that are portable and scalable across a variety of software
8+
and hardware environments, from workstations to cluster, cloud, and high
9+
performance computing (HPC) environments. CWL is designed to meet the needs of
10+
data-intensive science, such as Bioinformatics, Medical Imaging, Astronomy,
11+
Physics, and Chemistry.
1612

17-
## CWL User Guide
13+
CWL is developed by an informal, multi-vendor working group consisting of
14+
organizations and individuals interested enabling scientists to share data
15+
analysis workflows. [The CWL project is on Github.](https://github.com/common-workflow-language/common-workflow-language)
1816

19-
[User guide for the current stable specification (v1.0)](http://www.commonwl.org/v1.0/UserGuide.html),
20-
provides a gentle introduction to writing CWL command line tool and workflow descriptions.
17+
CWL builds on technologies such as [JSON-LD](http://json-ld.org)
18+
for data modeling and [Docker](http://docker.com) for portable runtime
19+
environments.
2120

22-
## CWL Specification
21+
## User Guide
2322

24-
The current stable specification is [v1.0](http://www.commonwl.org/v1.0/):
23+
The [CWL user guide (v1.0)](http://www.commonwl.org/v1.0/UserGuide.html) provides a
24+
gentle introduction to learning how to write CWL command line tool and workflow
25+
descriptions.
2526

26-
http://www.commonwl.org/v1.0/
27+
## Specification
2728

28-
Older drafts: [draft-1](https://github.com/common-workflow-language/common-workflow-language/tree/master/draft-1), [draft-2](http://www.commonwl.org/draft-2/), [draft-3](http://www.commonwl.org/draft-3/)
29+
For developers and advanced users, the current
30+
[CWL specification (v1.0)](http://www.commonwl.org/v1.0/) provides
31+
authoritative documentation of the execution of CWL documents. Links older
32+
drafts:
33+
[draft-1](https://github.com/common-workflow-language/common-workflow-language/tree/master/draft-1),
34+
[draft-2](http://www.commonwl.org/draft-2/),
35+
[draft-3](http://www.commonwl.org/draft-3/)
2936

3037
### Citation
3138

3239
Please cite https://dx.doi.org/10.6084/m9.figshare.3115156.v2
3340

3441
## Implementations
3542

36-
Some of the software supporting running Common Workflow Language tools or workflows:
37-
38-
* [cwltool (reference implementation)](https://github.com/common-workflow-language/cwltool),
39-
[cwltool wiki page](https://github.com/common-workflow-language/common-workflow-language/wiki/cwltool-%28reference-implementation%29)
40-
* [Rabix](https://github.com/rabix/rabix),
41-
[Rabix wiki page](https://github.com/common-workflow-language/common-workflow-language/wiki/Rabix)
42-
* [Arvados](https://arvados.org),
43-
[Arvados wiki page](https://github.com/common-workflow-language/common-workflow-language/wiki/Arvados)
44-
* [Galaxy](https://github.com/common-workflow-language/Galaxy),
45-
[Galaxy wiki page](https://github.com/common-workflow-language/common-workflow-language/wiki/Galaxy)
46-
* [Parallel Recipes](https://github.com/yvdriess/precipes),
47-
[Parallel Recipes wiki page](https://github.com/common-workflow-language/common-workflow-language/wiki/Parallel-Recipes)
48-
* [Toil](https://github.com/BD2KGenomics/toil),
49-
[Toil wiki page](https://github.com/common-workflow-language/common-workflow-language/wiki/Toil)
50-
* [CancerCollaboratory](https://github.com/CancerCollaboratory),
51-
[CancerCollaboratory wiki page](https://github.com/common-workflow-language/common-workflow-language/wiki/CancerCollaboratory)
52-
* [Airflow (SciDAP)](https://github.com/SciDAP/scidap),
53-
[Airflow wiki page](https://github.com/common-workflow-language/common-workflow-language/wiki/SciDAP)
54-
* [cwl2script](https://github.com/common-workflow-language/cwl2script),
55-
[cwl2script page](https://github.com/common-workflow-language/common-workflow-language/wiki/cwl2script)
56-
* [Apache Taverna](http://taverna.incubator.apache.org/),
57-
[Apache Taverna wiki page](https://github.com/common-workflow-language/common-workflow-language/wiki/Taverna)
58-
59-
We continuously run the CWL conformance tests on several implementations:
60-
61-
https://ci.commonwl.org
62-
63-
## Examples
64-
65-
[Github repository of example tools and workflows.](https://github.com/common-workflow-language/workflows)
66-
67-
## Support
68-
69-
The best place to ask a question about all things CWL is on
43+
|Software|Description|CWL support|Platform support|Maturity|
44+
|--------|-----------|-----------|--------|--------|
45+
|[cwltool](https://github.com/common-workflow-language/cwltool)|Reference implementation of CWL|[![Build Status](https://ci.commonwl.org/job/cwltool-conformance/badge/icon)](http://ci.commonwl.org/job/cwltool-conformance/lastBuild/testReport/)|Linux, OS X, local execution only|Production|
46+
|[Arvados](https://arvados.org)|Distributed computing platform for data analysis on massive data sets. [Using CWL on Arvados](http://doc.arvados.org/user/cwl/cwl-runner.html)|[![Build Status](https://ci.commonwl.org/job/arvados-conformance/badge/icon)](http://ci.commonwl.org/job/arvados-conformance/lastBuild/testReport/)|AWS, GCP, Azure, Slurm|Production|
47+
|[Toil](https://github.com/BD2KGenomics/toil)|Toil is a workflow engine entirely written in Python.|[![Build Status](https://ci.commonwl.org/job/toil-conformance/badge/icon)](http://ci.commonwl.org/job/toil-conformance/lastBuild/testReport/)|AWS, GCP, Azure, OpenStack, Grid Engine, Mesos|Production|
48+
|[Apache Taverna](http://taverna.incubator.apache.org/)|Domain-independent Workflow Management System|[alpha](https://issues.apache.org/jira/browse/TAVERNA-900)|Java|Production|
49+
|[Galaxy](https://galaxyproject.org/)|Web-based platform for data intensive biomedical research.|[alpha](https://github.com/common-workflow-language/galaxy)|Python|Production|
50+
|[AWE](https://github.com/MG-RAST/AWE)|Workflow and resource management system for bioinformatics data analysis.|[alpha](https://github.com/wgerlach/AWE)|Go|Production|
51+
|[Funnel](https://github.com/bmeg/funnel)|Use Google Genomics Pipeline API with CWL|alpha|GCP|alpha|
52+
|[Rabix Bunny](https://github.com/rabix/bunny)|Reproducible Analyses for Bioinformatics|alpha|Java|alpha|
53+
54+
## Repositories of CWL Tools and Workflows
55+
56+
|Repository|Description|
57+
|----|-----------|
58+
|[Workflows repository](https://github.com/common-workflow-language/workflows)|Git repository of user contributed tools and workflows.|
59+
|[Dockstore tool registry](http://dockstore.org)|An open platform for sharing Docker-based tools described with the Common Workflow Language used by the GA4GH.|
60+
61+
## Software for working with CWL
62+
63+
|Software|Description|
64+
|--------|-----------|
65+
|[cwltest](https://github.com/common-workflow-language/cwltest)|CWL testing framework, automated testing of tools and workflows written with CWL|
66+
|[cwl-upgrader](https://github.com/common-workflow-language/cwl-upgrader)|Upgrade CWL documents from draft-3 to v1.0|
67+
|[argparse2cwl](https://github.com/common-workflow-language/gxargparse#argparse2cwl)|Generate CWL CommandLineTool wrapper from Python programs that use argparse. Also supports [click](http://click.pocoo.org/5/) argument parser.|
68+
|[cwl2argparse](https://github.com/common-workflow-language/cwl2argparse)|Generate Python argparse code from CWL CommandLineTool description.|
69+
|[pypi2cwl](https://github.com/common-workflow-language/pypi2cwl)|Automatically run argparse2cwl on any package in PyPi|
70+
|[cwlavro](https://github.com/common-workflow-language/cwlavro)|Java classes for loading CWL documents|
71+
72+
## Support, Community and Contributing
73+
74+
The recommended place to ask a question about all things CWL is on
7075
[Biostars](https://www.biostars.org/t/cwl/).
7176

72-
[![Biostars
73-
CWL](https://www.biostars.org/static/biostar2.logo.png)](https://www.biostars.org/t/cwl/)
74-
</a>
75-
76-
## Development and testing
77-
78-
[The CWL project is on Github.](https://github.com/common-workflow-language/common-workflow-language)
79-
80-
[![GitHub
81-
stars](https://img.shields.io/github/stars/common-workflow-language/common-workflow-language.svg)](https://github.com/common-workflow-language/common-workflow-language/stargazers)
82-
83-
There is a Jenkins server maintained by Curoverse that runs tests for the
84-
reference implementation, builds and uploads packages, and builds and uploads
85-
Docker images:
86-
87-
https://ci.curoverse.com/job/common-workflow-language/
88-
89-
Current build status: [![Build Status](https://ci.curoverse.com/buildStatus/icon?job=common-workflow-language)](https://ci.curoverse.com/job/common-workflow-language/)
90-
91-
## Community and Contributing
77+
[![Biostars CWL](https://www.biostars.org/static/biostar2.logo.png)](https://www.biostars.org/t/cwl/)
9278

9379
If you are interested in learning more or contributing ideas or code,
9480
[come chat with us on Gitter](https://gitter.im/common-workflow-language/common-workflow-language),
@@ -97,8 +83,6 @@ join the [mailing list common-workflow-language on Google Groups](https://groups
9783
[fork the repository](https://github.com/common-workflow-language/common-workflow-language)
9884
and send a pull request!
9985

100-
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/common-workflow-language/common-workflow-language?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
101-
10286
Your CWL Community Engineer, Michael R. Crusoe, publishes a blog about his work
10387
with updates at http://mrc.commonwl.org.
10488

cwltool/schemas/doc/add-new-draft.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
How to make a new draft version of the CWL spec
22

3-
1. Duplicate prior draft-n directory to draft-n+1 in a branch
3+
1. Duplicate prior directory to "vNewVersion-dev1" or "vExistingVersion-devN+1'
4+
in a branch
45
2. Update references to the new draft name.
56
3. Pull in the latest metaschema, where `schema_salad_repo` is the remote
67
repository for the schema salad tool.
78

89
git fetch --all
9-
git subtree add -P draft-4/salad schema_salad_repo/master
10+
git subtree add -P v1.1.0-dev1/salad schema_salad_repo/master
1011

1112
4. In the reference implementation (cwltool): make a new branch, and update the
1213
subtree checkout of the spec:
13-
14-
git subtree merge -P cwltool/schemas/ cwl_repo/draft-4
14+
15+
git subtree merge --squash -P cwltool/schemas/ cwl_repo/v1.1.0-dev1
1516

1617
Where `cwl_repo` is the remote repository for the CWL specifications.
1718
4. In the reference implementation, teach it about the new draft version:

cwltool/schemas/run_test.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ EOF
1313

1414
DRAFT=v1.0
1515
TEST_N=""
16+
JUNIT_XML=""
1617
RUNNER=cwl-runner
1718
PLATFORM=$(uname -s)
1819
COVERAGE="python"
20+
EXTRA=""
1921

2022
while [[ -n "$1" ]]
2123
do
@@ -35,6 +37,9 @@ do
3537
--only-tools)
3638
ONLY_TOOLS=--only-tools
3739
;;
40+
--junit-xml=*)
41+
JUNIT_XML=$arg
42+
;;
3843
*=*)
3944
eval $(echo $arg | cut -d= -f1)=\"$(echo $arg | cut -d= -f2-)\"
4045
;;
@@ -64,9 +69,9 @@ runtest() {
6469

6570
runs=$((runs+1))
6671
(cd $DRAFT
67-
${COVERAGE} -m cwltool.cwltest --tool "$1" \
72+
cwltest --tool "$1" \
6873
--test=conformance_test_${DRAFT}.yaml ${TEST_N} \
69-
${TEST_L} ${ONLY_TOOLS} --basedir ${DRAFT}
74+
${TEST_L} ${ONLY_TOOLS} ${JUNIT_XML} --basedir ${DRAFT} -- ${EXTRA}
7075
)
7176
checkexit
7277
}

cwltool/schemas/site/cwlsite-job.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

cwltool/schemas/site/cwlsite-job.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env cwl-runner
2+
brand: CWL
3+
brandimg: {class: File, path: CWL-Logo-Header.png}
4+
cwl:tool: cwlsite.cwl
5+
render:
6+
- brandimg: '<img src=''CWL-Logo-Header.png'' style=''height: 61px; margin-top: -20px;
7+
margin-left: -20px''></img>'
8+
brandlink: index.html
9+
primtype: null
10+
redirect: []
11+
renderlist: []
12+
source: {class: File, path: ../README.md}
13+
target: index.html
14+
- {$import: cwlsite-draft3-job.json}
15+
- {$import: cwlsite-v1.0.0-job.json}
16+
- {$import: cwlsite-v1.1.0-dev1-job.yaml}
17+
schemas:
18+
- {$import: cwlsite-draft3-schemas.json}
19+
- {$import: cwlsite-v1.0.0-schemas.json}
20+
- {$import: cwlsite-v1.1.0-dev1-schemas.yaml}

cwltool/schemas/site/cwlsite-draft4-job.json renamed to cwltool/schemas/site/cwlsite-v1.0.0-job.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"source": {
1515
"class": "File",
1616
"path": "../v1.0/CommandLineTool-standalone.yml",
17-
"secondaryFiles": {"$import": "draft4-deps.json"}
17+
"secondaryFiles": {"$import": "v1.0.0-deps.json"}
1818
},
1919
"target": "v1.0/CommandLineTool.html",
2020
"renderlist": [
@@ -30,7 +30,7 @@
3030
"source": {
3131
"class": "File",
3232
"path": "../v1.0/CommonWorkflowLanguage.yml",
33-
"secondaryFiles": {"$import": "draft4-deps.json"}
33+
"secondaryFiles": {"$import": "v1.0.0-deps.json"}
3434
},
3535
"target": "v1.0/Workflow.html",
3636
"renderlist": [
@@ -50,7 +50,7 @@
5050
"primtype": "#CWLType"
5151
},
5252
{
53-
"source": {$import: draft4-metaschema.json},
53+
"source": {$import: v1.0.0-metaschema.json},
5454
"target": "v1.0/SchemaSalad.html",
5555
"renderlist": [
5656
"https://w3id.org/cwl/salad#Semantic_Annotations_for_Linked_Avro_Data",

cwltool/schemas/site/cwlsite-draft4-schemas.json renamed to cwltool/schemas/site/cwlsite-v1.0.0-schemas.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"schema_in": {
33
"class": "File",
44
"path": "../v1.0/CommonWorkflowLanguage.yml",
5-
"secondaryFiles": {"$import": "draft4-deps.json"}
5+
"secondaryFiles": {"$import": "v1.0.0-deps.json"}
66
},
77
"context_target": "v1.0/cwl-context.json",
88
"rdfs_target": "v1.0/cwl.ttl"
99
}, {
10-
"schema_in": {$import: draft4-metaschema.json},
10+
"schema_in": {$import: v1.0.0-metaschema.json},
1111
"context_target": "v1.0/salad-context.json",
1212
"rdfs_target": "v1.0/salad.ttl"
1313
}

0 commit comments

Comments
 (0)