Browse Source

update reportStatusMessages output

pull/442/head
tzwang 8 months ago
parent
commit
481c4d27de
2 changed files with 11 additions and 1 deletions
  1. +2
    -0
      internal/scheduler/service/aiService.go
  2. +9
    -1
      internal/scheduler/service/utils/status/taskStatusSync.go

+ 2
- 0
internal/scheduler/service/aiService.go View File

@@ -14,6 +14,7 @@ import (
"gitlink.org.cn/JointCloud/pcm-modelarts/client/modelartsservice" "gitlink.org.cn/JointCloud/pcm-modelarts/client/modelartsservice"
"gitlink.org.cn/JointCloud/pcm-octopus/octopusclient" "gitlink.org.cn/JointCloud/pcm-octopus/octopusclient"
"strconv" "strconv"
"sync"
) )


const ( const (
@@ -30,6 +31,7 @@ type AiService struct {
Storage *database.AiStorage Storage *database.AiStorage
LocalCache map[string]interface{} LocalCache map[string]interface{}
Conf *config.Config Conf *config.Config
TaskSyncLock sync.Mutex
} }


func NewAiService(conf *config.Config, storages *database.AiStorage, localCache map[string]interface{}) (*AiService, error) { func NewAiService(conf *config.Config, storages *database.AiStorage, localCache map[string]interface{}) (*AiService, error) {


+ 9
- 1
internal/scheduler/service/utils/status/taskStatusSync.go View File

@@ -159,11 +159,19 @@ func reportStatusMessages(svc *svc.ServiceContext, task *types.TaskModel, aiTask
Messages: make([]*jcs.ReportMessage, 0), Messages: make([]*jcs.ReportMessage, 0),
} }
//add report msg //add report msg
var output string
switch aiTask.Name {
case "openI":
output = aiTask.JobId
case "modelarts":
output = aiTask.Output
}

jobMsg := &jcs.ReportMessage{ jobMsg := &jcs.ReportMessage{
Status: true, Status: true,
Message: "", Message: "",
ClusterID: strconv.FormatInt(aiTask.ClusterId, 10), ClusterID: strconv.FormatInt(aiTask.ClusterId, 10),
Output: aiTask.JobId,
Output: output,
} }
report.Messages = append(report.Messages, jobMsg) report.Messages = append(report.Messages, jobMsg)




Loading…
Cancel
Save