Skip to content

Commit 3eec3bb

Browse files
authored
Merge pull request #70 from simleo/output_encoding_format
Convert encoding format for output files
2 parents 3cf875e + 60689aa commit 3eec3bb

21 files changed

+965
-945
lines changed

cwl/grepsort/grepsort.cwl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ inputs:
1919
outputs:
2020
grepsort_out:
2121
type: File
22+
format: "https://www.iana.org/assignments/media-types/text/plain"
2223
outputSource: sorted/sort_out
2324

2425
steps:

cwl/grepsort/sorttool.cwl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ inputs:
2020
outputs:
2121
sort_out:
2222
type: File
23+
format: "https://www.iana.org/assignments/media-types/text/plain"
2324
outputBinding:
2425
glob: sort_out.txt
2526
stdout: sort_out.txt

src/runcrate/convert.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
WORKFLOW_BASENAME = "packed.cwl"
4242
INPUTS_FILE_BASENAME = "primary-job.json"
43+
OUTPUTS_FILE_BASENAME = "primary-output.json"
4344
MANIFEST_FILE = "manifest-sha1.txt"
4445

4546
CWL_TYPE_MAP = {
@@ -294,6 +295,7 @@ def build(self):
294295
self.add_action(crate, self.workflow_run)
295296
self.patch_workflow_input_collection(crate)
296297
self.add_inputs_file(crate)
298+
self.add_output_formats(crate)
297299
return crate
298300

299301
def add_root_metadata(self, crate):
@@ -777,3 +779,10 @@ def add_inputs_file(self, crate):
777779
"name": "input object document",
778780
"encodingFormat": "application/json",
779781
})
782+
783+
def add_output_formats(self, crate):
784+
path = self.root / "workflow" / OUTPUTS_FILE_BASENAME
785+
if path.is_file():
786+
with open(path) as f:
787+
data = json.load(f)
788+
self._map_input_data(crate, data)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Bag-Software-Agent: cwltool 3.1.20230513155734
1+
Bag-Software-Agent: cwltool 3.1.20231020140205
22
BagIt-Profile-Identifier: https://w3id.org/ro/bagit/profile
3-
Bagging-Date: 2023-05-26
3+
Bagging-Date: 2023-11-09
44
External-Description: Research Object of CWL workflow run
5-
External-Identifier: arcp://uuid,c54a7289-731a-498b-9f08-3cc2bb801ba1/
5+
External-Identifier: arcp://uuid,8b3eb82c-de04-4dd0-b519-0354c0ce7cf5/
66
Payload-Oxum: 192.4
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[2023-11-09T13:19:38,436.000000Z] [cwltool] /home/simleo/git/runcrate/venv/bin/cwltool --provenance ro grepsort.cwl params.yml
2+
[2023-11-09T13:19:38,439.000000Z] Resolved 'grepsort.cwl' to 'file:///home/simleo/git/runcrate/cwl/grepsort/grepsort.cwl'
3+
[2023-11-09T13:19:38,940.000000Z] [provenance] Adding to RO file:///home/simleo/git/runcrate/cwl/grepsort/lines.txt
4+
[2023-11-09T13:19:38,940.000000Z] [provenance] Adding to RO file:///home/simleo/git/runcrate/cwl/grepsort/lines.aux
5+
[2023-11-09T13:19:38,941.000000Z] [workflow ] start
6+
[2023-11-09T13:19:38,942.000000Z] [workflow ] starting step grep
7+
[2023-11-09T13:19:38,942.000000Z] [step grep] start
8+
[2023-11-09T13:19:38,943.000000Z] [job grep] /tmp/mruwmsr2$ bash \
9+
-c \
10+
'grep -f /tmp/b6vih64i/stg5a0c19bf-8d22-4f74-b973-641b81910030/lines.aux /tmp/b6vih64i/stg5a0c19bf-8d22-4f74-b973-641b81910030/lines.txt >grep_out.txt'
11+
[2023-11-09T13:19:38,953.000000Z] [job grep] completed success
12+
[2023-11-09T13:19:38,953.000000Z] [step grep] completed success
13+
[2023-11-09T13:19:38,953.000000Z] [workflow ] starting step sorted
14+
[2023-11-09T13:19:38,953.000000Z] [step sorted] start
15+
[2023-11-09T13:19:38,954.000000Z] [job sorted] /tmp/w0c9z4je$ sort \
16+
/tmp/epamolr9/stgfc1b1b27-6041-4eb9-be0b-5ae94c510df3/grep_out.txt > /tmp/w0c9z4je/sort_out.txt
17+
[2023-11-09T13:19:38,957.000000Z] [job sorted] completed success
18+
[2023-11-09T13:19:38,957.000000Z] [step sorted] completed success
19+
[2023-11-09T13:19:38,957.000000Z] [workflow ] completed success
20+
[2023-11-09T13:19:38,987.000000Z] Final process status is success

tests/data/grepsort-run-1/metadata/logs/engine.fb8f0a7a-121b-47e1-b955-75d213864598.txt

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)