cwl_utils.image_puller
Classes for docker-extract.
Classes
Helper class that provides a standard way to create an ABC using |
|
Pull docker image with Docker. |
|
Pull docker image with Singularity. |
Module Contents
- class cwl_utils.image_puller.ImagePuller(req, save_directory, cmd, force_pull)
Bases:
abc.ABC
Helper class that provides a standard way to create an ABC using inheritance.
- Parameters:
req (str)
save_directory (str | pathlib.Path | None)
cmd (str)
force_pull (bool)
- req
- save_directory
- cmd
- force_pull
- abstractmethod save_docker_image()
Download and save the image to disk.
- Return type:
None
- class cwl_utils.image_puller.DockerImagePuller(req, save_directory, cmd, force_pull)
Bases:
ImagePuller
Pull docker image with Docker.
- Parameters:
req (str)
save_directory (str | pathlib.Path | None)
cmd (str)
force_pull (bool)
- save_docker_image()
Download and save the software container image to disk as a docker tarball.
- Return type:
None
- class cwl_utils.image_puller.SingularityImagePuller(req, save_directory, cmd, force_pull)
Bases:
ImagePuller
Pull docker image with Singularity.
The image req may not contain a protocol.
The image req, if it refers to a Docker image, may or may not contain a tag.
- Parameters:
req (str)
save_directory (str | pathlib.Path | None)
cmd (str)
force_pull (bool)
- CHARS_TO_REPLACE = ['_', '/']
- NEW_STRINGS = ['___', '_s_']
- get_image_name()
Determine the file name appropriate to the installed version of Singularity.
- Return type:
- get_alternate_image_names()
Determine filenames used by previous versions of cwltool or cwl-utils.
These should be checked for the image and used if it exists there, instead of pulling it again.
These cover cwltool 3.2.20260720092025 and cwl-utils 0.42.
If an image name could potentially also belong to some image under the current scheme, it will not appear here.
- find_destination_path()
Find the path where the image belongs.
- Return type:
- save_docker_image_from_cache(target, search_paths=None)
Put the image we need at our destination path, if we have it locally.
- Parameters:
target (pathlib.Path) – The destination path.
search_paths (list[pathlib.Path] | None)
- Return type:
Checks target, plus under save_directory, plus inder the directories in search_paths if provided.
- Returns:
True if the image was found and put in place, and False otherwise.
- Parameters:
target (pathlib.Path)
search_paths (list[pathlib.Path] | None)
- Return type:
If force_pull is set, does nothing and returns False.
- save_docker_image()
Pull down the Docker software container image and save it in the Singularity image format.
Uses the cache if possible.
- Return type:
None