cwl_utils.image_puller
======================

.. py:module:: cwl_utils.image_puller

.. autoapi-nested-parse::

   Classes for docker-extract.



Classes
-------

.. autoapisummary::

   cwl_utils.image_puller.ImagePuller
   cwl_utils.image_puller.DockerImagePuller
   cwl_utils.image_puller.SingularityImagePuller


Module Contents
---------------

.. py:class:: ImagePuller(req, save_directory, cmd, force_pull)

   Bases: :py:obj:`abc.ABC`

   .. autoapi-inheritance-diagram:: cwl_utils.image_puller.ImagePuller
      :parts: 1


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


   .. py:attribute:: req


   .. py:attribute:: save_directory


   .. py:attribute:: cmd


   .. py:attribute:: force_pull


   .. py:method:: get_image_name()
      :abstractmethod:


      Get the engine-specific image name.



   .. py:method:: save_docker_image()
      :abstractmethod:


      Download and save the image to disk.



.. py:class:: DockerImagePuller(req, save_directory, cmd, force_pull)

   Bases: :py:obj:`ImagePuller`

   .. autoapi-inheritance-diagram:: cwl_utils.image_puller.DockerImagePuller
      :parts: 1


   Pull docker image with Docker.


   .. py:method:: get_image_name()

      Get the name of the tarball.



   .. py:method:: generate_udocker_loading_command()

      Generate the udocker loading command.



   .. py:method:: save_docker_image()

      Download and save the software container image to disk as a docker tarball.



.. py:class:: SingularityImagePuller(req, save_directory, cmd, force_pull)

   Bases: :py:obj:`ImagePuller`

   .. autoapi-inheritance-diagram:: cwl_utils.image_puller.SingularityImagePuller
      :parts: 1


   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.


   .. py:attribute:: CHARS_TO_REPLACE
      :value: ['_', '/']



   .. py:attribute:: NEW_STRINGS
      :value: ['___', '_s_']



   .. py:method:: get_image_name()

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



   .. py:method:: 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.



   .. py:method:: find_destination_path()

      Find the path where the image belongs.



   .. py:method:: save_docker_image_from_cache(target, search_paths = None)

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

      :param target: The destination path.

      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.

      If force_pull is set, does nothing and returns False.



   .. py:method:: save_docker_image()

      Pull down the Docker software container image and save it in the Singularity image format.

      Uses the cache if possible.



