batchresource

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const PluginName = "BatchResource"

Variables

View Source
var (
	Clock clock.Clock = clock.RealClock{} // for testing

)

Functions

This section is empty.

Types

type NRTHandler added in v1.4.0

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

func (*NRTHandler) Create added in v1.4.0

func (*NRTHandler) Delete added in v1.4.0

func (*NRTHandler) Generic added in v1.4.0

func (*NRTHandler) Update added in v1.4.0

type Plugin

type Plugin struct{}

Plugin does 2 things: 1. calculate and update the extended resources of batch-cpu and batch-memory on the Node. 2. calculate and update the zone resources of batch-cpu and batch-memory on the NodeResourceTopology.

func (*Plugin) Calculate

func (p *Plugin) Calculate(strategy *configuration.ColocationStrategy, node *corev1.Node, podList *corev1.PodList,
	resourceMetrics *framework.ResourceMetrics) ([]framework.ResourceItem, error)

Calculate calculates Batch resources using the formula below: Node.Total - Node.Reserved - System.Used - Pod(High-Priority).Used, System.Used = Node.Used - Pod(All).Used. As node and podList are the nearly latest state at time T1, the resourceMetrics are the node metric and pod metrics collected and snapshot at time T0 (T0 < T1). There can be gaps between the states of T0 and T1. We firstly calculate an infimum of the batch allocatable at time T0. `BatchAllocatable0 = NodeAllocatable * ratio - SystemUsed0 - Pod(HP and in Pods1).Used0` - Pod(not in Pods1).Used0. Then we minus the sum requests of the pods newly scheduled but have not been reported metrics to give a safe result.

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) NeedSync

func (p *Plugin) NeedSync(strategy *configuration.ColocationStrategy, oldNode, newNode *corev1.Node) (bool, string)

func (*Plugin) PreUpdate added in v1.4.0

func (p *Plugin) PreUpdate(strategy *configuration.ColocationStrategy, node *corev1.Node, nr *framework.NodeResource) error

func (*Plugin) Prepare added in v1.4.0

func (*Plugin) Reset

func (p *Plugin) Reset(node *corev1.Node, message string) []framework.ResourceItem

func (*Plugin) Setup added in v1.4.0

func (p *Plugin) Setup(opt *framework.Option) error

Jump to

Keyboard shortcuts

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