Skip to content

Commit 0071e84

Browse files
author
Peter Amstutz
committed
Update user guide for v1.0
1 parent 5fa3867 commit 0071e84

File tree

10 files changed

+91
-82
lines changed

10 files changed

+91
-82
lines changed

run_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Options:
1111
-l List tests
1212
EOF
1313

14-
DRAFT=draft-3
14+
DRAFT=v1.0
1515
TEST_N=""
1616
RUNNER=cwl-runner
1717
PLATFORM=$(uname -s)

v1.0/UserGuide.yml

Lines changed: 58 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
What's going on here? Let's break it down:
4242
4343
```
44-
cwlVersion: cwl:draft-3
44+
cwlVersion: v1.0
4545
class: CommandLineTool
4646
```
4747
48-
The 'cwlVersion` field indicates the version of the CWL spec used by the
48+
The `cwlVersion` field indicates the version of the CWL spec used by the
4949
document. The `class` field indicates this document describes a command
5050
line tool.
5151
@@ -58,7 +58,7 @@
5858
5959
```
6060
inputs:
61-
- id: message
61+
message:
6262
type: string
6363
inputBinding:
6464
position: 1
@@ -123,7 +123,7 @@
123123
line. Let's look at each example in detail.
124124
125125
```
126-
- id: example_flag
126+
example_flag:
127127
type: boolean
128128
inputBinding:
129129
position: 1
@@ -135,7 +135,7 @@
135135
command line. If false, no flag is added.
136136
137137
```
138-
- id: example_string
138+
example_string:
139139
type: string
140140
inputBinding:
141141
position: 3
@@ -148,7 +148,7 @@
148148
rendered as `--example-string hello`.
149149
150150
```
151-
- id: example_int
151+
example_int:
152152
type: int
153153
inputBinding:
154154
position: 2
@@ -163,19 +163,17 @@
163163
164164
165165
```
166-
- id: example_file
167-
type: ["null", File]
166+
example_file:
167+
type: File?
168168
inputBinding:
169169
prefix: --file=
170170
separate: false
171171
position: 4
172172
```
173173
174174
File types appear on the command line as the path to the file. When the
175-
parameter type is a list, this indicates several alternate types are
176-
valid for this parameter. The most common use is to provide "null" as an
177-
alternate parameter type, which indicates that the parameter is optional.
178-
In the example above, this is rendered as
175+
parameter type ends with a question mark `?` it indicates that the
176+
parameter is optional. In the example above, this is rendered as
179177
`--file=/home/example/whale.txt`. However, if the "example_file"
180178
parameter were not provided in the input, nothing would appear on the
181179
command line.
@@ -228,7 +226,7 @@
228226
Final process status is success
229227
{
230228
"example_out": {
231-
"path": "hello.txt",
229+
"location": "hello.txt",
232230
"size": 13,
233231
"class": "File",
234232
"checksum": "sha1$47a013e660d408619d894b20806b1d5086aab03b"
@@ -255,8 +253,8 @@
255253
## Capturing a tool's standard output stream
256254
257255
To capture a tool's standard output stream, add the `stdout` field with
258-
the name of the file where the output stream should go. Then use `glob`
259-
on `outputBinding` to return the file.
256+
the name of the file where the output stream should go. Then add `type:
257+
stdout` on the corresponding output parameter.
260258
261259
*stdout.cwl*
262260
```
@@ -279,7 +277,7 @@
279277
Final process status is success
280278
{
281279
"output": {
282-
"path": "output.txt",
280+
"location": "output.txt",
283281
"size": 13,
284282
"class": "File",
285283
"checksum": "sha1$47a013e660d408619d894b20806b1d5086aab03b"
@@ -319,7 +317,7 @@
319317
Final process status is success
320318
{
321319
"example_out": {
322-
"path": "goodbye.txt",
320+
"location": "goodbye.txt",
323321
"size": 24,
324322
"class": "File",
325323
"checksum": "sha1$dd0a4c4c49ba43004d6611771972b6cf969c1c01"
@@ -332,7 +330,7 @@
332330
333331
```
334332
outputs:
335-
- id: example_out
333+
example_out:
336334
type: File
337335
outputBinding:
338336
glob: $(inputs.extractfile)
@@ -427,12 +425,28 @@
427425
```
428426
$ echo "public class Hello {}" > Hello.java
429427
$ cwl-runner arguments.cwl arguments-job.yml
430-
[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
428+
[job arguments.cwl] /tmp/tmpwYALo1$ docker \
429+
run \
430+
-i \
431+
--volume=/home/peter/work/common-workflow-language/v1.0/examples/Hello.java:/var/lib/cwl/stg8939ac04-7443-4990-a518-1855b2322141/Hello.java:ro \
432+
--volume=/tmp/tmpwYALo1:/var/spool/cwl:rw \
433+
--volume=/tmp/tmpptIAJ8:/tmp:rw \
434+
--workdir=/var/spool/cwl \
435+
--read-only=true \
436+
--user=1001 \
437+
--rm \
438+
--env=TMPDIR=/tmp \
439+
--env=HOME=/var/spool/cwl \
440+
java:7 \
441+
javac \
442+
-d \
443+
/var/spool/cwl \
444+
/var/lib/cwl/stg8939ac04-7443-4990-a518-1855b2322141/Hello.java
431445
Final process status is success
432446
{
433447
"classfile": {
434448
"size": 416,
435-
"path": "/home/example/Hello.class",
449+
"location": "/home/example/Hello.class",
436450
"checksum": "sha1$2f7ac33c1f3aac3f1fec7b936b6562422c85b38a",
437451
"class": "File"
438452
}
@@ -444,9 +458,7 @@
444458
command line that isn't tied to a specific input parameter.
445459
446460
```
447-
arguments:
448-
- prefix: "-d"
449-
valueFrom: $(runtime.outdir)
461+
arguments: ["-d", $(runtime.outdir)]
450462
```
451463
452464
This example references a runtime parameter. Runtime parameters
@@ -527,13 +539,13 @@
527539
"output": [
528540
{
529541
"size": 0,
530-
"path": "/home/peter/work/common-workflow-language/draft-3/examples/foo.txt",
542+
"location": "/home/peter/work/common-workflow-language/draft-3/examples/foo.txt",
531543
"checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
532544
"class": "File"
533545
},
534546
{
535547
"size": 0,
536-
"path": "/home/peter/work/common-workflow-language/draft-3/examples/baz.txt",
548+
"location": "/home/peter/work/common-workflow-language/draft-3/examples/baz.txt",
537549
"checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
538550
"class": "File"
539551
}
@@ -726,7 +738,7 @@
726738
{
727739
"classfile": {
728740
"size": 416,
729-
"path": "/home/example/Hello.class",
741+
"location": "/home/example/Hello.class",
730742
"checksum": "sha1$2f7ac33c1f3aac3f1fec7b936b6562422c85b38a",
731743
"class": "File"
732744
}
@@ -759,6 +771,7 @@
759771
command line:
760772
761773
```
774+
$ echo "public class Hello {}" > Hello.java && tar -cvf hello.tar Hello.java
762775
$ cwl-runner 1st-workflow.cwl 1st-workflow-job.yml
763776
[job untar] /tmp/tmp94qFiM$ tar xf /home/example/hello.tar Hello.java
764777
[step untar] completion status is success
@@ -768,8 +781,8 @@
768781
Final process status is success
769782
{
770783
"classout": {
771-
"path": "/home/example/Hello.class",
772-
"checksum": "sha1$2f7ac33c1f3aac3f1fec7b936b6562422c85b38a",
784+
"location": "/home/example/Hello.class",
785+
"checksum": "sha1$e68df795c0686e9aa1a1195536bd900f5f417b18",
773786
"class": "File",
774787
"size": 416
775788
}
@@ -779,7 +792,7 @@
779792
What's going on here? Let's break it down:
780793
781794
```
782-
cwlVersion: cwl:draft-3
795+
cwlVersion: v1.0
783796
class: Workflow
784797
```
785798
@@ -789,10 +802,8 @@
789802
790803
```
791804
inputs:
792-
- id: inp
793-
type: File
794-
- id: ex
795-
type: string
805+
inp: File
806+
ex: string
796807
```
797808
798809
The `inputs` section describes the inputs of the workflow. This is a
@@ -802,9 +813,9 @@
802813
803814
```
804815
outputs:
805-
- id: classout
816+
classout:
806817
type: File
807-
source: "#compile/classfile"
818+
outputSource: compile/classfile
808819
```
809820
810821
The `outputs` section describes the outputs of the workflow. This is a
@@ -814,15 +825,12 @@
814825
815826
```
816827
steps:
817-
- id: untar
828+
untar:
818829
run: tar-param.cwl
819-
inputs:
820-
- id: tarfile
821-
source: "#inp"
822-
- id: extractfile
823-
source: "#ex"
824-
outputs:
825-
- id: example_out
830+
in:
831+
tarfile: inp
832+
extractfile: ex
833+
outputs: [example_out]
826834
```
827835
828836
The `steps` section describes the actual steps of the workflow. In this
@@ -839,25 +847,23 @@
839847
`example_out`.
840848
841849
The `inputs` section of the workflow step connects these two input
842-
parameters to the inputs of the workflow, `#inp` and `#ex` using
850+
parameters to the inputs of the workflow, `inp` and `ex` using
843851
`source`. This means that when the workflow step is executed, the values
844-
assigned to `#inp` and `#ex` will be used for the parameters `tarfile`
852+
assigned to `inp` and `ex` will be used for the parameters `tarfile`
845853
and `extractfile` in order to run the tool.
846854
847855
The `outputs` section of the workflow step lists the output parameters
848856
that are expected from the tool.
849857
850858
```
851-
- id: compile
859+
compile:
852860
run: arguments.cwl
853-
inputs:
854-
- id: src
855-
source: "#untar/example_out"
856-
outputs:
857-
- id: classfile
861+
in:
862+
src: untar/example_out
863+
outputs: [classfile]
858864
```
859865
860866
The second step `compile` depends on the results from the first step by
861867
connecting the input parameter `src` to the output parameter of `untar`
862-
using `#untar/example_out`. The output of this step `classfile` is
868+
using `untar/example_out`. The output of this step `classfile` is
863869
connected to the `outputs` section for the Workflow, described above.

v1.0/conformance_test_v1.0.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,3 +789,15 @@
789789
size: 18
790790
tool: v1.0/cat3-tool.cwl
791791
doc: Test file literal as input
792+
793+
- job: examples/arguments-job.yml
794+
output: {
795+
"classfile": {
796+
"checksum": "sha1$2f7ac33c1f3aac3f1fec7b936b6562422c85b38a",
797+
"location": "Hello.class",
798+
"class": "File",
799+
"size": 416
800+
}
801+
}
802+
tool: examples/linkfile.cwl
803+
doc: The expression in InitialWorkDir listing

v1.0/examples/1st-workflow.cwl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ inputs:
77
outputs:
88
classout:
99
type: File
10-
outputSource: "#compile/classfile"
10+
outputSource: compile/classfile
1111

1212
steps:
1313
untar:
1414
run: tar-param.cwl
15-
inputs:
15+
in:
1616
tarfile: inp
1717
extractfile: ex
18-
outputs: [example_out]
18+
out: [example_out]
1919

2020
compile:
2121
run: arguments.cwl
22-
inputs:
22+
in:
2323
src: untar/example_out
24-
outputs: [classfile]
24+
out: [classfile]

v1.0/examples/Hello.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
public class Hello
2-
{
3-
public static void main(String[] args)
4-
{
5-
System.out.println("Hello world!");
6-
}
7-
}
1+
public class Hello {}

v1.0/examples/array-inputs.cwl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ cwlVersion: v1.0
22
class: CommandLineTool
33
inputs:
44
filesA:
5-
type:
6-
type: array
7-
items: string
5+
type: string[]
86
inputBinding:
97
prefix: -A
108
position: 1
@@ -20,9 +18,7 @@ inputs:
2018
position: 2
2119

2220
filesC:
23-
type:
24-
type: array
25-
items: string
21+
type: string[]
2622
inputBinding:
2723
prefix: -C=
2824
itemSeparator: ","

v1.0/examples/createfile.cwl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ cwlVersion: v1.0
33
baseCommand: ["cat", "example.conf"]
44

55
requirements:
6-
InitialWorkDirRequirirement:
6+
InitialWorkDirRequirement:
77
listing:
8-
example.conf: |
9-
CONFIGVAR=$(inputs.message)
8+
- entryname: example.conf
9+
entry: |
10+
CONFIGVAR=$(inputs.message)
1011

1112
inputs:
1213
message: string

0 commit comments

Comments
 (0)