From 9ed717773534b26d37e9eb9ea6869272a8d92700 Mon Sep 17 00:00:00 2001 From: Daniel Loos Date: Wed, 4 Dec 2024 15:38:08 +0100 Subject: [PATCH] Add ogc-app-cwl --- ogc-app-cwl/Dockerfile | 4 +++ ogc-app-cwl/example.cwl | 74 +++++++++++++++++++++++++++++++++++++++++ ogc-app-cwl/run.jl | 1 + ogc-app-cwl/run.sh | 5 +++ 4 files changed, 84 insertions(+) create mode 100644 ogc-app-cwl/Dockerfile create mode 100644 ogc-app-cwl/example.cwl create mode 100755 ogc-app-cwl/run.jl create mode 100755 ogc-app-cwl/run.sh diff --git a/ogc-app-cwl/Dockerfile b/ogc-app-cwl/Dockerfile new file mode 100644 index 0000000..7eb4e55 --- /dev/null +++ b/ogc-app-cwl/Dockerfile @@ -0,0 +1,4 @@ +FROM julia:1.10 +WORKDIR /work +ADD run.jl ./ +ENTRYPOINT ["/work/run.jl"] diff --git a/ogc-app-cwl/example.cwl b/ogc-app-cwl/example.cwl new file mode 100644 index 0000000..d260085 --- /dev/null +++ b/ogc-app-cwl/example.cwl @@ -0,0 +1,74 @@ +#!/usr/bin/env cwl-runner + +$graph: +- class: Workflow + label: add numbers + doc: Example workflow adding two numbers in Julia + + inputs: + a: + label: a + doc: The first summand + type: double + b: + label: b + doc: The second summand + type: double + + outputs: + c: + doc: the sum of the two numbers + type: double + outputSource: add/c + + steps: + add: + in: + a: a + b: b + run: '#cmd-add' + out: + - c + id: add-numbers +- class: CommandLineTool + + requirements: + DockerRequirement: + dockerPull: danlooo/cwl-example:latest + InlineJavascriptRequirement: {} + + inputs: + a: + type: double + inputBinding: + position: 1 + b: + type: double + inputBinding: + position: 2 + + outputs: + c: + type: double + outputBinding: + glob: stdout.txt + outputEval: $(parseFloat(self[0].contents)) + loadContents: true + stdout: stdout.txt + id: cmd-add +$namespaces: + edam: http://edamontology.org/ + s: https://schema.org/ +$schemas: +- https://schema.org/version/latest/schemaorg-current-https.rdf +- http://edamontology.org/EDAM_1.18.owl +cwlVersion: v1.2 +s:author: +- class: s:Person + s:email: fairsendd@bgc-jena.mpg.de + s:identifier: https://orcid.org/0000-0002-4024-4443 + s:name: Daniel Loos +s:citation: https://dx.doi.org/10.6084/m9.figshare.3115156.v2 +s:codeRepository: https://github.com/EarthyScience/FAIRSenDD/ +s:dateCreated: '2024-10-28' +s:license: https://spdx.org/licenses/Apache-2.0 diff --git a/ogc-app-cwl/run.jl b/ogc-app-cwl/run.jl new file mode 100755 index 0000000..717042f --- /dev/null +++ b/ogc-app-cwl/run.jl @@ -0,0 +1 @@ +#! /usr/bin/env julia \ No newline at end of file diff --git a/ogc-app-cwl/run.sh b/ogc-app-cwl/run.sh new file mode 100755 index 0000000..27d19f5 --- /dev/null +++ b/ogc-app-cwl/run.sh @@ -0,0 +1,5 @@ +#! /usr/bin/env sh + +docker build . -t danlooo/cwl-example +docker push danlooo/cwl-example +cwltool example.cwl#add-numbers -a 1.2 -b 3.4 \ No newline at end of file