specs

package module
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 2 Imported by: 14

Documentation

Index

Constants

View Source
const CurrentVersion = "0.8.0"

CurrentVersion is the current version of the Spec.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerEdits

type ContainerEdits struct {
	Env            []string      `json:"env,omitempty"`
	DeviceNodes    []*DeviceNode `json:"deviceNodes,omitempty"`
	Hooks          []*Hook       `json:"hooks,omitempty"`
	Mounts         []*Mount      `json:"mounts,omitempty"`
	IntelRdt       *IntelRdt     `json:"intelRdt,omitempty"`
	AdditionalGIDs []uint32      `json:"additionalGids,omitempty"`
}

ContainerEdits are edits a container runtime must make to the OCI spec to expose the device.

type Device

type Device struct {
	Name string `json:"name"`
	// Annotations add meta information per device. Note these are CDI-specific and do not affect container metadata.
	Annotations    map[string]string `json:"annotations,omitempty"`
	ContainerEdits ContainerEdits    `json:"containerEdits"`
}

Device is a "Device" a container runtime can add to a container

type DeviceNode

type DeviceNode struct {
	Path        string       `json:"path"`
	HostPath    string       `json:"hostPath,omitempty"`
	Type        string       `json:"type,omitempty"`
	Major       int64        `json:"major,omitempty"`
	Minor       int64        `json:"minor,omitempty"`
	FileMode    *os.FileMode `json:"fileMode,omitempty"`
	Permissions string       `json:"permissions,omitempty"`
	UID         *uint32      `json:"uid,omitempty"`
	GID         *uint32      `json:"gid,omitempty"`
}

DeviceNode represents a device node that needs to be added to the OCI spec.

func (*DeviceNode) ToOCI deprecated

func (d *DeviceNode) ToOCI() error

ToOCI returns the opencontainers runtime Spec LinuxDevice for this DeviceNode.

Deprecated: This function has been moved to tags.cncf.io/container-device-interface/pkg/cdi.DeviceNode.toOCI and made private.

type Hook

type Hook struct {
	HookName string   `json:"hookName"`
	Path     string   `json:"path"`
	Args     []string `json:"args,omitempty"`
	Env      []string `json:"env,omitempty"`
	Timeout  *int     `json:"timeout,omitempty"`
}

Hook represents a hook that needs to be added to the OCI spec.

func (*Hook) ToOCI deprecated

func (h *Hook) ToOCI() error

ToOCI returns the opencontainers runtime Spec Hook for this Hook.

Deprecated: This function has been moved to tags.cncf.io/container-device-interface/pkg/cdi.Hook.toOCI and made private.

type IntelRdt added in v0.7.0

type IntelRdt struct {
	ClosID        string `json:"closID,omitempty"`
	L3CacheSchema string `json:"l3CacheSchema,omitempty"`
	MemBwSchema   string `json:"memBwSchema,omitempty"`
	EnableCMT     bool   `json:"enableCMT,omitempty"`
	EnableMBM     bool   `json:"enableMBM,omitempty"`
}

IntelRdt describes the Linux IntelRdt parameters to set in the OCI spec.

func (*IntelRdt) ToOCI deprecated added in v0.7.0

func (i *IntelRdt) ToOCI() error

ToOCI returns the opencontainers runtime Spec LinuxIntelRdt for this IntelRdt config.

Deprecated: This function has been moved to tags.cncf.io/container-device-interface/pkg/cdi.IntelRdt.toOCI and made private.

type Mount

type Mount struct {
	HostPath      string   `json:"hostPath"`
	ContainerPath string   `json:"containerPath"`
	Options       []string `json:"options,omitempty"`
	Type          string   `json:"type,omitempty"`
}

Mount represents a mount that needs to be added to the OCI spec.

func (*Mount) ToOCI deprecated

func (m *Mount) ToOCI() error

ToOCI returns the opencontainers runtime Spec Mount for this Mount.

Deprecated: This function has been moved to tags.cncf.io/container-device-interface/pkg/cdi.Mount.toOCI and made private.

type Spec

type Spec struct {
	Version string `json:"cdiVersion"`
	Kind    string `json:"kind"`
	// Annotations add meta information per CDI spec. Note these are CDI-specific and do not affect container metadata.
	Annotations    map[string]string `json:"annotations,omitempty"`
	Devices        []Device          `json:"devices"`
	ContainerEdits ContainerEdits    `json:"containerEdits,omitempty"`
}

Spec is the base configuration for CDI

Jump to

Keyboard shortcuts

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