|
41 | 41 | What's going on here? Let's break it down:
|
42 | 42 |
|
43 | 43 | ```
|
44 |
| - cwlVersion: cwl:draft-3 |
| 44 | + cwlVersion: v1.0 |
45 | 45 | class: CommandLineTool
|
46 | 46 | ```
|
47 | 47 |
|
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 |
49 | 49 | document. The `class` field indicates this document describes a command
|
50 | 50 | line tool.
|
51 | 51 |
|
|
58 | 58 |
|
59 | 59 | ```
|
60 | 60 | inputs:
|
61 |
| - - id: message |
| 61 | + message: |
62 | 62 | type: string
|
63 | 63 | inputBinding:
|
64 | 64 | position: 1
|
|
123 | 123 | line. Let's look at each example in detail.
|
124 | 124 |
|
125 | 125 | ```
|
126 |
| - - id: example_flag |
| 126 | + example_flag: |
127 | 127 | type: boolean
|
128 | 128 | inputBinding:
|
129 | 129 | position: 1
|
|
135 | 135 | command line. If false, no flag is added.
|
136 | 136 |
|
137 | 137 | ```
|
138 |
| - - id: example_string |
| 138 | + example_string: |
139 | 139 | type: string
|
140 | 140 | inputBinding:
|
141 | 141 | position: 3
|
|
148 | 148 | rendered as `--example-string hello`.
|
149 | 149 |
|
150 | 150 | ```
|
151 |
| - - id: example_int |
| 151 | + example_int: |
152 | 152 | type: int
|
153 | 153 | inputBinding:
|
154 | 154 | position: 2
|
|
163 | 163 |
|
164 | 164 |
|
165 | 165 | ```
|
166 |
| - - id: example_file |
167 |
| - type: ["null", File] |
| 166 | + example_file: |
| 167 | + type: File? |
168 | 168 | inputBinding:
|
169 | 169 | prefix: --file=
|
170 | 170 | separate: false
|
171 | 171 | position: 4
|
172 | 172 | ```
|
173 | 173 |
|
174 | 174 | 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 |
179 | 177 | `--file=/home/example/whale.txt`. However, if the "example_file"
|
180 | 178 | parameter were not provided in the input, nothing would appear on the
|
181 | 179 | command line.
|
|
228 | 226 | Final process status is success
|
229 | 227 | {
|
230 | 228 | "example_out": {
|
231 |
| - "path": "hello.txt", |
| 229 | + "location": "hello.txt", |
232 | 230 | "size": 13,
|
233 | 231 | "class": "File",
|
234 | 232 | "checksum": "sha1$47a013e660d408619d894b20806b1d5086aab03b"
|
|
255 | 253 | ## Capturing a tool's standard output stream
|
256 | 254 |
|
257 | 255 | 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. |
260 | 258 |
|
261 | 259 | *stdout.cwl*
|
262 | 260 | ```
|
|
279 | 277 | Final process status is success
|
280 | 278 | {
|
281 | 279 | "output": {
|
282 |
| - "path": "output.txt", |
| 280 | + "location": "output.txt", |
283 | 281 | "size": 13,
|
284 | 282 | "class": "File",
|
285 | 283 | "checksum": "sha1$47a013e660d408619d894b20806b1d5086aab03b"
|
|
319 | 317 | Final process status is success
|
320 | 318 | {
|
321 | 319 | "example_out": {
|
322 |
| - "path": "goodbye.txt", |
| 320 | + "location": "goodbye.txt", |
323 | 321 | "size": 24,
|
324 | 322 | "class": "File",
|
325 | 323 | "checksum": "sha1$dd0a4c4c49ba43004d6611771972b6cf969c1c01"
|
|
332 | 330 |
|
333 | 331 | ```
|
334 | 332 | outputs:
|
335 |
| - - id: example_out |
| 333 | + example_out: |
336 | 334 | type: File
|
337 | 335 | outputBinding:
|
338 | 336 | glob: $(inputs.extractfile)
|
|
427 | 425 | ```
|
428 | 426 | $ echo "public class Hello {}" > Hello.java
|
429 | 427 | $ 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 |
431 | 445 | Final process status is success
|
432 | 446 | {
|
433 | 447 | "classfile": {
|
434 | 448 | "size": 416,
|
435 |
| - "path": "/home/example/Hello.class", |
| 449 | + "location": "/home/example/Hello.class", |
436 | 450 | "checksum": "sha1$2f7ac33c1f3aac3f1fec7b936b6562422c85b38a",
|
437 | 451 | "class": "File"
|
438 | 452 | }
|
|
444 | 458 | command line that isn't tied to a specific input parameter.
|
445 | 459 |
|
446 | 460 | ```
|
447 |
| - arguments: |
448 |
| - - prefix: "-d" |
449 |
| - valueFrom: $(runtime.outdir) |
| 461 | + arguments: ["-d", $(runtime.outdir)] |
450 | 462 | ```
|
451 | 463 |
|
452 | 464 | This example references a runtime parameter. Runtime parameters
|
|
527 | 539 | "output": [
|
528 | 540 | {
|
529 | 541 | "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", |
531 | 543 | "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
|
532 | 544 | "class": "File"
|
533 | 545 | },
|
534 | 546 | {
|
535 | 547 | "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", |
537 | 549 | "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",
|
538 | 550 | "class": "File"
|
539 | 551 | }
|
|
726 | 738 | {
|
727 | 739 | "classfile": {
|
728 | 740 | "size": 416,
|
729 |
| - "path": "/home/example/Hello.class", |
| 741 | + "location": "/home/example/Hello.class", |
730 | 742 | "checksum": "sha1$2f7ac33c1f3aac3f1fec7b936b6562422c85b38a",
|
731 | 743 | "class": "File"
|
732 | 744 | }
|
|
759 | 771 | command line:
|
760 | 772 |
|
761 | 773 | ```
|
| 774 | + $ echo "public class Hello {}" > Hello.java && tar -cvf hello.tar Hello.java |
762 | 775 | $ cwl-runner 1st-workflow.cwl 1st-workflow-job.yml
|
763 | 776 | [job untar] /tmp/tmp94qFiM$ tar xf /home/example/hello.tar Hello.java
|
764 | 777 | [step untar] completion status is success
|
|
768 | 781 | Final process status is success
|
769 | 782 | {
|
770 | 783 | "classout": {
|
771 |
| - "path": "/home/example/Hello.class", |
772 |
| - "checksum": "sha1$2f7ac33c1f3aac3f1fec7b936b6562422c85b38a", |
| 784 | + "location": "/home/example/Hello.class", |
| 785 | + "checksum": "sha1$e68df795c0686e9aa1a1195536bd900f5f417b18", |
773 | 786 | "class": "File",
|
774 | 787 | "size": 416
|
775 | 788 | }
|
|
779 | 792 | What's going on here? Let's break it down:
|
780 | 793 |
|
781 | 794 | ```
|
782 |
| - cwlVersion: cwl:draft-3 |
| 795 | + cwlVersion: v1.0 |
783 | 796 | class: Workflow
|
784 | 797 | ```
|
785 | 798 |
|
|
789 | 802 |
|
790 | 803 | ```
|
791 | 804 | inputs:
|
792 |
| - - id: inp |
793 |
| - type: File |
794 |
| - - id: ex |
795 |
| - type: string |
| 805 | + inp: File |
| 806 | + ex: string |
796 | 807 | ```
|
797 | 808 |
|
798 | 809 | The `inputs` section describes the inputs of the workflow. This is a
|
|
802 | 813 |
|
803 | 814 | ```
|
804 | 815 | outputs:
|
805 |
| - - id: classout |
| 816 | + classout: |
806 | 817 | type: File
|
807 |
| - source: "#compile/classfile" |
| 818 | + outputSource: compile/classfile |
808 | 819 | ```
|
809 | 820 |
|
810 | 821 | The `outputs` section describes the outputs of the workflow. This is a
|
|
814 | 825 |
|
815 | 826 | ```
|
816 | 827 | steps:
|
817 |
| - - id: untar |
| 828 | + untar: |
818 | 829 | 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] |
826 | 834 | ```
|
827 | 835 |
|
828 | 836 | The `steps` section describes the actual steps of the workflow. In this
|
|
839 | 847 | `example_out`.
|
840 | 848 |
|
841 | 849 | 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 |
843 | 851 | `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` |
845 | 853 | and `extractfile` in order to run the tool.
|
846 | 854 |
|
847 | 855 | The `outputs` section of the workflow step lists the output parameters
|
848 | 856 | that are expected from the tool.
|
849 | 857 |
|
850 | 858 | ```
|
851 |
| - - id: compile |
| 859 | + compile: |
852 | 860 | 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] |
858 | 864 | ```
|
859 | 865 |
|
860 | 866 | The second step `compile` depends on the results from the first step by
|
861 | 867 | 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 |
863 | 869 | connected to the `outputs` section for the Workflow, described above.
|
0 commit comments