Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

feat: Toil engine for CWL #317

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
af25f15
feat: Toil engine for CWL
adamnovak Jan 5, 2022
a5bfbb5
Expect to have exactly 30 arguments
adamnovak Mar 8, 2022
ebf6971
Add a bigger CWL workflow
adamnovak Feb 17, 2022
ba47534
Make workflow harder
adamnovak Feb 18, 2022
cab340d
Use a Toil that can generate dest buckets and mount Docker
adamnovak Feb 18, 2022
a9df643
Fix undefined type in mock
adamnovak Mar 15, 2022
c0f4fbb
Fix size requirement in example workflow
adamnovak Mar 15, 2022
674bfa4
Use current Toil with its AGC integration merged
adamnovak Mar 15, 2022
9cc8e12
Use older JS exponentiation
adamnovak Mar 16, 2022
7b71d7e
Add a workflow that will run a lot of little jobs
adamnovak Mar 23, 2022
cbd8cec
Attach workflow to project
adamnovak Mar 23, 2022
b017df9
Turn off Toil caching
adamnovak Mar 23, 2022
2815899
Rename CWL demo to not conflict with WDL demo
adamnovak Mar 24, 2022
c996774
Use Toil that will point to S3 URLs in output
adamnovak Mar 24, 2022
9f2f47c
Stop changing mock files
adamnovak Mar 30, 2022
b5ad0e6
Rename toilJobArn to toilJobDefinitionArnPattern
adamnovak Mar 30, 2022
1a573f5
Avoid adding permissions on * for Toil batch access
adamnovak Mar 30, 2022
c8f2634
Avoid granting Toil extra permissions that maybe only Cromwell needs
adamnovak Mar 30, 2022
4c71b9b
Drop TODO comment
adamnovak Mar 30, 2022
a8a78f4
Restrict Toil S3 and SimpleDB policies to job store data
adamnovak Mar 30, 2022
74ee3f3
Revise comment per review
adamnovak Mar 30, 2022
9d99a7f
Clarify what the JobQueue is for
adamnovak Mar 30, 2022
83193cb
Make adapter log group optional
adamnovak Mar 30, 2022
01ea177
Provide WES images only when needed
adamnovak Mar 30, 2022
a064c4b
Use constants to track expected arg counts
adamnovak Mar 30, 2022
f08b1ba
Alphabetize workflow types in help
adamnovak Mar 30, 2022
1aeb097
Fix spelling
adamnovak Mar 30, 2022
6bd9b43
Update Toil readme to fix spelling and remove details
adamnovak Mar 30, 2022
f64eb0e
Fix formatting and run tests to completion
adamnovak Mar 30, 2022
4145c5b
Define a default filesystem for the Toil engine
adamnovak Mar 30, 2022
595913c
Remove disallowed pieces from S3 ARNs
adamnovak Mar 30, 2022
0194714
Pass empty components to appease ARN builder
adamnovak Mar 30, 2022
94f9063
Fix CI error from linter having opinions about loops
adamnovak Mar 30, 2022
e80e185
Add Toil engine documentation
adamnovak Apr 26, 2022
f586d88
Correct inaccuracies about container setup
adamnovak Apr 27, 2022
5687a89
Set a plausible-looking set of IAM permissions for the Toil job store
adamnovak Apr 27, 2022
a8d26fe
Add HeadObject which we might need and a trailing comma
adamnovak Apr 27, 2022
d1a64a3
Remove space in comment which causes build to fail
adamnovak Apr 28, 2022
be5e01b
Add s3:GetBucketLocation permission for Toil
adamnovak May 3, 2022
d979cac
Delete IAM actions that do not exist according to the console
adamnovak May 3, 2022
c017154
docs: Incorporate README fixes from 26dc5add
adamnovak May 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions examples/demo-cwl-project/agc-project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: CWLDemo
schemaVersion: 1
workflows:
hello:
type:
language: cwl
version: v1.2
sourceURL: workflows/hello/hello.cwl
nontrivial:
type:
language: cwl
version: v1.2
sourceURL: workflows/nontrivial
manyjobs:
type:
language: cwl
version: v1.2
sourceURL: workflows/manyjobs
contexts:
myContext:
engines:
- type: cwl
engine: toil

spotCtx:
requestSpotInstances: true
engines:
- type: cwl
engine: toil
15 changes: 15 additions & 0 deletions examples/demo-cwl-project/workflows/hello/hello.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cwlVersion: v1.0
class: CommandLineTool
baseCommand: echo
stdout: output.txt
inputs:
- id: message
type: string
default: "Hello world!"
inputBinding:
position: 1
outputs:
- id: output
type: File
outputBinding:
glob: output.txt
7 changes: 7 additions & 0 deletions examples/demo-cwl-project/workflows/manyjobs/MANIFEST.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"mainWorkflowURL": "manyjobs.cwl",
"inputFileURLs": [
"inputs.json"
],
"optionsFileURL": "options.json"
}
18 changes: 18 additions & 0 deletions examples/demo-cwl-project/workflows/manyjobs/compress-file.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env cwl-runner
cwlVersion: v1.2
class: CommandLineTool
baseCommand: ["-9", "-p", "8", "-c"]
hints:
DockerRequirement:
dockerPull: bytesco/pigz
ResourceRequirement:
coresMin: 8
inputs:
input_file:
type: File
inputBinding:
position: 1
outputs:
compressed_file:
type: stdout
stdout: compressed.gz
14 changes: 14 additions & 0 deletions examples/demo-cwl-project/workflows/manyjobs/concatenate-files.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cwlVersion: v1.2
class: CommandLineTool
baseCommand: cat
inputs:
files:
type: File[]
inputBinding:
position: 1

outputs:
concatenated_file:
type: stdout

stdout: concatenated.txt
4 changes: 4 additions & 0 deletions examples/demo-cwl-project/workflows/manyjobs/inputs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"script_file": {"class": "File", "path": "make-a-little-data.js"},
"script_argument_count": 1000
}
4 changes: 4 additions & 0 deletions examples/demo-cwl-project/workflows/manyjobs/inputs.tiny.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"script_file": {"class": "File", "path": "make-a-little-data.js"},
"script_argument_count": 2
}
21 changes: 21 additions & 0 deletions examples/demo-cwl-project/workflows/manyjobs/make-a-little-data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const crypto = require('crypto')
if (process.argv.length > 2) {
let arg = process.argv[2]
console.log("Argument is: " + arg)

let hashes = [arg]

for (let i = 10; i >= 0; i--) {
console.log(i + " bottles of " + arg + " on the wall...")
hasher = crypto.createHash('sha512')
for (let h of hashes) {
hasher.update(h)
}
hashes.push(hasher.digest('hex'))
}

console.log("After meditating on the nature of " + arg + ", it turns out to be " + hashes[hashes.length - 1])

} else {
console.log("Didn't get an argument")
}
13 changes: 13 additions & 0 deletions examples/demo-cwl-project/workflows/manyjobs/make-array.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env cwl-runner
cwlVersion: v1.2
class: ExpressionTool
requirements:
InlineJavascriptRequirement: {}
inputs:
size:
type: int
outputs:
array:
type: string[]
expression: "$({array: function(){var arr = []; for (var i = 0; i < inputs.size; i++) {arr.push('' + i)}; return arr;}()})"

52 changes: 52 additions & 0 deletions examples/demo-cwl-project/workflows/manyjobs/manyjobs.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
cwlVersion: v1.2
class: Workflow

requirements:
SubworkflowFeatureRequirement: {}
ScatterFeatureRequirement: {}

inputs:
- id: script_file
type: File
- id: script_argument_count
type: int

steps:
make_array:
run: make-array.cwl
in:
size: script_argument_count
out: [array]

scripts:
run: run-script.cwl
scatter: arg
in:
src: script_file
arg: make_array/array
out: [script_output]

sort:
run: sort-file.cwl
scatter: input_file
in:
input_file: scripts/script_output
out: [sorted_file]

concat:
run: concatenate-files.cwl
in:
files: sort/sorted_file
out:
[concatenated_file]

compress:
run: compress-file.cwl
in:
input_file: concat/concatenated_file
out: [compressed_file]

outputs:
- id: output
type: File
outputSource: compress/compressed_file
1 change: 1 addition & 0 deletions examples/demo-cwl-project/workflows/manyjobs/options.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
24 changes: 24 additions & 0 deletions examples/demo-cwl-project/workflows/manyjobs/run-script.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env cwl-runner
# Modified from the CWL docs
cwlVersion: v1.2
class: CommandLineTool
baseCommand: node
hints:
DockerRequirement:
dockerPull: node:slim
ResourceRequirement:
coresMax: 1
ramMin: 2000
inputs:
src:
type: File
inputBinding:
position: 1
arg:
type: string
inputBinding:
position: 2
outputs:
script_output:
type: stdout
stdout: output.txt
19 changes: 19 additions & 0 deletions examples/demo-cwl-project/workflows/manyjobs/sort-file.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env cwl-runner
cwlVersion: v1.2
class: CommandLineTool
baseCommand: ["sort"]
requirements:
InlineJavascriptRequirement: {}
hints:
ResourceRequirement:
coresMax: 1
outdirMin: $(parseInt(Math.ceil(inputs.input_file.size / Math.pow(2, 20))))
inputs:
input_file:
type: File
inputBinding:
position: 1
outputs:
sorted_file:
type: stdout
stdout: sorted.txt
7 changes: 7 additions & 0 deletions examples/demo-cwl-project/workflows/nontrivial/MANIFEST.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"mainWorkflowURL": "nontrivial.cwl",
"inputFileURLs": [
"inputs.json"
],
"optionsFileURL": "options.json"
}
18 changes: 18 additions & 0 deletions examples/demo-cwl-project/workflows/nontrivial/compress-file.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env cwl-runner
cwlVersion: v1.2
class: CommandLineTool
baseCommand: ["-9", "-p", "8", "-c"]
hints:
DockerRequirement:
dockerPull: bytesco/pigz
ResourceRequirement:
coresMin: 8
inputs:
input_file:
type: File
inputBinding:
position: 1
outputs:
compressed_file:
type: stdout
stdout: compressed.gz
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cwlVersion: v1.2
class: CommandLineTool
baseCommand: cat
inputs:
files:
type: File[]
inputBinding:
position: 1

outputs:
concatenated_file:
type: stdout

stdout: concatenated.txt
7 changes: 7 additions & 0 deletions examples/demo-cwl-project/workflows/nontrivial/inputs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"script_file": {"class": "File", "path": "make-data.js"},
"script_arguments": [
"A", "B", "C", "D", "E", "F", "G",
"cats", "pigs", "dogs", "space weasles", "snacks"
]
}
21 changes: 21 additions & 0 deletions examples/demo-cwl-project/workflows/nontrivial/make-data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const crypto = require('crypto')
if (process.argv.length > 2) {
let arg = process.argv[2]
console.log("Argument is: " + arg)

let hashes = [arg]

for (let i = 10000; i >= 0; i--) {
console.log(i + " bottles of " + arg + " on the wall...")
hasher = crypto.createHash('sha512')
for (let h of hashes) {
hasher.update(h)
}
hashes.push(hasher.digest('hex'))
}

console.log("After meditating on the nature of " + arg + ", it turns out to be " + hashes[hashes.length - 1])

} else {
console.log("Didn't get an argument")
}
46 changes: 46 additions & 0 deletions examples/demo-cwl-project/workflows/nontrivial/nontrivial.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
cwlVersion: v1.2
class: Workflow

requirements:
SubworkflowFeatureRequirement: {}
ScatterFeatureRequirement: {}

inputs:
- id: script_file
type: File
- id: script_arguments
type: string[]

steps:
scripts:
run: run-script.cwl
scatter: arg
in:
src: script_file
arg: script_arguments
out: [script_output]

sort:
run: sort-file.cwl
scatter: input_file
in:
input_file: scripts/script_output
out: [sorted_file]

concat:
run: concatenate-files.cwl
in:
files: sort/sorted_file
out:
[concatenated_file]

compress:
run: compress-file.cwl
in:
input_file: concat/concatenated_file
out: [compressed_file]

outputs:
- id: output
type: File
outputSource: compress/compressed_file
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
24 changes: 24 additions & 0 deletions examples/demo-cwl-project/workflows/nontrivial/run-script.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env cwl-runner
# Modified from the CWL docs
cwlVersion: v1.2
class: CommandLineTool
baseCommand: node
hints:
DockerRequirement:
dockerPull: node:slim
ResourceRequirement:
coresMax: 1
ramMin: 2000
inputs:
src:
type: File
inputBinding:
position: 1
arg:
type: string
inputBinding:
position: 2
outputs:
script_output:
type: stdout
stdout: output.txt
Loading