X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/bb5b4b99bd9957fd1b4713c5168b0d7e148899ee..466e236c4174de64bdefeb1766160a11217c8c1c:/sdk/cwl/arvados_cwl/arvjob.py diff --git a/sdk/cwl/arvados_cwl/arvjob.py b/sdk/cwl/arvados_cwl/arvjob.py index 0ab065d787..1287fbb6ea 100644 --- a/sdk/cwl/arvados_cwl/arvjob.py +++ b/sdk/cwl/arvados_cwl/arvjob.py @@ -18,6 +18,7 @@ from cwltool.job import JobBase from schema_salad.sourceline import SourceLine +from arvados_cwl.util import get_current_container, get_intermediate_collection_info import ruamel.yaml as yaml import arvados.collection @@ -76,7 +77,14 @@ class ArvadosJob(JobBase): if vwd: with Perf(metrics, "generatefiles.save_new %s" % self.name): - vwd.save_new() + if not runtimeContext.current_container: + runtimeContext.current_container = get_current_container(self.arvrunner.api, self.arvrunner.num_retries, logger) + info = get_intermediate_collection_info(self.name, runtimeContext.current_container, runtimeContext.intermediate_output_ttl) + vwd.save_new(name=info["name"], + owner_uuid=self.arvrunner.project_uuid, + ensure_unique_name=True, + trash_at=info["trash_at"], + properties=info["properties"]) for f, p in generatemapper.items(): if p.type == "File": @@ -106,11 +114,14 @@ class ArvadosJob(JobBase): with Perf(metrics, "arv_docker_get_image %s" % self.name): (docker_req, docker_is_req) = self.get_requirement("DockerRequirement") - if docker_req and runtimeContextuse_container is not False: + if docker_req and runtimeContext.use_container is not False: if docker_req.get("dockerOutputDirectory"): raise SourceLine(docker_req, "dockerOutputDirectory", UnsupportedRequirement).makeError( "Option 'dockerOutputDirectory' of DockerRequirement not supported.") - runtime_constraints["docker_image"] = arv_docker_get_image(self.arvrunner.api, docker_req, pull_image, self.arvrunner.project_uuid) + runtime_constraints["docker_image"] = arv_docker_get_image(self.arvrunner.api, + docker_req, + runtimeContext.pull_image, + self.arvrunner.project_uuid) else: runtime_constraints["docker_image"] = "arvados/jobs" @@ -252,7 +263,7 @@ class ArvadosJob(JobBase): dirs[g.group(1)] = g.group(2) if processStatus == "permanentFail": - done.logtail(logc, logger, "%s error log:" % self.arvrunner.label(self)) + done.logtail(logc, logger.error, "%s (%s) error log:" % (self.arvrunner.label(self), record["uuid"]), maxlen=40) with Perf(metrics, "output collection %s" % self.name): outputs = done.done(self, record, dirs["tmpdir"],