Container image pusher

Class used for copying images in Quay. It supports both source (single-arch) and multiarch images. Logic for determining whether manifest list merging is necessary, or simple copy suffices is also contained in this class. This class handles all the container-related parts of the Push Docker workflow.

class pubtools._quay.container_image_pusher.ContainerImagePusher(push_items: List[Any], target_settings: Dict[str, Any])[source]

Push container images to Quay.

No validation is performed, push items are expected to be correct.

__init__(push_items: List[Any], target_settings: Dict[str, Any]) None[source]

Initialize.

Args:
push_items ([ContainerPushItem]):

List of push items.

target_settings (dict):

Target settings.

classmethod run_tag_images(source_ref: str, dest_refs: List[str], all_arch: bool, target_settings: Dict[str, Any]) None[source]

Prepare the “tag images” entrypoint with all the necessary arguments and run it.

NOTE: Tagging operation will run with retries to compensate for transient

container-related issues.

Args:
source_ref (str):

Source image reference.

dest_refs ([str]):

List of destination references.

all_arch (bool):

Whether all architectures should be copied.

target_settings (dict):

Settings used for setting the values of the function parameters.

copy_source_push_item(push_item: Any) None[source]

Perform the tagging operation for a push item containing a source image.

Args:
push_item (ContainerPushItem):

Source container push item.

run_merge_workflow(source_ref: str, dest_refs: List[str]) None[source]

Perform Docker push and manifest list merge workflow.

The difference in this workflow is that all single arch images are first copied via digest, and then their respective manifest lists are merged.

Args:
source_ref (str):

Source image reference.

dest_refs ([str]):

List of destination references which need manifest merging.

copy_multiarch_push_item(push_item: Any, source_ml: ManifestList) None[source]

Evaluate the correct tagging and manifest list merging strategy of multiarch push item.

There are two workflows of multiarch images: Simple copying, or manifest list merging. Destination tags are sorted, and correct workflow is performed on them.

Args:
push_items (ContainerPushItem):

Multiarch container push item.

source_ml (dict):

Manifest list of the source image.

push_container_images() None[source]

Push container images to Quay.

Two image types are supported: source images and multiarch images. Non-source, single arch images are not supported. In case of multiarch images, manifest list merging is performed if destination image contains more architectures than source.