-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpushare-inspect.go
42 lines (35 loc) · 834 Bytes
/
gpushare-inspect.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package scheduler
import (
"github.com/AliyunContainerService/gpushare-scheduler-extender/pkg/cache"
)
func NewGPUShareInspect(c *cache.SchedulerCache) *Inspect {
return &Inspect{
Name: "gpushareinspect",
cache: c,
}
}
type Result struct {
Nodes []*Node `json:"nodes"`
Error string `json:"error,omitempty"`
}
type Node struct {
Name string `json:"name"`
TotalGPU uint `json:"totalGPU"`
UsedGPU uint `json:"usedGPU"`
Devices []*Device `json:"devs"`
}
type Device struct {
ID int `json:"id"`
TotalGPU uint `json:"totalGPU"`
UsedGPU uint `json:"usedGPU"`
Pods []*Pod `json:"pods"`
}
type Pod struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
UsedGPU int `json:"usedGPU"`
}
type Inspect struct {
Name string
cache *cache.SchedulerCache
}