diff --git a/README.md b/README.md index 383cafe..ea18d2f 100644 --- a/README.md +++ b/README.md @@ -10,15 +10,21 @@ All that's required for execution using our Docker-based setup is `Docker` with ## Building the Docker container -If you are not using a pre-built container run: +If you want to use a pre-built container run: + +`docker pull ghcr.io/hubmapconsortium/hra-do-processor:main` + +if you are not using a pre-built container run: `docker build . -t hra-do-processor` ## Running the Docker container -To run the container, use the following command: +To run using a pre-built container, use the following command: + +`docker run --mount type=bind,source=./digital-objects,target=/digital-objects --mount type=bind,source=./dist,target=/dist -t ghcr.io/hubmapconsortium/hra-do-processor:main help` -`docker run --mount type=bind,source=./digital-objects,target=/digital-objects --mount type=bind,source=./dist,target=/dist -t hra-do-processor:latest help` +If you are using a locally built container, replace `ghcr.io/hubmapconsortium/hra-do-processor:main` with `hra-do-processor:latest`. Replace `./digital-objects` and `./dist` with paths to your own `digital-objects` and `dist` folders if not the same. @@ -36,7 +42,13 @@ You will need to install a Python 3 and Docker (or other container system suppor ## Running the DO Processor with CWL -`cwl-runner hra-do-processor.cwl example-cwl-job.yaml` +For running with a pre-built container (no git checkout required), use this command: + +`cwl-runner https://raw.githubusercontent.com/hubmapconsortium/hra-do-processor/main/do-processor.cwl example-cwl-job.yaml` + +For running with a local container, use this command: + +`cwl-runner do-processor.local.cwl example-cwl-job.yaml` # Running Locally diff --git a/do-processor.cwl b/do-processor.cwl new file mode 100755 index 0000000..dee8e86 --- /dev/null +++ b/do-processor.cwl @@ -0,0 +1,44 @@ +#!/usr/bin/env cwl-runner + +cwlVersion: v1.0 +class: CommandLineTool + +requirements: + DockerRequirement: + dockerPull: ghcr.io/hubmapconsortium/hra-do-processor:main + 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 diff --git a/hra-do-processor.cwl b/do-processor.local.cwl similarity index 100% rename from hra-do-processor.cwl rename to do-processor.local.cwl diff --git a/docker-compose.yaml b/docker-compose.yaml index 7fe73db..229e61a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,7 +1,9 @@ version: '3.9' services: do-processor: - image: hra-do-processor:latest + # image: ghcr.io/hubmapconsortium/hra-do-processor:main # uncomment if using the pre-built container + # image: hra-do-processor # uncomment if using a locally built container + build: . # uncomment to build locally on the fly volumes: - type: bind source: ./digital-objects