ImageSource¶
- class controller.services.source.base.ImageSource(logger)¶
Bases:
object
Base class for image sources.
An image source is a class that wraps a Docker image registry, gathers information about known images, and answers questions about those images. It is used by the image service as the source of truth about remote images.
This is the base class that defines the interface and some common code.
- Parameters:
logger (
BoundLogger
) – Logger for messages.
Methods Summary
image_for_reference
(reference)Determine the image corresponding to a Docker reference.
image_for_tag_name
(tag_name)Determine the image corresponding to a tag.
mark_prepulled
(image, node)Optimistically mark an image as prepulled to a node.
All known images suitable for display in the spawner menu.
prepulled_images
(nodes)All known images with their prepulled status in the API model.
update_images
(prepull, node_cache)Update image information and determine what images to prepull.
Methods Documentation
- abstract async image_for_reference(reference)¶
Determine the image corresponding to a Docker reference.
- Parameters:
reference (
DockerReference
) – Docker reference, which may or may not have a known digest.- Returns:
Corresponding image.
- Return type:
- abstract async image_for_tag_name(tag_name)¶
Determine the image corresponding to a tag.
Assuming that the tag is for our image source, construct the corresponding
RSPImage
.
- abstract mark_prepulled(image, node)¶
Optimistically mark an image as prepulled to a node.
Called by the prepuller after the prepull pod succeeded.
All known images suitable for display in the spawner menu.
- abstract prepulled_images(nodes)¶
All known images with their prepulled status in the API model.
- abstract async update_images(prepull, node_cache)¶
Update image information and determine what images to prepull.
Retrieve the full list of remote images, update their node presence information, and construct the subset to prepull.
- Parameters:
prepull (
PrepullerOptions
) – Configuration of what images to prepull.node_cache (
Mapping
[str
,list
[KubernetesNodeImage
]]) – Mapping of node names to the list of cached images on that node.
- Returns:
Collection of images to prepull.
- Return type: