cwl_utils.image_puller

Classes for docker-extract.

Classes

ImagePuller

Helper class that provides a standard way to create an ABC using

DockerImagePuller

Pull docker image with Docker.

SingularityImagePuller

Pull docker image with Singularity.

Module Contents

class cwl_utils.image_puller.ImagePuller(req, save_directory, cmd, force_pull)

Bases: abc.ABC

Inheritance diagram of cwl_utils.image_puller.ImagePuller

Helper class that provides a standard way to create an ABC using inheritance.

Parameters:
req
save_directory
cmd
force_pull
abstractmethod get_image_name()

Get the engine-specific image name.

Return type:

str

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

Inheritance diagram of cwl_utils.image_puller.DockerImagePuller

Pull docker image with Docker.

Parameters:
get_image_name()

Get the name of the tarball.

Return type:

str

generate_udocker_loading_command()

Generate the udocker loading command.

Return type:

str

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

Inheritance diagram of cwl_utils.image_puller.SingularityImagePuller

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:
CHARS_TO_REPLACE = ['_', '/']
NEW_STRINGS = ['___', '_s_']
get_image_name()

Determine the file name appropriate to the installed version of Singularity.

Return type:

str

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.

Return type:

list[str]

find_destination_path()

Find the path where the image belongs.

Return type:

pathlib.Path

save_docker_image_from_cache(target, search_paths=None)

Put the image we need at our destination path, if we have it locally.

Parameters:
Return type:

bool

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:
Return type:

bool

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