RSPImage

class controller.models.domain.rspimage.RSPImage(tag, image_type, version, cycle, display_name, registry, repository, digest, size=None, aliases=<factory>, alias_target=None, nodes=<factory>)

Bases: RSPImageTag

A tagged Rubin Science Platform image.

An RSPImage differs from a RSPImageTag by having a reference and digest, potentially additional alias tags, and possibly information discovered from a Kubernetes cluster, such as the image size and the list of nodes on which it is present.

Parameters:

Attributes Summary

alias_target

The tag of the image for which this is an alias, if known.

is_possible_alias

Whether this tag could be an alias.

reference

Docker reference for this image.

reference_with_digest

Docker reference for this image, with the digest.

size

Size of the image in bytes if known.

Methods Summary

from_tag(*, registry, repository, tag, digest)

Construct an image from an existing tag.

resolve_alias(target)

Resolve an alias tag with information about its target.

Attributes Documentation

alias_target: str | None = None

The tag of the image for which this is an alias, if known.

is_possible_alias

Whether this tag could be an alias.

reference

Docker reference for this image.

reference_with_digest

Docker reference for this image, with the digest.

size: int | None = None

Size of the image in bytes if known.

Methods Documentation

classmethod from_tag(*, registry, repository, tag, digest)

Construct an image from an existing tag.

Parameters:
  • registry (str) – Docker registry for this image.

  • repository (str) – Docker repository for this image.

  • tag (RSPImageTag) – Tag for this image.

  • digest (str) – Digest for this image.

Returns:

Resulting image object.

Return type:

RSPImage

resolve_alias(target)

Resolve an alias tag with information about its target.

If we discover the target tag of an alias tag, we can improve the alias tag’s display name and cycle information using the information of the underlying tag. This normally happens when ingesting a set of images, including alias images, into an RSPImageCollection.

If the tag was previously an unknown tag but we found another tag with the same digest, assume it is an alias tag and upgrade it.

Parameters:

target (RSPImage) – Another tag with the same digest.

Raises:

ValueError – If this image has a type other than unknown or alias. (Ideally this should be represented in the type system, but that code is tedious and doesn’t add much value.)

Return type:

None