Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert encoding format for output files #70

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cwl/grepsort/grepsort.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ inputs:
outputs:
grepsort_out:
type: File
format: "https://www.iana.org/assignments/media-types/text/plain"
outputSource: sorted/sort_out

steps:
Expand Down
1 change: 1 addition & 0 deletions cwl/grepsort/sorttool.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ inputs:
outputs:
sort_out:
type: File
format: "https://www.iana.org/assignments/media-types/text/plain"
outputBinding:
glob: sort_out.txt
stdout: sort_out.txt
9 changes: 9 additions & 0 deletions src/runcrate/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

WORKFLOW_BASENAME = "packed.cwl"
INPUTS_FILE_BASENAME = "primary-job.json"
OUTPUTS_FILE_BASENAME = "primary-output.json"
MANIFEST_FILE = "manifest-sha1.txt"

CWL_TYPE_MAP = {
Expand Down Expand Up @@ -294,6 +295,7 @@ def build(self):
self.add_action(crate, self.workflow_run)
self.patch_workflow_input_collection(crate)
self.add_inputs_file(crate)
self.add_output_formats(crate)
return crate

def add_root_metadata(self, crate):
Expand Down Expand Up @@ -777,3 +779,10 @@ def add_inputs_file(self, crate):
"name": "input object document",
"encodingFormat": "application/json",
})

def add_output_formats(self, crate):
path = self.root / "workflow" / OUTPUTS_FILE_BASENAME
if path.is_file():
with open(path) as f:
data = json.load(f)
self._map_input_data(crate, data)
6 changes: 3 additions & 3 deletions tests/data/grepsort-run-1/bag-info.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Bag-Software-Agent: cwltool 3.1.20230513155734
Bag-Software-Agent: cwltool 3.1.20231020140205
BagIt-Profile-Identifier: https://w3id.org/ro/bagit/profile
Bagging-Date: 2023-05-26
Bagging-Date: 2023-11-09
External-Description: Research Object of CWL workflow run
External-Identifier: arcp://uuid,c54a7289-731a-498b-9f08-3cc2bb801ba1/
External-Identifier: arcp://uuid,8b3eb82c-de04-4dd0-b519-0354c0ce7cf5/
Payload-Oxum: 192.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[2023-11-09T13:19:38,436.000000Z] [cwltool] /home/simleo/git/runcrate/venv/bin/cwltool --provenance ro grepsort.cwl params.yml
[2023-11-09T13:19:38,439.000000Z] Resolved 'grepsort.cwl' to 'file:///home/simleo/git/runcrate/cwl/grepsort/grepsort.cwl'
[2023-11-09T13:19:38,940.000000Z] [provenance] Adding to RO file:///home/simleo/git/runcrate/cwl/grepsort/lines.txt
[2023-11-09T13:19:38,940.000000Z] [provenance] Adding to RO file:///home/simleo/git/runcrate/cwl/grepsort/lines.aux
[2023-11-09T13:19:38,941.000000Z] [workflow ] start
[2023-11-09T13:19:38,942.000000Z] [workflow ] starting step grep
[2023-11-09T13:19:38,942.000000Z] [step grep] start
[2023-11-09T13:19:38,943.000000Z] [job grep] /tmp/mruwmsr2$ bash \
-c \
'grep -f /tmp/b6vih64i/stg5a0c19bf-8d22-4f74-b973-641b81910030/lines.aux /tmp/b6vih64i/stg5a0c19bf-8d22-4f74-b973-641b81910030/lines.txt >grep_out.txt'
[2023-11-09T13:19:38,953.000000Z] [job grep] completed success
[2023-11-09T13:19:38,953.000000Z] [step grep] completed success
[2023-11-09T13:19:38,953.000000Z] [workflow ] starting step sorted
[2023-11-09T13:19:38,953.000000Z] [step sorted] start
[2023-11-09T13:19:38,954.000000Z] [job sorted] /tmp/w0c9z4je$ sort \
/tmp/epamolr9/stgfc1b1b27-6041-4eb9-be0b-5ae94c510df3/grep_out.txt > /tmp/w0c9z4je/sort_out.txt
[2023-11-09T13:19:38,957.000000Z] [job sorted] completed success
[2023-11-09T13:19:38,957.000000Z] [step sorted] completed success
[2023-11-09T13:19:38,957.000000Z] [workflow ] completed success
[2023-11-09T13:19:38,987.000000Z] Final process status is success

This file was deleted.

Loading