Documentation
¶
Overview ¶
Package imagepreparation prepares neutral caches, never installed stacks.
Index ¶
- Constants
- Variables
- func CleanTarget(target string) error
- func FileDigest(name string) (string, error)
- func InspectOCIArchive(name string, image Image, platform Platform) error
- func ModelDirectory(root string, model architecturev2renderer.OfflineModelPin) string
- func OfflineBundleReference(root string) (runtimeprofile.OfflineBundleRef, error)
- func SafePath(name string) error
- func StageOfflineModel(ctx context.Context, root string, pin architecturev2renderer.OfflineModelPin, ...) error
- func VerifyCandidateToolDirectory(candidate releaseindex.VerifiedPreviewCandidate, directory string) error
- func VerifyOfflineModelRef(ctx context.Context, ref runtimeprofile.OfflineBundleRef, component string) (string, error)
- type Authority
- type BundleFile
- type BundleImage
- type BundleManifest
- func ImportOfflineBundle(ctx context.Context, options Options, root string) (result BundleManifest, err error)
- func PrepareOfflineBundle(ctx context.Context, options Options, root, profileID, modelCache string) (BundleManifest, error)
- func VerifyOfflineBundle(ctx context.Context, options Options, root string) (BundleManifest, error)
- func VerifyOfflineBundleRef(ctx context.Context, options Options, ref runtimeprofile.OfflineBundleRef) (BundleManifest, error)
- type CandidateSelection
- type CandidateSource
- type ContainerCache
- type FreshBundleAdmission
- type Image
- type LocalDocker
- type Manifest
- func Prepare(ctx context.Context, options Options, id string) (Manifest, error)
- func ReadManifest(name string, authority Authority) (Manifest, error)
- func Verify(ctx context.Context, options Options, manifestPath string) (Manifest, error)
- func VerifyCache(ctx context.Context, options Options, manifestPath string) (Manifest, error)
- func VerifyOfflineBundleInit(ctx context.Context, options Options, ref runtimeprofile.OfflineBundleRef) (Manifest, error)
- type ModelPack
- type Options
- type Platform
- type Profile
- type Release
- type SourceKind
Constants ¶
const BundleManifestName = "manifest.json"
const ManifestName = "neutral-image.json"
const OfflineModelMount = architecturev2renderer.OfflineModelMount
Variables ¶
var ErrAdmissionMismatch = errors.New("neutral image admission mismatch")
var ErrNotNeutral = errors.New("image roots contain state that cannot be cloned")
Functions ¶
func CleanTarget ¶
CleanTarget refuses every existing entry, including foreign custody nested beneath arbitrary directories. Preparation never scrubs an initialized host.
func FileDigest ¶
func InspectOCIArchive ¶ added in v0.54.10
inspectOCIArchive authenticates the content graph BEFORE Docker reads an archive. The unsigned bundle's file checksum is a transport check only; authority is the exact catalog digest and every reachable OCI descriptor. Classic Docker exports without their original OCI graph are not admitted.
func ModelDirectory ¶ added in v0.54.10
func ModelDirectory(root string, model architecturev2renderer.OfflineModelPin) string
func OfflineBundleReference ¶ added in v0.54.10
func OfflineBundleReference(root string) (runtimeprofile.OfflineBundleRef, error)
func StageOfflineModel ¶ added in v0.54.10
func StageOfflineModel(ctx context.Context, root string, pin architecturev2renderer.OfflineModelPin, modelCache string) error
StageOfflineModel copies only the reviewed model closure into a new neutral bundle. A pre-existing Ollama cache is a transport optimization, never trust.
func VerifyCandidateToolDirectory ¶ added in v0.54.10
func VerifyCandidateToolDirectory(candidate releaseindex.VerifiedPreviewCandidate, directory string) error
VerifyCandidateToolDirectory reuses this owner's complete authenticated tool closure for the existing historical-source extractor. It grants no fresh installation permission and makes no current-process or original-Apply claim.
func VerifyOfflineModelRef ¶ added in v0.54.10
func VerifyOfflineModelRef(ctx context.Context, ref runtimeprofile.OfflineBundleRef, component string) (string, error)
VerifyOfflineModelRef is the runtime read-only mount admission, not a new installer. Init has bound the whole authenticated bundle to the canonical ref; runtime additionally re-derives the model's immutable content pins from this binary before each use. It never trusts a manifest's own model hashes.
Types ¶
type Authority ¶ added in v0.54.10
type Authority interface {
NeutralImageProfile(string) ([]byte, error)
ValidateNeutralImageManifest([]byte) error
}
Authority is implemented by the existing embedded CUE owner. Keeping the artifact transport independent lets native runtime owners reuse model verification without importing the service that constructs those owners.
type BundleFile ¶ added in v0.54.10
type BundleImage ¶ added in v0.54.10
type BundleManifest ¶ added in v0.54.10
type BundleManifest struct {
SchemaVersion string `json:"schemaVersion"`
Neutral Manifest `json:"neutral"`
Images []BundleImage `json:"images"`
Models []architecturev2renderer.OfflineModelPin `json:"models"`
Files map[string]BundleFile `json:"files"`
}
BundleManifest is unsigned transport metadata, never Apply or release authority. The running attested release, embedded catalog and reviewed model table independently authenticate every executable, image and model input.
func ImportOfflineBundle ¶ added in v0.54.10
func ImportOfflineBundle(ctx context.Context, options Options, root string) (result BundleManifest, err error)
ImportOfflineBundle only imports admitted neutral artifacts. Native init, generation and Apply retain their existing separate ownership and custody.
func PrepareOfflineBundle ¶ added in v0.54.10
func PrepareOfflineBundle(ctx context.Context, options Options, root, profileID, modelCache string) (BundleManifest, error)
PrepareOfflineBundle is the online preparation phase. It delegates release, tool, provider and image admission to the existing neutral-cache owner. It never initializes an Owner, starts a workload or copies a workspace.
func VerifyOfflineBundle ¶ added in v0.54.10
VerifyOfflineBundle performs no Docker mutation, registry request or Apply. It also works after installation: runtime owners must recheck this exact immutable closure before mounting a local model, not re-run bake neutrality.
func VerifyOfflineBundleRef ¶ added in v0.54.10
func VerifyOfflineBundleRef(ctx context.Context, options Options, ref runtimeprofile.OfflineBundleRef) (BundleManifest, error)
VerifyOfflineBundleRef is routine lifecycle verification. An initialized workspace is legitimate here; fresh-target admission is never replayed.
type CandidateSelection ¶ added in v0.54.10
type CandidateSelection struct {
Directory string
Selector releaseindex.PreviewSourceSelector
}
CandidateSelection is an explicit byte selection, never an installation grant. Directory is needed only when retaining new bytes during online preparation.
type CandidateSource ¶ added in v0.54.10
type CandidateSource struct {
Identity releaseindex.AttestedPreviewCandidateIdentity `json:"identity"`
Kit string `json:"kit"`
Version string `json:"version"`
Platform releaseindex.Platform `json:"platform"`
CLISHA256 string `json:"cliSha256"`
}
CandidateSource contains only identities authenticated by the signed index, payload and actual process equality. Actions locator IDs are deliberately absent.
type ContainerCache ¶
type FreshBundleAdmission ¶ added in v0.54.10
type FreshBundleAdmission struct {
// contains filtered or unexported fields
}
FreshBundleAdmission is created only by this owner after full byte verification and fresh-target admission. It is neither a public release Receipt nor a conversion of a source-cache proof into installation authority.
func AdmitFreshOfflineBundle ¶ added in v0.54.10
func AdmitFreshOfflineBundle(ctx context.Context, options Options, root string) (*FreshBundleAdmission, error)
AdmitFreshOfflineBundle checks every signature, tool, provider, image and model before even observing Docker. Import retains the separate effect gate.
type LocalDocker ¶
type LocalDocker struct{ Config string }
LocalDocker always addresses the local Unix socket with an empty config. Contexts, DOCKER_HOST and user registry credentials cannot redirect a bake.
func (LocalDocker) RunInput ¶ added in v0.54.10
func (docker LocalDocker) RunInput(ctx context.Context, input *os.File, args ...string) ([]byte, error)
RunInput passes an already-open file directly to Docker's stdin. Import never gives Docker a transport or temporary pathname to reopen after verification.
type Manifest ¶
type Manifest struct {
SchemaVersion string `json:"schemaVersion"`
Profile Profile `json:"profile"`
Platform Platform `json:"platform"`
Release Release `json:"release,omitzero"`
SourceKind SourceKind `json:"sourceKind,omitempty"`
Candidate *CandidateSource `json:"candidate,omitempty"`
Binaries map[string]string `json:"binaries"`
ProviderFiles map[string]string `json:"providerFiles"`
}
func Prepare ¶
Prepare downloads the current exact attested release into the neutral cache, verifies the actual packaged tools, and only pulls immutable container images.
func Verify ¶
Verify re-observes the clone, release bytes and cache. An unsigned manifest's asserted digests or its writer's previous host evidence authorize nothing.
func VerifyCache ¶ added in v0.50.1
VerifyCache re-observes the host, attested release, packaged tools and exact neutral container cache. It does not admit deployment contents: init must separately require an empty target or an already-applied canonical intent.
func VerifyOfflineBundleInit ¶ added in v0.54.10
func VerifyOfflineBundleInit(ctx context.Context, options Options, ref runtimeprofile.OfflineBundleRef) (Manifest, error)
VerifyOfflineBundleInit authenticates the complete closure before any native intent or custody effect and re-observes the neutral Docker cache. A populated workspace is handled only by the caller's existing same-intent RequireAlreadyApplied path, never granted a fresh installation capability.
type Options ¶
type Options struct {
SourceKind SourceKind
Candidate *CandidateSelection
Authority Authority
CacheRoot string
Target string
Executable string
Version string
Installer releaseindex.Installer
Docker ContainerCache
// Host observation is injectable only for package tests. The CLI always
// supplies ObserveHost and LocalDocker; manifests never supply these facts.
ObserveHost func() (Platform, error)
}
type Platform ¶
type Platform struct {
OS string `json:"os"`
Arch string `json:"arch"`
Distribution string `json:"distribution"`
Version string `json:"version"`
}
func ObserveHost ¶
type Profile ¶
type Profile struct {
ID string `json:"id"`
Kit string `json:"kit"`
Module string `json:"module"`
DefaultOS string `json:"defaultOS"`
CompatibleOS []string `json:"compatibleOS"`
Architectures []string `json:"architectures"`
Runtime string `json:"runtime"`
ManagedTarget string `json:"managedTarget"`
CacheScope string `json:"cacheScope"`
NetworkRequired bool `json:"networkRequired"`
Images []Image `json:"images"`
DataProfile string `json:"dataProfile,omitempty"`
Modules []string `json:"modules,omitempty"`
ModelPacks []ModelPack `json:"modelPacks,omitempty"`
}
type SourceKind ¶ added in v0.54.10
type SourceKind string
const ( PublicReleaseSource SourceKind = "public-release" PreviewCandidateSource SourceKind = "preview-candidate" )