idleness

package
v0.0.0-...-24d1fa5 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is the name of the plugin used in Registry and configurations.
	Name                     = "Idleness"
	ScaledResourceName       = "aliyun.com/gpu-mem"
	BinpackEnabled           = "xxx.com/binpack-enabled"
	IdlenessPolicyAnnotation = "xxx.com/idleness-policy"

	ResourceTypeCpu = "cpu"
	ResourceTypeMem = "memory"
	ResourceTypeGpu = "gpu"
	True            = "true"

	Binpack  IdlenessPolicy = "binpack"    // 极端聚集
	Spread   IdlenessPolicy = "spread"     // 极端打散
	Balanced IdlenessPolicy = "binpack2.0" // binpack 2.0 均衡
)

Variables

This section is empty.

Functions

func New

New 初始化一个新插件并返回

Types

type Idleness

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

func (*Idleness) Name

func (r *Idleness) Name() string

func (*Idleness) NormalizeScore

func (r *Idleness) NormalizeScore(ctx context.Context, state *framework.CycleState, p *v1.Pod, scores framework.NodeScoreList) *framework.Status

func (*Idleness) Score

func (r *Idleness) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (score int64, status *framework.Status)

func (*Idleness) ScoreExtensions

func (r *Idleness) ScoreExtensions() framework.ScoreExtensions

type IdlenessPolicy

type IdlenessPolicy string

type Resource

type Resource struct {
	MilliCPU         int64
	Memory           int64
	EphemeralStorage int64
	// We store allowedPodNumber (which is Node.Status.Allocatable.Pods().Value())
	// explicitly as int, to avoid conversions and improve performance.
	AllowedPodNumber int
	// ScalarResources
	ScalarResources map[v1.ResourceName]int64
}

Resource is a collection of compute resource.

func NewResource

func NewResource(rl v1.ResourceList) *Resource

NewResource creates a Resource from ResourceList

func (*Resource) Add

func (r *Resource) Add(rl v1.ResourceList)

Add adds ResourceList into Resource.

func (*Resource) AddScalar

func (r *Resource) AddScalar(name v1.ResourceName, quantity int64)

AddScalar adds a resource by a scalar value of this resource.

func (*Resource) Clone

func (r *Resource) Clone() *Resource

Clone returns a copy of this resource.

func (*Resource) ResourceList

func (r *Resource) ResourceList() v1.ResourceList

ResourceList returns a resource list of this resource.

func (*Resource) SetMaxResource

func (r *Resource) SetMaxResource(rl v1.ResourceList)

SetMaxResource compares with ResourceList and takes max value for each Resource.

func (*Resource) SetScalar

func (r *Resource) SetScalar(name v1.ResourceName, quantity int64)

SetScalar sets a resource by a scalar value of this resource.

Jump to

Keyboard shortcuts

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