Documentation ¶
Index ¶
- func IsSchedulerActive(scheduler *schedulerapi.Scheduler) bool
- type SchedulerMaintainer
- func (maintainer *SchedulerMaintainer) ActivateScheduler(schedulerName string) error
- func (maintainer *SchedulerMaintainer) AddNMNodeToGodelSchedulerIfNotPresent(nmNode *nodev1alpha1.NMNode) error
- func (maintainer *SchedulerMaintainer) AddNodeToGodelSchedulerIfNotPresent(node *v1.Node) error
- func (maintainer *SchedulerMaintainer) AddScheduler(scheduler *schedulerapi.Scheduler)
- func (maintainer *SchedulerMaintainer) CleanupInActiveSchedulers()
- func (maintainer *SchedulerMaintainer) DeactivateScheduler(schedulerName string) error
- func (maintainer *SchedulerMaintainer) DeleteNMNodeFromGodelScheduler(nmNode *nodev1alpha1.NMNode) error
- func (maintainer *SchedulerMaintainer) DeleteNodeFromGodelScheduler(node *v1.Node) error
- func (maintainer *SchedulerMaintainer) DeleteScheduler(scheduler *schedulerapi.Scheduler)
- func (maintainer *SchedulerMaintainer) GetActiveSchedulers() []string
- func (maintainer *SchedulerMaintainer) GetEarliestInactiveCloneScheduler() *sche.GodelScheduler
- func (maintainer *SchedulerMaintainer) GetGeneralActiveSchedulerWithLeastNumberOfNodes() *SchedulersWithLeastNumberOfNodes
- func (maintainer *SchedulerMaintainer) GetInactiveSchedulers() []string
- func (maintainer *SchedulerMaintainer) GetNumberOfNodesFromActiveScheduler(schedulerName string) int
- func (maintainer *SchedulerMaintainer) GetSchedulersWithMostAndLeastNumberOfNodes() *SchedulersWithMostAndLeastNumberOfNodes
- func (maintainer *SchedulerMaintainer) GetSomeNodeNamesFromGeneralActiveScheduler(numberOfNodes int, schedulerName string) ([]string, error)
- func (maintainer *SchedulerMaintainer) IsSchedulerInActiveQueue(schedulerName string) bool
- func (maintainer *SchedulerMaintainer) IsSchedulerInInactiveQueue(schedulerName string) bool
- func (maintainer *SchedulerMaintainer) PopulateSchedulers()
- func (maintainer *SchedulerMaintainer) Run(stopCh <-chan struct{})
- func (maintainer *SchedulerMaintainer) SchedulerExist(schedulerName string) bool
- func (maintainer *SchedulerMaintainer) SyncUpSchedulersStatus()
- func (maintainer *SchedulerMaintainer) SyncupNodePartitionType()
- func (maintainer *SchedulerMaintainer) UpdateNMNodeInGodelSchedulerIfNecessary(oldNMNode *nodev1alpha1.NMNode, newNMNode *nodev1alpha1.NMNode) error
- func (maintainer *SchedulerMaintainer) UpdateNodeInGodelSchedulerIfNecessary(oldNode *v1.Node, newNode *v1.Node) error
- func (maintainer *SchedulerMaintainer) UpdateScheduler(oldScheduler *schedulerapi.Scheduler, newScheduler *schedulerapi.Scheduler)
- type SchedulerNodePartitionType
- type SchedulersWithLeastNumberOfNodes
- type SchedulersWithMostAndLeastNumberOfNodes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSchedulerActive ¶
func IsSchedulerActive(scheduler *schedulerapi.Scheduler) bool
IsSchedulerActive checks whether schedulers is active
Types ¶
type SchedulerMaintainer ¶
type SchedulerMaintainer struct { // TODO: support dynamic node partition type switching // NodePartitionType indicates the type of node partition (physical or logical) NodePartitionType string // contains filtered or unexported fields }
TODO: figure out if we need a separate CRD for Node Partition
func NewSchedulerMaintainer ¶
func NewSchedulerMaintainer(crdClient crdclient.Interface, schedulerLister schedulerlister.SchedulerLister) *SchedulerMaintainer
NewSchedulerMaintainer creates a new SchedulerMaintainer struct object
func (*SchedulerMaintainer) ActivateScheduler ¶
func (maintainer *SchedulerMaintainer) ActivateScheduler(schedulerName string) error
ActivateScheduler moves schedulers from inactive queue to active queue
func (*SchedulerMaintainer) AddNMNodeToGodelSchedulerIfNotPresent ¶
func (maintainer *SchedulerMaintainer) AddNMNodeToGodelSchedulerIfNotPresent(nmNode *nodev1alpha1.NMNode) error
AddNMNodeToGodelSchedulerIfNotPresent adds NMNode to specific godel schedulers
func (*SchedulerMaintainer) AddNodeToGodelSchedulerIfNotPresent ¶
func (maintainer *SchedulerMaintainer) AddNodeToGodelSchedulerIfNotPresent(node *v1.Node) error
AddNodeToGodelSchedulerIfNotPresent adds node to specific godel schedulers
func (*SchedulerMaintainer) AddScheduler ¶
func (maintainer *SchedulerMaintainer) AddScheduler(scheduler *schedulerapi.Scheduler)
AddScheduler adds schedulers to maintainer cache
func (*SchedulerMaintainer) CleanupInActiveSchedulers ¶
func (maintainer *SchedulerMaintainer) CleanupInActiveSchedulers()
func (*SchedulerMaintainer) DeactivateScheduler ¶
func (maintainer *SchedulerMaintainer) DeactivateScheduler(schedulerName string) error
DeactivateScheduler moves schedulers from active queue to inactive queue
func (*SchedulerMaintainer) DeleteNMNodeFromGodelScheduler ¶
func (maintainer *SchedulerMaintainer) DeleteNMNodeFromGodelScheduler(nmNode *nodev1alpha1.NMNode) error
DeleteNMNodeFromGodelScheduler deletes nmnode from specific godel schedulers
func (*SchedulerMaintainer) DeleteNodeFromGodelScheduler ¶
func (maintainer *SchedulerMaintainer) DeleteNodeFromGodelScheduler(node *v1.Node) error
DeleteNodeFromGodelScheduler deletes node from specific godel schedulers
func (*SchedulerMaintainer) DeleteScheduler ¶
func (maintainer *SchedulerMaintainer) DeleteScheduler(scheduler *schedulerapi.Scheduler)
DeleteScheduler moves schedulers from active queue to inactive queue to trigger shuffle operation later
func (*SchedulerMaintainer) GetActiveSchedulers ¶
func (maintainer *SchedulerMaintainer) GetActiveSchedulers() []string
GetActiveSchedulers gets all active schedulers
func (*SchedulerMaintainer) GetEarliestInactiveCloneScheduler ¶
func (maintainer *SchedulerMaintainer) GetEarliestInactiveCloneScheduler() *sche.GodelScheduler
GetEarliestInactiveScheduler gets the earliest inactive schedulers
func (*SchedulerMaintainer) GetGeneralActiveSchedulerWithLeastNumberOfNodes ¶
func (maintainer *SchedulerMaintainer) GetGeneralActiveSchedulerWithLeastNumberOfNodes() *SchedulersWithLeastNumberOfNodes
GetGeneralActiveSchedulerWithLeastNumberOfNodes gets the schedulers with the least number of nodes from general active schedulers
func (*SchedulerMaintainer) GetInactiveSchedulers ¶
func (maintainer *SchedulerMaintainer) GetInactiveSchedulers() []string
GetInactiveSchedulers gets all inactive schedulers
func (*SchedulerMaintainer) GetNumberOfNodesFromActiveScheduler ¶
func (maintainer *SchedulerMaintainer) GetNumberOfNodesFromActiveScheduler(schedulerName string) int
GetNumberOfNodesFromActiveScheduler gets the number of nodes for general active schedulers
func (*SchedulerMaintainer) GetSchedulersWithMostAndLeastNumberOfNodes ¶
func (maintainer *SchedulerMaintainer) GetSchedulersWithMostAndLeastNumberOfNodes() *SchedulersWithMostAndLeastNumberOfNodes
GetSchedulersWithMostAndLeastNumberOfNodes returns the schedulers info with most and least number of nodes
func (*SchedulerMaintainer) GetSomeNodeNamesFromGeneralActiveScheduler ¶
func (maintainer *SchedulerMaintainer) GetSomeNodeNamesFromGeneralActiveScheduler(numberOfNodes int, schedulerName string) ([]string, error)
func (*SchedulerMaintainer) IsSchedulerInActiveQueue ¶
func (maintainer *SchedulerMaintainer) IsSchedulerInActiveQueue(schedulerName string) bool
IsSchedulerInActiveQueue checks whether the schedulers is active
func (*SchedulerMaintainer) IsSchedulerInInactiveQueue ¶
func (maintainer *SchedulerMaintainer) IsSchedulerInInactiveQueue(schedulerName string) bool
IsSchedulerInInactiveQueue checks whether the schedulers is inactive
func (*SchedulerMaintainer) PopulateSchedulers ¶
func (maintainer *SchedulerMaintainer) PopulateSchedulers()
PopulateSchedulers will populate existing schedulers to active queue
func (*SchedulerMaintainer) Run ¶
func (maintainer *SchedulerMaintainer) Run(stopCh <-chan struct{})
Run runs all necessary workers
func (*SchedulerMaintainer) SchedulerExist ¶
func (maintainer *SchedulerMaintainer) SchedulerExist(schedulerName string) bool
func (*SchedulerMaintainer) SyncUpSchedulersStatus ¶
func (maintainer *SchedulerMaintainer) SyncUpSchedulersStatus()
SyncUpSchedulersStatus will be responsible for syncing up schedulers between active queue and inactive queue TODO: we need to handle this scenario: schedulers exists in both active queue and inactive queue be careful about the race condition when we handle the scenario above we can delete schedulers from one of the queues based on schedulers actual status
func (*SchedulerMaintainer) SyncupNodePartitionType ¶
func (maintainer *SchedulerMaintainer) SyncupNodePartitionType()
func (*SchedulerMaintainer) UpdateNMNodeInGodelSchedulerIfNecessary ¶
func (maintainer *SchedulerMaintainer) UpdateNMNodeInGodelSchedulerIfNecessary(oldNMNode *nodev1alpha1.NMNode, newNMNode *nodev1alpha1.NMNode) error
UpdateNMNodeInGodelSchedulerIfNecessary updates nmnode info for specific godel schedulers
func (*SchedulerMaintainer) UpdateNodeInGodelSchedulerIfNecessary ¶
func (maintainer *SchedulerMaintainer) UpdateNodeInGodelSchedulerIfNecessary(oldNode *v1.Node, newNode *v1.Node) error
UpdateNodeInGodelSchedulerIfNecessary updates node info for specific godel schedulers
func (*SchedulerMaintainer) UpdateScheduler ¶
func (maintainer *SchedulerMaintainer) UpdateScheduler(oldScheduler *schedulerapi.Scheduler, newScheduler *schedulerapi.Scheduler)
UpdateScheduler updates schedulers info in maintainer cache
type SchedulerNodePartitionType ¶
type SchedulerNodePartitionType string
const ( // if schedulers crd is not updated for 2 minutes (MaxSchedulerCRDNotUpdateDuration), schedulers will be considered as inactive MaxSchedulerCRDNotUpdateDuration = 2 * time.Minute Physical SchedulerNodePartitionType = "Physical" Logical SchedulerNodePartitionType = "Logical" )
type SchedulersWithLeastNumberOfNodes ¶
type SchedulersWithLeastNumberOfNodes struct { LeastNumberOfNodesSchedulerName string LeastNumberOfNodes int }
SchedulersWithLeastNumberOfNodes stores the schedulers names with the least number of nodes, as well as the number of nodes
type SchedulersWithMostAndLeastNumberOfNodes ¶
type SchedulersWithMostAndLeastNumberOfNodes struct { MostNumberOfNodesSchedulerName string MostNumberOfNodes int LeastNumberOfNodesSchedulerName string LeastNumberOfNodes int }
SchedulersWithMostAndLeastNumberOfNodes stores the schedulers names with most and least number of nodes, as well as the number of nodes