Skip to content

Commit 06c9ba7

Browse files
authored
Merge pull request #230 from common-workflow-language/stderr-out-types
Stderr out types
2 parents 57a5bc8 + cbd7bc2 commit 06c9ba7

9 files changed

+229
-24
lines changed

draft-4/CommandLineTool.yml

+81
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,86 @@ $graph:
382382
specializeTo: "#CommandOutputArraySchema"
383383
- specializeFrom: "#OutputBinding"
384384
specializeTo: "#CommandOutputBinding"
385+
fields:
386+
- name: type
387+
type:
388+
- "null"
389+
- "#CWLType"
390+
- "#stdout"
391+
- "#stderr"
392+
- "sld:RecordSchema"
393+
- "sld:EnumSchema"
394+
- "sld:ArraySchema"
395+
- string
396+
- type: array
397+
items:
398+
- "#CWLType"
399+
- "sld:RecordSchema"
400+
- "sld:EnumSchema"
401+
- "sld:ArraySchema"
402+
- string
403+
jsonldPredicate:
404+
"_id": "sld:type"
405+
"_type": "@vocab"
406+
refScope: 2
407+
typeDSL: True
408+
doc: |
409+
Specify valid types of data that may be assigned to this parameter.
385410
411+
- name: stdout
412+
type: enum
413+
symbols: [ "cwl:stdout" ]
414+
docParent: "#CommandOutputParameter"
415+
doc: |
416+
Only valid as a `type` for an output.
417+
418+
The following
419+
```
420+
outputs:
421+
an_output_name:
422+
type: stdout
423+
424+
stdout: a_stdout_file
425+
```
426+
is equivalent to
427+
```
428+
outputs:
429+
an_output_name:
430+
type: File
431+
outputBinding:
432+
glob: a_stdout_file
433+
434+
stdout: a_stdout_file
435+
```
436+
437+
If there is no `stdout` name provided, a random filename will be created.
438+
439+
440+
- name: stderr
441+
type: enum
442+
symbols: [ "cwl:stderr" ]
443+
docParent: "#CommandOutputParameter"
444+
doc: |
445+
Only valid as a `type` for an output.
446+
447+
The following
448+
```
449+
outputs:
450+
an_output_name:
451+
type: stderr
452+
453+
stderr: a_stderr_file
454+
```
455+
is equivalent to
456+
```
457+
outputs:
458+
an_output_name:
459+
type: File
460+
outputBinding:
461+
glob: a_stderr_file
462+
```
463+
464+
If there is no `stderr` name provided, a random filename will be created.
386465
387466
- type: record
388467
name: CommandLineTool
@@ -436,6 +515,7 @@ $graph:
436515
standard input stream.
437516
- name: stderr
438517
type: ["null", string, "#Expression"]
518+
jsonldPredicate: "https://w3id.org/cwl/cwl#stderr"
439519
doc: |
440520
Capture the command's standard error stream to a file written to
441521
the designated output directory.
@@ -448,6 +528,7 @@ $graph:
448528
characters (such as the path separator `/`) it is an error.
449529
- name: stdout
450530
type: ["null", string, "#Expression"]
531+
jsonldPredicate: "https://w3id.org/cwl/cwl#stdout"
451532
doc: |
452533
Capture the command's standard output stream to a file written to
453534
the designated output directory.

draft-4/Process.yml

+23-24
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ $graph:
138138
# type: ["null", long]
139139
# doc: Optional directory size.
140140

141-
142141
- name: SchemaBase
143142
type: record
144143
abstract: true
@@ -209,29 +208,6 @@ $graph:
209208
Define an input or output parameter to a process.
210209
211210
fields:
212-
- name: type
213-
type:
214-
- "null"
215-
- "#CWLType"
216-
- "sld:RecordSchema"
217-
- "sld:EnumSchema"
218-
- "sld:ArraySchema"
219-
- string
220-
- type: array
221-
items:
222-
- "#CWLType"
223-
- "sld:RecordSchema"
224-
- "sld:EnumSchema"
225-
- "sld:ArraySchema"
226-
- string
227-
jsonldPredicate:
228-
"_id": "sld:type"
229-
"_type": "@vocab"
230-
refScope: 2
231-
typeDSL: True
232-
doc: |
233-
Specify valid types of data that may be assigned to this parameter.
234-
235211
- name: label
236212
type:
237213
- "null"
@@ -402,6 +378,29 @@ $graph:
402378
- specializeFrom: "sld:ArraySchema"
403379
specializeTo: "#InputArraySchema"
404380
fields:
381+
- name: type
382+
type:
383+
- "null"
384+
- "#CWLType"
385+
- "sld:RecordSchema"
386+
- "sld:EnumSchema"
387+
- "sld:ArraySchema"
388+
- string
389+
- type: array
390+
items:
391+
- "#CWLType"
392+
- "sld:RecordSchema"
393+
- "sld:EnumSchema"
394+
- "sld:ArraySchema"
395+
- string
396+
jsonldPredicate:
397+
"_id": "sld:type"
398+
"_type": "@vocab"
399+
refScope: 2
400+
typeDSL: True
401+
doc: |
402+
Specify valid types of data that may be assigned to this parameter.
403+
405404
- name: id
406405
type: string
407406
jsonldPredicate: "@id"

draft-4/conformance_test_draft-4.yaml

+37
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,43 @@
5757
tool: draft-4/cat3-tool.cwl
5858
doc: Test command execution in Docker with stdout redirection
5959

60+
- job: draft-4/cat-job.json
61+
tool: draft-4/cat3-tool-shortcut.cwl
62+
doc: Test command execution in Docker with stdout redirection
63+
64+
- job: draft-4/cat-job.json
65+
output:
66+
output_file:
67+
class: File
68+
checksum: sha1$47a013e660d408619d894b20806b1d5086aab03b
69+
path: cat-out
70+
size: 13
71+
tool: draft-4/cat3-tool-mediumcut.cwl
72+
doc: Test command execution in Docker with stdout redirection
73+
74+
- args: [egrep]
75+
stderr: error.txt
76+
job:
77+
tool: draft-4/egrep-stderr.cwl
78+
doc: Test command line with stderr redirection
79+
80+
- args: [egrep]
81+
job:
82+
tool: draft-4/egrep-stderr-shortcut.cwl
83+
doc: Test command line with stderr redirection, brief syntax
84+
85+
- args: [egrep]
86+
stderr: std.err
87+
output:
88+
output_file:
89+
class: File
90+
size: 84
91+
checksum: sha1$cec7b8746a78c42060c96505887449bca0142976
92+
path: std.err
93+
job:
94+
tool: draft-4/egrep-stderr-mediumcut.cwl
95+
doc: Test command line with stderr redirection, named brief syntax
96+
6097
- job: draft-4/cat-job.json
6198
output:
6299
output_txt:
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env cwl-runner
2+
class: CommandLineTool
3+
cwlVersion: cwl:draft-4.dev2
4+
description: "Print the contents of a file to stdout using 'cat' running in a docker container."
5+
hints:
6+
DockerRequirement:
7+
dockerPull: debian:wheezy
8+
inputs:
9+
file1:
10+
type: File
11+
label: Input File
12+
description: "The file that will be copied using 'cat'"
13+
inputBinding: {position: 1}
14+
outputs:
15+
output_file:
16+
type: stdout
17+
baseCommand: cat
18+
stdout: cat-out
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env cwl-runner
2+
class: CommandLineTool
3+
cwlVersion: cwl:draft-4.dev2
4+
description: "Print the contents of a file to stdout using 'cat' running in a docker container."
5+
hints:
6+
DockerRequirement:
7+
dockerPull: debian:wheezy
8+
inputs:
9+
file1:
10+
type: File
11+
label: Input File
12+
description: "The file that will be copied using 'cat'"
13+
inputBinding: {position: 1}
14+
outputs:
15+
output_file:
16+
type: stdout
17+
baseCommand: cat
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env cwl-runner
2+
class: CommandLineTool
3+
cwlVersion: cwl:draft-4.dev2
4+
description: "Test of capturing stderr output in a docker container."
5+
hints:
6+
DockerRequirement:
7+
dockerPull: debian:wheezy
8+
9+
inputs: []
10+
11+
outputs:
12+
output_file:
13+
type: stderr
14+
15+
baseCommand: egrep
16+
successCodes: [2]
17+
18+
stderr: std.err
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env cwl-runner
2+
class: CommandLineTool
3+
cwlVersion: cwl:draft-4.dev2
4+
description: "Test of capturing stderr output in a docker container."
5+
hints:
6+
DockerRequirement:
7+
dockerPull: debian:wheezy
8+
9+
inputs: []
10+
11+
outputs:
12+
output_file:
13+
type: stderr
14+
15+
baseCommand: egrep
16+
successCodes: [2]

draft-4/draft-4/egrep-stderr.cwl

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env cwl-runner
2+
class: CommandLineTool
3+
cwlVersion: cwl:draft-4.dev2
4+
description: "Test of capturing stderr output in a docker container."
5+
hints:
6+
DockerRequirement:
7+
dockerPull: debian:wheezy
8+
inputs: []
9+
outputs:
10+
output_file:
11+
type: File
12+
outputBinding: {glob: error.txt}
13+
baseCommand: egrep
14+
successCodes: [2]
15+
stderr: error.txt

site/draft4-deps.json

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
"path": "../draft-4/salad/schema_salad/metaschema/metaschema.yml",
1212
"class": "File"
1313
},
14+
{
15+
"path": "../draft-4/salad/schema_salad/metaschema/metaschema_base.yml",
16+
"class": "File"
17+
},
1418
{
1519
"path": "../draft-4/salad/schema_salad/metaschema/salad.md",
1620
"class": "File"

0 commit comments

Comments
 (0)