From e286f029b2f1b9074830d578eb078efb380b4f2b Mon Sep 17 00:00:00 2001 From: Edmore Moyo Date: Tue, 15 Apr 2025 16:56:30 -0400 Subject: [PATCH 1/4] initial changes --- .gitignore | 3 ++- job.yml | 11 +++++++++++ main.cwl | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 job.yml create mode 100644 main.cwl diff --git a/.gitignore b/.gitignore index 6320cd2..7106392 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -data \ No newline at end of file +data +.DS_Store diff --git a/job.yml b/job.yml new file mode 100644 index 0000000..079de1f --- /dev/null +++ b/job.yml @@ -0,0 +1,11 @@ +script: + class: File + path: ./main.py + +input_dir: + class: Directory + path: ./data/input + +output_dir: + class: Directory + path: ./data/output diff --git a/main.cwl b/main.cwl new file mode 100644 index 0000000..fb915a8 --- /dev/null +++ b/main.cwl @@ -0,0 +1,36 @@ +cwlVersion: v1.2 +class: CommandLineTool + +baseCommand: ["python", "main.py"] + +requirements: + DockerRequirement: + dockerPull: python:3.11 + InitialWorkDirRequirement: + listing: + - entryname: main.py + entry: $(inputs.script) + +inputs: + script: + type: File + inputBinding: {} + doc: "The main Python script" + + input_dir: + type: Directory + inputBinding: + prefix: "data/input" + separate: false + + output_dir: + type: Directory + inputBinding: + prefix: "data/output" + separate: false + +outputs: + output_data: + type: Directory + outputBinding: + glob: data/output From 12fa41fdef48badd20219d9b078ce68d207c19a0 Mon Sep 17 00:00:00 2001 From: Edmore Moyo Date: Tue, 15 Apr 2025 19:15:06 -0400 Subject: [PATCH 2/4] refactors --- .gitignore | 1 + job.yml | 10 +++------- main.cwl | 26 +++++++++++++------------- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 7106392..044922b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ data .DS_Store +output/* diff --git a/job.yml b/job.yml index 079de1f..d336d6b 100644 --- a/job.yml +++ b/job.yml @@ -1,11 +1,7 @@ +# job.yml script: class: File - path: ./main.py - + path: main.py input_dir: class: Directory - path: ./data/input - -output_dir: - class: Directory - path: ./data/output + path: data/input \ No newline at end of file diff --git a/main.cwl b/main.cwl index fb915a8..451b5ed 100644 --- a/main.cwl +++ b/main.cwl @@ -1,36 +1,36 @@ cwlVersion: v1.2 class: CommandLineTool -baseCommand: ["python", "main.py"] +baseCommand: ["python3.13", "main.py"] requirements: DockerRequirement: - dockerPull: python:3.11 + dockerPull: python:3.13.1 InitialWorkDirRequirement: listing: - entryname: main.py entry: $(inputs.script) + - entryname: data/input + entry: $(inputs.input_dir) + - entryname: data/output + entry: "$(null)" + writable: true + EnvVarRequirement: + envDef: + INPUT_DIR: "data/input" + OUTPUT_DIR: "data/output" inputs: script: type: File - inputBinding: {} doc: "The main Python script" input_dir: type: Directory - inputBinding: - prefix: "data/input" - separate: false - - output_dir: - type: Directory - inputBinding: - prefix: "data/output" - separate: false + doc: "Input directory" outputs: output_data: type: Directory outputBinding: - glob: data/output + glob: data/output \ No newline at end of file From 67e9d117c55bde1085d5f049c9e4ef7740eade65 Mon Sep 17 00:00:00 2001 From: Edmore Moyo Date: Wed, 16 Apr 2025 13:45:03 -0400 Subject: [PATCH 3/4] update to use pre-built docker image --- main.cwl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/main.cwl b/main.cwl index 451b5ed..8882716 100644 --- a/main.cwl +++ b/main.cwl @@ -1,11 +1,9 @@ cwlVersion: v1.2 class: CommandLineTool -baseCommand: ["python3.13", "main.py"] - requirements: DockerRequirement: - dockerPull: python:3.13.1 + dockerPull: hackathon/python InitialWorkDirRequirement: listing: - entryname: main.py @@ -30,7 +28,7 @@ inputs: doc: "Input directory" outputs: - output_data: + output_dir: type: Directory outputBinding: glob: data/output \ No newline at end of file From 7e00988d900b74a78ce7a956ff2075400abe4237 Mon Sep 17 00:00:00 2001 From: Edmore Moyo Date: Wed, 16 Apr 2025 13:46:21 -0400 Subject: [PATCH 4/4] updates docs --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index cad16e8..c143d7d 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,7 @@ To test, create `input` and `output` subfolders in the `data` directory. Create Re-Run: `docker-compose up --build` The testfile should be copied to the `data/output` directory. + +To run cwl file: + +`cwltool --outdir=data main.cwl job.yml`