ranking

package
v1.3.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const FavourNodeSelectorPrefix = "favour_"

FavourNodeSelectorPrefix labels prefixed with this string will be considered as a "favour" selector that prioritizes those nodes, instead of a "must" selector that filters out nodes that don't match.

Variables

This section is empty.

Functions

func NewEnginesNodeRanker

func NewEnginesNodeRanker() *featureNodeRanker

func NewFixedRanker

func NewFixedRanker(ranks ...int) *fixedRanker

func NewPublishersNodeRanker

func NewPublishersNodeRanker() *featureNodeRanker

func NewStoragesNodeRanker

func NewStoragesNodeRanker() *featureNodeRanker

Types

type Chain

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

Chain assigns a random rank to each node to allow the orchestrator to select random top nodes for job execution.

func NewChain

func NewChain() *Chain

func (*Chain) Add

func (c *Chain) Add(ranker ...orchestrator.NodeRanker)

Add ranker to the chain

func (*Chain) RankNodes

func (c *Chain) RankNodes(ctx context.Context, job models.Job, nodes []models.NodeInfo) ([]orchestrator.NodeRank, error)

type LabelsNodeRanker

type LabelsNodeRanker struct {
}

func NewLabelsNodeRanker

func NewLabelsNodeRanker() *LabelsNodeRanker

func (*LabelsNodeRanker) RankNodes

func (s *LabelsNodeRanker) RankNodes(ctx context.Context, job models.Job, nodes []models.NodeInfo) ([]orchestrator.NodeRank, error)

RankNodes ranks nodes based on the node labels and job selectors: - Rank 20: Selectors with `favour_` prefix and matching node labels - Rank 10: Selectors match node labels. - Rank -1: Selectors don't match node labels. - Rank 0: Job selectors are not set.

type MaxUsageNodeRanker

type MaxUsageNodeRanker struct {
}

func NewMaxUsageNodeRanker

func NewMaxUsageNodeRanker() *MaxUsageNodeRanker

func (*MaxUsageNodeRanker) RankNodes

func (s *MaxUsageNodeRanker) RankNodes(ctx context.Context, job models.Job, nodes []models.NodeInfo) ([]orchestrator.NodeRank, error)

RankNodes ranks nodes based on the MaxJobRequirements the compute nodes are accepting: - Rank 10: Node is accepting MaxJobRequirements that are equal or higher than the job requirements. - Rank -1: Node is accepting MaxJobRequirements that are lower than the job requirements. - Rank 0: Node MaxJobRequirements are not set, or the node was discovered not through nodeInfoPublisher (e.g. identity protocol)

type MinVersionNodeRanker

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

func NewMinVersionNodeRanker

func NewMinVersionNodeRanker(params MinVersionNodeRankerParams) *MinVersionNodeRanker

func (*MinVersionNodeRanker) RankNodes

func (s *MinVersionNodeRanker) RankNodes(ctx context.Context, job models.Job, nodes []models.NodeInfo) ([]orchestrator.NodeRank, error)

type MinVersionNodeRankerParams

type MinVersionNodeRankerParams struct {
	MinVersion models.BuildVersionInfo
}

type PreviousExecutionsNodeRanker

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

func (*PreviousExecutionsNodeRanker) RankNodes

RankNodes ranks nodes based on whether the node has already executed the job, which is useful when ranking nodes when handling retries: - Rank 30: Node has never executed the job. - Rank 0: Node has already executed the job. - Rank -1: Node has executed the job more than once or has rejected a bid

type PreviousExecutionsNodeRankerParams

type PreviousExecutionsNodeRankerParams struct {
	JobStore jobstore.Store
}

type RandomNodeRanker

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

RandomNodeRanker assigns a random rank to each node to allow the orchestrator to select random top nodes for job execution.

func NewRandomNodeRanker

func NewRandomNodeRanker(params RandomNodeRankerParams) *RandomNodeRanker

func (*RandomNodeRanker) RankNodes

func (s *RandomNodeRanker) RankNodes(ctx context.Context, job models.Job, nodes []models.NodeInfo) ([]orchestrator.NodeRank, error)

type RandomNodeRankerParams

type RandomNodeRankerParams struct {
	RandomnessRange int
}

Jump to

Keyboard shortcuts

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