workload

package
v1.46.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	UpdateWorkloadState(ctx context.Context, workloadState *State, workload *tfv1.TensorFusionWorkload) error
	ApplyRecommendationToWorkload(ctx context.Context, workloadState *State, recommendation *tfv1.Resources) error
	UpdateWorkloadStatus(ctx context.Context, state *State, recommendation *tfv1.Resources) error
	GetMaxAllowedResourcesSpec(workload *State) (*tfv1.Resource, error)
}

func NewHandler

func NewHandler(client client.Client, allocator *gpuallocator.GpuAllocator) Handler

type State

type State struct {
	Namespace             string
	Name                  string
	Spec                  tfv1.WorkloadProfileSpec
	Status                tfv1.TensorFusionWorkloadStatus
	CurrentActiveWorkers  map[string]*corev1.Pod
	WorkerUsageSamplers   map[string]*metrics.WorkerUsageSampler
	WorkerUsageAggregator *metrics.WorkerUsageAggregator
}

func NewWorkloadState

func NewWorkloadState() *State

func (*State) AddSample

func (w *State) AddSample(sample *metrics.WorkerUsage)

func (*State) GetCurrentResourcesSpec

func (w *State) GetCurrentResourcesSpec() *tfv1.Resources

func (*State) GetOriginalResourcesSpec

func (w *State) GetOriginalResourcesSpec() *tfv1.Resources

func (*State) IsAutoSetResourcesEnabled

func (w *State) IsAutoSetResourcesEnabled() bool

func (*State) IsRecommendationAppliedToAllWorkers

func (w *State) IsRecommendationAppliedToAllWorkers() bool

func (*State) ShouldScaleResource

func (w *State) ShouldScaleResource(name tfv1.ResourceName) bool

Jump to

Keyboard shortcuts

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