Skip to content

Commit

Permalink
Merge pull request #244 from jfennick/python_api_cwl_docker_extract
Browse files Browse the repository at this point in the history
copy & paste cwl-docker-extract code from main.py
  • Loading branch information
sameeul authored Jun 20, 2024
2 parents ae7adf8 + 7962470 commit 052d633
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/sophios/api/pythonapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""CLT utilities."""
import logging
from pathlib import Path
import subprocess as sub
from typing import Any, ClassVar, Optional, TypeVar, Union

import cwl_utils.parser as cu_parser
Expand Down Expand Up @@ -753,6 +754,14 @@ def run(self) -> None:
args = get_args(self.process_name) # Use mock CLI args
rose_tree: RoseTree = compiler_info.rose

# cwl-docker-extract recursively `docker pull`s all images in all subworkflows.
# This is important because cwltool only uses `docker run` when executing
# workflows, and if there is a local image available,
# `docker run` will NOT query the remote repository for the latest image!
# cwltool has a --force-docker-pull option, but this may cause multiple pulls in parallel.
cmd = ['cwl-docker-extract', '--force-download', f'autogenerated/{self.process_name}.cwl']
sub.run(cmd, check=True)

# If you don't like it, you can programmatically overwrite anything in args
# args.docker_remove_entrypoints = True
if args.docker_remove_entrypoints:
Expand Down

0 comments on commit 052d633

Please sign in to comment.