morca · API

orca.registry

Which architectures a container image has (#267): the pool autoscaler makes a machine only of a type the worker image runs on.

var r = Registry.from_env() r.arches("ghcr.io/magmalake/orca:e82807b") # ["amd64", "arm64"]

An image's tag names a manifest; a multi-architecture image's is an index (OCI) or a manifest list (Docker), whose entries each name a platform, and a single-architecture image's has its architecture in its config blob. This reads the registry's v2 API with a pull token: anonymous, or from ORCA_REGISTRY_USER and the secret ORCA_REGISTRY_TOKEN_SECRET names (orca.control.fetch_secret) for a private image, never in an error. ORCA_REGISTRY_ENDPOINT points every image's registry at one URL, for tests' fake.

Structs

ImageRef

struct ImageRef

host/repo:tag taken apart.

Implements Copyable, Movable

Fields
host: String
repo: String
tag: String

parse

def parse(image: String) -> Self

ghcr.io/magmalake/orca:tag (a tag is needed; a host too).

Registry

struct Registry

Implements Movable

Fields
endpoint: String: Every registry at this URL (tests), or empty for https://<host>.
user: String

__init__

def __init__(out self, endpoint: String, user: String, token: String)

from_env

def from_env() -> Self

has_credentials

def has_credentials(self) -> Bool

credentials

def credentials(self) -> Tuple[String, String]

The user and token to log in to pull the image (the pool machines' boot, orca.pool_boot); empty for none.

arches

def arches(self, image: String) -> List[String]

The Linux architectures image has a variant for, Docker's names (amd64, arm64).

Functions

platform_arches

def platform_arches(manifest: Value) -> List[String]

The architectures of an index's or manifest list's entries for Linux, without attestation entries (unknown), in order; empty for a single-architecture manifest.