Skip to main content

Module template_catalog

Module template_catalog 

Source
Expand description

On-disk template catalog (CORE-107).

A template is a named, versioned sandbox base: a built rootfs plus a default-config bundle, optionally paired with a pre-warmed boot-to-ready snapshot (template.proto). The catalog persists metadata only — one atomically-replaced JSON file per template name under {data_dir}/template-catalog/ — while the artifacts live elsewhere and are referenced, never copied: rootfs images in the converted-rootfs cache (pinned through TemplateCatalog::rootfs_paths) and warm snapshots in the SnapshotCatalog under the TEMPLATE_LABEL reserved label.

Versioning model: Build installs the mutable draft slot; Publish freezes the draft as an immutable version (newest published wins bare-name resolution). Version strings are caller-chosen and opaque — “newest” means publish order, never a semver comparison.

Structs§

PublishOutcome
Result of publishing: the frozen version plus any released artifacts.
PutDraftOutcome
Result of installing a draft: the stored entry plus any artifacts the displaced previous draft owned exclusively.
ReleasedArtifacts
Snapshot ids released by a catalog mutation.
ResolvedTemplate
A name[:version] reference resolved against the catalog.
TemplateCatalog
The on-disk template catalog: one atomically-replaced JSON per name.
TemplateDefaultsSpec
Default configuration a template applies to sandboxes created from it.
TemplateEntry
One built template version, or the unpublished draft.
WarmArtifact
A pre-warmed boot-to-ready snapshot plus the geometry it requires.

Enums§

ReadyProbeSpec
Readiness probe recorded in template defaults.

Constants§

TEMPLATE_LABEL
Reserved snapshot label marking a snapshot as owned by a catalog template.

Functions§

compute_digest
Deterministic content digest for a template entry (sha256:<hex>).
validate_template_name
Validate a template name.
validate_template_version
Validate a template version string ([A-Za-z0-9._-], e.g. “1.2.0”).