def print_keep_deps_visitor(references, doc_loader, tool):
def collect_locators(obj):
- loc = obj.get("location", "") or obj.get("http://arvados.org/cwl#dockerCollectionPDH", "")
+ loc = obj.get("location", "")
g = arvados.util.keepuri_pattern.match(loc)
if g and g[1] not in references:
references.append(g[1])
+ return
+
+ loc = obj.get("http://arvados.org/cwl#dockerCollectionPDH", "") or obj.get("acrContainerImage")
+ if loc:
+ references.append(loc)
sc_result = scandeps(tool["id"], tool,
set(),
nestdirs=False)
visit_class(sc_result, ("File", "Directory"), collect_locators)
+ visit_class(tool, ("DockerRequirement", "http://arvados.org/cwl#WorkflowRunnerResources"), collect_locators)
def print_keep_deps(tool):
"ARVADOS_API_TOKEN": src.api_token,
"PATH": os.environ["PATH"]}
result = subprocess.run(["arvados-cwl-runner", "--quiet", "--print-keep-deps", "arvwf:"+wf_uuid],
- env=env)
- print(result)
- exit()
+ capture_output=True, env=env)
+ locations = json.loads(result.stdout)
- #if locations:
- # copy_collections(locations, src, dst, args)
+ if locations:
+ copy_collections(locations, src, dst, args)
# copy the workflow itself
del wf['uuid']