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 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.
Click to show internal directories.
Click to hide internal directories.