Skip to content

Commit a0c2dae

Browse files
committed
checking for default container when container is not provided in hints or requirement
1 parent b203750 commit a0c2dae

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

cwltool/process.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -557,20 +557,29 @@ def _init_job(self, joborder, **kwargs):
557557
builder.debug = kwargs.get("debug")
558558
builder.mutation_manager = kwargs.get("mutation_manager")
559559

560-
dockerReq, is_req = self.get_requirement("DockerRequirement")
561560
builder.make_fs_access = kwargs.get("make_fs_access") or StdFsAccess
562561
builder.fs_access = builder.make_fs_access(kwargs["basedir"])
563562

564563
loadListingReq, _ = self.get_requirement("http://commonwl.org/cwltool#LoadListingRequirement")
565564
if loadListingReq:
566565
builder.loadListing = loadListingReq.get("loadListing")
567566

568-
if dockerReq and kwargs.get("use_container"):
569-
# Check if docker output directory is absolute
570-
if dockerReq.get("dockerOutputDirectory") and dockerReq.get("dockerOutputDirectory").startswith('/'):
571-
builder.outdir = dockerReq.get("dockerOutputDirectory")
572-
else:
573-
builder.outdir = builder.fs_access.docker_compatible_realpath(dockerReq.get("dockerOutputDirectory") or kwargs.get("docker_outdir") or "/var/spool/cwl")
567+
dockerReq, is_req = self.get_requirement("DockerRequirement")
568+
569+
if dockerReq is None and kwargs["default_container"]:
570+
defaultDocker = kwargs["default_container"]
571+
572+
if dockerReq or defaultDocker and kwargs.get("use_container"):
573+
if dockerReq:
574+
# Check if docker output directory is absolute
575+
if dockerReq.get("dockerOutputDirectory") and dockerReq.get("dockerOutputDirectory").startswith('/'):
576+
builder.outdir = dockerReq.get("dockerOutputDirectory")
577+
else:
578+
builder.outdir = builder.fs_access.docker_compatible_realpath(
579+
dockerReq.get("dockerOutputDirectory") or kwargs.get("docker_outdir") or "/var/spool/cwl")
580+
elif defaultDocker:
581+
builder.outdir = builder.fs_access.docker_compatible_realpath(
582+
kwargs.get("docker_outdir") or "/var/spool/cwl")
574583
builder.tmpdir = builder.fs_access.docker_compatible_realpath(kwargs.get("docker_tmpdir") or "/tmp")
575584
builder.stagedir = builder.fs_access.docker_compatible_realpath(kwargs.get("docker_stagedir") or "/var/lib/cwl")
576585
else:

0 commit comments

Comments
 (0)