resource

package
v0.0.1-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputePodRequest

func ComputePodRequest(pod v1.Pod) v1.ResourceList

func FromFrameworkToList

func FromFrameworkToList(r framework.Resource) v1.ResourceList

FromFrameworkToList converts the input scheduler framework.Resource to a core v1.ResourceList

func FromListToFramework

func FromListToFramework(r v1.ResourceList) framework.Resource

FromListToFramework converts the input core v1.ResourceList to a scheduler framework.Resource

func Subtract

Subtract returns a new resource corresponding to the result of r1 - r2. The returned resource contains the union of the scalar resources of r1 and r2.

func SubtractNonNegative

func SubtractNonNegative(r1 framework.Resource, r2 framework.Resource) framework.Resource

SubtractNonNegative returns a new resource corresponding to the result of Max(0, r1 - r2). The returned resource contains the union of the scalar resources of r1 and r2.

func Sum

Sum returns a new resource corresponding to the result of Max(0, r1 - r2). The returned resource contains the union of the scalar resources of r1 and r2.

Types

type Calculator

type Calculator interface {
	ComputePodRequest(pod v1.Pod) v1.ResourceList
}

type Device

type Device struct {
	// ResourceName is the name of the resource exposed to k8s
	// (e.g. nvidia.com/gpu, nvidia.com/mig-2g10gb, etc.)
	ResourceName v1.ResourceName
	// DeviceId is the actual ID of the underlying device
	// (e.g. ID of the GPU, ID of the MIG device, etc.)
	DeviceId string
	// Status represents the status of the k8s resource (e.g. free or used)
	Status Status
}

func (Device) IsFree

func (d Device) IsFree() bool

func (Device) IsUsed

func (d Device) IsUsed() bool

type Status

type Status string
const (
	StatusUsed    Status = "used"
	StatusFree    Status = "free"
	StatusUnknown Status = "unknown"
)

Jump to

Keyboard shortcuts

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