types

package
v0.0.0-...-302a361 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 0 Imported by: 29

Documentation

Index

Constants

View Source
const (
	// Namespace prefix for group resources.
	DeviceGroupPrefix = "resource/group"
)

Variables

This section is empty.

Functions

func AddGroupResource

func AddGroupResource(list ResourceList, key string, val int64)

Types

type ContainerInfo

type ContainerInfo struct {
	KubeRequests ResourceList     `json:"-"`                      // requests being handled by kubernetes core - only needed here for resource translation
	Requests     ResourceList     `json:"requests,omitempty"`     // requests specified in annotations in the pod spec
	DevRequests  ResourceList     `json:"devrequests,omitempty"`  // requests after translation - these are used by scheduler to schedule
	AllocateFrom ResourceLocation `json:"allocatefrom,omitempty"` // only valid for extended resources being advertised here
	Scorer       ResourceScorer   `json:"scorer,omitempty"`       // scorer function specified in pod specificiation annotations
}

func FillContainerInfo

func FillContainerInfo(fill *ContainerInfo) *ContainerInfo

func NewContainerInfo

func NewContainerInfo() *ContainerInfo

type NodeInfo

type NodeInfo struct {
	Name        string         `json:"name,omitempty"`
	Capacity    ResourceList   `json:"capacity,omitempty"`
	Allocatable ResourceList   `json:"allocatable,omitempty"` // capacity minus reserverd
	Used        ResourceList   `json:"used,omitempty"`        // being used by pods, must be less than allocatable
	Scorer      ResourceScorer `json:"scorer,omitempty"`
	KubeCap     ResourceList   `json:"-"` // capacity patched into extended resources directly -- stuff default scheduler takes care of
	KubeAlloc   ResourceList   `json:"-"` // stuff default scheduler takes care of
}

NodeInfo only holds resources being advertised by the device advertisers through annotations

func NewNodeInfo

func NewNodeInfo() *NodeInfo

func NewNodeInfoWithName

func NewNodeInfoWithName(name string) *NodeInfo

func (*NodeInfo) Clone

func (ni *NodeInfo) Clone() *NodeInfo

type PodInfo

type PodInfo struct {
	Name              string                   `json:"podname,omitempty"`
	NodeName          string                   `json:"nodename,omitempty"` // the node for which DevRequests and AllocateFrom on ContainerInfo are valid, the node for which PodInfo has been customized
	Requests          ResourceList             `json:"requests,omitempty"` // pod level requests
	InitContainers    map[string]ContainerInfo `json:"initcontainer,omitempty"`
	RunningContainers map[string]ContainerInfo `json:"runningcontainer,omitempty"`
}

func NewPodInfo

func NewPodInfo() *PodInfo

func (*PodInfo) GetContainerInPod

func (p *PodInfo) GetContainerInPod(name string) *ContainerInfo

type ResourceList

type ResourceList map[ResourceName]int64

ResourceList is a set of resources

type ResourceLocation

type ResourceLocation map[ResourceName]ResourceName

ResourceLocation is a set of (resource name, resource location on node) pairs.

type ResourceName

type ResourceName string

type ResourceScorer

type ResourceScorer map[ResourceName]int32

ResourceScorer is a set of (resource name, scorer) pairs.

Jump to

Keyboard shortcuts

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