engine

package
v1.18.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBinaryPathsForRuntimes added in v1.17.0

func GetBinaryPathsForRuntimes(cfg defaultRuntimesGetter) []string

GetBinaryPathsForRuntimes returns the list of binary paths for common runtimes. The following list of runtimes is considered:

the default runtime, "runc", and "crun"

If an nvidia* runtime is set as the default runtime, this is ignored.

func GetLowLevelRuntimes added in v1.17.0

func GetLowLevelRuntimes(cfg defaultRuntimesGetter) []string

GetLowLevelRuntimes returns a predefined list low-level runtimes from the specified config. nvidia* runtimes are ignored.

Types

type Config

type Config struct {
	Source      RuntimeConfigSource
	Destination RuntimeConfigDestination
}

A Config represents a config for a container engine. These include container, cri-o, and docker. The config is logically split into a Source and Destination. This allows an existing config to be updated (Source == Destination) or runtime-specific settings to be written to a new config. The latter is useful when creation NVIDIA-specific drop-in files for container engines that support this.

func (*Config) AddRuntime added in v1.18.0

func (c *Config) AddRuntime(name string, path string, setAsDefault bool) error

AddRuntime adds a runtime to the destination config and optionally sets it as the default. The options to apply to the added runtime are read from the source config default runtime.

func (*Config) DefaultRuntime added in v1.18.0

func (c *Config) DefaultRuntime() string

DefaultRuntime returns the default runtime for the source config.

func (*Config) EnableCDI added in v1.18.0

func (c *Config) EnableCDI()

EnableCDI enables CDI in the destination config.

func (*Config) GetRuntimeConfig added in v1.18.0

func (c *Config) GetRuntimeConfig(runtime string) (RuntimeConfig, error)

GetRuntimeConfig returns the source config for the specified runtime.

func (*Config) RemoveRuntime added in v1.18.0

func (c *Config) RemoveRuntime(runtime string) error

RemoveRuntime removes a runtime from the destination config.

func (*Config) Save added in v1.18.0

func (c *Config) Save(path string) (int64, error)

Save saves the destination runtime to the specified path.

func (*Config) String added in v1.18.0

func (c *Config) String() string

type Interface

type Interface interface {
	AddRuntime(string, string, bool) error
	DefaultRuntime() string
	EnableCDI()
	GetRuntimeConfig(string) (RuntimeConfig, error)
	RemoveRuntime(string) error
	Save(string) (int64, error)
	String() string
}

Interface defines the API for a runtime config updater.

type RuntimeConfig added in v1.17.0

type RuntimeConfig interface {
	GetBinaryPath() string
}

RuntimeConfig defines the interface to query container runtime handler configuration

type RuntimeConfigDestination added in v1.18.0

type RuntimeConfigDestination interface {
	AddRuntimeWithOptions(string, string, bool, interface{}) error
	EnableCDI()
	RemoveRuntime(string) error
	Save(string) (int64, error)
	String() string
}

A RuntimeConfigDestination allows a runtime with specific settings to be WRITTEN to a config.

type RuntimeConfigSource added in v1.18.0

type RuntimeConfigSource interface {
	DefaultRuntime() string
	GetRuntimeConfig(string) (RuntimeConfig, error)
	GetDefaultRuntimeOptions() interface{}
	String() string
}

A RuntimeConfigSource allows runtime-specific settings to be READ from a config.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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