forked from JointCloud/pcm-coordinator
updated runtasklogic
This commit is contained in:
parent
1682755098
commit
aa29c1b917
|
@ -103,6 +103,7 @@ func generateFilteredDataDistributes(clusters []*strategy.AssignedCluster, distr
|
||||||
code := &types.CodeDistribute{}
|
code := &types.CodeDistribute{}
|
||||||
code.DataName = codeDistribute.DataName
|
code.DataName = codeDistribute.DataName
|
||||||
code.PackageID = codeDistribute.PackageID
|
code.PackageID = codeDistribute.PackageID
|
||||||
|
code.Output = codeDistribute.Output
|
||||||
clusterScheduledList := make([]*types.ClusterScheduled, 0)
|
clusterScheduledList := make([]*types.ClusterScheduled, 0)
|
||||||
|
|
||||||
if len(codeDistribute.Clusters) != 0 {
|
if len(codeDistribute.Clusters) != 0 {
|
||||||
|
|
|
@ -103,6 +103,7 @@ func (l *ScheduleRunTaskLogic) SaveResult(task *models.Task, results []*schedule
|
||||||
|
|
||||||
opt.ComputeCard = strings.ToUpper(r.Card)
|
opt.ComputeCard = strings.ToUpper(r.Card)
|
||||||
opt.Replica = r.Replica
|
opt.Replica = r.Replica
|
||||||
|
opt.Output = r.Output
|
||||||
|
|
||||||
adapterName, err := l.svcCtx.Scheduler.AiStorages.GetAdapterNameById(r.AdapterId)
|
adapterName, err := l.svcCtx.Scheduler.AiStorages.GetAdapterNameById(r.AdapterId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -274,10 +275,14 @@ func updateClustersByScheduledDatas(taskId int64, clustersWithDataDistributes *C
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if cluster.CodeId == "" {
|
//if cluster.CodeId == "" {
|
||||||
for _, distribute := range clustersWithDataDistributes.DataDistributes.Code {
|
for _, distribute := range clustersWithDataDistributes.DataDistributes.Code {
|
||||||
for _, c := range distribute.Clusters {
|
for _, c := range distribute.Clusters {
|
||||||
if cluster.ClusterId == c.ClusterID {
|
if cluster.ClusterId == c.ClusterID {
|
||||||
|
|
||||||
|
cluster.Output = distribute.Output
|
||||||
|
|
||||||
|
if cluster.CodeId == "" {
|
||||||
if c.JsonData == "" {
|
if c.JsonData == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -291,6 +296,7 @@ func updateClustersByScheduledDatas(taskId int64, clustersWithDataDistributes *C
|
||||||
}
|
}
|
||||||
cluster.CodeId = jsonData.Id
|
cluster.CodeId = jsonData.Id
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,6 +196,7 @@ func (s *AiStorage) SaveAiTask(taskId int64, opt option.Option, adapterName stri
|
||||||
Strategy: aiOpt.StrategyName,
|
Strategy: aiOpt.StrategyName,
|
||||||
Status: status,
|
Status: status,
|
||||||
Msg: msg,
|
Msg: msg,
|
||||||
|
Output: aiOpt.Output,
|
||||||
Card: aiOpt.ComputeCard,
|
Card: aiOpt.ComputeCard,
|
||||||
StartTime: time.Now().Format(time.RFC3339),
|
StartTime: time.Now().Format(time.RFC3339),
|
||||||
CommitTime: time.Now(),
|
CommitTime: time.Now(),
|
||||||
|
|
|
@ -57,6 +57,7 @@ type AiResult struct {
|
||||||
Replica int32
|
Replica int32
|
||||||
Card string
|
Card string
|
||||||
Msg string
|
Msg string
|
||||||
|
Output string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewAiScheduler(ctx context.Context, val string, scheduler *scheduler.Scheduler, option *option.AiOption) (*AiScheduler, error) {
|
func NewAiScheduler(ctx context.Context, val string, scheduler *scheduler.Scheduler, option *option.AiOption) (*AiScheduler, error) {
|
||||||
|
@ -206,6 +207,7 @@ func (as *AiScheduler) AssignTask(clusters []*strategy.AssignedCluster, mode int
|
||||||
result.ClusterId = c.ClusterId
|
result.ClusterId = c.ClusterId
|
||||||
result.Strategy = as.option.StrategyName
|
result.Strategy = as.option.StrategyName
|
||||||
result.Card = opt.ComputeCard
|
result.Card = opt.ComputeCard
|
||||||
|
result.Output = opt.Output
|
||||||
|
|
||||||
ch <- result
|
ch <- result
|
||||||
wg.Done()
|
wg.Done()
|
||||||
|
@ -319,9 +321,7 @@ func (as *AiScheduler) handleErrors(errs []interface{}, clusters []*strategy.Ass
|
||||||
}
|
}
|
||||||
|
|
||||||
//report status
|
//report status
|
||||||
if mode == executor.SUBMIT_MODE_STORAGE_SCHEDULE {
|
_ = jcs.StatusReport(as.AiService.Conf.JcsMiddleware.JobStatusReportUrl, report)
|
||||||
_ = jcs.StatusReport(as.AiService.Conf.JcsMiddleware.JobStatusReportUrl, report)
|
|
||||||
}
|
|
||||||
|
|
||||||
logx.Errorf(errors.New(errmsg).Error())
|
logx.Errorf(errors.New(errmsg).Error())
|
||||||
return errors.New(errmsg)
|
return errors.New(errmsg)
|
||||||
|
@ -343,6 +343,7 @@ func updateAiOptionByMode(cluster *strategy.AssignedCluster, opt *option.AiOptio
|
||||||
|
|
||||||
opt.ResourcesRequired = cluster.ResourcesRequired
|
opt.ResourcesRequired = cluster.ResourcesRequired
|
||||||
|
|
||||||
|
opt.Output = cluster.Output
|
||||||
default:
|
default:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,8 @@ type AiOption struct {
|
||||||
Image string
|
Image string
|
||||||
Model interface{}
|
Model interface{}
|
||||||
|
|
||||||
|
Output string
|
||||||
|
|
||||||
ResourcesRequired []map[string]interface{}
|
ResourcesRequired []map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ type AssignedCluster struct {
|
||||||
ImageId string
|
ImageId string
|
||||||
CodeId string
|
CodeId string
|
||||||
ModelId string
|
ModelId string
|
||||||
|
Output string
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetStrategyNames() []string {
|
func GetStrategyNames() []string {
|
||||||
|
|
|
@ -55,6 +55,7 @@ type (
|
||||||
Card string `db:"card"`
|
Card string `db:"card"`
|
||||||
InferUrl string `db:"infer_url"`
|
InferUrl string `db:"infer_url"`
|
||||||
ModelName string `db:"model_name"`
|
ModelName string `db:"model_name"`
|
||||||
|
Output string `db:"output"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue