api

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// K8s API group name.
	APIGroupName = icrd.APIGroupName
	// K8s API group version.
	APIVersion = icrd.APIVersion
	// PLain HW GPU to be allocated.
	GpuDeviceType = icrd.GpuDeviceType
	// SR-IOV Virtual Function to be allocated.
	VfDeviceType = icrd.VfDeviceType
	// Either GPU or VF to be allocated.
	AnyDeviceType = icrd.AnyDeviceType
	// Unsupported device type.
	UnknownDeviceType = icrd.UnknownDeviceType
	// K8s API Kind string for GpuClaimParameters.
	GpuClaimParametersKind = "GpuClaimParameters"
	// K8s API Kind string for GpuClassParameters.
	GpuClassParametersKind = "GpuClassParameters"
)
View Source
const (
	// Status indicating that CRD entry can be used by controller.
	GpuAllocationStateStatusReady = "Ready"
	// Status indicating that CRD entry cannot be used by controller.
	GpuAllocationStateStatusNotReady = "NotReady"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocatableGpu

type AllocatableGpu = intelcrd.AllocatableGpu

AllocatableGpu represents an allocatable Gpu on a node.

type AllocatedClaim

type AllocatedClaim = intelcrd.AllocatedClaim

Resources that were allocated for the claim by controller.

type AllocatedClaims

type AllocatedClaims = intelcrd.AllocatedClaims

Map of resources allocated per claim UID.

type AllocatedGpu

type AllocatedGpu = intelcrd.AllocatedGpu

AllocatedGpu represents an allocated Gpu on a node.

func AllocatedFromAllocatable

func AllocatedFromAllocatable(source *AllocatableGpu, claimParams *intelcrd.GpuClaimParametersSpec, shared bool) AllocatedGpu

AllocatedFromAllocatable returns AllocatedGpu with relevant fields copied from AllocatableGpu.

type AllocatedGpus

type AllocatedGpus = intelcrd.AllocatedGpus

AllocatedGpus represents a list of allocated devices on a node.

type DeviceSelector

type DeviceSelector = icrd.DeviceSelector

DeviceSelector allows one to match on a specific type of Device as part of the class.

type GpuAllocationState

type GpuAllocationState struct {
	*intelcrd.GpuAllocationState
	// contains filtered or unexported fields
}

Main GpuAllocationState object structure - used to track allocatable devices, allocated devices per ResourceClaim.UID, prepared devices per ResourceClaim.UID.

func NewGpuAllocationState

func NewGpuAllocationState(config *GpuAllocationStateConfig, clientset intelclientset.Interface) *GpuAllocationState

Returns a blank GpuAllocationState object ready to retrieve the record from API or creates a new one.

func (*GpuAllocationState) AvailableAndConsumed

func (g *GpuAllocationState) AvailableAndConsumed() (
	map[string]*intelcrd.AllocatableGpu, map[string]*intelcrd.AllocatableGpu)

AvailableAndConsumed returns allocatable devices without devices that have VFs provisioned, and calculates consumed resources based on existing allocations.

func (*GpuAllocationState) Create

func (g *GpuAllocationState) Create(ctx context.Context) error

Submits a new GpuAllocationState record to the API.

func (*GpuAllocationState) Delete

func (g *GpuAllocationState) Delete(ctx context.Context) error

Removes the GpuAllocationState record from the API.

func (*GpuAllocationState) DeviceIsAllocated

func (g *GpuAllocationState) DeviceIsAllocated(deviceUID string) bool

DeviceIsAllocated returns true if device is present in any allocation, otherwise false.

func (*GpuAllocationState) Get

Fetches existing GpuAllocationState record from the API or returns error.

func (*GpuAllocationState) GetOrCreate

func (g *GpuAllocationState) GetOrCreate(ctx context.Context) error

Returns an existing GpuAllocationState record fetched from API or submits new record ensuring it exists in the API.

func (*GpuAllocationState) GpuHasVFs

func (g *GpuAllocationState) GpuHasVFs(parentUID string) bool

GpuHasVFs returns true if allocatable devices have VFs with parentUID, or allocated devices have pending / not yet provisioned VFs with parentUID.

func (*GpuAllocationState) ListNames

func (g *GpuAllocationState) ListNames(ctx context.Context) ([]string, error)

Returns list of existing GpuAllocationState records in the API.

func (*GpuAllocationState) SameOwnerVFAllocations

func (g *GpuAllocationState) SameOwnerVFAllocations(parentUID string, owner string) bool

SameOwnerVFAllocations returns true if all VFs currently allocated from parentUID belong to the same owner, otherwise false.

func (*GpuAllocationState) Update

Updates the GpuAllocationState record in the API.

func (*GpuAllocationState) UpdateStatus

func (g *GpuAllocationState) UpdateStatus(ctx context.Context, status string) error

Updates only status field of the GpuAllocationState record in the API.

type GpuAllocationStateConfig

type GpuAllocationStateConfig struct {
	Name      string
	Namespace string
	Owner     *metav1.OwnerReference
}

Config to help getting entry of GpuAllocationState.

type GpuAllocationStateSpec

type GpuAllocationStateSpec = intelcrd.GpuAllocationStateSpec

GpuAllocationStateSpec is the spec for the GpuAllocationState CRD.

type GpuClaimParameters

type GpuClaimParameters = icrd.GpuClaimParameters

Main GpuClaimParameters object for storing resource request specification.

type GpuClaimParametersList

type GpuClaimParametersList = icrd.GpuClaimParametersList

List of GpuClaimParameters.

type GpuClaimParametersSpec

type GpuClaimParametersSpec = icrd.GpuClaimParametersSpec

Spec field of GpuClaimParameters.

func DefaultGpuClaimParametersSpec

func DefaultGpuClaimParametersSpec() *GpuClaimParametersSpec

DefaultGpuClaimParametersSpec returns new object with hardcoded default values.

type GpuClassParameters

type GpuClassParameters = icrd.GpuClassParameters

Main GpuClassParameters object for storing resource request specification.

type GpuClassParametersList

type GpuClassParametersList = icrd.GpuClassParametersList

List of GpuClassParameters.

type GpuClassParametersSpec

type GpuClassParametersSpec = icrd.GpuClassParametersSpec

Spec field of GpuClassParameters.

func DefaultGpuClassParametersSpec

func DefaultGpuClassParametersSpec() *GpuClassParametersSpec

DefaultGpuClassParametersSpec returns new object with hardcoded default values.

type PreparedClaim

type PreparedClaim = intelcrd.PreparedClaim

Resources prepared for the claim by kubelet-plugin.

type PreparedClaims

type PreparedClaims = intelcrd.PreparedClaims

Resources prepared for the claim by kubelet-plugin.

Jump to

Keyboard shortcuts

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