Skip to content

Commit

Permalink
Added cwl workflow config
Browse files Browse the repository at this point in the history
  • Loading branch information
bherr2 committed May 17, 2023
1 parent 582c99c commit 38e1e69
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ RUN apt-get update && \

COPY scripts scripts
COPY schemas schemas
COPY requirements.txt package.json package-lock.json .
COPY requirements.txt package.json package-lock.json /build/

RUN /bin/bash /build/scripts/setup-environment.sh /venv
RUN ./scripts/setup-environment.sh /venv

ENV PATH="/venv/bin:$PATH"

Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ You can also use the docker-compose.yaml file as an example if you want to run i

`docker compose run do-processor help`

# Running with CWL

## CWL Setup Requirements

You will need to install a Python 3 and Docker (or other container system supported by CWL) and a cwl runner. The default cwl runner can be installed with Python 3's pip module like so:

`python3 -m pip cwltool cwl-runner`

## Running the DO Processor with CWL

`cwl-runner hra-do-processor.cwl example-cwl-job.yaml`

# Running Locally

## Local Setup Requirements
Expand Down
9 changes: 9 additions & 0 deletions example-cwl-job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
do_home:
class: Directory
path: ./digital-objects
deploy_home:
class: Directory
path: ./dist
arguments:
- list
- --help
44 changes: 44 additions & 0 deletions hra-do-processor.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env cwl-runner

cwlVersion: v1.0
class: CommandLineTool

requirements:
DockerRequirement:
dockerPull: hra-do-processor:latest
dockerOutputDirectory: /output
EnvVarRequirement:
envDef:
DO_HOME: /output/digital-objects
DEPLOY_HOME: /output/dist
InitialWorkDirRequirement:
listing:
- entryname: digital-objects
writable: true
entry: $(inputs.do_home)
- entryname: dist
writable: true
entry: $(inputs.deploy_home)

inputs:
do_home:
type: Directory
deploy_home:
type: Directory
arguments:
type: string[]
inputBinding:
position: 1

outputs:
do_home:
type: Directory
outputBinding:
glob: digital-objects
deploy_home:
type: Directory
outputBinding:
glob: dist
output:
type: stdout
stdout: output.txt

0 comments on commit 38e1e69

Please sign in to comment.