Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertDeviceRequest(podRequest corev1.ResourceList, combination uint) corev1.ResourceList
- func GetPodDeviceRequests(pod *corev1.Pod) (map[schedulingv1alpha1.DeviceType]corev1.ResourceList, error)
- func New(obj runtime.Object, handle framework.Handle) (framework.Plugin, error)
- func ValidateDeviceRequest(podRequest corev1.ResourceList) (uint, error)
- func ValidatePercentageResource(q resource.Quantity) bool
- type AutopilotAllocator
- type DefaultDeviceHandler
- type DeviceAllocator
- type DeviceHandler
- type GPUHandler
- type NUMATopology
- type NodeDeviceSummary
- type PCIe
- type PCIeIndex
- type Plugin
- func (p *Plugin) AddPod(ctx context.Context, cycleState *framework.CycleState, ...) *framework.Status
- func (p *Plugin) Allocate(ctx context.Context, cycleState *framework.CycleState, ...) *framework.Status
- func (p *Plugin) EventsToRegister() []framework.ClusterEventWithHint
- func (p *Plugin) Filter(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (p *Plugin) FilterReservation(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (p *Plugin) FinalRestoreReservation(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (p *Plugin) GetPodTopologyHints(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, ...) (map[string][]topologymanager.NUMATopologyHint, *framework.Status)
- func (p *Plugin) Name() string
- func (p *Plugin) NormalizeReservationScore(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (p *Plugin) NormalizeScore(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (p *Plugin) PreBind(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (p *Plugin) PreBindReservation(ctx context.Context, cycleState *framework.CycleState, ...) *framework.Status
- func (p *Plugin) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod) (*framework.PreFilterResult, *framework.Status)
- func (p *Plugin) PreFilterExtensions() framework.PreFilterExtensions
- func (p *Plugin) PreRestoreReservation(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod) *framework.Status
- func (p *Plugin) RegisterEndpoints(group *gin.RouterGroup)
- func (p *Plugin) RemovePod(ctx context.Context, cycleState *framework.CycleState, ...) *framework.Status
- func (p *Plugin) ReservationScoreExtensions() frameworkext.ReservationScoreExtensions
- func (p *Plugin) Reserve(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (p *Plugin) ResizePod(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (p *Plugin) RestoreReservation(ctx context.Context, cycleState *framework.CycleState, ...) (interface{}, *framework.Status)
- func (p *Plugin) Score(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, ...) (int64, *framework.Status)
- func (p *Plugin) ScoreExtensions() framework.ScoreExtensions
- func (p *Plugin) ScoreReservation(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, ...) (int64, *framework.Status)
- func (p *Plugin) Unreserve(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, ...)
- type VFAllocation
Constants ¶
View Source
const ( NvidiaGPU = 1 << iota HygonDCU KoordGPU GPUCore GPUMemory GPUMemoryRatio FPGA RDMA )
View Source
const (
// Name is the name of the plugin used in the plugin registry and configurations.
Name = "DeviceShare"
)
Variables ¶
View Source
var DeviceResourceFlags = map[corev1.ResourceName]uint{ apiext.ResourceNvidiaGPU: NvidiaGPU, apiext.ResourceHygonDCU: HygonDCU, apiext.ResourceGPU: KoordGPU, apiext.ResourceGPUCore: GPUCore, apiext.ResourceGPUMemory: GPUMemory, apiext.ResourceGPUMemoryRatio: GPUMemoryRatio, apiext.ResourceFPGA: FPGA, apiext.ResourceRDMA: RDMA, }
View Source
var DeviceResourceNames = map[schedulingv1alpha1.DeviceType][]corev1.ResourceName{ schedulingv1alpha1.GPU: { apiext.ResourceNvidiaGPU, apiext.ResourceHygonDCU, apiext.ResourceGPU, apiext.ResourceGPUCore, apiext.ResourceGPUMemory, apiext.ResourceGPUMemoryRatio, }, schedulingv1alpha1.RDMA: {apiext.ResourceRDMA}, schedulingv1alpha1.FPGA: {apiext.ResourceFPGA}, }
View Source
var DeviceResourceValidators = map[corev1.ResourceName]func(q resource.Quantity) bool{ apiext.ResourceGPU: ValidatePercentageResource, apiext.ResourceGPUCore: ValidatePercentageResource, apiext.ResourceGPUMemoryRatio: ValidatePercentageResource, apiext.ResourceFPGA: ValidatePercentageResource, apiext.ResourceRDMA: ValidatePercentageResource, }
View Source
var ResourceCombinationsMapper = map[uint]func(podRequest corev1.ResourceList) corev1.ResourceList{ GPUMemory: func(podRequest corev1.ResourceList) corev1.ResourceList { return corev1.ResourceList{ apiext.ResourceGPUMemory: podRequest[apiext.ResourceGPUMemory], } }, GPUMemoryRatio: func(podRequest corev1.ResourceList) corev1.ResourceList { return corev1.ResourceList{ apiext.ResourceGPUMemoryRatio: podRequest[apiext.ResourceGPUMemoryRatio], } }, GPUCore | GPUMemory: func(podRequest corev1.ResourceList) corev1.ResourceList { return corev1.ResourceList{ apiext.ResourceGPUCore: podRequest[apiext.ResourceGPUCore], apiext.ResourceGPUMemory: podRequest[apiext.ResourceGPUMemory], } }, GPUCore | GPUMemoryRatio: func(podRequest corev1.ResourceList) corev1.ResourceList { return corev1.ResourceList{ apiext.ResourceGPUCore: podRequest[apiext.ResourceGPUCore], apiext.ResourceGPUMemoryRatio: podRequest[apiext.ResourceGPUMemoryRatio], } }, KoordGPU: func(podRequest corev1.ResourceList) corev1.ResourceList { return corev1.ResourceList{ apiext.ResourceGPUCore: podRequest[apiext.ResourceGPU], apiext.ResourceGPUMemoryRatio: podRequest[apiext.ResourceGPU], } }, NvidiaGPU: func(podRequest corev1.ResourceList) corev1.ResourceList { nvidiaGPU := podRequest[apiext.ResourceNvidiaGPU] return corev1.ResourceList{ apiext.ResourceGPUCore: *resource.NewQuantity(nvidiaGPU.Value()*100, resource.DecimalSI), apiext.ResourceGPUMemoryRatio: *resource.NewQuantity(nvidiaGPU.Value()*100, resource.DecimalSI), } }, HygonDCU: func(podRequest corev1.ResourceList) corev1.ResourceList { hygonDCU := podRequest[apiext.ResourceHygonDCU] return corev1.ResourceList{ apiext.ResourceGPUCore: *resource.NewQuantity(hygonDCU.Value()*100, resource.DecimalSI), apiext.ResourceGPUMemoryRatio: *resource.NewQuantity(hygonDCU.Value()*100, resource.DecimalSI), } }, FPGA: func(podRequest corev1.ResourceList) corev1.ResourceList { return corev1.ResourceList{ apiext.ResourceFPGA: podRequest[apiext.ResourceFPGA], } }, RDMA: func(podRequest corev1.ResourceList) corev1.ResourceList { return corev1.ResourceList{ apiext.ResourceRDMA: podRequest[apiext.ResourceRDMA], } }, }
Functions ¶
func ConvertDeviceRequest ¶ added in v1.3.0
func ConvertDeviceRequest(podRequest corev1.ResourceList, combination uint) corev1.ResourceList
func GetPodDeviceRequests ¶ added in v1.4.0
func GetPodDeviceRequests(pod *corev1.Pod) (map[schedulingv1alpha1.DeviceType]corev1.ResourceList, error)
func ValidateDeviceRequest ¶ added in v1.3.0
func ValidateDeviceRequest(podRequest corev1.ResourceList) (uint, error)
func ValidatePercentageResource ¶ added in v1.3.0
Types ¶
type AutopilotAllocator ¶ added in v1.4.0
type AutopilotAllocator struct {
// contains filtered or unexported fields
}
func (*AutopilotAllocator) Allocate ¶ added in v1.4.0
func (a *AutopilotAllocator) Allocate( required, preferred map[schedulingv1alpha1.DeviceType]sets.Int, requiredDeviceResources, preemptibleDeviceResources map[schedulingv1alpha1.DeviceType]deviceResources, ) (apiext.DeviceAllocations, *framework.Status)
func (*AutopilotAllocator) Prepare ¶ added in v1.4.0
func (a *AutopilotAllocator) Prepare() *framework.Status
type DefaultDeviceHandler ¶ added in v1.4.0
type DefaultDeviceHandler struct {
// contains filtered or unexported fields
}
func (*DefaultDeviceHandler) CalcDesiredRequestsAndCount ¶ added in v1.4.0
func (h *DefaultDeviceHandler) CalcDesiredRequestsAndCount(_ *corev1.Node, _ *corev1.Pod, podRequests corev1.ResourceList, nodeDevice *nodeDevice, hint *apiext.DeviceHint) (corev1.ResourceList, int, *framework.Status)
type DeviceAllocator ¶ added in v1.4.0
type DeviceHandler ¶ added in v1.4.0
type DeviceHandler interface {
CalcDesiredRequestsAndCount(node *corev1.Node, pod *corev1.Pod, podRequests corev1.ResourceList, nodeDevice *nodeDevice, hint *apiext.DeviceHint) (corev1.ResourceList, int, *framework.Status)
}
type GPUHandler ¶ added in v1.4.0
type GPUHandler struct { }
func (*GPUHandler) CalcDesiredRequestsAndCount ¶ added in v1.4.0
func (h *GPUHandler) CalcDesiredRequestsAndCount(node *corev1.Node, pod *corev1.Pod, podRequests corev1.ResourceList, nodeDevice *nodeDevice, hint *apiext.DeviceHint) (corev1.ResourceList, int, *framework.Status)
type NUMATopology ¶ added in v1.4.0
type NUMATopology struct {
// contains filtered or unexported fields
}
type NodeDeviceSummary ¶
type NodeDeviceSummary struct { DeviceTotal map[v1.ResourceName]*resource.Quantity `json:"deviceTotal"` DeviceFree map[v1.ResourceName]*resource.Quantity `json:"deviceFree"` DeviceUsed map[v1.ResourceName]*resource.Quantity `json:"deviceUsed"` DeviceTotalDetail map[schedulingv1alpha1.DeviceType]deviceResources `json:"deviceTotalDetail"` DeviceFreeDetail map[schedulingv1alpha1.DeviceType]deviceResources `json:"deviceFreeDetail"` DeviceUsedDetail map[schedulingv1alpha1.DeviceType]deviceResources `json:"deviceUsedDetail"` AllocateSet map[schedulingv1alpha1.DeviceType]map[string]map[int]v1.ResourceList `json:"allocateSet"` }
func NewNodeDeviceSummary ¶
func NewNodeDeviceSummary() *NodeDeviceSummary
type PCIe ¶ added in v1.4.0
type PCIe struct { PCIeIndex // contains filtered or unexported fields }
type PCIeIndex ¶ added in v1.4.0
type PCIeIndex struct {
// contains filtered or unexported fields
}
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (*Plugin) Allocate ¶ added in v1.4.0
func (p *Plugin) Allocate(ctx context.Context, cycleState *framework.CycleState, affinity topologymanager.NUMATopologyHint, pod *corev1.Pod, nodeName string) *framework.Status
func (*Plugin) EventsToRegister ¶ added in v1.3.0
func (p *Plugin) EventsToRegister() []framework.ClusterEventWithHint
func (*Plugin) FilterReservation ¶ added in v1.2.0
func (p *Plugin) FilterReservation(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, reservationInfo *frameworkext.ReservationInfo, nodeName string) *framework.Status
func (*Plugin) FinalRestoreReservation ¶ added in v1.3.0
func (p *Plugin) FinalRestoreReservation(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, nodeToStates frameworkext.NodeReservationRestoreStates) *framework.Status
func (*Plugin) GetPodTopologyHints ¶ added in v1.4.0
func (p *Plugin) GetPodTopologyHints(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, nodeName string) (map[string][]topologymanager.NUMATopologyHint, *framework.Status)
func (*Plugin) NormalizeReservationScore ¶ added in v1.4.0
func (p *Plugin) NormalizeReservationScore(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, scores frameworkext.ReservationScoreList) *framework.Status
func (*Plugin) NormalizeScore ¶ added in v1.3.0
func (*Plugin) PreBindReservation ¶ added in v1.2.0
func (p *Plugin) PreBindReservation(ctx context.Context, cycleState *framework.CycleState, reservation *schedulingv1alpha1.Reservation, nodeName string) *framework.Status
func (*Plugin) PreFilterExtensions ¶
func (p *Plugin) PreFilterExtensions() framework.PreFilterExtensions
func (*Plugin) PreRestoreReservation ¶ added in v1.3.0
func (*Plugin) RegisterEndpoints ¶
func (p *Plugin) RegisterEndpoints(group *gin.RouterGroup)
func (*Plugin) ReservationScoreExtensions ¶ added in v1.4.0
func (p *Plugin) ReservationScoreExtensions() frameworkext.ReservationScoreExtensions
func (*Plugin) RestoreReservation ¶ added in v1.3.0
func (p *Plugin) RestoreReservation(ctx context.Context, cycleState *framework.CycleState, podToSchedule *corev1.Pod, matched []*frameworkext.ReservationInfo, unmatched []*frameworkext.ReservationInfo, nodeInfo *framework.NodeInfo) (interface{}, *framework.Status)
func (*Plugin) ScoreExtensions ¶ added in v1.3.0
func (p *Plugin) ScoreExtensions() framework.ScoreExtensions
func (*Plugin) ScoreReservation ¶ added in v1.3.0
func (p *Plugin) ScoreReservation(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, reservationInfo *frameworkext.ReservationInfo, nodeName string) (int64, *framework.Status)
type VFAllocation ¶ added in v1.4.0
type VFAllocation struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.