Skip to content

Commit

Permalink
Add ogc-app-cwl
Browse files Browse the repository at this point in the history
  • Loading branch information
danlooo committed Dec 4, 2024
1 parent d200663 commit 9ed7177
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ogc-app-cwl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM julia:1.10
WORKDIR /work
ADD run.jl ./
ENTRYPOINT ["/work/run.jl"]
74 changes: 74 additions & 0 deletions ogc-app-cwl/example.cwl
Original file line number Diff line number Diff line change
@@ -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: [email protected]
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
1 change: 1 addition & 0 deletions ogc-app-cwl/run.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#! /usr/bin/env julia
5 changes: 5 additions & 0 deletions ogc-app-cwl/run.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9ed7177

Please sign in to comment.