Documentation
¶
Overview ¶
Package hardware probes host hardware compatibility attributes and evaluates sandbox runtime compatibility between workers and snapshots.
Index ¶
- Constants
- func Matches(worker, snap *ateapipb.SandboxRuntime) bool
- func MatchesCompat(worker, snap *ateapipb.VersionedSandboxCompat) bool
- func MatchingRuntime(status *ateapipb.WorkerStatus, snap *ateapipb.SandboxRuntime) *ateapipb.SandboxRuntime
- func ProbeHost() *ateletpb.VersionedSandboxCompat
- func RuntimeFor(status *ateapipb.WorkerStatus, snap *ateapipb.SandboxRuntime) *ateapipb.SandboxRuntime
- func WorkerMatches(status *ateapipb.WorkerStatus, snap *ateapipb.SandboxRuntime) bool
Constants ¶
const ( // SchemaVersionV1 is the initial compatibility schema version. SchemaVersionV1 = "v1" // AttrArchitecture is the CPU architecture ("amd64", "arm64", etc.). AttrArchitecture = "architecture" // AttrSandboxRuntimeHash identifies the sandbox runtime binaries: a // sha256 over a SandboxConfig version's asset digests and pause image // digest, computed by atelet. AttrSandboxRuntimeHash = "sandbox_runtime_hash" )
Variables ¶
This section is empty.
Functions ¶
func Matches ¶
func Matches(worker, snap *ateapipb.SandboxRuntime) bool
Matches reports whether a worker's SandboxRuntime can restore a snapshot stamped with snap. A nil snapshot SandboxRuntime imposes no constraint. Otherwise the sandbox classes must be equal and MatchesCompat must hold.
func MatchesCompat ¶ added in v0.5.0
func MatchesCompat(worker, snap *ateapipb.VersionedSandboxCompat) bool
MatchesCompat reports whether worker can restore a snapshot stamped with snap: the same non-empty schema version, and every attribute on snap present on worker with an equal value. Keys only the worker has are ignored, so a worker can start reporting a new key under the same schema version without invalidating the snapshots taken before it; removing or recomputing a key is a new schema version, under which older snapshots no longer match.
func MatchingRuntime ¶ added in v0.5.0
func MatchingRuntime(status *ateapipb.WorkerStatus, snap *ateapipb.SandboxRuntime) *ateapipb.SandboxRuntime
MatchingRuntime returns the SandboxRuntime from status that can restore a snapshot stamped with snap (checking DefaultRuntime first, then RestorableRuntimes in order), or nil if none matches. When snap is nil, DefaultRuntime is returned.
func ProbeHost ¶
func ProbeHost() *ateletpb.VersionedSandboxCompat
ProbeHost inspects the current host and returns its v1 VersionedSandboxCompat in atelet wire format.
TODO: Probe and populate cpu_features and other host hardware attributes (e.g. via CPUID on amd64 and MIDR_EL1 on arm64).
func RuntimeFor ¶ added in v0.5.0
func RuntimeFor(status *ateapipb.WorkerStatus, snap *ateapipb.SandboxRuntime) *ateapipb.SandboxRuntime
RuntimeFor returns the runtime a worker with status runs an actor under whose snapshot is stamped with snap: the matching runtime when it can restore the snapshot, else the DefaultRuntime the guest boots fresh under. This is what an assignment records and what the actor's next checkpoint is stamped with.
func WorkerMatches ¶ added in v0.5.0
func WorkerMatches(status *ateapipb.WorkerStatus, snap *ateapipb.SandboxRuntime) bool
WorkerMatches reports whether a worker with status can restore a snapshot stamped with snap. A nil snapshot SandboxRuntime imposes no constraint.
Types ¶
This section is empty.