X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3854e6bfcd5344bce5ee0388248cb115e3c5e902..2a3daf14afb93de4d65108019a7a1d35aa1052ad:/sdk/cwl/arvados_cwl/runner.py diff --git a/sdk/cwl/arvados_cwl/runner.py b/sdk/cwl/arvados_cwl/runner.py index 3949709849..28de7f368a 100644 --- a/sdk/cwl/arvados_cwl/runner.py +++ b/sdk/cwl/arvados_cwl/runner.py @@ -191,12 +191,8 @@ def tag_git_version(packed): packed["http://schema.org/version"] = githash -def upload_job_order(arvrunner, name, tool, job_order): - """Upload local files referenced in the input object and return updated input - object with 'location' updated to the proper keep references. - """ - - for t in tool.tool["inputs"]: +def discover_secondary_files(inputs, job_order): + for t in inputs: def setSecondary(fileobj): if isinstance(fileobj, dict) and fileobj.get("class") == "File": if "secondaryFiles" not in fileobj: @@ -209,6 +205,13 @@ def upload_job_order(arvrunner, name, tool, job_order): if shortname(t["id"]) in job_order and t.get("secondaryFiles"): setSecondary(job_order[shortname(t["id"])]) +def upload_job_order(arvrunner, name, tool, job_order): + """Upload local files referenced in the input object and return updated input + object with 'location' updated to the proper keep references. + """ + + discover_secondary_files(tool.tool["inputs"], job_order) + jobmapper = upload_dependencies(arvrunner, name, tool.doc_loader, @@ -293,6 +296,12 @@ class Runner(object): self.tool = tool self.job_order = job_order self.running = False + if enable_reuse: + # If reuse is permitted by command line arguments but + # disabled by the workflow itself, disable it. + reuse_req, _ = get_feature(self.tool, "http://arvados.org/cwl#ReuseRequirement") + if reuse_req: + enable_reuse = reuse_req["enableReuse"] self.enable_reuse = enable_reuse self.uuid = None self.final_output = None