ocispec

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package ocispec builds the runtime-neutral OCI spec for actor bundles, which each ateom shapes for its runtime.

Index

Constants

View Source
const (
	// GuestSharedDir is where the kata agent mounts the share in the guest.
	GuestSharedDir = "/run/kata-containers/shared/containers"
	// ShareDurable, ShareCSI and ShareSystemInfo hold one subdirectory per
	// volume; ShareVolumes holds a container's image volumes at
	// <containerID>/volumes/<name>.
	ShareDurable    = "durable"
	ShareCSI        = "csi"
	ShareSystemInfo = "system-info"
	ShareVolumes    = "volumes"
)

Sub-share names inside the micro-VM virtio-fs share.

View Source
const PauseContainer = "_pause"

PauseContainer is the name of the sandbox root container. The underscore keeps it outside the k8s-short-name an ActorTemplate container name is drawn from, so no actor container can collide with it.

Variables

This section is empty.

Functions

func Build

func Build(o Options) *specs.Spec

Build returns a runtime-neutral OCI spec for an actor container.

func Load

func Load(bundlePath string) (*specs.Spec, error)

Load reads the OCI spec of the bundle at bundlePath.

func Save

func Save(bundlePath string, spec *specs.Spec) error

Save writes spec as the OCI spec of the bundle at bundlePath.

func ShapeGVisor

func ShapeGVisor(spec *specs.Spec, o GVisorOptions)

ShapeGVisor adds runsc CRI annotations, durable-dir mount hints, host resolv.conf, and per-container cgroups to the spec. It is idempotent.

func ShapeMicroVM

func ShapeMicroVM(spec *specs.Spec, o MicroVMOptions) error

ShapeMicroVM replaces host system mounts with guest mounts, repoints volume bind mounts to guest share paths, and fills in kata's default resources. It must run on an unshaped spec, and errors on a bind it cannot place in the guest.

Types

type GVisorOptions

type GVisorOptions struct {
	ActorUID      string
	ContainerName string
	// DurableVolumes are declared on the sandbox (pause) spec only.
	DurableVolumes []string
	// Size sizes the container's cgroup leaf. Only gVisor applies it; a micro-VM
	// container's limits come from its own declared resources (see sizing).
	Size sizing.SandboxSize
}

GVisorOptions describes the gVisor-specific context of one actor container.

type MicroVMOptions

type MicroVMOptions struct {
	ActorUID    string
	ContainerID string
}

MicroVMOptions describes the micro-VM context of one actor container.

type Options

type Options struct {
	ActorUID      string
	ContainerName string
	Args          []string
	Env           []string
	// NetNSPath is the network namespace the ateom runs the actor in.
	NetNSPath    string
	Volumes      []*ateletpb.Volume
	VolumeMounts []*ateletpb.VolumeMount
	Capabilities []string
	// Resources are the container's own declared limits, or nil for none.
	Resources *ateletpb.ResourceLimits
}

Options describes one actor container. Args, Env and Capabilities arrive already resolved.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL