Skip to content

Commit

Permalink
Squashed 'cwltool/schemas/' changes from 3e1b02c..0c275b4
Browse files Browse the repository at this point in the history
0c275b4 clarify that outputBinding must not be set
c30b79f finish restoring allowable types for parameters
06c9ba7 Merge pull request common-workflow-language#230 from common-workflow-language/stderr-out-types
cbd7bc2 only allow use of stderr/stdout shortcuts as types for the Outputs. Better place the docs
0ba703d jsonldPredicate did it!
a5a7516 nope, use an enum instead
24a611d use long ids?
52f6411 extend doc to stderr psuedotype
9d0fbe0 initial stdout & stderr shortcut support
392be2f fixing site build?
57a5bc8 Fix last test using "args"
3cc79d2 Port draft-3 changes to command line generation tests to draft-4.
f2a18c3 Add missing args.py used by draft-3 tests.
ac17f5d Port draft-2 changes to command line generation tests to draft-3.
ddf417b Command line generation tests now work by executing a small script that copies the command line to the output.  Allows cwl-runner implementations to drop the --conformance-test code path.
c4cecad Merge pull request common-workflow-language#228 from common-workflow-language/scoped-ref-and-typedsl
d1d53b3 Merge pull request common-workflow-language#227 from common-workflow-language/stderr
0b987d3 add test
71e9b3d add stderr object
347c28e Merge pull request common-workflow-language#212 from common-workflow-language/cwl-runner-interface
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

git-subtree-dir: cwltool/schemas
git-subtree-split: 0c275b4
  • Loading branch information
mr-c committed Jun 15, 2016
1 parent dba242f commit ef67193
Show file tree
Hide file tree
Showing 47 changed files with 713 additions and 241 deletions.
67 changes: 28 additions & 39 deletions draft-2/conformance_test_draft-2.yaml
Original file line number Diff line number Diff line change
@@ -1,63 +1,52 @@
- args: [bwa, mem, -t, '4', -I, '1,2,3,4', -m, '3', draft-2/rabix/tests/test-files/chr20.fa,
draft-2/rabix/tests/test-files/example_human_Illumina.pe_1.fastq, draft-2/rabix/tests/test-files/example_human_Illumina.pe_2.fastq]
- args:
job: draft-2/bwa-mem-job.json
stdout: output.sam
tool: draft-2/bwa-mem-tool.cwl
output:
args: [bwa, mem, -t, '4', -I, '1,2,3,4', -m, '3',
chr20.fa,
example_human_Illumina.pe_1.fastq,
example_human_Illumina.pe_2.fastq]
doc: General test of command line generation

- args: [bwa, mem, draft-2/rabix/tests/test-files/chr20.fa,
"-XXX",
"-YYY", draft-2/rabix/tests/test-files/example_human_Illumina.pe_1.fastq,
"-YYY", draft-2/rabix/tests/test-files/example_human_Illumina.pe_2.fastq]
- output:
args: [bwa, mem, chr20.fa,
"-XXX",
"-YYY", example_human_Illumina.pe_1.fastq,
"-YYY", example_human_Illumina.pe_2.fastq]
job: draft-2/bwa-mem-job.json
tool: draft-2/binding-test.cwl
doc: Test nested prefixes with arrays

- args: [tmap, mapall, stage1, map1, --min-seq-length, '20', map2, --min-seq-length,
- output:
args: [tmap, mapall, stage1, map1, --min-seq-length, '20', map2, --min-seq-length,
'20', stage2, map1, --max-seq-length, '20', --min-seq-length, '10', --seed-length,
'16', map2, --max-seed-hits, '-1', --max-seq-length, '20', --min-seq-length, '10']
job: draft-2/tmap-job.json
stdin: draft-2/reads.fastq
stdout: output.sam
tool: draft-2/tmap-tool.cwl
doc: Test nested command line bindings and stdin/stdout redirection
doc: Test nested command line bindings

- args: [cat, draft-2/hello.txt]
- output:
args: [cat, hello.txt]
job: draft-2/cat-job.json
tool: draft-2/cat1-tool.cwl
tool: draft-2/cat1-testcli.cwl
doc: Test command line with optional input (missing)

- args: [cat, -n, draft-2/hello.txt]
- output:
args: [cat, -n, hello.txt]
job: draft-2/cat-n-job.json
tool: draft-2/cat1-tool.cwl
tool: draft-2/cat1-testcli.cwl
doc: Test command line with optional input (provided)

- args: [cat]
job: draft-2/cat-job.json
stdin: draft-2/hello.txt
tool: draft-2/cat2-tool.cwl
doc: Test command line with stdin redirection

- args: [cat, draft-2/hello.txt]
job: draft-2/cat-job.json
stdout: output.txt
tool: draft-2/cat3-tool.cwl
doc: Test command line with stdout redirection

- args: [cat]
job: draft-2/cat-job.json
stdin: draft-2/hello.txt
stdout: output.txt
tool: draft-2/cat4-tool.cwl
doc: Test command line with stdin and stdout redirection

- args: [cat, foo.txt]
createfiles: {foo.txt: 'The file is draft-2/hello.txt

'}
- output:
"foo": {
"checksum": "sha1$63da67422622fbf9251a046d7a34b7ea0fd4fead",
"class": "File",
"path": "foo.txt",
"size": 22
}
job: draft-2/cat-job.json
tool: draft-2/template-tool.cwl
doc: Test CreateFileRequirement ExpressionEngineRequirement.engineConfig features
doc: Test CreateFileRequirement ExpressionEngineRequirement.engineConfig feature

- job: draft-2/cat-job.json
output:
Expand Down
7 changes: 7 additions & 0 deletions draft-2/draft-2/args.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python
import sys
import json
import os
args = [os.path.basename(a) for a in sys.argv[1:]]
with open("cwl.output.json", "w") as f:
json.dump({"args": args}, f)
11 changes: 10 additions & 1 deletion draft-2/draft-2/binding-test.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ inputs:
inputBinding: { prefix: "-YYY" }
inputBinding: { position: 3, prefix: "-XXX" }

- id: "#args.py"
type: File
default:
class: File
path: args.py
inputBinding:
position: -1

outputs: []

baseCommand: ["bwa", "mem"]
baseCommand: python
arguments: ["bwa", "mem"]
6 changes: 3 additions & 3 deletions draft-2/draft-2/bwa-mem-job.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"reference": {
"class": "File",
"path": "rabix/tests/test-files/chr20.fa",
"path": "chr20.fa",
"size": 123,
"checksum": "sha1$hash"
},
"reads": [
{
"class": "File",
"path": "rabix/tests/test-files/example_human_Illumina.pe_1.fastq"
"path": "example_human_Illumina.pe_1.fastq"
},
{
"class": "File",
"path": "rabix/tests/test-files/example_human_Illumina.pe_2.fastq"
"path": "example_human_Illumina.pe_2.fastq"
}
],
"min_std_max_min": [
Expand Down
23 changes: 16 additions & 7 deletions draft-2/draft-2/bwa-mem-tool.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ class: CommandLineTool
requirements:
- import: node-engine.cwl

hints:
- class: DockerRequirement
dockerPull: images.sbgenomics.com/rabix/bwa
dockerImageId: 9d3b9b0359cf

inputs:
- id: "#reference"
type: File
Expand All @@ -31,14 +26,28 @@ inputs:
prefix: "-I"
itemSeparator: ","

- id: "#args.py"
type: File
default:
class: File
path: args.py
inputBinding:
position: -1

outputs:
- id: "#sam"
type: "File"
type: ["null", "File"]
outputBinding: { "glob": "output.sam" }
- id: "#args"
type:
type: array
items: string

baseCommand: ["bwa", "mem"]
baseCommand: python

arguments:
- "bwa"
- "mem"
- valueFrom:
engine: "node-engine.cwl"
script: "$job.allocatedResources.cpu"
Expand Down
34 changes: 34 additions & 0 deletions draft-2/draft-2/cat1-testcli.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env cwl-runner
{
"class": "CommandLineTool",
"description": "Print the contents of a file to stdout using 'cat' running in a docker container.",
"inputs": [
{
"id": "#file1",
"type": "File",
"inputBinding": {"position": 1}
},
{
"id": "#numbering",
"type": ["null", "boolean"],
"inputBinding": {
"position": 0,
"prefix": "-n"
}
},
{
id: "#args.py",
type: File,
default: {
class: File,
path: args.py
},
inputBinding: {
position: -1
}
}
],
"outputs": [],
"baseCommand": "python",
"arguments": ["cat"]
}
23 changes: 0 additions & 23 deletions draft-2/draft-2/cat2-tool.cwl

This file was deleted.

Empty file added draft-2/draft-2/chr20.fa
Empty file.
Empty file.
Empty file.
Empty file added draft-2/draft-2/reads.fastq
Empty file.
9 changes: 7 additions & 2 deletions draft-2/draft-2/template-tool.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ requirements:
- filename: foo.txt
fileContent:
engine: "#js"
script: 't("The file is <%= $job.file1.path %>\n")'
script: >
t("The file is <%= $job.file1.path.split('/').slice(-1)[0] %>\n")
inputs:
- id: "#file1"
type: File
outputs: []
outputs:
- id: "#foo"
type: File
outputBinding:
glob: foo.txt
baseCommand: ["cat", "foo.txt"]
21 changes: 14 additions & 7 deletions draft-2/draft-2/tmap-tool.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,26 @@
"type": "array",
"items": "Stage"
}
},
{
id: "#args.py",
type: File,
default: {
class: File,
path: args.py
},
inputBinding: {
position: -1
}
}
],
"outputs": [
{
"id": "#sam",
"outputBinding": {
"glob": "output.sam"
},
"type": "File"
"type": ["null", "File"]
}
],
"requirements": [
Expand Down Expand Up @@ -233,10 +244,6 @@
]
}
]}],
"baseCommand": ["tmap", "mapall"],
"stdin": {
"engine": "cwl:JsonPointer",
"script": "job/reads/path"
},
"stdout": "output.sam"
"baseCommand": "python",
"arguments": ["tmap", "mapall"]
}
70 changes: 29 additions & 41 deletions draft-3/conformance_test_draft-3.yaml
Original file line number Diff line number Diff line change
@@ -1,63 +1,51 @@
- args: [bwa, mem, -t, '4', -I, '1,2,3,4', -m, '3', draft-3/rabix/tests/test-files/chr20.fa,
draft-3/rabix/tests/test-files/example_human_Illumina.pe_1.fastq, draft-3/rabix/tests/test-files/example_human_Illumina.pe_2.fastq]
job: draft-3/bwa-mem-job.json
stdout: output.sam
- job: draft-3/bwa-mem-job.json
tool: draft-3/bwa-mem-tool.cwl
output:
args: [bwa, mem, -t, '4', -I, '1,2,3,4', -m, '3',
chr20.fa,
example_human_Illumina.pe_1.fastq,
example_human_Illumina.pe_2.fastq]
doc: General test of command line generation

- args: [bwa, mem, draft-3/rabix/tests/test-files/chr20.fa,
"-XXX",
"-YYY", draft-3/rabix/tests/test-files/example_human_Illumina.pe_1.fastq,
"-YYY", draft-3/rabix/tests/test-files/example_human_Illumina.pe_2.fastq]
- output:
args: [bwa, mem, chr20.fa,
"-XXX",
"-YYY", example_human_Illumina.pe_1.fastq,
"-YYY", example_human_Illumina.pe_2.fastq]
job: draft-3/bwa-mem-job.json
tool: draft-3/binding-test.cwl
doc: Test nested prefixes with arrays

- args: [tmap, mapall, stage1, map1, --min-seq-length, '20', map2, --min-seq-length,
- output:
args: [tmap, mapall, stage1, map1, --min-seq-length, '20', map2, --min-seq-length,
'20', stage2, map1, --max-seq-length, '20', --min-seq-length, '10', --seed-length,
'16', map2, --max-seed-hits, '-1', --max-seq-length, '20', --min-seq-length, '10']
job: draft-3/tmap-job.json
stdin: draft-3/reads.fastq
stdout: output.sam
tool: draft-3/tmap-tool.cwl
doc: Test nested command line bindings and stdin/stdout redirection
doc: Test nested command line bindings

- args: [cat, draft-3/hello.txt]
- output:
args: [cat, hello.txt]
job: draft-3/cat-job.json
tool: draft-3/cat1-tool.cwl
tool: draft-3/cat1-testcli.cwl
doc: Test command line with optional input (missing)

- args: [cat, -n, draft-3/hello.txt]
- output:
args: [cat, -n, hello.txt]
job: draft-3/cat-n-job.json
tool: draft-3/cat1-tool.cwl
tool: draft-3/cat1-testcli.cwl
doc: Test command line with optional input (provided)

- args: [cat]
job: draft-3/cat-job.json
stdin: draft-3/hello.txt
tool: draft-3/cat2-tool.cwl
doc: Test command line with stdin redirection

- args: [cat, draft-3/hello.txt]
job: draft-3/cat-job.json
stdout: output.txt
tool: draft-3/cat3-tool.cwl
doc: Test command line with stdout redirection

- args: [cat]
job: draft-3/cat-job.json
stdin: draft-3/hello.txt
stdout: output.txt
tool: draft-3/cat4-tool.cwl
doc: Test command line with stdin and stdout redirection

- args: [cat, foo.txt]
createfiles: {foo.txt: 'The file is draft-3/hello.txt

'}
- output:
"foo": {
"checksum": "sha1$63da67422622fbf9251a046d7a34b7ea0fd4fead",
"class": "File",
"path": "foo.txt",
"size": 22
}
job: draft-3/cat-job.json
tool: draft-3/template-tool.cwl
doc: Test CreateFileRequirement ExpressionEngineRequirement.engineConfig features
doc: Test CreateFileRequirement ExpressionEngineRequirement.engineConfig feature

- job: draft-3/cat-job.json
output:
Expand Down Expand Up @@ -504,7 +492,7 @@
doc: |
Test parameter evaluation, with support for JS expressions
- args: [cat, draft-3/hello.txt]
- output: {}
job: draft-3/cat-job.json
tool: draft-3/metadata.cwl
doc: Test metadata
Expand Down
Loading

0 comments on commit ef67193

Please sign in to comment.