juju: github.com/juju/juju/core/devices Index | Files

package devices

import "github.com/juju/juju/core/devices"

Index

Package Files

constraints.go kubernetes.go

type Constraints Uses

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 Uses

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 Uses

type DeviceType string

DeviceType defines a device type.

type KubernetesDeviceParams Uses

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.

Package devices imports 4 packages (graph) and is imported by 18 packages. Updated 2018-08-15. Refresh now. Tools for package owners.