staticpolicy

package
v0.5.41 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStaticPolicy

func NewStaticPolicy(
	agentCtx *agent.GenericContext, conf *config.Configuration,
	_ interface{}, agentName string,
) (bool, agent.Component, error)

NewStaticPolicy returns a static gpu policy

Types

type StaticPolicy

type StaticPolicy struct {
	sync.RWMutex
	pluginapi.UnimplementedResourcePluginServer
	*baseplugin.BasePlugin
	// contains filtered or unexported fields
}

StaticPolicy is the static gpu policy

func (*StaticPolicy) Allocate

Allocate is called during pod admit so that the resource plugin can allocate corresponding resource for the container according to resource request

func (*StaticPolicy) AllocateAssociatedDevice

func (p *StaticPolicy) AllocateAssociatedDevice(
	ctx context.Context, req *pluginapi.AssociatedDeviceRequest,
) (resp *pluginapi.AssociatedDeviceAllocationResponse, respErr error)

AllocateAssociatedDevice allocates a device in this sequence: 1. Find the resource plugin that corresponds to the accompanyResourceName and allocate 2. Find the custom device plugin that corresponds to the deviceName and allocate

func (*StaticPolicy) AllocateForPod

AllocateForPod is called during pod admit so that the resource plugin can allocate corresponding resource for the pod according to resource request

func (*StaticPolicy) GetPodTopologyHints

func (p *StaticPolicy) GetPodTopologyHints(
	_ context.Context,
	req *pluginapi.PodResourceRequest,
) (resp *pluginapi.PodResourceHintsResponse, err error)

GetPodTopologyHints returns hints of corresponding resources

func (*StaticPolicy) GetResourcePluginOptions

func (p *StaticPolicy) GetResourcePluginOptions(
	context.Context,
	*pluginapi.Empty,
) (*pluginapi.ResourcePluginOptions, error)

GetResourcePluginOptions returns options to be communicated with Resource Manager

func (*StaticPolicy) GetResourcesAllocation

GetResourcesAllocation returns allocation results of corresponding resources

func (*StaticPolicy) GetTopologyAwareAllocatableResources

GetTopologyAwareAllocatableResources returns corresponding allocatable resources as topology aware format

func (*StaticPolicy) GetTopologyAwareResources

GetTopologyAwareResources returns allocation results of corresponding resources as topology aware format

func (*StaticPolicy) GetTopologyHints

func (p *StaticPolicy) GetTopologyHints(
	ctx context.Context,
	req *pluginapi.ResourceRequest,
) (resp *pluginapi.ResourceHintsResponse, err error)

GetTopologyHints returns hints of corresponding resources

func (*StaticPolicy) Name

func (p *StaticPolicy) Name() string

Name returns the name of this plugin

func (*StaticPolicy) PreStartContainer

PreStartContainer is called, if indicated by resource plugin during registration phase, before each container start. Resource plugin can run resource specific operations such as resetting the resource before making resources available to the container

func (*StaticPolicy) RegisterCustomDevicePlugin

func (p *StaticPolicy) RegisterCustomDevicePlugin(plugin customdeviceplugin.CustomDevicePlugin)

func (*StaticPolicy) RegisterResourcePlugin

func (p *StaticPolicy) RegisterResourcePlugin(resourcePlugin resourceplugin.ResourcePlugin)

func (*StaticPolicy) RemovePod

func (*StaticPolicy) ResourceName

func (p *StaticPolicy) ResourceName() string

ResourceName returns resource names managed by this plugin

func (*StaticPolicy) Start

func (p *StaticPolicy) Start() (err error)

Start starts this plugin

func (*StaticPolicy) Stop

func (p *StaticPolicy) Stop() error

Stop stops this plugin

Jump to

Keyboard shortcuts

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