mirror of
https://github.com/newnius/YAO-scheduler.git
synced 2025-06-06 05:51:54 +00:00
support update share_max_utilization at runtime
This commit is contained in:
parent
17fd698e35
commit
ccdc09bbf7
@ -112,4 +112,9 @@ GPU is occupied by which job(s)
|
||||
**UpdateStrategy**
|
||||
```
|
||||
?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
|
||||
}
|
||||
|
||||
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{} {
|
||||
res := map[string]interface{}{}
|
||||
res["KafkaBrokers"] = config.KafkaBrokers
|
||||
|
@ -358,6 +358,14 @@ func serverAPI(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write(js)
|
||||
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:
|
||||
http.Error(w, "Not Found", http.StatusNotFound)
|
||||
break
|
||||
|
@ -194,7 +194,7 @@ func (pool *ResourcePool) checkDeadNodes() {
|
||||
delete(pool.versions, k)
|
||||
pool.versionsMu.Unlock()
|
||||
nodesToDel = append(nodesToDel, k)
|
||||
log.Warn(" node ", k, " is offline")
|
||||
log.Warn("node ", k, " is offline")
|
||||
}
|
||||
}
|
||||
for _, v := range nodesToDel {
|
||||
|
Loading…
Reference in New Issue
Block a user