-from cwltool.draft2tool import CommandLineTool
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+from cwltool.command_line_tool import CommandLineTool
from .arvjob import ArvadosJob
from .arvcontainer import ArvadosContainer
from .pathmapper import ArvPathMapper
self.arvrunner = arvrunner
self.work_api = kwargs["work_api"]
- def makeJobRunner(self):
+ def makeJobRunner(self, **kwargs):
if self.work_api == "containers":
return ArvadosContainer(self.arvrunner)
elif self.work_api == "jobs":
def makePathMapper(self, reffiles, stagedir, **kwargs):
# type: (List[Any], unicode, **Any) -> PathMapper
if self.work_api == "containers":
- return ArvPathMapper(self.arvrunner, reffiles, kwargs["basedir"],
+ return ArvPathMapper(self.arvrunner, reffiles+kwargs.get("extra_reffiles", []), kwargs["basedir"],
"/keep/%s",
"/keep/%s/%s",
**kwargs)
**kwargs)
def job(self, joborder, output_callback, **kwargs):
+
+ # Workaround for #13365
+ builderargs = kwargs.copy()
+ builderargs["toplevel"] = True
+ builderargs["tmp_outdir_prefix"] = ""
+ builder = self._init_job(joborder, **builderargs)
+ joborder = builder.job
+
if self.work_api == "containers":
- kwargs["outdir"] = "/var/spool/cwl"
- kwargs["docker_outdir"] = "/var/spool/cwl"
+ dockerReq, is_req = self.get_requirement("DockerRequirement")
+ if dockerReq and dockerReq.get("dockerOutputDirectory"):
+ kwargs["outdir"] = dockerReq.get("dockerOutputDirectory")
+ kwargs["docker_outdir"] = dockerReq.get("dockerOutputDirectory")
+ else:
+ kwargs["outdir"] = "/var/spool/cwl"
+ kwargs["docker_outdir"] = "/var/spool/cwl"
elif self.work_api == "jobs":
kwargs["outdir"] = "$(task.outdir)"
kwargs["docker_outdir"] = "$(task.outdir)"