...

Package runtime

import "framework/runtime"
Overview
Index
Subdirectories

Overview ▾

Index ▾

Constants
type BindingPipelineStopwatches
    func NewBindingPipelineStopwatches() *BindingPipelineStopwatches
type DefaultBindingPipeline
    func NewDefaultBindingPipeline(id int, plugins *pipeline.BindingPipelinePlugins, clusterAgentServices pipeline.ClusterAgentServices, nodesLocker collections.EntityLocker) *DefaultBindingPipeline
    func (bp *DefaultBindingPipeline) CommitSchedulingDecision(schedCtx pipeline.SchedulingContext, schedDecision *client.ClusterSchedulingDecision, queuedPod client.PodQueuedOnNode) (*client.CommitSchedulingDecisionSuccess, pipeline.Status)
type DefaultDecisionPipeline
    func NewDefaultDecisionPipeline(id int, plugins *pipeline.DecisionPipelinePlugins, scheduler pipeline.PolarisScheduler) *DefaultDecisionPipeline
    func (dp *DefaultDecisionPipeline) DecideCommitCandidates(podInfo *pipeline.SampledPodInfo, commitCandidatesCount int) ([]*pipeline.SchedulingDecision, pipeline.Status)
type DefaultPolarisNodeSampler
    func NewDefaultPolarisNodeSampler(clusterAgentConfig *config.ClusterAgentConfig, ginEngine *gin.Engine, clusterClient client.LocalClusterClient, nodesCache client.NodesCache, pluginsRegistry *pipeline.PluginsRegistry[pipeline.ClusterAgentServices], logger *logr.Logger) *DefaultPolarisNodeSampler
    func (sampler *DefaultPolarisNodeSampler) ClusterClient() client.LocalClusterClient
    func (sampler *DefaultPolarisNodeSampler) Config() *config.ClusterAgentConfig
    func (sampler *DefaultPolarisNodeSampler) Logger() *logr.Logger
    func (sampler *DefaultPolarisNodeSampler) NodesCache() client.NodesCache
    func (sampler *DefaultPolarisNodeSampler) SamplingStrategies() []pipeline.SamplingStrategyPlugin
    func (sampler *DefaultPolarisNodeSampler) Start(ctx context.Context) error
type DefaultPolarisScheduler
    func NewDefaultPolarisScheduler(conf *config.SchedulerConfig, pluginsRegistry *pipeline.PluginsRegistry[pipeline.PolarisScheduler], podSource pipeline.PodSource, clusterClientsMgr client.ClusterClientsManager, logger *logr.Logger) *DefaultPolarisScheduler
    func (ps *DefaultPolarisScheduler) ClusterClientsManager() client.ClusterClientsManager
    func (ps *DefaultPolarisScheduler) Config() *config.SchedulerConfig
    func (ps *DefaultPolarisScheduler) IsActive() bool
    func (ps *DefaultPolarisScheduler) Logger() *logr.Logger
    func (ps *DefaultPolarisScheduler) PodsInDecisionPipelineCount() int
    func (ps *DefaultPolarisScheduler) PodsInNodeSamplingCount() int
    func (ps *DefaultPolarisScheduler) PodsInQueueCount() int
    func (ps *DefaultPolarisScheduler) PodsWaitingForDecisionPipelineCount() int
    func (ps *DefaultPolarisScheduler) Start(ctx context.Context) error
    func (ps *DefaultPolarisScheduler) Stop() error
type DefaultSamplingPipeline
    func NewDefaultSamplingPipeline(id int, plugins *pipeline.SamplingPipelinePlugins, nodeSampler pipeline.PolarisNodeSampler) *DefaultSamplingPipeline
    func (sp *DefaultSamplingPipeline) SampleNodes(ctx pipeline.SchedulingContext, samplingStrategy pipeline.SamplingStrategyPlugin, podInfo *pipeline.PodInfo, nodesToSampleBp int) ([]*pipeline.NodeInfo, pipeline.Status)
type PipelineHelper
    func NewPipelineHelper() *PipelineHelper
    func (ph *PipelineHelper) RunFilterPlugins(ctx pipeline.SchedulingContext, filterPlugins []pipeline.FilterPlugin, podInfo *pipeline.PodInfo, candidateNodes *list.List) pipeline.Status
    func (ph *PipelineHelper) RunPreFilterPlugins(ctx pipeline.SchedulingContext, preFilterPlugins []pipeline.PreFilterPlugin, podInfo *pipeline.PodInfo) pipeline.Status
    func (ph *PipelineHelper) RunPreScorePlugins(ctx pipeline.SchedulingContext, preScorePlugins []pipeline.PreScorePlugin, podInfo *pipeline.PodInfo, eligibleNodes []*pipeline.NodeInfo) pipeline.Status
    func (ph *PipelineHelper) RunScorePlugins(ctx pipeline.SchedulingContext, scorePlugins []*pipeline.ScorePluginWithExtensions, podInfo *pipeline.PodInfo, eligibleNodes []*pipeline.NodeInfo) ([][]pipeline.NodeScore, pipeline.Status)

Package files

default_binding_pipeline.go default_decision_pipeline.go default_polaris_node_sampler.go default_polaris_scheduler.go default_sampling_pipeline.go pipeline_helper.go

Constants

const (
    BindingPipelineStopwatchesStateKey = "polaris-internal.stopwatches.binding"
)
const (
    SamplingEndpointsPrefix = "samples"
)

type BindingPipelineStopwatches

A collection of stopwatches for timing various parts of the binding pipeline.

ToDo: find a better way to handle the responsibilities for timing other than this shared struct.

type BindingPipelineStopwatches struct {
    QueueTime       *util.Stopwatch
    NodeLockTime    *util.Stopwatch
    FetchNodeInfo   *util.Stopwatch
    BindingPipeline *util.Stopwatch
    CommitDecision  *util.Stopwatch
}

func NewBindingPipelineStopwatches

func NewBindingPipelineStopwatches() *BindingPipelineStopwatches

type DefaultBindingPipeline

Default implementation of the BindingPipeline.

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

func NewDefaultBindingPipeline

func NewDefaultBindingPipeline(
    id int,
    plugins *pipeline.BindingPipelinePlugins,
    clusterAgentServices pipeline.ClusterAgentServices,
    nodesLocker collections.EntityLocker,
) *DefaultBindingPipeline

Creates a new instance of the default implementation of the BindingPipeline.

func (*DefaultBindingPipeline) CommitSchedulingDecision

func (bp *DefaultBindingPipeline) CommitSchedulingDecision(schedCtx pipeline.SchedulingContext, schedDecision *client.ClusterSchedulingDecision, queuedPod client.PodQueuedOnNode) (*client.CommitSchedulingDecisionSuccess, pipeline.Status)

type DefaultDecisionPipeline

Default implementation of the Polaris DecisionPipeline

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

func NewDefaultDecisionPipeline

func NewDefaultDecisionPipeline(id int, plugins *pipeline.DecisionPipelinePlugins, scheduler pipeline.PolarisScheduler) *DefaultDecisionPipeline

Creates a new instance of the DefaultDecisionPipeline.

func (*DefaultDecisionPipeline) DecideCommitCandidates

func (dp *DefaultDecisionPipeline) DecideCommitCandidates(podInfo *pipeline.SampledPodInfo, commitCandidatesCount int) ([]*pipeline.SchedulingDecision, pipeline.Status)

type DefaultPolarisNodeSampler

Default implementation of the PolarisNodeSampler.

This implementation relies on Gin for providing a REST interface. Since the Gin engine can be shared among multiple services, it must be started by the owner of this object after calling Start().

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

func NewDefaultPolarisNodeSampler

func NewDefaultPolarisNodeSampler(
    clusterAgentConfig *config.ClusterAgentConfig,
    ginEngine *gin.Engine,
    clusterClient client.LocalClusterClient,
    nodesCache client.NodesCache,
    pluginsRegistry *pipeline.PluginsRegistry[pipeline.ClusterAgentServices],
    logger *logr.Logger,
) *DefaultPolarisNodeSampler

func (*DefaultPolarisNodeSampler) ClusterClient

func (sampler *DefaultPolarisNodeSampler) ClusterClient() client.LocalClusterClient

func (*DefaultPolarisNodeSampler) Config

func (sampler *DefaultPolarisNodeSampler) Config() *config.ClusterAgentConfig

func (*DefaultPolarisNodeSampler) Logger

func (sampler *DefaultPolarisNodeSampler) Logger() *logr.Logger

func (*DefaultPolarisNodeSampler) NodesCache

func (sampler *DefaultPolarisNodeSampler) NodesCache() client.NodesCache

func (*DefaultPolarisNodeSampler) SamplingStrategies

func (sampler *DefaultPolarisNodeSampler) SamplingStrategies() []pipeline.SamplingStrategyPlugin

func (*DefaultPolarisNodeSampler) Start

func (sampler *DefaultPolarisNodeSampler) Start(ctx context.Context) error

type DefaultPolarisScheduler

The default implementation of the PolarisScheduler.

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

func NewDefaultPolarisScheduler

func NewDefaultPolarisScheduler(
    conf *config.SchedulerConfig,
    pluginsRegistry *pipeline.PluginsRegistry[pipeline.PolarisScheduler],
    podSource pipeline.PodSource,
    clusterClientsMgr client.ClusterClientsManager,
    logger *logr.Logger,
) *DefaultPolarisScheduler

Creates a new instance of the default implementation of the PolarisScheduler.

func (*DefaultPolarisScheduler) ClusterClientsManager

func (ps *DefaultPolarisScheduler) ClusterClientsManager() client.ClusterClientsManager

Gets the ClusterClientsManager for communicating with the node clusters.

func (*DefaultPolarisScheduler) Config

func (ps *DefaultPolarisScheduler) Config() *config.SchedulerConfig

Gets the scheduler configuration.

func (*DefaultPolarisScheduler) IsActive

func (ps *DefaultPolarisScheduler) IsActive() bool

Returns true if the scheduling process has been started.

func (*DefaultPolarisScheduler) Logger

func (ps *DefaultPolarisScheduler) Logger() *logr.Logger

Gets the logger used by this scheduler.

func (*DefaultPolarisScheduler) PodsInDecisionPipelineCount

func (ps *DefaultPolarisScheduler) PodsInDecisionPipelineCount() int

Returns the number of pods currently in the decision pipeline.

func (*DefaultPolarisScheduler) PodsInNodeSamplingCount

func (ps *DefaultPolarisScheduler) PodsInNodeSamplingCount() int

Returns the number of pods, for which nodes are currently being sampled.

func (*DefaultPolarisScheduler) PodsInQueueCount

func (ps *DefaultPolarisScheduler) PodsInQueueCount() int

Returns the number of queued pods.

func (*DefaultPolarisScheduler) PodsWaitingForDecisionPipelineCount

func (ps *DefaultPolarisScheduler) PodsWaitingForDecisionPipelineCount() int

Returns the number of pods, for which nodes have been sampled, and which are now waiting to enter the decision pipeline.

func (*DefaultPolarisScheduler) Start

func (ps *DefaultPolarisScheduler) Start(ctx context.Context) error

Starts the scheduling goroutines and then returns nil or an error, if any occurred.

func (*DefaultPolarisScheduler) Stop

func (ps *DefaultPolarisScheduler) Stop() error

Stops the scheduling goroutines.

type DefaultSamplingPipeline

Default implementation of the Polaris SamplingPipeline

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

func NewDefaultSamplingPipeline

func NewDefaultSamplingPipeline(id int, plugins *pipeline.SamplingPipelinePlugins, nodeSampler pipeline.PolarisNodeSampler) *DefaultSamplingPipeline

func (*DefaultSamplingPipeline) SampleNodes

func (sp *DefaultSamplingPipeline) SampleNodes(
    ctx pipeline.SchedulingContext,
    samplingStrategy pipeline.SamplingStrategyPlugin,
    podInfo *pipeline.PodInfo,
    nodesToSampleBp int,
) ([]*pipeline.NodeInfo, pipeline.Status)

SampleNodes implements pipeline.SamplingPipeline

type PipelineHelper

Handles functionality that is common to both the scheduling and the sampling pipeline.

type PipelineHelper struct {
}

func NewPipelineHelper

func NewPipelineHelper() *PipelineHelper

func (*PipelineHelper) RunFilterPlugins

func (ph *PipelineHelper) RunFilterPlugins(
    ctx pipeline.SchedulingContext,
    filterPlugins []pipeline.FilterPlugin,
    podInfo *pipeline.PodInfo,
    candidateNodes *list.List,
) pipeline.Status

Runs the specified Filter plugins on the candidate nodes list and removes all nodes that are not eligible from that list.

Returns a Success status, if candidate nodes are left after filtering, or an Unschedulable status if no candidate nodes are left after filtering.

func (*PipelineHelper) RunPreFilterPlugins

func (ph *PipelineHelper) RunPreFilterPlugins(ctx pipeline.SchedulingContext, preFilterPlugins []pipeline.PreFilterPlugin, podInfo *pipeline.PodInfo) pipeline.Status

Runs the specified PreFilter plugins for the specified pod.

func (*PipelineHelper) RunPreScorePlugins

func (ph *PipelineHelper) RunPreScorePlugins(
    ctx pipeline.SchedulingContext,
    preScorePlugins []pipeline.PreScorePlugin,
    podInfo *pipeline.PodInfo,
    eligibleNodes []*pipeline.NodeInfo,
) pipeline.Status

Runs the specified PreScore plugins on the eligible nodes.

func (*PipelineHelper) RunScorePlugins

func (ph *PipelineHelper) RunScorePlugins(
    ctx pipeline.SchedulingContext,
    scorePlugins []*pipeline.ScorePluginWithExtensions,
    podInfo *pipeline.PodInfo,
    eligibleNodes []*pipeline.NodeInfo,
) ([][]pipeline.NodeScore, pipeline.Status)

Runs the specified Score plugins and their extensions on the eligible nodes.

Returns a nested array of allScores (type [][]pipeline.NodeScore), where allScores[i] stores the scores for all eligible nodes computed by score plugin i.

Subdirectories

Name Synopsis
..
pluginfactories
queue