added jobid to scheduleResult api
Former-commit-id: 3a2e77a99adb0cfca2e80183ba0cce7264311f2d
This commit is contained in:
parent
120dbecc1d
commit
3f9e814e88
|
@ -21,6 +21,7 @@ type (
|
|||
TaskId string `json:"taskId"`
|
||||
Card string `json:"card"`
|
||||
Strategy string `json:"strategy"`
|
||||
JobId string `json:"jobId"`
|
||||
Replica int32 `json:"replica"`
|
||||
Msg string `json:"msg"`
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ import (
|
|||
"gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc"
|
||||
"gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types"
|
||||
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/constants"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
@ -31,6 +33,7 @@ func (l *ScheduleSubmitLogic) ScheduleSubmit(req *types.ScheduleReq) (resp *type
|
|||
AdapterId: req.AiOption.AdapterId,
|
||||
TaskName: req.AiOption.TaskName,
|
||||
ResourceType: req.AiOption.ResourceType,
|
||||
ComputeCard: req.AiOption.ComputeCard,
|
||||
Replica: 1,
|
||||
Tops: req.AiOption.Tops,
|
||||
TaskType: req.AiOption.TaskType,
|
||||
|
@ -69,12 +72,13 @@ func (l *ScheduleSubmitLogic) ScheduleSubmit(req *types.ScheduleReq) (resp *type
|
|||
for _, r := range rs {
|
||||
scheResult := &types.ScheduleResult{}
|
||||
scheResult.ClusterId = r.ClusterId
|
||||
scheResult.TaskId = r.TaskId
|
||||
scheResult.TaskId = strconv.FormatInt(id, 10)
|
||||
scheResult.Strategy = r.Strategy
|
||||
scheResult.Card = strings.ToUpper(r.Card)
|
||||
scheResult.Replica = r.Replica
|
||||
scheResult.Msg = r.Msg
|
||||
|
||||
opt.ComputeCard = r.Card
|
||||
opt.ComputeCard = strings.ToUpper(r.Card)
|
||||
|
||||
clusterName, _ := l.svcCtx.Scheduler.AiStorages.GetClusterNameById(r.ClusterId)
|
||||
|
||||
|
@ -82,6 +86,7 @@ func (l *ScheduleSubmitLogic) ScheduleSubmit(req *types.ScheduleReq) (resp *type
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
resp.Results = append(resp.Results, scheResult)
|
||||
}
|
||||
|
||||
|
|
|
@ -591,7 +591,7 @@ func (o *OctopusLink) generateResourceId(ctx context.Context, option *option.AiO
|
|||
}
|
||||
|
||||
if option.ResourceType == CARD {
|
||||
err = setResourceIdByCard(option, specResp, option.ComputeCard)
|
||||
err = setResourceIdByCard(option, specResp, GCU)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue