commonstate

package
v0.5.15 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const (
	PoolNameShare           = "share"
	PoolNameReclaim         = "reclaim"
	PoolNameDedicated       = "dedicated"
	PoolNameReserve         = "reserve"
	PoolNamePrefixIsolation = "isolation"
	PoolNamePrefixSystem    = "system"

	EmptyOwnerPoolName = ""

	// PoolNameFallback is not a real pool, and is a union of
	// all none-reclaimed pools to put pod should have been isolated
	PoolNameFallback = "fallback"
)

notice that pool-name may not have direct mapping relations with qos-level, for instance - both isolated_shared_cores and dedicated_cores fall into PoolNameDedicated

View Source
const (
	FakedContainerName = ""
	FakedNUMAID        = -1
	NameSeparator      = "#"
	NUMAPoolInfix      = "-NUMA"
)

FakedContainerName represents a placeholder since pool entry has no container-level FakedNUMAID represents a placeholder since pools like shared/reclaimed will not contain a specific numa

Variables

This section is empty.

Functions

func CheckNUMABindingSharedCoresAntiAffinity added in v0.5.12

func CheckNUMABindingSharedCoresAntiAffinity(meta *AllocationMeta, annotations map[string]string) bool

CheckNUMABindingSharedCoresAntiAffinity returns true if the AllocationMeta isn't compatible for the annotations of a numa binding shared cores candidate

func GetNUMAPoolName added in v0.5.12

func GetNUMAPoolName(candidateSpecifiedPoolName string, targetNUMANode uint64) string

func GetPoolType added in v0.5.12

func GetPoolType(poolName string) string

func GetSpecifiedPoolName added in v0.5.12

func GetSpecifiedPoolName(qosLevel, cpusetEnhancementValue string) string

GetSpecifiedPoolName todo: this function (along with pool-name consts) should be moved to generic qos conf

func IsIsolationPool added in v0.5.12

func IsIsolationPool(poolName string) bool

func IsSystemPool added in v0.5.12

func IsSystemPool(poolName string) bool

Types

type AllocationMeta added in v0.5.12

type AllocationMeta struct {
	PodUid         string `json:"pod_uid,omitempty"`
	PodNamespace   string `json:"pod_namespace,omitempty"`
	PodName        string `json:"pod_name,omitempty"`
	ContainerName  string `json:"container_name,omitempty"`
	ContainerType  string `json:"container_type,omitempty"`
	ContainerIndex uint64 `json:"container_index,omitempty"`
	OwnerPoolName  string `json:"owner_pool_name,omitempty"`
	PodRole        string `json:"pod_role,omitempty"`
	PodType        string `json:"pod_type,omitempty"`

	Labels      map[string]string `json:"labels"`
	Annotations map[string]string `json:"annotations"`
	QoSLevel    string            `json:"qosLevel"`
}

func GenerateGenericContainerAllocationMeta added in v0.5.12

func GenerateGenericContainerAllocationMeta(req *pluginapi.ResourceRequest, ownerPoolName, qosLevel string) AllocationMeta

GenerateGenericContainerAllocationMeta generates a generic container's allocation metadata. This function populates the AllocationMeta struct using data from the resource request and other parameters. Parameters: - req: The resource request containing information about the pod, container, and other attributes. - ownerPoolName: The name of the pool owning this container. - qosLevel: The QoS (Quality of Service) level for the container. Returns: - A pointer to an AllocationMeta struct filled with relevant data from the request and other inputs.

func GenerateGenericPoolAllocationMeta added in v0.5.12

func GenerateGenericPoolAllocationMeta(poolName string) AllocationMeta

GenerateGenericPoolAllocationMeta generates a generic allocation metadata for a pool. This function creates an AllocationMeta where both PodUid and OwnerPoolName are set to the given pool name. Parameters: - poolName: The name of the pool for which the metadata is generated. Returns: - A pointer to an AllocationMeta struct with the pool name set for both PodUid and OwnerPoolName.

func (*AllocationMeta) CheckDedicated added in v0.5.12

func (am *AllocationMeta) CheckDedicated() bool

CheckDedicated returns true if the AllocationInfo is for pod with dedicated-qos

func (*AllocationMeta) CheckDedicatedNUMABinding added in v0.5.12

func (am *AllocationMeta) CheckDedicatedNUMABinding() bool

CheckDedicatedNUMABinding returns true if the AllocationInfo is for pod with dedicated-qos and numa-binding enhancement

func (*AllocationMeta) CheckDedicatedPool added in v0.5.12

func (am *AllocationMeta) CheckDedicatedPool() bool

CheckDedicatedPool returns true if the AllocationInfo is for a container in the dedicated pool

func (*AllocationMeta) CheckMainContainer added in v0.5.12

func (am *AllocationMeta) CheckMainContainer() bool

CheckMainContainer returns true if the AllocationInfo is for main container

func (*AllocationMeta) CheckNUMABinding added in v0.5.12

func (am *AllocationMeta) CheckNUMABinding() bool

CheckNUMABinding returns true if the AllocationInfo is for pod with numa-binding enhancement

func (*AllocationMeta) CheckNumaExclusive added in v0.5.12

func (am *AllocationMeta) CheckNumaExclusive() bool

CheckNumaExclusive returns true if the AllocationInfo is for pod with numa-exclusive enhancement

func (*AllocationMeta) CheckReclaimed added in v0.5.12

func (am *AllocationMeta) CheckReclaimed() bool

CheckReclaimed returns true if the AllocationInfo is for pod with reclaimed-qos

func (*AllocationMeta) CheckShared added in v0.5.12

func (am *AllocationMeta) CheckShared() bool

CheckShared returns true if the AllocationInfo is for pod with shared-qos

func (*AllocationMeta) CheckSharedNUMABinding added in v0.5.12

func (am *AllocationMeta) CheckSharedNUMABinding() bool

CheckSharedNUMABinding returns true if the AllocationInfo is for pod with shared-qos and numa-binding enhancement

func (*AllocationMeta) CheckSharedOrDedicatedNUMABinding added in v0.5.12

func (am *AllocationMeta) CheckSharedOrDedicatedNUMABinding() bool

CheckSharedOrDedicatedNUMABinding returns true if the AllocationInfo is for pod with shared-qos or dedicated-qos and numa-binding enhancement

func (*AllocationMeta) CheckSideCar added in v0.5.12

func (am *AllocationMeta) CheckSideCar() bool

CheckSideCar returns true if the AllocationInfo is for side-car container

func (*AllocationMeta) CheckSystem added in v0.5.12

func (am *AllocationMeta) CheckSystem() bool

func (*AllocationMeta) Clone added in v0.5.12

func (am *AllocationMeta) Clone() *AllocationMeta

func (*AllocationMeta) GetOwnerPoolName added in v0.5.12

func (am *AllocationMeta) GetOwnerPoolName() string

GetOwnerPoolName parses the owner pool name for AllocationInfo

func (*AllocationMeta) GetPoolName added in v0.5.12

func (am *AllocationMeta) GetPoolName() string

GetPoolName parses the owner pool name for AllocationInfo if owner exists, just return; otherwise, parse from qos-level

func (*AllocationMeta) GetSpecifiedNUMABindingPoolName added in v0.5.12

func (am *AllocationMeta) GetSpecifiedNUMABindingPoolName() (string, error)

GetSpecifiedNUMABindingPoolName get numa_binding pool name for numa_binding shared_cores according to enhancements and NUMA hint

func (*AllocationMeta) GetSpecifiedPoolName added in v0.5.12

func (am *AllocationMeta) GetSpecifiedPoolName() string

GetSpecifiedPoolName parses the owner pool name for AllocationInfo from qos-level

func (*AllocationMeta) GetSpecifiedSystemPoolName added in v0.5.12

func (am *AllocationMeta) GetSpecifiedSystemPoolName() (string, error)

type ControlKnobInfo

type ControlKnobInfo struct {
	ControlKnobValue string `json:"control_knob_value"`

	// for control knobs applied by cgroup manager
	// according to entryName, subEntryName, cgroupIfaceName and cgroupSubsysName
	CgroupVersionToIfaceName map[string]string `json:"cgroup_version_to_iface_name"`
	CgroupSubsysName         string            `json:"cgroup_subsys_name"`

	// for control knobs applied by QRM framework according to ociPropertyName
	OciPropertyName string `json:"oci_property_name"`
}

ControlKnobInfo shows common types of control knobs: 1. applied by cgroup manager according to entryName, subEntryName, cgroupIfaceName and cgroupSubsysName 2. applied by QRM framework according to ociPropertyName

there may be new types of control knobs, we won't modify this struct to identify them, and we will register custom per-control-knob executor to deal with them.

func (ControlKnobInfo) Clone

func (cki ControlKnobInfo) Clone() ControlKnobInfo

type ExtraControlKnobConfig

type ExtraControlKnobConfig struct {
	PodExplicitlyAnnotationKey string            `json:"pod_explicitly_annotation_key"`
	QoSLevelToDefaultValue     map[string]string `json:"qos_level_to_default_value"`
	ControlKnobInfo            `json:"control_knob_info"`
}

type ExtraControlKnobConfigs

type ExtraControlKnobConfigs map[string]ExtraControlKnobConfig

func LoadExtraControlKnobConfigs

func LoadExtraControlKnobConfigs(extraControlKnobConfigAbsPath string) (ExtraControlKnobConfigs, error)

Jump to

Keyboard shortcuts

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