mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-06-07 14:21:55 +00:00
support update share_max_utilization at runtime
This commit is contained in:
parent
17fd698e35
commit
ccdc09bbf7
@ -113,3 +113,8 @@ GPU is occupied by which job(s)
|
|||||||
```
|
```
|
||||||
?aciotn=allocator_update_strategy&strategy=mixed
|
?aciotn=allocator_update_strategy&strategy=mixed
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**UpdateShareMaxUtilization**
|
||||||
|
```
|
||||||
|
?aciotn=conf_set_share_max_utilization&util=1.5
|
||||||
|
```
|
@ -145,6 +145,12 @@ func (config *Configuration) SetPreScheduleRatio(ratio float64) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (config *Configuration) SetShareMaxUtilization(value float64) bool {
|
||||||
|
config.ShareMaxUtilization = value
|
||||||
|
log.Info("ShareMaxUtilization is set to ", value)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func (config *Configuration) Dump() map[string]interface{} {
|
func (config *Configuration) Dump() map[string]interface{} {
|
||||||
res := map[string]interface{}{}
|
res := map[string]interface{}{}
|
||||||
res["KafkaBrokers"] = config.KafkaBrokers
|
res["KafkaBrokers"] = config.KafkaBrokers
|
||||||
|
@ -358,6 +358,14 @@ func serverAPI(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.Write(js)
|
w.Write(js)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
case "conf_set_share_max_utilization":
|
||||||
|
log.Debug("conf_set_share_max_utilization")
|
||||||
|
util, _ := strconv.ParseFloat(r.URL.Query().Get("util"), 32)
|
||||||
|
js, _ := json.Marshal(InstanceOfConfiguration().SetShareMaxUtilization(util))
|
||||||
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
w.Write(js)
|
||||||
|
break
|
||||||
|
|
||||||
default:
|
default:
|
||||||
http.Error(w, "Not Found", http.StatusNotFound)
|
http.Error(w, "Not Found", http.StatusNotFound)
|
||||||
break
|
break
|
||||||
|
@ -194,7 +194,7 @@ func (pool *ResourcePool) checkDeadNodes() {
|
|||||||
delete(pool.versions, k)
|
delete(pool.versions, k)
|
||||||
pool.versionsMu.Unlock()
|
pool.versionsMu.Unlock()
|
||||||
nodesToDel = append(nodesToDel, k)
|
nodesToDel = append(nodesToDel, k)
|
||||||
log.Warn(" node ", k, " is offline")
|
log.Warn("node ", k, " is offline")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, v := range nodesToDel {
|
for _, v := range nodesToDel {
|
||||||
|
Loading…
Reference in New Issue
Block a user