Documentation
¶
Overview ¶
Package ociruntime implements the persistent OCI lifecycle used by container engines to run MicroVM workloads.
Index ¶
- Constants
- func BuildGuestInitramfs(bundle string, config Config) (string, func(), error)
- func LaunchSupervisor(ctx context.Context, store *Store, id, executable, pidFile string) error
- func ServeSupervisor(ctx context.Context, store *Store, id string, readyFD int) (err error)
- type Capabilities
- type Config
- type Mount
- type Process
- type Rlimit
- type Root
- type State
- type Store
- func (s *Store) Close() error
- func (s *Store) Create(ctx context.Context, id, bundle string) (State, error)
- func (s *Store) Delete(ctx context.Context, id string, force bool) error
- func (s *Store) Dir() string
- func (s *Store) Get(ctx context.Context, id string) (State, bool, error)
- func (s *Store) Kill(ctx context.Context, id string, signal syscall.Signal) error
- func (s *Store) List(ctx context.Context) ([]State, error)
- func (s *Store) SetExited(ctx context.Context, id string, status uint32, exitedAt time.Time) error
- func (s *Store) SetStatus(ctx context.Context, id, status string) error
- func (s *Store) SetSupervisor(ctx context.Context, id string, pid int) error
- func (s *Store) Start(ctx context.Context, id string) error
- type User
- type VMMMetrics
Constants ¶
View Source
const (
OCIVersion = "1.2.0"
)
Variables ¶
This section is empty.
Functions ¶
func BuildGuestInitramfs ¶
BuildGuestInitramfs snapshots Podman's already-materialized rootfs through os.Root confinement, injects the project-owned PID 1 and the OCI entrypoint, then creates the deterministic archive consumed by the native VMM.
func LaunchSupervisor ¶
Types ¶
type Capabilities ¶
type Config ¶
type Config struct {
OCIVersion string `json:"ociVersion"`
Root Root `json:"root"`
Process Process `json:"process"`
Hostname string `json:"hostname,omitempty"`
Mounts []Mount `json:"mounts,omitempty"`
Hooks json.RawMessage `json:"hooks,omitempty"`
Linux json.RawMessage `json:"linux,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
}
func LoadConfig ¶
type Process ¶
type Process struct {
Terminal bool `json:"terminal,omitempty"`
User User `json:"user"`
Args []string `json:"args"`
Env []string `json:"env,omitempty"`
Cwd string `json:"cwd"`
Capabilities *Capabilities `json:"capabilities,omitempty"`
Rlimits []Rlimit `json:"rlimits,omitempty"`
NoNewPrivileges bool `json:"noNewPrivileges,omitempty"`
ApparmorProfile string `json:"apparmorProfile,omitempty"`
OOMScoreAdj *int `json:"oomScoreAdj,omitempty"`
SelinuxLabel string `json:"selinuxLabel,omitempty"`
}
type State ¶
type State struct {
OCIVersion string `json:"ociVersion"`
ID string `json:"id"`
Status string `json:"status"`
PID int `json:"pid"`
// PIDStartTicks distinguishes this process from a later reuse of PID.
// Zero preserves compatibility with state created before this field existed.
PIDStartTicks int64 `json:"pidStartTicks,omitempty"`
Bundle string `json:"bundle"`
Created time.Time `json:"created"`
ExitStatus *uint32 `json:"exitStatus,omitempty"`
ExitedAt *time.Time `json:"exitedAt,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
Metrics *VMMMetrics `json:"metrics,omitempty"`
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) List ¶
List returns the reconciled runtime states in stable ID order. State files are the only source of truth; lock files, control sockets and interrupted temporary writes are never surfaced as workloads.
func (*Store) SetSupervisor ¶
type VMMMetrics ¶
type VMMMetrics struct {
APIVersion string `json:"api_version"`
RuntimeMS int64 `json:"runtime_ms"`
MemoryMiB int `json:"memory_mib"`
VCPUs int `json:"vcpus"`
ExitStatus uint32 `json:"exit_status"`
}
VMMMetrics is terminal, durable telemetry embedded in the canonical runtime state rather than maintained in a second sidecar store.
Click to show internal directories.
Click to hide internal directories.