Skip to content

Commit 516793f

Browse files
author
Peter Amstutz
committed
Switch inputs to use yaml instead of json.
1 parent f4daf16 commit 516793f

23 files changed

+132
-121
lines changed

draft-3/UserGuide.yml

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
2020
Use a JSON object in a separate file to describe the input of a run:
2121
22-
*echo-job.json*
22+
*echo-job.yml*
2323
```
24-
- $include: examples/echo-job.json
24+
- $include: examples/echo-job.yml
2525
- |
2626
```
2727
2828
Now invoke `cwl-runner` with the tool wrapper and the input object on the
2929
command line:
3030
3131
```
32-
$ cwl-runner example-echo.cwl example-echo-job.json
32+
$ cwl-runner 1st.cwl echo-job.yml
3333
[job 140199012414352] $ echo 'Hello world!'
3434
Hello world!
3535
Final process status is success
@@ -94,9 +94,9 @@
9494
- |
9595
```
9696
97-
*inp-job.json*
97+
*inp-job.yml*
9898
```
99-
- $include: examples/inp-job.json
99+
- $include: examples/inp-job.yml
100100
- |
101101
```
102102
@@ -107,7 +107,7 @@
107107
command line:
108108
109109
```
110-
$ cwl-runner example-inp.cwl example-inp-job.json
110+
$ cwl-runner inp.cwl inp-job.yml
111111
[job 140020149614160] /home/example$ echo -f -i42 --example-string hello --file=/home/example/whale.txt
112112
-f -i42 --example-string hello --file=/home/example/whale.txt
113113
Final process status is success
@@ -209,16 +209,16 @@
209209
- |
210210
```
211211
212-
*tar-job.json*
212+
*tar-job.yml*
213213
```
214-
- $include: examples/tar-job.json
214+
- $include: examples/tar-job.yml
215215
- |
216216
```
217217
218218
Invoke `cwl-runner` with the tool wrapper and the input object on the
219219
command line:
220220
```
221-
$ cwl-runner example-tar.cwl example-tar-job.json
221+
$ cwl-runner tar.cwl tar-job.yml
222222
[job 139868145165200] $ tar xf /home/example/hello.tar
223223
Final process status is success
224224
{
@@ -259,17 +259,17 @@
259259
- |
260260
```
261261
262-
*echo-job.json*
262+
*echo-job.yml*
263263
```
264-
- $include: examples/echo-job.json
264+
- $include: examples/echo-job.yml
265265
- |
266266
```
267267
268268
Now invoke `cwl-runner` providing the tool wrapper and the input object
269269
on the command line:
270270
271271
```
272-
$ cwl-runner example-stdout.cwl example-echo-job.json
272+
$ cwl-runner stdout.cwl echo-job.yml
273273
[job 140199012414352] $ echo 'Hello world!' > output.txt
274274
Final process status is success
275275
{
@@ -299,16 +299,16 @@
299299
- |
300300
```
301301
302-
*tar-param-job.json*
302+
*tar-param-job.yml*
303303
```
304-
- $include: examples/tar-param-job.json
304+
- $include: examples/tar-param-job.yml
305305
- |
306306
```
307307
308308
Invoke `cwl-runner` with the tool wrapper and the input object on the
309309
command line:
310310
```
311-
$ cwl-runner example-tar-param.cwl example-tar-param-job.json
311+
$ cwl-runner example-tar-param.cwl example-tar-param-job.yml
312312
[job 139868145165200] $ tar xf /home/example/hello.tar goodbye.txt
313313
Final process status is success
314314
{
@@ -365,17 +365,17 @@
365365
- |
366366
```
367367
368-
*docker-job.json*
368+
*docker-job.yml*
369369
```
370-
- $include: examples/docker-job.json
370+
- $include: examples/docker-job.yml
371371
- |
372372
```
373373
374374
Now invoke `cwl-runner` providing the tool wrapper and the input object
375375
on the command line:
376376
377377
```
378-
$ cwl-runner example-docker.cwl example-docker-job.json
378+
$ cwl-runner example-docker.cwl example-docker-job.yml
379379
[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
380380
Hello world!
381381
Final process status is success
@@ -408,17 +408,17 @@
408408
- |
409409
```
410410
411-
*arguments-job.json*
411+
*arguments-job.yml*
412412
```
413-
- $include: examples/arguments-job.json
413+
- $include: examples/arguments-job.yml
414414
- |
415415
```
416416
417417
Now invoke `cwl-runner` providing the tool wrapper and the input object
418418
on the command line:
419419
420420
```
421-
$ cwl-runner example-arguments.cwl example-arguments-job.json
421+
$ cwl-runner example-arguments.cwl example-arguments-job.yml
422422
[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
423423
Final process status is success
424424
{
@@ -458,23 +458,23 @@
458458
under the `type` field with `type: array` and `items` defining the valid
459459
data types that may appear in the array.
460460
461-
*array.cwl*
461+
*array-inputs.cwl*
462462
```
463-
- $include: examples/array.cwl
463+
- $include: examples/array-inputs.cwl
464464
- |
465465
```
466466
467-
*array-job.json*
467+
*array-inputs-job.yml*
468468
```
469-
- $include: examples/array-job.json
469+
- $include: examples/array-inputs-job.yml
470470
- |
471471
```
472472
473473
Now invoke `cwl-runner` providing the tool wrapper and the input object
474474
on the command line:
475475
476476
```
477-
$ cwl-runner example-array.cwl example-array-job.json
477+
$ cwl-runner array-inputs.cwl array-inputs-job.yml
478478
/home/peter/work/cwl-venv/bin/cwltool 1.0.20160325210917
479479
[job 140334923640912] /home/peter/work/common-workflow-language/draft-3/examples$ echo -A one two three -B=four -B=five -B=six -C=seven,eight,nine
480480
-A one two three -B=four -B=five -B=six -C=seven,eight,nine
@@ -506,29 +506,29 @@
506506
- |
507507
```
508508
509-
*record-job1.json*
509+
*record-job1.yml*
510510
```
511-
- $include: examples/record-job1.json
511+
- $include: examples/record-job1.yml
512512
- |
513513
```
514514
515515
```
516-
$ cwl-runner example-record.cwl example-record-job1.json
516+
$ cwl-runner record.cwl record-job1.yml
517517
Workflow error:
518518
Error validating input record, could not validate field `dependent_parameters` because
519519
missing required field `itemB`
520520
```
521521
522522
In the first example, you can't provide `itemA` without also providing `itemB`.
523523
524-
*record-job2.json*
524+
*record-job2.yml*
525525
```
526-
- $include: examples/record-job2.json
526+
- $include: examples/record-job2.yml
527527
- |
528528
```
529529
530530
```
531-
$ cwl-runner example-record.cwl example-record-job2.json
531+
$ cwl-runner record.cwl record-job2.yml
532532
[job 140566927111376] /home/example$ echo -A one -B two -C three
533533
-A one -B two -C three
534534
Final process status is success
@@ -538,14 +538,14 @@
538538
In the second example, `itemC` and `itemD` are exclusive, so only `itemC`
539539
is added to the command line and `itemD` is ignored.
540540
541-
*record-job3.json*
541+
*record-job3.yml*
542542
```
543-
- $include: examples/record-job2.json
543+
- $include: examples/record-job2.yml
544544
- |
545545
```
546546
547547
```
548-
$ cwl-runner example-record.cwl example-record-job3.json
548+
$ cwl-runner record.cwl record-job3.yml
549549
[job 140606932172880] /home/example$ echo -A one -B two -D four
550550
-A one -B two -D four
551551
Final process status is success
@@ -568,17 +568,17 @@
568568
- |
569569
```
570570
571-
*echo-job.json*
571+
*echo-job.yml*
572572
```
573-
- $include: examples/echo-job.json
573+
- $include: examples/echo-job.yml
574574
- |
575575
```
576576
577577
Now invoke `cwl-runner` with the tool wrapper and the input object on the
578578
command line:
579579
580580
```
581-
$ cwltool example-env.cwl example-echo-job.json
581+
$ cwl-runner env.cwl echo-job.yml
582582
[job 140710387785808] /home/example$ env
583583
PATH=/bin:/usr/bin:/usr/local/bin
584584
HELLO=Hello world!
@@ -602,7 +602,7 @@
602602
```
603603
604604
```
605-
$ cwl-runner example-expression.cwl empty.json
605+
$ cwl-runner expression.cwl empty.yml
606606
[job 140000594593168] /home/example$ echo -A 2 -B baz -C 10 9 8 7 6 5 4 3 2 1
607607
-A 2 -B baz -C 10 9 8 7 6 5 4 3 2 1
608608
Final process status is success
@@ -628,17 +628,17 @@
628628
- |
629629
```
630630
631-
*echo-job.json*
631+
*echo-job.yml*
632632
```
633-
- $include: examples/echo-job.json
633+
- $include: examples/echo-job.yml
634634
- |
635635
```
636636
637637
Now invoke `cwl-runner` with the tool wrapper and the input object on the
638638
command line:
639639
640640
```
641-
$ cwltool example-createfile.cwl example-echo-job.json
641+
$ cwltool createfile.cwl echo-job.yml
642642
[job 140528604979344] /home/example$ cat example.conf
643643
CONFIGVAR=Hello world!
644644
Final process status is success
@@ -661,17 +661,17 @@
661661
- |
662662
```
663663
664-
*arguments-job.json*
664+
*arguments-job.yml*
665665
```
666-
- $include: examples/arguments-job.json
666+
- $include: examples/arguments-job.yml
667667
- |
668668
```
669669
670670
Now invoke `cwl-runner` with the tool wrapper and the input object on the
671671
command line:
672672
673673
```
674-
$ cwl-runner example-linkfile.cwl example-arguments-job.json
674+
$ cwl-runner linkfile.cwl arguments-job.yml
675675
[job 139928309171664] /home/example$ docker run -i --volume=/home/peter/work/common-workflow-language/draft-3/examples/Hello.java:/var/lib/cwl/job557617295_examples/Hello.java:ro --volume=/home/peter/work/common-workflow-language/draft-3/examples:/var/spool/cwl:rw --volume=/tmp/tmpmNbApw:/tmp:rw --workdir=/var/spool/cwl --read-only=true --net=none --user=1001 --rm --env=TMPDIR=/tmp java:7 javac Hello.java
676676
Final process status is success
677677
{

draft-3/examples/arguments-job.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
src:
2+
class: File
3+
path: Hello.java

draft-3/examples/array-inputs-job.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
filesA: [one, two, three]
2+
filesB: [four, five, six]
3+
filesC: [seven, eight, nine]

draft-3/examples/array-inputs.cwl

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
cwlVersion: cwl:draft-3
2+
class: CommandLineTool
3+
inputs:
4+
- id: filesA
5+
type:
6+
type: array
7+
items: string
8+
inputBinding:
9+
prefix: -A
10+
position: 1
11+
12+
- id: filesB
13+
type:
14+
type: array
15+
items: string
16+
inputBinding:
17+
prefix: -B=
18+
separate: false
19+
inputBinding:
20+
position: 2
21+
22+
- id: filesC
23+
type:
24+
type: array
25+
items: string
26+
inputBinding:
27+
prefix: -C=
28+
itemSeparator: ","
29+
separate: false
30+
position: 4
31+
32+
outputs: []
33+
baseCommand: echo

draft-3/examples/createfile-job.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
{
2-
"conf": "hello"
3-
}
1+
conf: hello

draft-3/examples/docker-job.json

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

draft-3/examples/docker-job.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
src:
2+
class: File
3+
path: hello.js

draft-3/examples/echo-job.json

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

draft-3/examples/echo-job.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
message: Hello world!
File renamed without changes.

draft-3/examples/inp-job.json

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

draft-3/examples/inp-job.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
example_flag: true
2+
example_string: hello
3+
example_int: 42
4+
example_file:
5+
class: File
6+
path: whale.txt

draft-3/examples/record-job1.json

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

draft-3/examples/record-job1.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dependent_parameters:
2+
itemA: one
3+
exclusive_parameters:
4+
itemC: three

0 commit comments

Comments
 (0)