Documentation
¶
Overview ¶
Package ocispec builds the runtime-neutral OCI spec for actor bundles, which each ateom shapes for its runtime.
Index ¶
- Constants
- func Build(o Options) *specs.Spec
- func Load(bundlePath string) (*specs.Spec, error)
- func Save(bundlePath string, spec *specs.Spec) error
- func ShapeGVisor(spec *specs.Spec, o GVisorOptions)
- func ShapeMicroVM(spec *specs.Spec, o MicroVMOptions) error
- type GVisorOptions
- type MicroVMOptions
- type Options
Constants ¶
const ( 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>. )
Sub-share names inside the micro-VM virtio-fs share.
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 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 ¶
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.