Skip to content

Commit

Permalink
Don't prepull containers if extensions are enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
stxue1 committed Jul 16, 2024
1 parent 2b559cb commit c264a0d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/toil/cwl/cwltoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
from toil.batchSystems.registry import DEFAULT_BATCH_SYSTEM
from toil.common import Toil, addOptions
from toil.cwl import check_cwltool_version
from toil.lib.misc import call_command
from toil.lib.misc import call_command, CalledProcessErrorStderr
from toil.provisioners.clusterScaler import JobTooBigError

check_cwltool_version()
Expand Down Expand Up @@ -247,14 +247,14 @@ def try_prepull(cwl_tool_uri: str, runtime_context: cwltool.context.RuntimeConte
"""
if runtime_context.singularity:
if "CWL_SINGULARITY_CACHE" in os.environ:
logger.info("Prepulling containers with Singularity...")
logger.info("Prepulling the workflow's containers with Singularity...")
call_command(["cwl-docker-extract", "--singularity", "--dir", os.environ['CWL_SINGULARITY_CACHE'], cwl_tool_uri])
elif not runtime_context.user_space_docker_cmd and not runtime_context.podman:
# For udocker and podman prefetching is unimplemented
# This is docker
if batchsystem == "single_machine":
# Only on single machine will the docker daemon be accessible by all workers and the leader
logger.info("Prepulling containers with Docker...")
logger.info("Prepulling the workflow's containers with Docker...")
call_command(["cwl-docker-extract", cwl_tool_uri])


Expand Down Expand Up @@ -3768,7 +3768,12 @@ def main(args: Optional[List[str]] = None, stdout: TextIO = sys.stdout) -> int:

# Attempt to prepull the containers
if not options.no_prepull:
try_prepull(uri, runtime_context, toil.config.batchSystem)
if not options.enable_ext:
# The CWL utils parser does not support cwltool extensions and will crash if encountered, so don't prepull if extensions are enabled
# See https://github.com/common-workflow-language/cwl-utils/issues/309
try_prepull(uri, runtime_context, toil.config.batchSystem)
else:
logger.debug("Not prepulling containers as cwltool extensions are not supported.")

options.tool_help = None
options.debug = options.logLevel == "DEBUG"
Expand Down

0 comments on commit c264a0d

Please sign in to comment.