Documentation
¶
Index ¶
- func NewDeviceMapByNode(node *corev1.Node) (map[int]*Device, error)
- type ClaimDevice
- type ContainerDevices
- type Device
- func (dev *Device) AllocatableCores() int
- func (dev *Device) AllocatableMemory() int
- func (dev *Device) AllocatableNumber() int
- func (dev *Device) GetBusID() string
- func (dev *Device) GetComputeCapability() float32
- func (dev *Device) GetID() int
- func (dev *Device) GetNUMA() int
- func (dev *Device) GetTotalCores() int
- func (dev *Device) GetTotalMemory() int
- func (dev *Device) GetTotalNumber() int
- func (dev *Device) GetType() string
- func (dev *Device) GetUUID() string
- func (dev *Device) Healthy() bool
- func (dev *Device) IsMIG() bool
- type DeviceInfo
- type NodeDeviceInfo
- type NodeInfo
- func (n *NodeInfo) AddUsedResources(id int, core int, memory int) error
- func (n *NodeInfo) GetAvailableCores() int
- func (n *NodeInfo) GetAvailableMemory() int
- func (n *NodeInfo) GetAvailableNumber() int
- func (n *NodeInfo) GetDeviceCount() int
- func (n *NodeInfo) GetDeviceMap() map[int]*Device
- func (n *NodeInfo) GetMaxCapability() float32
- func (n *NodeInfo) GetName() string
- func (n *NodeInfo) GetNode() *corev1.Node
- func (n *NodeInfo) GetTotalCores() int
- func (n *NodeInfo) GetTotalMemory() int
- func (n *NodeInfo) GetTotalNumber() int
- type NodeTopologyInfo
- type PodDevices
- type TopologyInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClaimDevice ¶
type ClaimDevice struct {
Id int `json:"id"`
Uuid string `json:"uuid"`
Cores int `json:"cores"`
Memory int `json:"memory"`
}
func (*ClaimDevice) MarshalText ¶
func (c *ClaimDevice) MarshalText() (string, error)
func (*ClaimDevice) UnmarshalText ¶
func (c *ClaimDevice) UnmarshalText(text string) error
type ContainerDevices ¶
type ContainerDevices struct {
Name string `json:"name"`
Devices []ClaimDevice `json:"devices"`
}
func GetCurrentPreAllocateContainerDevice ¶
func GetCurrentPreAllocateContainerDevice(pod *corev1.Pod) (*ContainerDevices, error)
GetCurrentPreAllocateContainerDevice find the device information pre allocated to the current container.
func (*ContainerDevices) MarshalText ¶
func (c *ContainerDevices) MarshalText() (string, error)
func (*ContainerDevices) UnmarshalText ¶
func (c *ContainerDevices) UnmarshalText(text string) error
type Device ¶ added in v0.3.0
type Device struct {
// contains filtered or unexported fields
}
func NewDevice ¶ added in v0.3.0
func NewDevice(dev DeviceInfo) *Device
func NewFakeDevice ¶ added in v0.3.0
func (*Device) AllocatableCores ¶ added in v0.3.0
AllocatableCores returns the remaining cores of this GPU device
func (*Device) AllocatableMemory ¶ added in v0.3.0
AllocatableMemory returns the remaining memory of this GPU device
func (*Device) AllocatableNumber ¶ added in v0.3.0
AllocatableNumber returns the remaining number of this GPU device
func (*Device) GetComputeCapability ¶ added in v0.3.0
GetComputeCapability returns the capability of this device
func (*Device) GetTotalCores ¶ added in v0.3.0
GetTotalCores returns the totalCore of this device
func (*Device) GetTotalMemory ¶ added in v0.3.0
GetTotalMemory returns the totalMemory of this device
func (*Device) GetTotalNumber ¶ added in v0.3.0
GetTotalNumber returns the totalNum of this device
type DeviceInfo ¶
type DeviceInfo struct {
Id int `json:"id"`
Type string `json:"type"`
Uuid string `json:"uuid"`
Core int `json:"core"`
Memory int `json:"memory"`
Number int `json:"number"`
Numa int `json:"numa"`
Mig bool `json:"mig"`
BusId string `json:"busId"`
Capability float32 `json:"capability"`
Healthy bool `json:"healthy"`
}
type NodeDeviceInfo ¶ added in v0.3.0
type NodeDeviceInfo []DeviceInfo
func ParseNodeDeviceInfo ¶ added in v0.3.0
func ParseNodeDeviceInfo(val string) (NodeDeviceInfo, error)
func (*NodeDeviceInfo) Decode ¶ added in v0.4.1
func (n *NodeDeviceInfo) Decode(val string) error
func (NodeDeviceInfo) Encode ¶ added in v0.3.0
func (n NodeDeviceInfo) Encode() (string, error)
type NodeInfo ¶
type NodeInfo struct {
// contains filtered or unexported fields
}
func NewFakeNodeInfo ¶ added in v0.3.0
func (*NodeInfo) AddUsedResources ¶ added in v0.3.0
AddUsedResources records the used GPU core and memory
func (*NodeInfo) GetAvailableCores ¶ added in v0.3.0
GetAvailableCores returns the remaining cores of this node
func (*NodeInfo) GetAvailableMemory ¶
GetAvailableMemory returns the remaining memory of this node
func (*NodeInfo) GetAvailableNumber ¶
GetAvailableNumber returns the remaining number of this node
func (*NodeInfo) GetDeviceCount ¶
GetDeviceCount returns the number of GPU devices
func (*NodeInfo) GetDeviceMap ¶
GetDeviceMap returns each GPU device information structure
func (*NodeInfo) GetMaxCapability ¶
GetMaxCapability returns the maxCapability of GPU devices
func (*NodeInfo) GetTotalCores ¶ added in v0.3.0
GetTotalCores returns the total cores of this node
func (*NodeInfo) GetTotalMemory ¶
GetTotalMemory returns the total memory of this node
func (*NodeInfo) GetTotalNumber ¶
GetTotalNumber returns the total number of this node
type NodeTopologyInfo ¶ added in v0.3.0
type NodeTopologyInfo []TopologyInfo
func ParseNodeTopology ¶ added in v0.3.0
func ParseNodeTopology(val string) (NodeTopologyInfo, error)
func (*NodeTopologyInfo) Decode ¶ added in v0.4.1
func (n *NodeTopologyInfo) Decode(val string) error
func (NodeTopologyInfo) Encode ¶ added in v0.3.0
func (n NodeTopologyInfo) Encode() (string, error)
type PodDevices ¶
type PodDevices []ContainerDevices
func GetPodAssignDevices ¶
func GetPodAssignDevices(pod *corev1.Pod) PodDevices
func (*PodDevices) MarshalText ¶
func (p *PodDevices) MarshalText() (string, error)
func (*PodDevices) UnmarshalText ¶
func (p *PodDevices) UnmarshalText(text string) error
type TopologyInfo ¶ added in v0.3.0
type TopologyInfo struct {
Index int `json:"index"`
Links map[int][]links.P2PLinkType `json:"links"`
}