Merge pull request 'fix ai scheduler bugs' (#109) from tzwang/pcm-coordinator:master into master
Former-commit-id: 1a46411fbc446d3ec4ad0f9adab43ab310a12545
This commit is contained in:
commit
76ca864472
|
@ -19,6 +19,7 @@ type (
|
||||||
ScheduleResult {
|
ScheduleResult {
|
||||||
ClusterId string `json:"clusterId"`
|
ClusterId string `json:"clusterId"`
|
||||||
TaskId string `json:"taskId"`
|
TaskId string `json:"taskId"`
|
||||||
|
Strategy string `json:"strategy"`
|
||||||
Replica int32 `json:"replica"`
|
Replica int32 `json:"replica"`
|
||||||
Msg string `json:"msg"`
|
Msg string `json:"msg"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,7 @@ func (l *ScheduleSubmitLogic) ScheduleSubmit(req *types.ScheduleReq) (resp *type
|
||||||
scheResult := &types.ScheduleResult{}
|
scheResult := &types.ScheduleResult{}
|
||||||
scheResult.ClusterId = r.ClusterId
|
scheResult.ClusterId = r.ClusterId
|
||||||
scheResult.TaskId = r.TaskId
|
scheResult.TaskId = r.TaskId
|
||||||
|
scheResult.Strategy = r.Strategy
|
||||||
scheResult.Replica = r.Replica
|
scheResult.Replica = r.Replica
|
||||||
scheResult.Msg = r.Msg
|
scheResult.Msg = r.Msg
|
||||||
resp.Results = append(resp.Results, scheResult)
|
resp.Results = append(resp.Results, scheResult)
|
||||||
|
|
|
@ -43,6 +43,7 @@ type AiScheduler struct {
|
||||||
type AiResult struct {
|
type AiResult struct {
|
||||||
TaskId string
|
TaskId string
|
||||||
ClusterId string
|
ClusterId string
|
||||||
|
Strategy string
|
||||||
Replica int32
|
Replica int32
|
||||||
Msg string
|
Msg string
|
||||||
}
|
}
|
||||||
|
@ -154,6 +155,7 @@ func (as *AiScheduler) AssignTask(clusters []*strategy.AssignedCluster) (interfa
|
||||||
result, _ := convertType(resp)
|
result, _ := convertType(resp)
|
||||||
result.Replica = c.Replicas
|
result.Replica = c.Replicas
|
||||||
result.ClusterId = c.ClusterId
|
result.ClusterId = c.ClusterId
|
||||||
|
result.Strategy = as.option.StrategyName
|
||||||
|
|
||||||
ch <- result
|
ch <- result
|
||||||
wg.Done()
|
wg.Done()
|
||||||
|
@ -167,7 +169,7 @@ func (as *AiScheduler) AssignTask(clusters []*strategy.AssignedCluster) (interfa
|
||||||
errs = append(errs, e)
|
errs = append(errs, e)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(errs) != len(clusters) {
|
if len(errs) == len(clusters) {
|
||||||
return nil, errors.New("submit task failed")
|
return nil, errors.New("submit task failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,18 +28,18 @@ func InitAiClusterMap(octopusRpc octopusclient.Octopus, modelArtsRpc modelartsse
|
||||||
case OCTOPUS:
|
case OCTOPUS:
|
||||||
id, _ := strconv.ParseInt(c.Id, 10, 64)
|
id, _ := strconv.ParseInt(c.Id, 10, 64)
|
||||||
octopus := storeLink.NewOctopusLink(octopusRpc, c.Nickname, id)
|
octopus := storeLink.NewOctopusLink(octopusRpc, c.Nickname, id)
|
||||||
collectorMap[c.Nickname] = octopus
|
collectorMap[c.Id] = octopus
|
||||||
executorMap[c.Nickname] = octopus
|
executorMap[c.Id] = octopus
|
||||||
case MODELARTS:
|
case MODELARTS:
|
||||||
id, _ := strconv.ParseInt(c.Id, 10, 64)
|
id, _ := strconv.ParseInt(c.Id, 10, 64)
|
||||||
modelarts := storeLink.NewModelArtsLink(modelArtsRpc, modelArtsImgRpc, c.Nickname, id)
|
modelarts := storeLink.NewModelArtsLink(modelArtsRpc, modelArtsImgRpc, c.Nickname, id)
|
||||||
collectorMap[c.Nickname] = modelarts
|
collectorMap[c.Id] = modelarts
|
||||||
executorMap[c.Nickname] = modelarts
|
executorMap[c.Id] = modelarts
|
||||||
case SHUGUANGAI:
|
case SHUGUANGAI:
|
||||||
id, _ := strconv.ParseInt(c.Id, 10, 64)
|
id, _ := strconv.ParseInt(c.Id, 10, 64)
|
||||||
sgai := storeLink.NewShuguangAi(aCRpc, c.Nickname, id)
|
sgai := storeLink.NewShuguangAi(aCRpc, c.Nickname, id)
|
||||||
collectorMap[c.Nickname] = sgai
|
collectorMap[c.Id] = sgai
|
||||||
executorMap[c.Nickname] = sgai
|
executorMap[c.Id] = sgai
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5289,6 +5289,7 @@ type ScheduleResp struct {
|
||||||
type ScheduleResult struct {
|
type ScheduleResult struct {
|
||||||
ClusterId string `json:"clusterId"`
|
ClusterId string `json:"clusterId"`
|
||||||
TaskId string `json:"taskId"`
|
TaskId string `json:"taskId"`
|
||||||
|
Strategy string `json:"strategy"`
|
||||||
Replica int32 `json:"replica"`
|
Replica int32 `json:"replica"`
|
||||||
Msg string `json:"msg"`
|
Msg string `json:"msg"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue