devices

package
v0.0.0-...-6dcaeb9 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: AGPL-3.0 Imports: 3 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Constraints

type Constraints struct {

	// Type is the device type or device-class.
	// currently supported types are
	// - gpu
	// - nvidia.com/gpu
	// - amd.com/gpu
	Type DeviceType `bson:"type"`

	// Count is the number of devices that the user has asked for - count min and max are the
	// number of devices the charm requires.
	Count int64 `bson:"count"`

	// Attributes is a collection of key value pairs device related (node affinity labels/tags etc.).
	Attributes map[string]string `bson:"attributes"`
}

Constraints describes a set of device constraints.

func ParseConstraints

func ParseConstraints(s string) (Constraints, error)

ParseConstraints parses the specified string and creates a Constraints structure.

The acceptable format for device constraints is a comma separated sequence of: COUNT, TYPE, and ATTRIBUTES with format like

<device-name>=[<count>,]<device-class>|<vendor/type>[,<attributes>]

where

COUNT is the number of devices that the user has asked for - count min and max are the
number of devices the charm requires. If unspecified, COUNT defaults to 1.

type DeviceType

type DeviceType string

DeviceType defines a device type.

type KubernetesDeviceParams

type KubernetesDeviceParams struct {
	// Type is the device type or device-class.
	Type DeviceType `bson:"type"`

	// Count is the number of devices that the user has asked for - count min and max are the
	// number of devices the charm requires.
	Count int64 `bson:"count"`

	// Attributes is a collection of key value pairs device related (node affinity labels/tags etc.).
	Attributes map[string]string `bson:"attributes"`
}

KubernetesDeviceParams is a fully specified set of parameters for devices allocation, derived from one or more of user-specified device constraints, a device definition, and charm device metadata.

Jump to

Keyboard shortcuts

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