X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3b4da80a23136c0cec743ee4cdad9b22b51ac3e0..cb97316068f201ffd03f54d67074a83601c2bb45:/sdk/cwl/arvados_cwl/runner.py diff --git a/sdk/cwl/arvados_cwl/runner.py b/sdk/cwl/arvados_cwl/runner.py index 3ce08f6cc7..87acf15d65 100644 --- a/sdk/cwl/arvados_cwl/runner.py +++ b/sdk/cwl/arvados_cwl/runner.py @@ -16,7 +16,7 @@ from schema_salad.sourceline import SourceLine, cmap from cwltool.command_line_tool import CommandLineTool import cwltool.workflow -from cwltool.process import get_feature, scandeps, UnsupportedRequirement, normalizeFilesDirs, shortname +from cwltool.process import scandeps, UnsupportedRequirement, normalizeFilesDirs, shortname from cwltool.load_tool import fetch_document from cwltool.pathmapper import adjustFileObjs, adjustDirObjs, visit_class from cwltool.utils import aslist @@ -122,11 +122,18 @@ def upload_dependencies(arvrunner, name, document_loader, # that external references in $include and $mixin are captured. scanobj = loadref("", workflowobj["id"]) - sc = scandeps(uri, scanobj, + sc_result = scandeps(uri, scanobj, loadref_fields, set(("$include", "$schemas", "location")), loadref, urljoin=document_loader.fetcher.urljoin) + sc = [] + def only_real(obj): + if obj.get("location", "").startswith("file:"): + sc.append(obj) + + visit_class(sc_result, ("File", "Directory"), only_real) + normalizeFilesDirs(sc) if include_primary and "id" in workflowobj: @@ -194,7 +201,7 @@ def upload_docker(arvrunner, tool): """Uploads Docker images used in CommandLineTool objects.""" if isinstance(tool, CommandLineTool): - (docker_req, docker_is_req) = get_feature(tool, "DockerRequirement") + (docker_req, docker_is_req) = tool.get_requirement("DockerRequirement") if docker_req: if docker_req.get("dockerOutputDirectory") and arvrunner.work_api != "containers": # TODO: can be supported by containers API, but not jobs API. @@ -346,8 +353,8 @@ class Runner(object): def __init__(self, runner, tool, job_order, enable_reuse, output_name, output_tags, submit_runner_ram=0, name=None, on_error=None, submit_runner_image=None, - intermediate_output_ttl=0, merged_map=None, priority=None, - secret_store=None): + intermediate_output_ttl=0, merged_map=None, default_storage_classes="default", + priority=None, secret_store=None): self.arvrunner = runner self.tool = tool self.job_order = job_order @@ -355,7 +362,7 @@ class Runner(object): 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") + reuse_req, _ = self.tool.get_requirement("http://arvados.org/cwl#ReuseRequirement") if reuse_req: enable_reuse = reuse_req["enableReuse"] self.enable_reuse = enable_reuse @@ -369,6 +376,7 @@ class Runner(object): self.intermediate_output_ttl = intermediate_output_ttl self.priority = priority self.secret_store = secret_store + self.default_storage_classes = default_storage_classes if submit_runner_ram: self.submit_runner_ram = submit_runner_ram