diff --git a/gatk4-mutect2-tumor-only-cwl/Dockerfile b/gatk4-mutect2-tumor-only-cwl/Dockerfile index 79ca5ba..e8cb297 100644 --- a/gatk4-mutect2-tumor-only-cwl/Dockerfile +++ b/gatk4-mutect2-tumor-only-cwl/Dockerfile @@ -1,17 +1,24 @@ -FROM quay.io/ncigdc/bio-alpine:py36-8dee591 +ARG REGISTRY=docker.osdc.io +FROM ${REGISTRY}/ncigdc/bio-alpine:cwltool3 as builder ARG WORKFLOW -COPY ./${WORKFLOW} /opt -# TODO: Copy additional directories as needed +COPY ./${WORKFLOW} /opt COPY ./tools /tools -COPY ./utils-cwl /utils-cwl COPY ./subworkflows /subworkflows +COPY ./utils-cwl /utils-cwl + +WORKDIR /opt + +RUN just validate && just pack + +FROM ${REGISTRY}/ncigdc/bio-alpine:just -RUN make -C /opt init-pip +COPY --from=builder /opt/cwl.json /opt/cwl.json +COPY --from=builder /opt/justfile /opt/justfile WORKDIR /opt -ENTRYPOINT ["make"] +ENTRYPOINT ["just"] -CMD ["pack"] \ No newline at end of file +CMD ["_print-cwl"] diff --git a/gatk4-mutect2-tumor-only-cwl/dockers.json b/gatk4-mutect2-tumor-only-cwl/dockers.json new file mode 100644 index 0000000..bd5f7c8 --- /dev/null +++ b/gatk4-mutect2-tumor-only-cwl/dockers.json @@ -0,0 +1,3 @@ +{ + "docker_repository": "docker.osdc.io/ncigdc" +} diff --git a/gatk4-mutect2-tumor-only-cwl/justfile b/gatk4-mutect2-tumor-only-cwl/justfile new file mode 100644 index 0000000..3ac1400 --- /dev/null +++ b/gatk4-mutect2-tumor-only-cwl/justfile @@ -0,0 +1,50 @@ +ENTRY_CWL := "gpas_gatk4.2.4.1_mutect2_tumor_only_workflow.cwl" + +# Pack and apply Jinja templating. Creates cwl.json file +# Should be runnable in built docker container +pack: + #!/bin/sh + if [ ! -f cwl.json ]; then + just _validate_entry + just _cwltool-pack > tmp.json + just _jinja tmp.json > cwl.json + rm tmp.json + fi + just _print-cwl + +# Ensures CWL entrypoint script exists +_validate_entry: + #!/bin/sh + if [ ! -f {{ENTRY_CWL}} ]; then + echo "No entry CWL file found!" + echo {{ENTRY_CWL}} + exit 1; + fi + +# Prints cwl.json if exists +_print-cwl: + @cat cwl.json + +# Packs CWL workflow into single json file +_cwltool-pack: _validate_entry + python3 -m cwltool --pack {{ENTRY_CWL}} + +# Apply template to JSON from dockers.json, errors on missing keys +_jinja JSON: + jinja -u 'strict' -d dockers.json {{JSON}} + +# Validates CWL workflow +validate: _validate_entry + python3 -m cwltool --validate {{ENTRY_CWL}} + +# Formats and prints all Dockers used in workflow +get-dockers: + just pack | grep dockerPull | cut -f2- -d ":" | sort | uniq | sed "s/\"//g" + +# Prints all dockerPull declarations in unformatted workflow +get-dockers-template: + just _cwltool-pack | grep dockerPull | cut -f2- -d ":" | sort | uniq | sed "s/\"//g" + +# Print template input file for workflow +inputs: + python3 -m cwltool --make-template {{ENTRY_CWL}} diff --git a/gatk4-pon-cwl/Dockerfile b/gatk4-pon-cwl/Dockerfile index 79ca5ba..e8cb297 100644 --- a/gatk4-pon-cwl/Dockerfile +++ b/gatk4-pon-cwl/Dockerfile @@ -1,17 +1,24 @@ -FROM quay.io/ncigdc/bio-alpine:py36-8dee591 +ARG REGISTRY=docker.osdc.io +FROM ${REGISTRY}/ncigdc/bio-alpine:cwltool3 as builder ARG WORKFLOW -COPY ./${WORKFLOW} /opt -# TODO: Copy additional directories as needed +COPY ./${WORKFLOW} /opt COPY ./tools /tools -COPY ./utils-cwl /utils-cwl COPY ./subworkflows /subworkflows +COPY ./utils-cwl /utils-cwl + +WORKDIR /opt + +RUN just validate && just pack + +FROM ${REGISTRY}/ncigdc/bio-alpine:just -RUN make -C /opt init-pip +COPY --from=builder /opt/cwl.json /opt/cwl.json +COPY --from=builder /opt/justfile /opt/justfile WORKDIR /opt -ENTRYPOINT ["make"] +ENTRYPOINT ["just"] -CMD ["pack"] \ No newline at end of file +CMD ["_print-cwl"] diff --git a/gatk4-pon-cwl/dockers.json b/gatk4-pon-cwl/dockers.json new file mode 100644 index 0000000..bd5f7c8 --- /dev/null +++ b/gatk4-pon-cwl/dockers.json @@ -0,0 +1,3 @@ +{ + "docker_repository": "docker.osdc.io/ncigdc" +} diff --git a/gatk4-pon-cwl/justfile b/gatk4-pon-cwl/justfile new file mode 100644 index 0000000..1accc46 --- /dev/null +++ b/gatk4-pon-cwl/justfile @@ -0,0 +1,50 @@ +ENTRY_CWL := "gpas_gatk4.2.4.1_mutect2_pon_workflow.cwl" + +# Pack and apply Jinja templating. Creates cwl.json file +# Should be runnable in built docker container +pack: + #!/bin/sh + if [ ! -f cwl.json ]; then + just _validate_entry + just _cwltool-pack > tmp.json + just _jinja tmp.json > cwl.json + rm tmp.json + fi + just _print-cwl + +# Ensures CWL entrypoint script exists +_validate_entry: + #!/bin/sh + if [ ! -f {{ENTRY_CWL}} ]; then + echo "No entry CWL file found!" + echo {{ENTRY_CWL}} + exit 1; + fi + +# Prints cwl.json if exists +_print-cwl: + @cat cwl.json + +# Packs CWL workflow into single json file +_cwltool-pack: _validate_entry + python3 -m cwltool --pack {{ENTRY_CWL}} + +# Apply template to JSON from dockers.json, errors on missing keys +_jinja JSON: + jinja -u 'strict' -d dockers.json {{JSON}} + +# Validates CWL workflow +validate: _validate_entry + python3 -m cwltool --validate {{ENTRY_CWL}} + +# Formats and prints all Dockers used in workflow +get-dockers: + just pack | grep dockerPull | cut -f2- -d ":" | sort | uniq | sed "s/\"//g" + +# Prints all dockerPull declarations in unformatted workflow +get-dockers-template: + just _cwltool-pack | grep dockerPull | cut -f2- -d ":" | sort | uniq | sed "s/\"//g" + +# Print template input file for workflow +inputs: + python3 -m cwltool --make-template {{ENTRY_CWL}}