Skip to content

Commit 8348c9d

Browse files
committed
Squashed 'cwltool/schemas/' changes from f027dbb..d1d53b3
d1d53b3 Merge pull request #227 from common-workflow-language/stderr 0b987d3 add test 71e9b3d add stderr object 347c28e Merge pull request #212 from common-workflow-language/cwl-runner-interface f36f52f Merge pull request #219 from denis-yuen/patch-1 11b45b5 Merge pull request #224 from common-workflow-language/jenkins-link b4d790d Backport fixes to draft-3 1ea9a5c add jenkins link 180a21e Corrections and test data 28f64f0 clarify description d791500 add output stanza, fix syntax ee0bea3 add descriptions 04dfbf0 toolfile is optional b1e740e bind and order the tool and jobfiles 81bd8de description c7a2bf1 move to a better location 979453a initial description of cwl-runner interface 5316da0 Add missing files for site generation. 31fbb76 Fix site generation workflows to specify draft-3 cff09a0 Add link to latest User Guide on front page 53b2ad7 Merge pull request #200 from common-workflow-language/draft-4 089fbd7 start documenting the draft-4 changes git-subtree-dir: cwltool/schemas git-subtree-split: d1d53b3
1 parent 4cadc61 commit 8348c9d

14 files changed

+407
-27
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ CWL builds on technologies such as [JSON-LD](http://json-ld.org) and
1414
CWL is designed to express workflows for data-intensive science, such as
1515
Bioinformatics, Medical Imaging, Chemistry, Physics, and Astronomy.
1616

17+
## CWL User Guide
18+
19+
[User guide for the current stable specification (draft-3)](http://www.commonwl.org/draft-3/UserGuide.html),
20+
provides a gentle introduction to writing CWL command line tool and workflow descriptions.
21+
1722
## CWL Specification
1823

1924
The current stable specification is [draft 3](http://www.commonwl.org/draft-3/):
@@ -55,6 +60,10 @@ Some of the software supporting running Common Workflow Language tools or workfl
5560
* [Apache Taverna](http://taverna.incubator.apache.org/),
5661
[Apache Taverna wiki page](https://github.com/common-workflow-language/common-workflow-language/wiki/Taverna)
5762

63+
We continuously run the CWL conformance tests on several implementations:
64+
65+
https://ci.commonwl.org
66+
5867
## Examples
5968

6069
[Github repository of example tools and workflows.](https://github.com/common-workflow-language/workflows)

draft-3/UserGuide.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- |
2121
```
2222
23-
Use a JSON object in a separate file to describe the input of a run:
23+
Use a YAML object in a separate file to describe the input of a run:
2424
2525
*echo-job.yml*
2626
```
@@ -106,10 +106,11 @@
106106
Notice that "example_file", as a `File` type, must be provided as an
107107
object with the fields `class: File` and `path`.
108108
109-
Invoke `cwl-runner` with the tool wrapper and the input object on the
109+
Next, create a whale.txt and invoke `cwl-runner` with the tool wrapper and the input object on the
110110
command line:
111111
112112
```
113+
$ touch whale.txt
113114
$ cwl-runner inp.cwl inp-job.yml
114115
[job 140020149614160] /home/example$ echo -f -i42 --example-string hello --file=/home/example/whale.txt
115116
-f -i42 --example-string hello --file=/home/example/whale.txt
@@ -218,9 +219,10 @@
218219
- |
219220
```
220221
221-
Invoke `cwl-runner` with the tool wrapper and the input object on the
222+
Next, create a tar file for the example and invoke `cwl-runner` with the tool wrapper and the input object on the
222223
command line:
223224
```
225+
$ touch hello.txt && tar -cvf hello.tar hello.txt
224226
$ cwl-runner tar.cwl tar-job.yml
225227
[job 139868145165200] $ tar xf /home/example/hello.tar
226228
Final process status is success
@@ -308,9 +310,10 @@
308310
- |
309311
```
310312
311-
Invoke `cwl-runner` with the tool wrapper and the input object on the
313+
Create your input files and invoke `cwl-runner` with the tool wrapper and the input object on the
312314
command line:
313315
```
316+
$ rm hello.tar || true && touch goodbye.txt && tar -cvf hello.tar
314317
$ cwl-runner tar-param.cwl tar-param-job.yml
315318
[job 139868145165200] $ tar xf /home/example/hello.tar goodbye.txt
316319
Final process status is success
@@ -374,11 +377,12 @@
374377
- |
375378
```
376379
377-
Now invoke `cwl-runner` providing the tool wrapper and the input object
380+
Provide a hello.js and invoke `cwl-runner` providing the tool wrapper and the input object
378381
on the command line:
379382
380383
```
381-
$ cwl-runner example-docker.cwl example-docker-job.yml
384+
$ echo "console.log(\"Hello World\");" > hello.js
385+
$ cwl-runner docker.cwl docker-job.yml
382386
[job 140259721854416] /home/example$ docker run -i --volume=/home/example/hello.js:/var/lib/cwl/job369354770_examples/hello.js:ro --volume=/home/example:/var/spool/cwl:rw --volume=/tmp/tmpDLs5hm:/tmp:rw --workdir=/var/spool/cwl --read-only=true --net=none --user=1001 --rm --env=TMPDIR=/tmp node:slim node /var/lib/cwl/job369354770_examples/hello.js
383387
Hello world!
384388
Final process status is success
@@ -417,11 +421,12 @@
417421
- |
418422
```
419423
420-
Now invoke `cwl-runner` providing the tool wrapper and the input object
424+
Now create a sample Java file and invoke `cwl-runner` providing the tool wrapper and the input object
421425
on the command line:
422426
423427
```
424-
$ cwl-runner example-arguments.cwl example-arguments-job.yml
428+
$ echo "public class Hello {}" > Hello.java
429+
$ cwl-runner arguments.cwl arguments-job.yml
425430
[job 140051188854928] /home/example$ docker run -i --volume=/home/example/Hello.java:/var/lib/cwl/job710906416_example/Hello.java:ro --volume=/home/example:/var/spool/cwl:rw --volume=/tmp/tmpdlQDWi:/tmp:rw --workdir=/var/spool/cwl --read-only=true --net=none --user=1001 --rm --env=TMPDIR=/tmp java:7 javac -d /var/spool/cwl /var/lib/cwl/job710906416_examples/Hello.java
426431
Final process status is success
427432
{
@@ -855,4 +860,4 @@
855860
The second step `compile` depends on the results from the first step by
856861
connecting the input parameter `src` to the output parameter of `untar`
857862
using `#untar/example_out`. The output of this step `classfile` is
858-
connected to the `outputs` section for the Workflow, described above.
863+
connected to the `outputs` section for the Workflow, described above.

draft-3/cwl-runner.cwl

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/usr/bin/env cwl-runner
2+
class: CommandLineTool
3+
cwlVersion: "cwl:draft-3"
4+
5+
description: |
6+
Generic interface to run a Common Workflow Language tool or workflow from the
7+
command line. To be implemented by each CWL compliant execution platform for
8+
testing conformance to the standard and optionally for use by users.
9+
10+
inputs:
11+
- id: outdir
12+
type: string
13+
default: outdir
14+
description: |
15+
Output directory, defaults to the current directory
16+
inputBinding:
17+
prefix: "--outdir"
18+
19+
- id: quiet
20+
type: boolean
21+
description: no diagnostic output
22+
inputBinding:
23+
prefix: "--quiet"
24+
25+
- id: toolfile
26+
type: [ "null", File ]
27+
description: |
28+
The tool or workflow description to run. Optional if the jobfile has a
29+
`cwl:tool` field to indicate the tool or workflow description to run.
30+
inputBinding:
31+
position: 1
32+
33+
- id: jobfile
34+
type: File
35+
inputBinding:
36+
position: 2
37+
38+
- id: conformance-test
39+
type: boolean
40+
inputBinding:
41+
prefix: "--conformance-test"
42+
43+
- id: basedir
44+
type: string
45+
inputBinding:
46+
prefix: "--basedir"
47+
48+
- id: no-container
49+
type: boolean
50+
description: |
51+
Do not execute jobs in a Docker container, even when listed as a Requirement
52+
inputBinding:
53+
prefix: "--no-container"
54+
55+
- id: tmp-outdir-prefix
56+
type: string
57+
description: |
58+
Path prefix for temporary directories. Useful for OS X so that boot2docker
59+
writes to /Users
60+
inputBinding:
61+
prefix: "--tmp-outdir-prefix"
62+
63+
- id: tmpdir-prefix
64+
type: string
65+
description: |
66+
Path prefix for temporary directories
67+
inputBinding:
68+
prefix: "--tmpdir-prefix"
69+
70+
baseCommand: cwl-runner
71+
72+
stdout: output-object.json
73+
74+
outputs:
75+
- id: output-object
76+
type: File
77+
outputBinding:
78+
glob: output-object.json

draft-4/CommandLineTool.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ $graph:
3838
- |
3939
## Introduction to draft 4
4040
41-
This specification represents the third milestone of the CWL group.
42-
Since draft-3, this draft introduces the following major changes and additions:
41+
This specification represents the fourth milestone of the CWL group.
42+
Since draft-3, this draft introduces the following changes and additions:
43+
44+
* Preliminary support for initialWorkDir & the Directory type
45+
* "id: name" is now just "name"; "class: Classname" is now just
46+
"Classtname".
4347
4448
## Purpose
4549
@@ -430,6 +434,18 @@ $graph:
430434
doc: |
431435
A path to a file whose contents must be piped into the command's
432436
standard input stream.
437+
- name: stderr
438+
type: ["null", string, "#Expression"]
439+
doc: |
440+
Capture the command's standard error stream to a file written to
441+
the designated output directory.
442+
443+
If `stderr` is a string, it specifies the file name to use.
444+
445+
If `stderr` is an expression, the expression is evaluated and must
446+
return a string with the file name to use to capture stderr. If the
447+
return value is not a string, or the resulting path contains illegal
448+
characters (such as the path separator `/`) it is an error.
433449
- name: stdout
434450
type: ["null", string, "#Expression"]
435451
doc: |

draft-4/UserGuide.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
- |
1818
```
1919
20-
Use a JSON object in a separate file to describe the input of a run:
20+
Use a YAML object in a separate file to describe the input of a run:
2121
2222
*echo-job.yml*
2323
```
@@ -103,10 +103,11 @@
103103
Notice that "example_file", as a `File` type, must be provided as an
104104
object with the fields `class: File` and `path`.
105105
106-
Invoke `cwl-runner` with the tool wrapper and the input object on the
106+
Next, create a whale.txt and invoke `cwl-runner` with the tool wrapper and the input object on the
107107
command line:
108108
109109
```
110+
$ touch whale.txt
110111
$ cwl-runner inp.cwl inp-job.yml
111112
[job 140020149614160] /home/example$ echo -f -i42 --example-string hello --file=/home/example/whale.txt
112113
-f -i42 --example-string hello --file=/home/example/whale.txt
@@ -215,9 +216,10 @@
215216
- |
216217
```
217218
218-
Invoke `cwl-runner` with the tool wrapper and the input object on the
219+
Next, create a tar file for the example and invoke `cwl-runner` with the tool wrapper and the input object on the
219220
command line:
220221
```
222+
$ touch hello.txt && tar -cvf hello.tar hello.txt
221223
$ cwl-runner tar.cwl tar-job.yml
222224
[job 139868145165200] $ tar xf /home/example/hello.tar
223225
Final process status is success
@@ -305,9 +307,10 @@
305307
- |
306308
```
307309
308-
Invoke `cwl-runner` with the tool wrapper and the input object on the
310+
Create your input files and invoke `cwl-runner` with the tool wrapper and the input object on the
309311
command line:
310312
```
313+
$ rm hello.tar || true && touch goodbye.txt && tar -cvf hello.tar
311314
$ cwl-runner example-tar-param.cwl example-tar-param-job.yml
312315
[job 139868145165200] $ tar xf /home/example/hello.tar goodbye.txt
313316
Final process status is success
@@ -371,11 +374,12 @@
371374
- |
372375
```
373376
374-
Now invoke `cwl-runner` providing the tool wrapper and the input object
377+
Provide a hello.js and invoke `cwl-runner` providing the tool wrapper and the input object
375378
on the command line:
376379
377380
```
378-
$ cwl-runner example-docker.cwl example-docker-job.yml
381+
$ echo "console.log(\"Hello World\");" > hello.js
382+
$ cwl-runner docker.cwl docker-job.yml
379383
[job 140259721854416] /home/example$ docker run -i --volume=/home/example/hello.js:/var/lib/cwl/job369354770_examples/hello.js:ro --volume=/home/example:/var/spool/cwl:rw --volume=/tmp/tmpDLs5hm:/tmp:rw --workdir=/var/spool/cwl --read-only=true --net=none --user=1001 --rm --env=TMPDIR=/tmp node:slim node /var/lib/cwl/job369354770_examples/hello.js
380384
Hello world!
381385
Final process status is success
@@ -414,11 +418,12 @@
414418
- |
415419
```
416420
417-
Now invoke `cwl-runner` providing the tool wrapper and the input object
421+
Now create a sample Java file and invoke `cwl-runner` providing the tool wrapper and the input object
418422
on the command line:
419423
420424
```
421-
$ cwl-runner example-arguments.cwl example-arguments-job.yml
425+
$ echo "public class Hello {}" > Hello.java
426+
$ cwl-runner arguments.cwl arguments-job.yml
422427
[job 140051188854928] /home/example$ docker run -i --volume=/home/example/Hello.java:/var/lib/cwl/job710906416_example/Hello.java:ro --volume=/home/example:/var/spool/cwl:rw --volume=/tmp/tmpdlQDWi:/tmp:rw --workdir=/var/spool/cwl --read-only=true --net=none --user=1001 --rm --env=TMPDIR=/tmp java:7 javac -d /var/spool/cwl /var/lib/cwl/job710906416_examples/Hello.java
423428
Final process status is success
424429
{

draft-4/Workflow.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ $graph:
3434
3535
## Introduction to draft 4
3636
37-
This specification represents the fourth milestone of the CWL group. Since
38-
draft-3, this draft introduces the following changes and additions:
37+
This specification represents the fourth milestone of the CWL group.
38+
Since draft-3, this draft introduces the following changes and additions:
3939
40-
* TBD
40+
* The 'inputs' and 'outputs' fields have been renamed 'in' and 'out'.
4141
4242
## Purpose
4343
@@ -469,4 +469,4 @@ $graph:
469469
extends: "#ProcessRequirement"
470470
doc: |
471471
Indicate that the workflow platform must support the `valueFrom` field
472-
of [WorkflowStepInput](#WorkflowStepInput).
472+
of [WorkflowStepInput](#WorkflowStepInput).

draft-4/conformance_test_draft-4.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444
tool: draft-4/cat3-tool.cwl
4545
doc: Test command line with stdout redirection
4646

47+
- args: [egrep]
48+
stderr: error.txt
49+
job:
50+
tool: draft-4/egrep-stderr.cwl
51+
doc: Test command line with stdout redirection
52+
4753
- args: [cat]
4854
job: draft-4/cat-job.json
4955
stdin: draft-4/hello.txt

0 commit comments

Comments
 (0)