Browse Source

Merge remote-tracking branch 'origin/master'

pull/445/head
qiwang 8 months ago
parent
commit
c9d63de8d5
7 changed files with 20 additions and 7 deletions
  1. +1
    -0
      internal/logic/schedule/schedulecreatetasklogic.go
  2. +10
    -4
      internal/logic/schedule/scheduleruntasklogic.go
  3. +1
    -0
      internal/scheduler/database/aiStorage.go
  4. +4
    -3
      internal/scheduler/schedulers/aiScheduler.go
  5. +2
    -0
      internal/scheduler/schedulers/option/aiOption.go
  6. +1
    -0
      internal/scheduler/strategy/strategy.go
  7. +1
    -0
      pkg/models/taskaimodel_gen.go

+ 1
- 0
internal/logic/schedule/schedulecreatetasklogic.go View File

@@ -103,6 +103,7 @@ func generateFilteredDataDistributes(clusters []*strategy.AssignedCluster, distr
code := &types.CodeDistribute{}
code.DataName = codeDistribute.DataName
code.PackageID = codeDistribute.PackageID
code.Output = codeDistribute.Output
clusterScheduledList := make([]*types.ClusterScheduled, 0)

if len(codeDistribute.Clusters) != 0 {


+ 10
- 4
internal/logic/schedule/scheduleruntasklogic.go View File

@@ -103,6 +103,7 @@ func (l *ScheduleRunTaskLogic) SaveResult(task *models.Task, results []*schedule

opt.ComputeCard = strings.ToUpper(r.Card)
opt.Replica = r.Replica
opt.Output = r.Output

adapterName, err := l.svcCtx.Scheduler.AiStorages.GetAdapterNameById(r.AdapterId)
if err != nil {
@@ -274,10 +275,14 @@ func updateClustersByScheduledDatas(taskId int64, clustersWithDataDistributes *C
}
}

if cluster.CodeId == "" {
for _, distribute := range clustersWithDataDistributes.DataDistributes.Code {
for _, c := range distribute.Clusters {
if cluster.ClusterId == c.ClusterID {
//if cluster.CodeId == "" {
for _, distribute := range clustersWithDataDistributes.DataDistributes.Code {
for _, c := range distribute.Clusters {
if cluster.ClusterId == c.ClusterID {

cluster.Output = distribute.Output

if cluster.CodeId == "" {
if c.JsonData == "" {
continue
}
@@ -291,6 +296,7 @@ func updateClustersByScheduledDatas(taskId int64, clustersWithDataDistributes *C
}
cluster.CodeId = jsonData.Id
}

}
}
}


+ 1
- 0
internal/scheduler/database/aiStorage.go View File

@@ -196,6 +196,7 @@ func (s *AiStorage) SaveAiTask(taskId int64, opt option.Option, adapterName stri
Strategy: aiOpt.StrategyName,
Status: status,
Msg: msg,
Output: aiOpt.Output,
Card: aiOpt.ComputeCard,
StartTime: time.Now().Format(time.RFC3339),
CommitTime: time.Now(),


+ 4
- 3
internal/scheduler/schedulers/aiScheduler.go View File

@@ -57,6 +57,7 @@ type AiResult struct {
Replica int32
Card string
Msg string
Output string
}

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.Strategy = as.option.StrategyName
result.Card = opt.ComputeCard
result.Output = opt.Output

ch <- result
wg.Done()
@@ -319,9 +321,7 @@ func (as *AiScheduler) handleErrors(errs []interface{}, clusters []*strategy.Ass
}

//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())
return errors.New(errmsg)
@@ -343,6 +343,7 @@ func updateAiOptionByMode(cluster *strategy.AssignedCluster, opt *option.AiOptio

opt.ResourcesRequired = cluster.ResourcesRequired

opt.Output = cluster.Output
default:

}


+ 2
- 0
internal/scheduler/schedulers/option/aiOption.go View File

@@ -34,6 +34,8 @@ type AiOption struct {
Image string
Model interface{}

Output string

ResourcesRequired []map[string]interface{}
}



+ 1
- 0
internal/scheduler/strategy/strategy.go View File

@@ -31,6 +31,7 @@ type AssignedCluster struct {
ImageId string
CodeId string
ModelId string
Output string
}

func GetStrategyNames() []string {


+ 1
- 0
pkg/models/taskaimodel_gen.go View File

@@ -55,6 +55,7 @@ type (
Card string `db:"card"`
InferUrl string `db:"infer_url"`
ModelName string `db:"model_name"`
Output string `db:"output"`
}
)



Loading…
Cancel
Save