Documentation ¶
Index ¶
- Variables
- func DisplayNodeDetails(nodeNames []string, nodeType types.NodeType, format types.FormatStyle, ...) error
- func DisplayNodeSummary(nodeNames []string, targetNodeType types.NodeType, format types.FormatStyle, ...) error
- func GetNodeGpuMetrics(client *kubernetes.Clientset) (map[string]types.NodeGpuMetric, error)
- func IsGPUExclusiveNode(node *v1.Node) bool
- func IsGPUShareNode(node *v1.Node) bool
- func IsGPUTopologyNode(node *v1.Node) bool
- func ListNodeDetails(nodeNames []string, nodeType types.NodeType, showMetric bool) (types.AllNodeInfo, error)
- func PrintLine(w io.Writer, fields ...string)
- type Node
- func BuildNodes(nodeNames []string, targetNodeType types.NodeType, showMetric bool) ([]Node, error)
- func NewGPUExclusiveNode(client *kubernetes.Clientset, node *v1.Node, index int, args buildNodeArgs) (Node, error)
- func NewGPUShareNode(client *kubernetes.Clientset, node *v1.Node, index int, args buildNodeArgs) (Node, error)
- func NewGPUTopologyNode(client *kubernetes.Clientset, node *v1.Node, index int, args buildNodeArgs) (Node, error)
- func NewNormalNode(client *kubernetes.Clientset, node *v1.Node, index int, args buildNodeArgs) (Node, error)
- type NodeProcesser
Constants ¶
This section is empty.
Variables ¶
var GPUExclusiveNodeDescription = `` /* 135-byte string literal not displayed */
var GPUTopologyNodeDescription = `` /* 133-byte string literal not displayed */
var NormalNodeDescription = `
This node has none gpu devices
`
Functions ¶
func DisplayNodeDetails ¶
func DisplayNodeSummary ¶
func DisplayNodeSummary(nodeNames []string, targetNodeType types.NodeType, format types.FormatStyle, showMetric bool) error
format like:
NAME IPADDRESS ROLE STATUS GPU(Total) GPU(Allocated) GPU_MODE cn-shanghai.192.168.7.178 192.168.7.178 master Ready 0 0 none cn-shanghai.192.168.7.179 192.168.7.179 master Ready 0 0 none cn-shanghai.192.168.7.180 192.168.7.180 master Ready 0 0 none cn-shanghai.192.168.7.181 192.168.7.181 <none> Ready 0 0 none cn-shanghai.192.168.7.182 192.168.7.182 <none> Ready 1 0 exclusive cn-shanghai.192.168.7.186 192.168.7.186 <none> Ready 4 0 topology cn-shanghai.192.168.7.183 192.168.7.183 <none> Ready 4 2.1 share
func GetNodeGpuMetrics ¶
func GetNodeGpuMetrics(client *kubernetes.Clientset) (map[string]types.NodeGpuMetric, error)
func IsGPUExclusiveNode ¶
func IsGPUShareNode ¶
func IsGPUTopologyNode ¶
func ListNodeDetails ¶
Types ¶
type Node ¶
type Node interface { // Index is used to sort the nodes Index() int // Name return the node name Name() string // Type return the node type Type() types.NodeType // Role returns the role of node Role() []string // IP returns the node ip IP() string // Status returns the node status Status() string // GetV1Pods returns the pods of node GetV1Pods() []*v1.Pod // GetV1Node returns the v1.node GetV1Node() *v1.Node // Convert2NodeInfo convert node to node info Convert2NodeInfo() interface{} // AllDevicesAreHealthy returns the all devices are healthy AllDevicesAreHealthy() bool // WideFormat is used to display node information with wide format WideFormat() string }
func BuildNodes ¶
func NewGPUExclusiveNode ¶
func NewGPUShareNode ¶
func NewGPUTopologyNode ¶
func NewNormalNode ¶
type NodeProcesser ¶
type NodeProcesser interface { // BuildNode builds the nodes and return the skip nodes BuildNode(client *kubernetes.Clientset, v1nodes *v1.Node, nodes []Node, targetNodeType types.NodeType, index int, args buildNodeArgs) ([]Node, bool) // Convert2NodeInfos filters nodes Convert2NodeInfos(nodes []Node, allNodes types.AllNodeInfo) types.AllNodeInfo // DisplayNodesDetails display nodes which the processer knowns DisplayNodesDetails(w *tabwriter.Writer, nodes []Node) // DisplayNodesSummary display nodes summary DisplayNodesSummary(w *tabwriter.Writer, nodes []Node, showNodeType, isUnhealthy bool) (int, int, int) // DisplayNodesCustomSummary display custom format of target type nodes DisplayNodesCustomSummary(w *tabwriter.Writer, nodes []Node) // SupportedNodeType Type returns the supported node type SupportedNodeType() types.NodeType }
NodeProcesser process the node
func GetSupportedNodePorcessers ¶
func GetSupportedNodePorcessers() []NodeProcesser
NewNormalNodeProcesser must be placed at last,it will match all unknown nodes
func NewGPUExclusiveNodeProcesser ¶
func NewGPUExclusiveNodeProcesser() NodeProcesser
func NewGPUShareNodeProcesser ¶
func NewGPUShareNodeProcesser() NodeProcesser
func NewGPUTopologyNodeProcesser ¶
func NewGPUTopologyNodeProcesser() NodeProcesser
func NewNormalNodeProcesser ¶
func NewNormalNodeProcesser() NodeProcesser