diff --git a/Dockstore.cwl b/Dockstore.cwl index 1495fb3..badc455 100644 --- a/Dockstore.cwl +++ b/Dockstore.cwl @@ -24,7 +24,8 @@ dct:creator: requirements: - class: DockerRequirement - dockerPull: "quay.io/ucsc_cgl/dockstore-tool-runner:1.0.16" + dockerPull: "quay.io/ucsc_cgl/dockstore-tool-runner:1.0.17" + hints: - class: ResourceRequirement coresMin: 1 @@ -75,6 +76,12 @@ inputs: inputBinding: prefix: --workflow-type + launch_type: + type: string? + doc: "String that describes the launch type: tool or workflow" + inputBinding: + prefix: --launch-type + parent_uuids: type: string doc: "UUIDs for parent" diff --git a/DockstoreRunner.py b/DockstoreRunner.py index 6fa3bfa..1c9dea5 100644 --- a/DockstoreRunner.py +++ b/DockstoreRunner.py @@ -53,6 +53,9 @@ def __init__(self): parser.add_argument('--json-encoded', default='e30=', required=True) parser.add_argument('--docker-uri', default='quay.io/wshands/fastqc:latest', required=True) parser.add_argument('--dockstore-url', default='https://dockstore.org/containers/quay.io/wshands/fastqc', required=True) + parser.add_argument('--launch-type', default='tool', const='tool', nargs='?', + choices=['tool', 'workflow'], required=False, + help='run a workflow or tool (default: %(default)s)') parser.add_argument('--workflow-type', default='sequence_upload_qc_report', required=True) parser.add_argument('--parent-uuids', default='parent-UUID-dummy-value', required=True) # FIXME: this append seems to crash on the mac but it would be the way to go if we want multiple parents @@ -84,6 +87,7 @@ def __init__(self): self.dockstore_url = args.dockstore_url self.workflow_name = args.docker_uri.split(':')[0] self.workflow_version = args.docker_uri.split(':')[1] + self.launch_type = args.launch_type self.workflow_type = args.workflow_type self.parent_uuids = args.parent_uuids self.bundle_uuid = uuid4() @@ -447,7 +451,7 @@ def run(self): self.run_command(cmd, self.MAX_ATTEMPTS, self.DELAY_IN_SECONDS, True) print("Calling Dockstore to launch a Dockstore tool") - cmd = "dockstore tool launch --debug --entry "+self.docker_uri+" --json "+transformed_json_path + cmd = "dockstore " + self.launch_type + " launch --debug --entry "+self.docker_uri+" --json "+transformed_json_path self.run_command(cmd, self.MAX_PIPELINE_ATTEMPTS, self.DELAY_IN_SECONDS, cwd=self.tmp_dir) t_end = time.time() diff --git a/README.md b/README.md index 4cffb49..a21dc59 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ Most people, other than developers of this tool, will use the Dockstore CLI to i # patch in /usr/local/lib/python2.7/dist-packages/cwltool # make a tmpdir like /datastore - docker build -t quay.io/ucsc_cgl/dockstore-tool-runner:1.0.16 . + docker build -t quay.io/ucsc_cgl/dockstore-tool-runner:1.0.17 . # fill in your JSON from Dockstore.json template as Dockstore.my.json mkdir /datastore; chown ubuntu:ubuntu /datastore/ # local execution @@ -107,7 +107,7 @@ Most people, other than developers of this tool, will use the Dockstore CLI to i # as root in /datastore TMPDIR=/datastore dockstore tool launch --entry ~ubuntu/gitroot/BD2KGenomics/dcc-dockstore-tool-runner/Dockstore.cwl --local-entry --json ~ubuntu/gitroot/BD2KGenomics/dcc-dockstore-tool-runner/Dockstore.my.json # execute published on dockstore (this is the way most people will use this tool!) - dockstore tool launch --entry quay.io/ucsc_cgl/dockstore-tool-runner:1.0.16 --json Dockstore.my.json + dockstore tool launch --entry quay.io/ucsc_cgl/dockstore-tool-runner:1.0.17 --json Dockstore.my.json # running you see it launch the cwltool command, you mind find this useful while debugging cwltool --enable-dev --non-strict --enable-net --outdir /datastore/./datastore/launcher-ff6b55b3-52e8-430c-9a70-1ff295332698/outputs/ --tmpdir-prefix /datastore/./datastore/launcher-ff6b55b3-52e8-430c-9a70-1ff295332698/working/ /home/ubuntu/gitroot/BD2KGenomics/dcc-dockstore-tool-runner/Dockstore.cwl /datastore/./datastore/launcher-ff6b55b3-52e8-430c-9a70-1ff295332698/workflow_params.json