orm

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricAddPodTimeout                            = "ORM_add_pod_timeout"
	MetricDeletePodTImeout                         = "ORM_delete_pod_timeout"
	MetricGetTopologyAwareResourcesFail            = "ORM_get_topology_aware_resource_fail"
	MetricGetTopologyAwareAllocatableResourcesFail = "ORM_get_topology_aware_allocatable_resource_fail"
	MetricUpdateAllocatedResourcesFail             = "ORM_update_allocatabled_resources_fail"

	MainContainerNameAnnotationKey = "kubernetes.io/main-container-name"

	KubeletPluginsDirSELinuxLabel = "system_u:object_r:container_file_t:s0"
)
View Source
const (
	NoneDevicesProvider = ""
)
View Source
const (
	ORMAgentName = "katalyst-agent-orm"
)

Variables

View Source
var EmptyValue = reflect.Value{}

Functions

func GetContainerTypeAndIndex

func GetContainerTypeAndIndex(pod *v1.Pod, container *v1.Container) (containerType pluginapi.ContainerType, containerIndex uint64, err error)

func ParseListOfTopologyHints

func ParseListOfTopologyHints(hintsList *pluginapi.ListOfTopologyHints) []topology.TopologyHint

func ParseTopologyManagerHint

func ParseTopologyManagerHint(hint topology.TopologyHint) *pluginapi.TopologyHint

Types

type ContainerResources

type ContainerResources map[string]ResourceAllocation // Keyed by containerName.

func (ContainerResources) DeepCopy

func (cr ContainerResources) DeepCopy() ContainerResources

type ManagerImpl

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

func NewManager

func NewManager(socketPath string, emitter metrics.MetricEmitter, metaServer *metaserver.MetaServer, config *config.Configuration) (*ManagerImpl, error)

func (*ManagerImpl) Allocate

func (m *ManagerImpl) Allocate(pod *v1.Pod, container *v1.Container) error

func (*ManagerImpl) DeRegisterPlugin

func (m *ManagerImpl) DeRegisterPlugin(pluginName string)

DeRegisterPlugin deregisters the plugin

func (*ManagerImpl) GetHandlerType

func (m *ManagerImpl) GetHandlerType() string

func (*ManagerImpl) GetPodTopologyHints

func (m *ManagerImpl) GetPodTopologyHints(pod *v1.Pod) map[string][]topology.TopologyHint

func (*ManagerImpl) GetTopologyAwareAllocatableResources added in v0.4.2

func (m *ManagerImpl) GetTopologyAwareAllocatableResources() []*podresourcesapi.AllocatableTopologyAwareResource

func (*ManagerImpl) GetTopologyAwareResources added in v0.4.2

func (m *ManagerImpl) GetTopologyAwareResources(pod *v1.Pod, container *v1.Container) []*podresourcesapi.TopologyAwareResource

func (*ManagerImpl) GetTopologyHints

func (m *ManagerImpl) GetTopologyHints(pod *v1.Pod, container *v1.Container) map[string][]topology.TopologyHint

func (*ManagerImpl) IsContainerRequestResource

func (m *ManagerImpl) IsContainerRequestResource(container *v1.Container, resourceName string) (bool, error)

func (*ManagerImpl) Register

Register registers a resource plugin.

func (*ManagerImpl) RegisterPlugin

func (m *ManagerImpl) RegisterPlugin(pluginName string, endpoint string, versions []string) error

RegisterPlugin starts the endpoint and registers it

func (*ManagerImpl) Run

func (m *ManagerImpl) Run(ctx context.Context)

func (*ManagerImpl) UpdateAllocatedResources added in v0.4.2

func (m *ManagerImpl) UpdateAllocatedResources()

UpdateAllocatedResources process add pods and delete pods synchronously.

func (*ManagerImpl) UpdatePodResources

func (m *ManagerImpl) UpdatePodResources(
	resourceAllocation map[string]*pluginapi.ResourceAllocationInfo,
	pod *v1.Pod, container *v1.Container, resource string,
)

func (*ManagerImpl) ValidatePlugin

func (m *ManagerImpl) ValidatePlugin(pluginName string, endpoint string, versions []string) error

ValidatePlugin validates a plugin if the version is correct and the name has the format of an extended resource

type PodResources

type PodResources map[string]ContainerResources // Keyed by podUID

func (PodResources) DeepCopy

func (pr PodResources) DeepCopy() PodResources

type ResourceAllocation

type ResourceAllocation map[string]*pluginapi.ResourceAllocationInfo // Keyed by resourceName.

func (ResourceAllocation) DeepCopy

func (ra ResourceAllocation) DeepCopy() ResourceAllocation

Directories

Path Synopsis
deviceprovider
podresources/testing
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.

Jump to

Keyboard shortcuts

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