if obj.get("location", "").startswith("_:"):
del obj["location"]
+def remove_redundant_fields(obj):
+ for field in ("path", "nameext", "nameroot", "dirname"):
+ if field in obj:
+ del obj[field]
+
def find_defaults(d, op):
if isinstance(d, list):
for i in d:
find_defaults(i, op)
- if isinstance(d, dict):
+ elif isinstance(d, dict):
if "default" in d:
op(d)
else:
if "location" not in f and "path" in f:
f["location"] = f["path"]
del f["path"]
- if not arvrunner.fs_access.exists(f["location"]):
+ if "location" in f and not arvrunner.fs_access.exists(f["location"]):
# Remove from sc
- i = 0
- while i < len(sc):
- if sc[i]["location"] == f["location"]:
- del sc[i]
- else:
- i += 1
+ sc[:] = [x for x in sc if x["location"] != f["location"]]
# Delete "default" from workflowobj
remove[0] = True
visit_class(obj["default"], ("File", "Directory"), add_default)
raise SourceLine(docker_req, "dockerOutputDirectory", UnsupportedRequirement).makeError(
"Option 'dockerOutputDirectory' of DockerRequirement not supported.")
arv_docker_get_image(arvrunner.api, docker_req, True, arvrunner.project_uuid)
+ else:
+ arv_docker_get_image(arvrunner.api, {"dockerPull": "arvados/jobs"}, True, arvrunner.project_uuid)
elif isinstance(tool, cwltool.workflow.Workflow):
for s in tool.steps:
upload_docker(arvrunner, s.embedded_tool)
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