flavorassigner

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 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 Assignment

type Assignment struct {
	PodSets     []PodSetAssignment
	TotalBorrow cache.FlavorResourceQuantities
	// contains filtered or unexported fields
}

func AssignFlavors

func AssignFlavors(log logr.Logger, wl *workload.Info, resourceFlavors map[kueue.ResourceFlavorReference]*kueue.ResourceFlavor, cq *cache.ClusterQueue) Assignment

AssignFlavors assigns flavors for each of the resources requested in each pod set. The result for each pod set is accompanied with reasons why the flavor can't be assigned immediately. Each assigned flavor is accompanied with a FlavorAssignmentMode.

func (*Assignment) Borrows

func (a *Assignment) Borrows() bool

func (*Assignment) Message

func (a *Assignment) Message() string

func (*Assignment) RepresentativeMode

func (a *Assignment) RepresentativeMode() FlavorAssignmentMode

RepresentativeMode calculates the representative mode for the assigment as the worst assignment mode among all the pod sets.

func (*Assignment) ToAPI

func (a *Assignment) ToAPI() []kueue.PodSetAssignment

type FlavorAssignment

type FlavorAssignment struct {
	Name kueue.ResourceFlavorReference
	Mode FlavorAssignmentMode
	// contains filtered or unexported fields
}

type FlavorAssignmentMode

type FlavorAssignmentMode int

FlavorAssignmentMode describes whether the flavor can be assigned immediately or what needs to happen so it can be assigned.

const (
	// NoFit means that there is not enough quota to assign this flavor.
	NoFit FlavorAssignmentMode = iota
	// Preempt means that there is not enough unused min quota in the ClusterQueue
	// or cohort. Preempting other workloads in the CluserQueue or cohort, or
	// waiting for them to finish might make it possible to assign this flavor.
	Preempt
	// Fit means that there is enough unused quota in the cohort to assign this
	// flavor.
	Fit
)

The flavor assigment modes below are ordered from lowest to highest preference.

func (FlavorAssignmentMode) String

func (m FlavorAssignmentMode) String() string

type PodSetAssignment

type PodSetAssignment struct {
	Name     string
	Flavors  ResourceAssignment
	Status   *Status
	Requests corev1.ResourceList
}

PodSetAssignment holds the assigned flavors and status messages for each of the resources that the pod set requests. Each assigned flavor is accompanied with an AssignmentMode. Empty .Flavors can be interpreted as NoFit mode for all the resources. Empty .Status can be interpreted as Fit mode for all the resources. .Flavors and .Status can't be empty at the same time, once PodSetAssignment is fully calculated.

func (*PodSetAssignment) RepresentativeMode

func (psa *PodSetAssignment) RepresentativeMode() FlavorAssignmentMode

RepresentativeMode calculates the representative mode for this assignment as the worst assignment mode among all assigned flavors.

type ResourceAssignment

type ResourceAssignment map[corev1.ResourceName]*FlavorAssignment

type Status

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

func (*Status) Equal

func (s *Status) Equal(o *Status) bool

func (*Status) IsError

func (s *Status) IsError() bool

func (*Status) Message

func (s *Status) Message() string

Jump to

Keyboard shortcuts

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