core

package
v0.0.0-...-12e0a72 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNodeInitialized

func IsNodeInitialized(node v1.Node) bool

IsNodeInitialized checks if the GPU Partitioning on the provided node has already been initialized is initialized. A node is initialized if it has GPU Spec partitioning annotations, and according to these annotations all the GPUs of the node have at least one GPU partition.

func NewPartitioningPlanId

func NewPartitioningPlanId() string

Types

type Actuator

type Actuator interface {
	Apply(ctx context.Context, snapshot Snapshot, plan PartitioningPlan) (bool, error)
}

func NewActuator

func NewActuator(client client.Client, partitioner Partitioner) Actuator

type NodeInitializer

type NodeInitializer interface {
	InitNodePartitioning(ctx context.Context, node v1.Node) error
}

type PartitionCalculator

type PartitionCalculator interface {
	GetPartitioning(node PartitionableNode) state.NodePartitioning
}

type PartitionableNode

type PartitionableNode interface {
	UpdateGeometryFor(slices map[gpu.Slice]int) (bool, error)
	GetName() string
	Geometry() map[gpu.Slice]int
	NodeInfo() framework.NodeInfo
	Clone() interface{}
	AddPod(pod v1.Pod) error
	HasFreeCapacity() bool
}

type Partitioner

type Partitioner interface {
	ApplyPartitioning(ctx context.Context, node v1.Node, planId string, partitioning state.NodePartitioning) error
}

type PartitioningPlan

type PartitioningPlan struct {
	DesiredState state.PartitioningState
	// contains filtered or unexported fields
}

func (PartitioningPlan) GetId

func (p PartitioningPlan) GetId() string

type Planner

type Planner interface {
	Plan(ctx context.Context, snapshot Snapshot, pendingPods []v1.Pod) (PartitioningPlan, error)
}

func NewPlanner

func NewPlanner(partitioner PartitionCalculator, sliceCalculator gpu.SliceCalculator, schedulerFramework framework.Framework) Planner

type SliceTracker

type SliceTracker struct {
	// contains filtered or unexported fields
}

SliceTracker is a utility struct for tracking the lacking GPU slices of a list of pods

func NewSliceTracker

func NewSliceTracker(snapshot Snapshot, calculator gpu.SliceCalculator, pods []v1.Pod) SliceTracker

func (SliceTracker) GetLackingSlices

func (t SliceTracker) GetLackingSlices() map[gpu.Slice]int

func (SliceTracker) GetRequestedSlices

func (t SliceTracker) GetRequestedSlices() map[gpu.Slice]int

func (SliceTracker) Remove

func (t SliceTracker) Remove(pod v1.Pod)

type Snapshot

type Snapshot interface {
	GetPartitioningState() state.PartitioningState
	GetCandidateNodes() []PartitionableNode
	GetLackingSlices(pod v1.Pod) map[gpu.Slice]int
	SetNode(n PartitionableNode)
	Fork() error
	Commit()
	Revert()
	GetNode(name string) (PartitionableNode, bool)
	GetNodes() map[string]PartitionableNode
	AddPod(node string, pod v1.Pod) error
	Clone() Snapshot
}

func NewClusterSnapshot

func NewClusterSnapshot(
	nodes map[string]PartitionableNode,
	partitioner PartitionCalculator,
	sliceCalculator gpu.SliceCalculator,
	sliceFilter gpu.SliceFilter,
) Snapshot

type SnapshotTaker

type SnapshotTaker interface {
	TakeSnapshot(clusterState *state.ClusterState) (Snapshot, error)
}

type Sorter

type Sorter interface {
	Sort(pods []v1.Pod) []v1.Pod
}

type SorterAdapter

type SorterAdapter func(pods []v1.Pod) []v1.Pod

func NewPodSorter

func NewPodSorter(sliceCalculator gpu.SliceCalculator) SorterAdapter

func (SorterAdapter) Sort

func (f SorterAdapter) Sort(pods []v1.Pod) []v1.Pod

Jump to

Keyboard shortcuts

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