Documentation
¶
Index ¶
- type Handler
- type State
- func (w *State) AddSample(sample *metrics.WorkerUsage)
- func (w *State) GetCurrentResourcesSpec() *tfv1.Resources
- func (w *State) GetOriginalResourcesSpec() *tfv1.Resources
- func (w *State) IsAutoSetResourcesEnabled() bool
- func (w *State) IsRecommendationAppliedToAllWorkers() bool
- func (w *State) ShouldScaleResource(name tfv1.ResourceName) bool
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 (*State) GetOriginalResourcesSpec ¶
func (*State) IsAutoSetResourcesEnabled ¶
func (*State) IsRecommendationAppliedToAllWorkers ¶
func (*State) ShouldScaleResource ¶
func (w *State) ShouldScaleResource(name tfv1.ResourceName) bool
Click to show internal directories.
Click to hide internal directories.