1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-12-15 08:16:43 +00:00

add group manager

This commit is contained in:
2019-07-29 14:56:18 +08:00
parent b954733a89
commit c664d1f99e
2 changed files with 80 additions and 9 deletions

View File

@@ -43,7 +43,7 @@ type MsgResource struct {
type MsgJobList struct {
Code int `json:"code"`
Error string `json:"error"`
Jobs []Job `json:"jobs"`
Jobs []Job `json:"jobs"`
}
type MsgLog struct {
@@ -136,6 +136,23 @@ type Task struct {
MemoryGPU int `json:"gpu_memory"`
}
type Group struct {
Name string `json:"name"`
Weight int `json:"weight"`
NumGPU int `json:"gpu_number"`
}
type MsgGroupCreate struct {
Code int `json:"code"`
Error string `json:"error"`
}
type MsgGroupList struct {
Code int `json:"code"`
Error string `json:"error"`
Groups []Group `json:"groups"`
}
func str2int(str string, defaultValue int) int {
i, err := strconv.Atoi(str)
if err == nil {