Documentation ¶
Index ¶
- Constants
- func Key(q *kueue.LocalQueue) string
- func SetupIndexes(indexer client.FieldIndexer) error
- type ClusterQueue
- type ClusterQueueBestEffortFIFO
- type ClusterQueueImpl
- func (c *ClusterQueueImpl) AddFromLocalQueue(q *LocalQueue) bool
- func (c *ClusterQueueImpl) Cohort() string
- func (c *ClusterQueueImpl) Delete(w *kueue.Workload)
- func (c *ClusterQueueImpl) DeleteFromLocalQueue(q *LocalQueue)
- func (c *ClusterQueueImpl) Dump() (sets.String, bool)
- func (c *ClusterQueueImpl) DumpInadmissible() (sets.String, bool)
- func (c *ClusterQueueImpl) Info(key string) *workload.Info
- func (c *ClusterQueueImpl) Pending() int
- func (c *ClusterQueueImpl) PendingActive() int
- func (c *ClusterQueueImpl) PendingInadmissible() int
- func (c *ClusterQueueImpl) Pop() *workload.Info
- func (c *ClusterQueueImpl) PushOrUpdate(wInfo *workload.Info)
- func (c *ClusterQueueImpl) QueueInadmissibleWorkloads(ctx context.Context, client client.Client) bool
- func (c *ClusterQueueImpl) RequeueIfNotPresent(wInfo *workload.Info, reason RequeueReason) bool
- func (c *ClusterQueueImpl) Update(apiCQ *kueue.ClusterQueue) error
- type ClusterQueueStrictFIFO
- type LocalQueue
- type Manager
- func (m *Manager) AddClusterQueue(ctx context.Context, cq *kueue.ClusterQueue) error
- func (m *Manager) AddLocalQueue(ctx context.Context, q *kueue.LocalQueue) error
- func (m *Manager) AddOrUpdateWorkload(w *kueue.Workload) bool
- func (m *Manager) Broadcast()
- func (m *Manager) CleanUpOnContext(ctx context.Context)
- func (m *Manager) ClusterQueueForWorkload(wl *kueue.Workload) (string, bool)
- func (m *Manager) DeleteClusterQueue(cq *kueue.ClusterQueue)
- func (m *Manager) DeleteLocalQueue(q *kueue.LocalQueue)
- func (m *Manager) DeleteWorkload(w *kueue.Workload)
- func (m *Manager) Dump() map[string]sets.String
- func (m *Manager) DumpInadmissible() map[string]sets.String
- func (m *Manager) Heads(ctx context.Context) []workload.Info
- func (m *Manager) Pending(cq *kueue.ClusterQueue) int
- func (m *Manager) PendingWorkloads(q *kueue.LocalQueue) (int32, error)
- func (m *Manager) QueueAssociatedInadmissibleWorkloads(ctx context.Context, w *kueue.Workload)
- func (m *Manager) QueueForWorkloadExists(wl *kueue.Workload) bool
- func (m *Manager) QueueInadmissibleWorkloads(ctx context.Context, cqNames sets.String)
- func (m *Manager) RequeueWorkload(ctx context.Context, info *workload.Info, reason RequeueReason) bool
- func (m *Manager) UpdateClusterQueue(ctx context.Context, cq *kueue.ClusterQueue) error
- func (m *Manager) UpdateLocalQueue(q *kueue.LocalQueue) error
- func (m *Manager) UpdateWorkload(oldW, w *kueue.Workload) bool
- type RequeueReason
- type StatusChecker
Constants ¶
const BestEffortFIFO = kueue.BestEffortFIFO
const StrictFIFO = kueue.StrictFIFO
Variables ¶
This section is empty.
Functions ¶
func SetupIndexes ¶
func SetupIndexes(indexer client.FieldIndexer) error
Types ¶
type ClusterQueue ¶
type ClusterQueue interface { // Update updates the properties of this ClusterQueue. Update(*kueue.ClusterQueue) error // Cohort returns the Cohort of this ClusterQueue. Cohort() string // AddFromQueue pushes all workloads belonging to this queue to // the ClusterQueue. If at least one workload is added, returns true. // Otherwise returns false. AddFromLocalQueue(*LocalQueue) bool // DeleteFromQueue removes all workloads belonging to this queue from // the ClusterQueue. DeleteFromLocalQueue(*LocalQueue) // PushOrUpdate pushes the workload to ClusterQueue. // If the workload is already present, updates with the new one. PushOrUpdate(*workload.Info) // Delete removes the workload from ClusterQueue. Delete(*kueue.Workload) // Pop removes the head of the queue and returns it. It returns nil if the // queue is empty. Pop() *workload.Info // RequeueIfNotPresent inserts a workload that was not // admitted back into the ClusterQueue. If the boolean is true, // the workloads should be put back in the queue immediately, // because we couldn't determine if the workload was admissible // in the last cycle. If the boolean is false, the implementation might // choose to keep it in temporary placeholder stage where it doesn't // compete with other workloads, until cluster events free up quota. // The workload should not be reinserted if it's already in the ClusterQueue. // Returns true if the workload was inserted. RequeueIfNotPresent(*workload.Info, RequeueReason) bool // QueueInadmissibleWorkloads moves all workloads put in temporary placeholder stage // to the ClusterQueue. If at least one workload is moved, // returns true. Otherwise returns false. QueueInadmissibleWorkloads(ctx context.Context, client client.Client) bool // Pending returns the total number of pending workloads. Pending() int // PendingActive returns the number of active pending workloads, // workloads that are in the admission queue. PendingActive() int // PendingInadmissible returns the number of inadmissible pending workloads, // workloads that were already tried and are waiting for cluster conditions // to change to potentially become admissible. PendingInadmissible() int // Dump produces a dump of the current workloads in the heap of // this ClusterQueue. It returns false if the queue is empty. // Otherwise returns true. Dump() (sets.String, bool) DumpInadmissible() (sets.String, bool) // Info returns workload.Info for the workload key. // Users of this method should not modify the returned object. Info(string) *workload.Info }
ClusterQueue is an interface for a cluster queue to store workloads waiting to be scheduled.
type ClusterQueueBestEffortFIFO ¶
type ClusterQueueBestEffortFIFO struct {
*ClusterQueueImpl
}
ClusterQueueBestEffortFIFO is the implementation for the ClusterQueue for BestEffortFIFO.
func (*ClusterQueueBestEffortFIFO) RequeueIfNotPresent ¶
func (cq *ClusterQueueBestEffortFIFO) RequeueIfNotPresent(wInfo *workload.Info, reason RequeueReason) bool
type ClusterQueueImpl ¶
type ClusterQueueImpl struct { // QueueingStrategy indicates the queueing strategy of the workloads // across the queues in this ClusterQueue. QueueingStrategy kueue.QueueingStrategy // contains filtered or unexported fields }
ClusterQueueImpl is the base implementation of ClusterQueue interface. It can be inherited and overwritten by other class.
func (*ClusterQueueImpl) AddFromLocalQueue ¶ added in v0.2.0
func (c *ClusterQueueImpl) AddFromLocalQueue(q *LocalQueue) bool
func (*ClusterQueueImpl) Cohort ¶
func (c *ClusterQueueImpl) Cohort() string
func (*ClusterQueueImpl) Delete ¶
func (c *ClusterQueueImpl) Delete(w *kueue.Workload)
func (*ClusterQueueImpl) DeleteFromLocalQueue ¶ added in v0.2.0
func (c *ClusterQueueImpl) DeleteFromLocalQueue(q *LocalQueue)
func (*ClusterQueueImpl) DumpInadmissible ¶ added in v0.2.0
func (c *ClusterQueueImpl) DumpInadmissible() (sets.String, bool)
func (*ClusterQueueImpl) Pending ¶
func (c *ClusterQueueImpl) Pending() int
func (*ClusterQueueImpl) PendingActive ¶ added in v0.2.0
func (c *ClusterQueueImpl) PendingActive() int
func (*ClusterQueueImpl) PendingInadmissible ¶ added in v0.2.0
func (c *ClusterQueueImpl) PendingInadmissible() int
func (*ClusterQueueImpl) Pop ¶
func (c *ClusterQueueImpl) Pop() *workload.Info
func (*ClusterQueueImpl) PushOrUpdate ¶
func (c *ClusterQueueImpl) PushOrUpdate(wInfo *workload.Info)
func (*ClusterQueueImpl) QueueInadmissibleWorkloads ¶
func (c *ClusterQueueImpl) QueueInadmissibleWorkloads(ctx context.Context, client client.Client) bool
QueueInadmissibleWorkloads moves all workloads from inadmissibleWorkloads to heap. If at least one workload is moved, returns true. Otherwise returns false.
func (*ClusterQueueImpl) RequeueIfNotPresent ¶
func (c *ClusterQueueImpl) RequeueIfNotPresent(wInfo *workload.Info, reason RequeueReason) bool
func (*ClusterQueueImpl) Update ¶
func (c *ClusterQueueImpl) Update(apiCQ *kueue.ClusterQueue) error
type ClusterQueueStrictFIFO ¶
type ClusterQueueStrictFIFO struct {
*ClusterQueueImpl
}
ClusterQueueStrictFIFO is the implementation for the ClusterQueue for StrictFIFO.
type LocalQueue ¶ added in v0.2.0
LocalQueue is the internal implementation of kueue.LocalQueue.
func (*LocalQueue) AddIfNotPresent ¶ added in v0.2.0
func (q *LocalQueue) AddIfNotPresent(w *workload.Info) bool
func (*LocalQueue) AddOrUpdate ¶ added in v0.2.0
func (q *LocalQueue) AddOrUpdate(info *workload.Info)
type Manager ¶
func NewManager ¶
func NewManager(client client.Client, checker StatusChecker) *Manager
func (*Manager) AddClusterQueue ¶
func (*Manager) AddLocalQueue ¶ added in v0.2.0
func (*Manager) AddOrUpdateWorkload ¶
AddOrUpdateWorkload adds or updates workload to the corresponding queue. Returns whether the queue existed.
func (*Manager) CleanUpOnContext ¶
CleanUpOnContext tracks the context. When closed, it wakes routines waiting on elements to be available. It should be called before doing any calls to Heads.
func (*Manager) ClusterQueueForWorkload ¶
ClusterQueueForWorkload returns the name of the ClusterQueue where the workload should be queued and whether it exists. Returns empty string if the queue doesn't exist.
func (*Manager) DeleteClusterQueue ¶
func (m *Manager) DeleteClusterQueue(cq *kueue.ClusterQueue)
func (*Manager) DeleteLocalQueue ¶ added in v0.2.0
func (m *Manager) DeleteLocalQueue(q *kueue.LocalQueue)
func (*Manager) DeleteWorkload ¶
func (*Manager) Dump ¶
Dump is a dump of the queues and it's elements (unordered). Only use for testing purposes.
func (*Manager) DumpInadmissible ¶ added in v0.2.0
DumpInadmissible is a dump of the inadmissible workloads list. Only use for testing purposes.
func (*Manager) Heads ¶
Heads returns the heads of the queues, along with their associated ClusterQueue. It blocks if the queues empty until they have elements or the context terminates.
func (*Manager) PendingWorkloads ¶
func (m *Manager) PendingWorkloads(q *kueue.LocalQueue) (int32, error)
func (*Manager) QueueAssociatedInadmissibleWorkloads ¶
QueueAssociatedInadmissibleWorkloads moves all associated workloads from inadmissibleWorkloads to heap. If at least one workload is moved, returns true. Otherwise returns false.
func (*Manager) QueueForWorkloadExists ¶
func (*Manager) QueueInadmissibleWorkloads ¶ added in v0.2.0
QueueInadmissibleWorkloads moves all inadmissibleWorkloads in corresponding ClusterQueues to heap. If at least one workload queued, we will broadcast the event.
func (*Manager) RequeueWorkload ¶
func (m *Manager) RequeueWorkload(ctx context.Context, info *workload.Info, reason RequeueReason) bool
RequeueWorkload requeues the workload ensuring that the queue and the workload still exist in the client cache and it's not admitted. It won't requeue if the workload is already in the queue (possible if the workload was updated).
func (*Manager) UpdateClusterQueue ¶
func (*Manager) UpdateLocalQueue ¶ added in v0.2.0
func (m *Manager) UpdateLocalQueue(q *kueue.LocalQueue) error
type RequeueReason ¶ added in v0.2.0
type RequeueReason string
const ( RequeueReasonFailedAfterNomination RequeueReason = "FailedAfterNomination" RequeueReasonNamespaceMismatch RequeueReason = "NamespaceMismatch" RequeueReasonGeneric RequeueReason = "" )
type StatusChecker ¶ added in v0.2.0
type StatusChecker interface { // ClusterQueueActive returns whether the clusterQueue is active. ClusterQueueActive(name string) bool }
StatusChecker checks status of clusterQueue.