Documentation ¶
Index ¶
- Variables
- func GetCount(node v1.Node) (int, error)
- func GetMemoryGB(node v1.Node) (int, error)
- func IsMigPartitioningEnabled(node v1.Node) bool
- func IsMpsPartitioningEnabled(node v1.Node) bool
- func IsNotFound(err error) bool
- func ParseNodeAnnotations(node v1.Node) (StatusAnnotationList, SpecAnnotationList)
- type Client
- type Device
- type DeviceList
- func (l DeviceList) AsStatusAnnotation(getProfile extractProfileName) StatusAnnotationList
- func (l DeviceList) GetFree() DeviceList
- func (l DeviceList) GetUsed() DeviceList
- func (l DeviceList) GroupBy(keyFunc func(resource Device) string) map[string]DeviceList
- func (l DeviceList) GroupByGpuIndex() map[int]DeviceList
- func (l DeviceList) GroupByResourceName() map[v1.ResourceName]DeviceList
- func (l DeviceList) GroupByStatus() map[resource.Status]DeviceList
- func (l DeviceList) SortByDeviceId() DeviceList
- type DevicePluginClient
- type Error
- type ErrorList
- type Geometry
- type Model
- type PartitioningKind
- type Slice
- type SliceCalculator
- type SliceFilter
- type SpecAnnotation
- type SpecAnnotationList
- type StatusAnnotation
- type StatusAnnotationList
- func (l StatusAnnotationList) Equal(other StatusAnnotationList) bool
- func (l StatusAnnotationList) Filter(keep func(annotation StatusAnnotation) bool) StatusAnnotationList
- func (l StatusAnnotationList) GetFree() StatusAnnotationList
- func (l StatusAnnotationList) GetUsed() StatusAnnotationList
- func (l StatusAnnotationList) GroupByGpuIndex() map[int]StatusAnnotationList
Constants ¶
This section is empty.
Variables ¶
var ( NotFoundErr = errorImpl{/* contains filtered or unexported fields */} GenericErr = errorImpl{/* contains filtered or unexported fields */} )
Functions ¶
func GetMemoryGB ¶
GetMemoryGB returns the amount of memory GB of the GPUs on the node.
func IsMigPartitioningEnabled ¶
IsMigPartitioningEnabled returns true if the node is enabled for automatic MIG GPU partitioning, false otherwise
func IsMpsPartitioningEnabled ¶
IsMpsPartitioningEnabled returns true if the node is enabled for automatic MPS GPU partitioning, false otherwise
func IsNotFound ¶
func ParseNodeAnnotations ¶
func ParseNodeAnnotations(node v1.Node) (StatusAnnotationList, SpecAnnotationList)
Types ¶
type Client ¶
type Client interface { GetDevices(ctx context.Context) (DeviceList, Error) GetUsedDevices(ctx context.Context) (DeviceList, Error) GetAllocatableDevices(ctx context.Context) (DeviceList, Error) }
type Device ¶
func (Device) FullResourceName ¶
FullResourceName returns the full resource name of the MIG device, including the name of the resource corresponding to the MIG profile and the index of the GPU to which it belongs to.
type DeviceList ¶
type DeviceList []Device
func (DeviceList) AsStatusAnnotation ¶
func (l DeviceList) AsStatusAnnotation(getProfile extractProfileName) StatusAnnotationList
func (DeviceList) GetFree ¶
func (l DeviceList) GetFree() DeviceList
func (DeviceList) GetUsed ¶
func (l DeviceList) GetUsed() DeviceList
func (DeviceList) GroupBy ¶
func (l DeviceList) GroupBy(keyFunc func(resource Device) string) map[string]DeviceList
func (DeviceList) GroupByGpuIndex ¶
func (l DeviceList) GroupByGpuIndex() map[int]DeviceList
func (DeviceList) GroupByResourceName ¶
func (l DeviceList) GroupByResourceName() map[v1.ResourceName]DeviceList
func (DeviceList) GroupByStatus ¶
func (l DeviceList) GroupByStatus() map[resource.Status]DeviceList
func (DeviceList) SortByDeviceId ¶
func (l DeviceList) SortByDeviceId() DeviceList
type DevicePluginClient ¶
type DevicePluginClient interface { // Restart restarts the NVIDIA device plugin pod on the specified node, waiting until the // pod is again in state "Running" or the timeout is reached. Restart(ctx context.Context, nodeName string, timeout time.Duration) error }
func NewDevicePluginClient ¶
func NewDevicePluginClient(k8sClient client.Client) DevicePluginClient
type Geometry ¶
Geometry corresponds to the partitioning Geometry of a GPU, namely the slices of the GPU with the respective quantity.
func GetFewestSlicesGeometry ¶
GetFewestSlicesGeometry returns the geometry with the lowest number of different slices
func (Geometry) MarshalJSON ¶
type Model ¶
type Model string
type PartitioningKind ¶
type PartitioningKind string
const ( PartitioningKindMig PartitioningKind = "mig" PartitioningKindMps PartitioningKind = "mps" PartitioningKindHybrid PartitioningKind = "hybrid" )
func GetPartitioningKind ¶
func GetPartitioningKind(node v1.Node) (PartitioningKind, bool)
func (PartitioningKind) String ¶
func (p PartitioningKind) String() string
type SliceCalculator ¶
type SliceFilter ¶
type SliceFilter interface {
ExtractSlices(resources map[v1.ResourceName]int64) map[Slice]int
}
type SpecAnnotation ¶
func ParseSpecAnnotation ¶
func ParseSpecAnnotation(key, value string) (SpecAnnotation, error)
func (SpecAnnotation) GetIndexWithProfile ¶
func (a SpecAnnotation) GetIndexWithProfile() string
GetIndexWithProfile returns the GPU index included in the annotation together with the respective profile. Example:
Annotation:
"nos.nebuly.com/status-gpu-0-1g.10gb-used"
Result:
"0-1g.10gb"
func (SpecAnnotation) GetValue ¶
func (a SpecAnnotation) GetValue() string
func (SpecAnnotation) String ¶
func (a SpecAnnotation) String() string
type SpecAnnotationList ¶
type SpecAnnotationList []SpecAnnotation
func (SpecAnnotationList) GroupByGpuIndex ¶
func (l SpecAnnotationList) GroupByGpuIndex() map[int]SpecAnnotationList
type StatusAnnotation ¶
func ParseStatusAnnotation ¶
func ParseStatusAnnotation(key, value string) (StatusAnnotation, error)
func (StatusAnnotation) GetIndexWithProfile ¶
func (a StatusAnnotation) GetIndexWithProfile() string
GetIndexWithProfile returns the GPU index included in the annotation together with the respective profile. Example:
Annotation:
"nos.nebuly.com/status-gpu-0-1g.10gb-used"
Result:
"0-1g.10gb"
func (StatusAnnotation) GetValue ¶
func (a StatusAnnotation) GetValue() string
func (StatusAnnotation) IsFree ¶
func (a StatusAnnotation) IsFree() bool
IsFree returns true if the annotation refers to a free device
func (StatusAnnotation) IsUsed ¶
func (a StatusAnnotation) IsUsed() bool
IsUsed returns true if the annotation refers to a used device
func (StatusAnnotation) String ¶
func (a StatusAnnotation) String() string
type StatusAnnotationList ¶
type StatusAnnotationList []StatusAnnotation
func (StatusAnnotationList) Equal ¶
func (l StatusAnnotationList) Equal(other StatusAnnotationList) bool
func (StatusAnnotationList) Filter ¶
func (l StatusAnnotationList) Filter(keep func(annotation StatusAnnotation) bool) StatusAnnotationList
func (StatusAnnotationList) GetFree ¶
func (l StatusAnnotationList) GetFree() StatusAnnotationList
GetFree return a new GPUStatusAnnotationList containing the annotations referring to free devices
func (StatusAnnotationList) GetUsed ¶
func (l StatusAnnotationList) GetUsed() StatusAnnotationList
GetUsed return a new GPUStatusAnnotationList containing the annotations referring to used devices
func (StatusAnnotationList) GroupByGpuIndex ¶
func (l StatusAnnotationList) GroupByGpuIndex() map[int]StatusAnnotationList