Skip to content

Commit 78aeed2

Browse files
committed
Record used_artifacts before relativize job
1 parent 79fef7d commit 78aeed2

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

cwltool/provenance.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -472,13 +472,15 @@ def copy_job_order(job, job_order_object):
472472
process_run_id = None
473473
research_obj = runtimeContext.research_obj
474474
assert research_obj is not None
475+
research_obj.make_fs_access = make_fs_access
475476
if not hasattr(process, "steps"):
476477
# record provenance of an independent commandline tool execution
477478
self.prospective_prov(job)
478479
customised_job = copy_job_order(job, job_order_object)
480+
self.used_artefacts(customised_job, self.workflow_run_uri)
479481
inputs = research_obj.create_job(
480-
customised_job, make_fs_access)
481-
self.used_artefacts(inputs, self.workflow_run_uri)
482+
customised_job)
483+
#self.used_artefacts(inputs, self.workflow_run_uri)
482484
name = ""
483485
if hasattr(job, "name"):
484486
name = str(job.name)
@@ -487,9 +489,10 @@ def copy_job_order(job, job_order_object):
487489
elif hasattr(job, "workflow"): # record provenance for the workflow execution
488490
self.prospective_prov(job)
489491
customised_job = copy_job_order(job, job_order_object)
492+
self.used_artefacts(customised_job, self.workflow_run_uri)
490493
inputs = research_obj.create_job(
491-
customised_job, make_fs_access)
492-
self.used_artefacts(inputs, self.workflow_run_uri)
494+
customised_job)
495+
#self.used_artefacts(inputs, self.workflow_run_uri)
493496
else: # in case of commandline tool execution as part of workflow
494497
name = ""
495498
if hasattr(job, "name"):
@@ -1524,15 +1527,13 @@ def _add_to_bagit(self, rel_path, **checksums):
15241527

15251528
def create_job(self,
15261529
job, # type: Dict
1527-
make_fs_access, # type: Callable[[Text], StdFsAccess]
15281530
): # type: (...) -> Dict
15291531
#TODO customise the file
15301532
'''
15311533
This function takes the dictionary input object and generates
15321534
a json file containing the relative paths and link to the associated
15331535
cwl document
15341536
'''
1535-
self.make_fs_access = make_fs_access
15361537
relativised_input_objecttemp = {} # type: Dict[Any,Any]
15371538
self._relativise_files(job)
15381539

@@ -1572,8 +1573,8 @@ def _relativise_files(self, structure):
15721573
with fsaccess.open(structure["location"], "rb") as relative_file:
15731574
relative_path = self.add_data_file(relative_file)
15741575
ref_location = structure["location"]
1575-
## FIXME: This might break something else
1576-
##structure["location"] = "../"+relative_path
1576+
## FIXME: might this break something else while running wf?
1577+
structure["location"] = "../"+relative_path
15771578
if "path" in structure:
15781579
del structure["path"]
15791580
if "checksum" not in structure:

0 commit comments

Comments
 (0)