#4840 fix-4777

Merged
zouap merged 8 commits from fix-4777 into V20231102 6 months ago
  1. +1
    -0
      models/cloudbrain_static.go
  2. +2
    -0
      options/locale/locale_en-US.ini
  3. +3
    -0
      options/locale/locale_zh-CN.ini
  4. +24
    -21
      routers/api/v1/repo/cloudbrain.go
  5. +1
    -0
      routers/api/v1/repo/cloudbrain_dashboard.go
  6. +18
    -15
      routers/api/v1/repo/modelarts.go
  7. +8
    -7
      routers/repo/grampus.go
  8. +25
    -19
      templates/admin/cloudbrain/list.tmpl
  9. +0
    -1
      templates/repo/cloudbrain/cloudbraincreate.tmpl
  10. +16
    -10
      templates/user/dashboard/cloudbrains.tmpl
  11. +25
    -2
      web_src/js/features/cloudrbanin.js
  12. +2
    -2
      web_src/less/openi.less
  13. +5
    -1
      web_src/vuepages/pages/cloudbrain/detail/index.vue
  14. +2
    -2
      web_src/vuepages/pages/cloudbrain/list/index.vue

+ 1
- 0
models/cloudbrain_static.go View File

@@ -15,6 +15,7 @@ type TaskDetail struct {
JobName string `json:"JobName"` JobName string `json:"JobName"`
DisplayJobName string `json:"DisplayJobName"` DisplayJobName string `json:"DisplayJobName"`
Status string `json:"Status"` Status string `json:"Status"`
DetailedStatus string `json:"DetailedStatus"`
JobType string `json:"JobType"` JobType string `json:"JobType"`
CreatedUnix timeutil.TimeStamp `json:"CreatedUnix"` CreatedUnix timeutil.TimeStamp `json:"CreatedUnix"`
WaitTime string `json:"WaitTime"` WaitTime string `json:"WaitTime"`


+ 2
- 0
options/locale/locale_en-US.ini View File

@@ -2507,6 +2507,8 @@ imagetopic.format_prompt = Topics can be up to 35 characters long.
use_repo_agreement=I promise that the content of this warehouse does not violate any national laws and regulations. During the use of the warehouse, I will abide by the OpenI community management regulations and platform usage rules, and will not conduct malicious attacks, mining, or any other illegal or disruptive platform order. Information release and related behaviors. For more information please refer to use_repo_agreement=I promise that the content of this warehouse does not violate any national laws and regulations. During the use of the warehouse, I will abide by the OpenI community management regulations and platform usage rules, and will not conduct malicious attacks, mining, or any other illegal or disruptive platform order. Information release and related behaviors. For more information please refer to
openi_use_agreement=OpenI Openi Community Platform Use Agreement. openi_use_agreement=OpenI Openi Community Platform Use Agreement.
reuse_last_result = Reuse last result reuse_last_result = Reuse last result
migratingData=Data migration in progress
centerPending=Queuing in sub centers
[org] [org]
org_name_holder = Organization Name org_name_holder = Organization Name
org_full_name_holder = Organization Full Name org_full_name_holder = Organization Full Name


+ 3
- 0
options/locale/locale_zh-CN.ini View File

@@ -2525,6 +2525,9 @@ imagetopic.format_prompt=标签长度不得超过35个字符
use_repo_agreement=我承诺此仓内容不违反任何国家法律法规,仓库使用过程中遵守OpenI启智社区管理规定和平台使用规则,不进行恶意攻击、挖矿等任何违法或扰乱平台秩序的信息发布和相关行为。更多信息请参考 use_repo_agreement=我承诺此仓内容不违反任何国家法律法规,仓库使用过程中遵守OpenI启智社区管理规定和平台使用规则,不进行恶意攻击、挖矿等任何违法或扰乱平台秩序的信息发布和相关行为。更多信息请参考
openi_use_agreement=OpenI启智社区平台使用协议 openi_use_agreement=OpenI启智社区平台使用协议
reuse_last_result = 复用上次结果 reuse_last_result = 复用上次结果
migratingData=数据迁移中
centerPending=分中心排队中

[org] [org]
org_name_holder=组织名称 org_name_holder=组织名称
org_full_name_holder=组织全名 org_full_name_holder=组织全名


+ 24
- 21
routers/api/v1/repo/cloudbrain.go View File

@@ -492,13 +492,14 @@ func GetCloudbrainTask(ctx *context.APIContext) {
if job.IsNewAITask() { if job.IsNewAITask() {
jobAfter, _ := task.UpdateCloudbrain(job) jobAfter, _ := task.UpdateCloudbrain(job)
ctx.JSON(http.StatusOK, map[string]interface{}{ ctx.JSON(http.StatusOK, map[string]interface{}{
"ID": ID,
"JobName": jobAfter.JobName,
"JobStatus": jobAfter.Status,
"SubState": "",
"CreatedTime": jobAfter.CreatedUnix.Format("2006-01-02 15:04:05"),
"CompletedTime": jobAfter.UpdatedUnix.Format("2006-01-02 15:04:05"),
"JobDuration": jobAfter.TrainJobDuration,
"ID": ID,
"JobName": jobAfter.JobName,
"JobStatus": jobAfter.Status,
"DetailedStatus": jobAfter.DetailedStatus,
"SubState": "",
"CreatedTime": jobAfter.CreatedUnix.Format("2006-01-02 15:04:05"),
"CompletedTime": jobAfter.UpdatedUnix.Format("2006-01-02 15:04:05"),
"JobDuration": jobAfter.TrainJobDuration,
}) })
return return
} }
@@ -507,13 +508,14 @@ func GetCloudbrainTask(ctx *context.APIContext) {
routerRepo.GetAiSafetyTaskByJob(job) routerRepo.GetAiSafetyTaskByJob(job)
job, err = models.GetCloudbrainByID(ID) job, err = models.GetCloudbrainByID(ID)
ctx.JSON(http.StatusOK, map[string]interface{}{ ctx.JSON(http.StatusOK, map[string]interface{}{
"ID": ID,
"JobName": job.JobName,
"JobStatus": job.Status,
"SubState": "",
"CreatedTime": job.CreatedUnix.Format("2006-01-02 15:04:05"),
"CompletedTime": job.UpdatedUnix.Format("2006-01-02 15:04:05"),
"JobDuration": job.TrainJobDuration,
"ID": ID,
"JobName": job.JobName,
"JobStatus": job.Status,
"DetailedStatus": job.DetailedStatus,
"SubState": "",
"CreatedTime": job.CreatedUnix.Format("2006-01-02 15:04:05"),
"CompletedTime": job.UpdatedUnix.Format("2006-01-02 15:04:05"),
"JobDuration": job.TrainJobDuration,
}) })
} else { } else {
jobAfter, err := cloudbrainTask.SyncCloudBrainOneStatus(job) jobAfter, err := cloudbrainTask.SyncCloudBrainOneStatus(job)
@@ -525,13 +527,14 @@ func GetCloudbrainTask(ctx *context.APIContext) {
} }


ctx.JSON(http.StatusOK, map[string]interface{}{ ctx.JSON(http.StatusOK, map[string]interface{}{
"ID": ID,
"JobName": jobAfter.JobName,
"JobStatus": jobAfter.Status,
"SubState": "",
"CreatedTime": jobAfter.CreatedUnix.Format("2006-01-02 15:04:05"),
"CompletedTime": jobAfter.UpdatedUnix.Format("2006-01-02 15:04:05"),
"JobDuration": jobAfter.TrainJobDuration,
"ID": ID,
"JobName": jobAfter.JobName,
"JobStatus": jobAfter.Status,
"DetailedStatus": jobAfter.DetailedStatus,
"SubState": "",
"CreatedTime": jobAfter.CreatedUnix.Format("2006-01-02 15:04:05"),
"CompletedTime": jobAfter.UpdatedUnix.Format("2006-01-02 15:04:05"),
"JobDuration": jobAfter.TrainJobDuration,
}) })
} }
} }


+ 1
- 0
routers/api/v1/repo/cloudbrain_dashboard.go View File

@@ -937,6 +937,7 @@ func GetCloudbrainsDetailData(ctx *context.Context) {
taskDetail.JobName = ciTasks[i].JobName taskDetail.JobName = ciTasks[i].JobName
taskDetail.DisplayJobName = ciTasks[i].DisplayJobName taskDetail.DisplayJobName = ciTasks[i].DisplayJobName
taskDetail.Status = ciTasks[i].Status taskDetail.Status = ciTasks[i].Status
taskDetail.DetailedStatus = ciTasks[i].DetailedStatus
taskDetail.JobType = ciTasks[i].JobType taskDetail.JobType = ciTasks[i].JobType
taskDetail.CreatedUnix = ciTasks[i].Cloudbrain.CreatedUnix taskDetail.CreatedUnix = ciTasks[i].Cloudbrain.CreatedUnix
taskDetail.RunTime = ciTasks[i].Cloudbrain.TrainJobDuration taskDetail.RunTime = ciTasks[i].Cloudbrain.TrainJobDuration


+ 18
- 15
routers/api/v1/repo/modelarts.go View File

@@ -66,11 +66,12 @@ func GetModelArtsNotebook2(ctx *context.APIContext) {


} }
ctx.JSON(http.StatusOK, map[string]interface{}{ ctx.JSON(http.StatusOK, map[string]interface{}{
"ID": ID,
"JobName": job.JobName,
"JobStatus": job.Status,
"JobDuration": job.TrainJobDuration,
"StartTime": job.StartTime,
"ID": ID,
"JobName": job.JobName,
"JobStatus": job.Status,
"JobDuration": job.TrainJobDuration,
"StartTime": job.StartTime,
"DetailedStatus": job.DetailedStatus,
}) })


} }
@@ -143,11 +144,12 @@ func GetModelArtsTrainJobVersion(ctx *context.APIContext) {
} }
aiCenterName = cloudbrainService.GetAiCenterShow(job.AiCenter, ctx.Context) aiCenterName = cloudbrainService.GetAiCenterShow(job.AiCenter, ctx.Context)
ctx.JSON(http.StatusOK, map[string]interface{}{ ctx.JSON(http.StatusOK, map[string]interface{}{
"JobID": jobID,
"JobStatus": job.Status,
"JobDuration": job.TrainJobDuration,
"AiCenter": aiCenterName,
"StartTime": job.StartTime,
"JobID": jobID,
"JobStatus": job.Status,
"DetailedStatus": job.DetailedStatus,
"JobDuration": job.TrainJobDuration,
"AiCenter": aiCenterName,
"StartTime": job.StartTime,
}) })
return return
} }
@@ -208,11 +210,12 @@ func GetModelArtsTrainJobVersion(ctx *context.APIContext) {
} }


ctx.JSON(http.StatusOK, map[string]interface{}{ ctx.JSON(http.StatusOK, map[string]interface{}{
"JobID": jobID,
"JobStatus": job.Status,
"JobDuration": job.TrainJobDuration,
"AiCenter": aiCenterName,
"StartTime": job.StartTime,
"JobID": jobID,
"JobStatus": job.Status,
"JobDuration": job.TrainJobDuration,
"AiCenter": aiCenterName,
"StartTime": job.StartTime,
"DetailedStatus": job.DetailedStatus,
}) })


} }


+ 8
- 7
routers/repo/grampus.go View File

@@ -1356,13 +1356,14 @@ func GetGrampusNotebook(ctx *context.APIContext) {
} }


ctx.JSON(http.StatusOK, map[string]interface{}{ ctx.JSON(http.StatusOK, map[string]interface{}{
"ID": ID,
"JobName": jobAfter.JobName,
"JobStatus": jobAfter.Status,
"AiCenter": aiCenterName,
"CreatedTime": jobAfter.CreatedUnix.Format("2006-01-02 15:04:05"),
"CompletedTime": jobAfter.UpdatedUnix.Format("2006-01-02 15:04:05"),
"JobDuration": jobAfter.TrainJobDuration,
"ID": ID,
"JobName": jobAfter.JobName,
"JobStatus": jobAfter.Status,
"DetailedStatus": jobAfter.DetailedStatus,
"AiCenter": aiCenterName,
"CreatedTime": jobAfter.CreatedUnix.Format("2006-01-02 15:04:05"),
"CompletedTime": jobAfter.UpdatedUnix.Format("2006-01-02 15:04:05"),
"JobDuration": jobAfter.TrainJobDuration,
}) })
} }




+ 25
- 19
templates/admin/cloudbrain/list.tmpl View File

@@ -46,7 +46,7 @@
<div class="one wide column text center nowrap" style="width:6% !important;"> <div class="one wide column text center nowrap" style="width:6% !important;">
<span>{{$.i18n.Tr "repo.modelarts.cluster"}}</span> <span>{{$.i18n.Tr "repo.modelarts.cluster"}}</span>
</div> </div>
<div class="two wide column text center nowrap" style="width: 6% !important;">
<div class="two wide column text center nowrap" style="width: 8% !important;">
<span>{{$.i18n.Tr "repo.modelarts.status"}}</span> <span>{{$.i18n.Tr "repo.modelarts.status"}}</span>
</div> </div>
<div class="one wide column text center nowrap" style="width:6% !important;"> <div class="one wide column text center nowrap" style="width:6% !important;">
@@ -62,11 +62,11 @@
<span>{{$.i18n.Tr "repo.modelarts.computing_resources"}}</span> <span>{{$.i18n.Tr "repo.modelarts.computing_resources"}}</span>
</div> </div>
<!-- 智算中心 --> <!-- 智算中心 -->
<div class="one wide column text center nowrap" style="width:8% !important;">
<div class="one wide column text center nowrap" style="width:7% !important;">
<span>{{$.i18n.Tr "repo.modelarts.ai_center"}}</span> <span>{{$.i18n.Tr "repo.modelarts.ai_center"}}</span>
</div> </div>
<!-- XPU类型 --> <!-- XPU类型 -->
<div class="one wide column text center nowrap" style="width:8% !important;">
<div class="one wide column text center nowrap" style="width:7% !important;">
<span>{{$.i18n.Tr "repo.modelarts.card_type"}}</span> <span>{{$.i18n.Tr "repo.modelarts.card_type"}}</span>
</div> </div>
<div class="one wide column text center nowrap" style="width:4% !important;"> <div class="one wide column text center nowrap" style="width:4% !important;">
@@ -153,14 +153,16 @@
</div> </div>
<!-- 任务状态 --> <!-- 任务状态 -->
<div class="two wide column text center nowrap" <div class="two wide column text center nowrap"
style="width: 6% !important;">
style="width: 8% !important;">
<span class="job-status" id="{{$JobID}}" <span class="job-status" id="{{$JobID}}"
data-repopath='{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "DEBUG" "ONLINEINFERENCE" "HPC"}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}{{else if eq .JobType "INFERENCE"}}/modelarts/inference-job{{else if eq .JobType "TRAIN"}}/modelarts/train-job{{else if eq .JobType "BENCHMARK" "MODELSAFETY"}}/cloudbrain{{end}}' data-repopath='{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "DEBUG" "ONLINEINFERENCE" "HPC"}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}{{else if eq .JobType "INFERENCE"}}/modelarts/inference-job{{else if eq .JobType "TRAIN"}}/modelarts/train-job{{else if eq .JobType "BENCHMARK" "MODELSAFETY"}}/cloudbrain{{end}}'
data-jobid="{{$JobID}}" data-version="{{.VersionName}}" data-jobid="{{$JobID}}" data-version="{{.VersionName}}"
data-cloudbrainid="{{.Cloudbrain.ID}}">
<span><i id="{{$JobID}}-icon" style="vertical-align: middle;"
class="{{.Status}}"></i><span id="{{$JobID}}-text"
style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span>
data-cloudbrainid="{{.Cloudbrain.ID}}" data-datamigrate='{{$.i18n.Tr "repo.migratingData"}}' data-centerpend='{{$.i18n.Tr "repo.centerPending"}}'>
<span>
<i id="{{$JobID}}-icon" style="vertical-align: middle;" class="{{.Status}}"></i>
<span id="{{$JobID}}-text" style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span>
<i id="{{$JobID}}-icon-detail" class="{{.DetailedStatus}}" style="vertical-align: middle;" title='{{$.i18n.Tr (printf "repo.%s" .DetailedStatus)}}'></i>
</span>
</span> </span>
</div> </div>
<!-- 任务类型 --> <!-- 任务类型 -->
@@ -184,11 +186,11 @@
style="font-size: 12px;" title="{{.ComputeResource}}">{{if .ComputeResource}}{{.ComputeResource}}{{else}}--{{end}}</span> style="font-size: 12px;" title="{{.ComputeResource}}">{{if .ComputeResource}}{{.ComputeResource}}{{else}}--{{end}}</span>
</div> </div>
<!-- 智算中心 --> <!-- 智算中心 -->
<div class="one wide column text center nowrap" style="width:8% !important;">
<div class="one wide column text center nowrap" style="width:7% !important;">
<span style="font-size: 12px;" id="cluster-{{$JobID}}" class="aicenter_{{.DisplayJobName}}_{{$JobID}}" title="{{if .AiCenter}}{{.AiCenter}}{{else}}--{{end}}">{{if .AiCenter}}{{.AiCenter}}{{else}}--{{end}}</span> <span style="font-size: 12px;" id="cluster-{{$JobID}}" class="aicenter_{{.DisplayJobName}}_{{$JobID}}" title="{{if .AiCenter}}{{.AiCenter}}{{else}}--{{end}}">{{if .AiCenter}}{{.AiCenter}}{{else}}--{{end}}</span>
</div> </div>
<!-- XPU类型 --> <!-- XPU类型 -->
<div class="one wide column text center nowrap" style="width:8% !important;">
<div class="one wide column text center nowrap" style="width:7% !important;">
<span style="font-size: 12px;" title="" class="card_type_{{.DisplayJobName}}_{{$JobID}}"></span> <span style="font-size: 12px;" title="" class="card_type_{{.DisplayJobName}}_{{$JobID}}"></span>
</div> </div>
<script> <script>
@@ -329,7 +331,7 @@
<!-- 修改任务 --> <!-- 修改任务 -->
{{if and (eq .JobType "TRAIN") (not .FineTune)}} {{if and (eq .JobType "TRAIN") (not .FineTune)}}
<div class="ui compact buttons __btn_edit__"> <div class="ui compact buttons __btn_edit__">
<a style="padding: 0.5rem 1rem;" class="ui basic blue button" href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .Cloudbrain.Type 1}}/modelarts/train-job{{else if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{else if eq .Cloudbrain.Type 2}}/grampus/train-job/{{ToLower .ComputeResource}}{{end}}/create?modify=true&id={{$JobID}}">
<a style="padding: 0.5rem 1rem;" class="ui basic blue button" href='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .Cloudbrain.Type 1}}/modelarts/train-job{{else if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{else if eq .Cloudbrain.Type 2}}/grampus/train-job/{{if eq .ComputeResource "CPU/GPU"}}gpu{{else}}{{ToLower .ComputeResource}}{{end}}{{end}}/create?modify=true&id={{$JobID}}'>
{{$.i18n.Tr "repo.modelarts.modify"}} {{$.i18n.Tr "repo.modelarts.modify"}}
</a> </a>
</div> </div>
@@ -406,12 +408,16 @@
</div> </div>
<!-- 任务状态 --> <!-- 任务状态 -->
<div class="two wide column text center nowrap" <div class="two wide column text center nowrap"
style="width: 6% !important;">
<span class="job-status" id="{{$JobID}}" data-jobid="{{$JobID}}"
data-version="{{.VersionName}}" data-cloudbrainid="{{.Cloudbrain.ID}}">
<span><i id="{{$JobID}}-icon" style="vertical-align: middle;"
class="{{.Status}}"></i><span id="{{$JobID}}-text"
style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span>
style="width: 8% !important;">
<span class="job-status" id="{{$JobID}}"
data-repopath='{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "DEBUG" "ONLINEINFERENCE" "HPC"}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}{{else if eq .JobType "INFERENCE"}}/modelarts/inference-job{{else if eq .JobType "TRAIN"}}/modelarts/train-job{{else if eq .JobType "BENCHMARK" "MODELSAFETY"}}/cloudbrain{{end}}'
data-jobid="{{$JobID}}" data-version="{{.VersionName}}"
data-cloudbrainid="{{.Cloudbrain.ID}}" data-datamigrate='{{$.i18n.Tr "repo.migratingData"}}' data-centerpend='{{$.i18n.Tr "repo.centerPending"}}'>
<span>
<i id="{{$JobID}}-icon" style="vertical-align: middle;" class="{{.Status}}"></i>
<span id="{{$JobID}}-text" style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span>
<i id="{{$JobID}}-icon-detail" class="{{.DetailedStatus}}" style="vertical-align: middle;" title='{{$.i18n.Tr (printf "repo.%s" .DetailedStatus)}}'></i>
</span>
</span> </span>
</div> </div>
<!-- 任务类型 --> <!-- 任务类型 -->
@@ -435,12 +441,12 @@
style="font-size: 12px;" title="{{.ComputeResource}}">{{if .ComputeResource}}{{.ComputeResource}}{{else}}--{{end}}</span> style="font-size: 12px;" title="{{.ComputeResource}}">{{if .ComputeResource}}{{.ComputeResource}}{{else}}--{{end}}</span>
</div> </div>
<!-- 智算中心 --> <!-- 智算中心 -->
<div class="one wide column text center nowrap" style="width:8% !important;">
<div class="one wide column text center nowrap" style="width:7% !important;">
<span <span
style="font-size: 12px;">{{if .AiCenter}}{{.AiCenter}}{{else}}--{{end}}</span> style="font-size: 12px;">{{if .AiCenter}}{{.AiCenter}}{{else}}--{{end}}</span>
</div> </div>
<!-- XPU类型 --> <!-- XPU类型 -->
<div class="one wide column text center nowrap" style="width:8% !important;">
<div class="one wide column text center nowrap" style="width:7% !important;">
<span style="font-size: 12px;" title="{{.CardType}}"> <span style="font-size: 12px;" title="{{.CardType}}">
{{if .CardType}}{{.CardType}}{{else}}--{{end}} {{if .CardType}}{{.CardType}}{{else}}--{{end}}
</span> </span>


+ 0
- 1
templates/repo/cloudbrain/cloudbraincreate.tmpl View File

@@ -2,7 +2,6 @@
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/vp-cloudbrain-create.css?v={{MD5 AppVer}}" /> <link rel="stylesheet" href="{{StaticUrlPrefix}}/css/vp-cloudbrain-create.css?v={{MD5 AppVer}}" />
<div class="repository"> <div class="repository">
{{template "repo/header" .}} {{template "repo/header" .}}
<i class="SUCCEEDED"></i>
<div id="__vue-root"></div> <div id="__vue-root"></div>
</div> </div>
<script src="{{StaticUrlPrefix}}/js/vp-cloudbrain-create.js?v={{MD5 AppVer}}"></script> <script src="{{StaticUrlPrefix}}/js/vp-cloudbrain-create.js?v={{MD5 AppVer}}"></script>


+ 16
- 10
templates/user/dashboard/cloudbrains.tmpl View File

@@ -141,10 +141,12 @@
data-repopath='{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "DEBUG" "ONLINEINFERENCE" "HPC"}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}{{else if eq .JobType "INFERENCE"}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts{{end}}/inference-job{{else if eq .JobType "TRAIN"}}{{if eq .ComputeResource "NPU"}}/modelarts/train-job{{else}}/cloudbrain/train-job{{end}}{{else if eq .JobType "BENCHMARK" "MODELSAFETY"}}/cloudbrain{{end}}' data-repopath='{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "DEBUG" "ONLINEINFERENCE" "HPC"}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}{{else if eq .JobType "INFERENCE"}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts{{end}}/inference-job{{else if eq .JobType "TRAIN"}}{{if eq .ComputeResource "NPU"}}/modelarts/train-job{{else}}/cloudbrain/train-job{{end}}{{else if eq .JobType "BENCHMARK" "MODELSAFETY"}}/cloudbrain{{end}}'
data-jobid="{{$JobID}}" data-version="{{.VersionName}}" data-jobid="{{$JobID}}" data-version="{{.VersionName}}"
data-cloudbrainid="{{.Cloudbrain.ID}}" data-cloudbrainid="{{.Cloudbrain.ID}}"
data-bootfile="{{.BootFile}}">
<span><i id="{{$JobID}}-icon" style="vertical-align: middle;"
class="{{.Status}}"></i><span id="{{$JobID}}-text"
style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span>
data-bootfile="{{.BootFile}}" data-datamigrate='{{$.i18n.Tr "repo.migratingData"}}' data-centerpend='{{$.i18n.Tr "repo.centerPending"}}'>
<span>
<i id="{{$JobID}}-icon" style="vertical-align: middle;" class="{{.Status}}"></i>
<span id="{{$JobID}}-text" style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span>
<i id="{{$JobID}}-icon-detail" class="{{.DetailedStatus}}" style="vertical-align: middle;" title='{{$.i18n.Tr (printf "repo.%s" .DetailedStatus)}}'></i>
</span>
</span> </span>
</div> </div>
<!-- 任务类型 --> <!-- 任务类型 -->
@@ -299,7 +301,7 @@
<!-- 修改任务 --> <!-- 修改任务 -->
{{if and (eq .JobType "TRAIN") (not .FineTune)}} {{if and (eq .JobType "TRAIN") (not .FineTune)}}
<div class="ui compact buttons __btn_edit__"> <div class="ui compact buttons __btn_edit__">
<a style="padding: 0.5rem 1rem;" class="ui basic blue button" href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .Cloudbrain.Type 1}}/modelarts/train-job{{else if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{else if eq .Cloudbrain.Type 2}}/grampus/train-job/{{ToLower .ComputeResource}}{{end}}/create?modify=true&id={{$JobID}}">
<a style="padding: 0.5rem 1rem;" class="ui basic blue button" href='{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .Cloudbrain.Type 1}}/modelarts/train-job{{else if eq .Cloudbrain.Type 0}}/cloudbrain/train-job{{else if eq .Cloudbrain.Type 2}}/grampus/train-job/{{if eq .ComputeResource "CPU/GPU"}}gpu{{else}}{{ToLower .ComputeResource}}{{end}}{{end}}/create?modify=true&id={{$JobID}}'>
{{$.i18n.Tr "repo.modelarts.modify"}} {{$.i18n.Tr "repo.modelarts.modify"}}
</a> </a>
</div> </div>
@@ -377,11 +379,15 @@
<!-- 任务状态 --> <!-- 任务状态 -->
<div class="two wide column text center nowrap" <div class="two wide column text center nowrap"
style="padding-left: 2.2rem !important; width: 8% !important;"> style="padding-left: 2.2rem !important; width: 8% !important;">
<span class="job-status" id="{{$JobID}}" data-jobid="{{$JobID}}"
data-version="{{.VersionName}}" data-cloudbrainid="{{.Cloudbrain.ID}}">
<span><i id="{{$JobID}}-icon" style="vertical-align: middle;"
class="{{.Status}}"></i><span id="{{$JobID}}-text"
style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span>
<span class="job-status" id="{{$JobID}}"
data-repopath='{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .JobType "DEBUG" "ONLINEINFERENCE" "HPC"}}{{if eq .Cloudbrain.Type 2}}/grampus/notebook{{else}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}{{end}}{{else if eq .JobType "INFERENCE"}}/modelarts/inference-job{{else if eq .JobType "TRAIN"}}/modelarts/train-job{{else if eq .JobType "BENCHMARK" "MODELSAFETY"}}/cloudbrain{{end}}'
data-jobid="{{$JobID}}" data-version="{{.VersionName}}"
data-cloudbrainid="{{.Cloudbrain.ID}}" data-datamigrate='{{$.i18n.Tr "repo.migratingData"}}' data-centerpend='{{$.i18n.Tr "repo.centerPending"}}'>
<span>
<i id="{{$JobID}}-icon" style="vertical-align: middle;" class="{{.Status}}"></i>
<span id="{{$JobID}}-text" style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span>
<i id="{{$JobID}}-icon-detail" class="{{.DetailedStatus}}" style="vertical-align: middle;" title='{{$.i18n.Tr (printf "repo.%s" .DetailedStatus)}}'></i>
</span>
</span> </span>
</div> </div>
<!-- 任务类型 --> <!-- 任务类型 -->


+ 25
- 2
web_src/js/features/cloudrbanin.js View File

@@ -13,16 +13,23 @@ export default async function initCloudrain() {


let debug_button = $(".cloudbrain_debug").data("debug"); let debug_button = $(".cloudbrain_debug").data("debug");
let debug_again_button = $(".cloudbrain_debug").data("debug-again"); let debug_again_button = $(".cloudbrain_debug").data("debug-again");
let timeid = window.setInterval(loadJobStatus, 15000);
let timeidShow = window.setInterval(loadShowJobStatus, 15000);
let timeid
let timeidShow
if (document.getElementsByClassName('job-status').length!==0) {
timeid = window.setInterval(loadJobStatus, 15000);
timeidShow = window.setInterval(loadShowJobStatus, 15000);
}
$(document).ready(loadJobStatus); $(document).ready(loadJobStatus);
$(document).ready(loadShowJobStatus); $(document).ready(loadShowJobStatus);
function loadJobStatus() { function loadJobStatus() {
let flagStopInterval = 1
$(".job-status").each((index, job) => { $(".job-status").each((index, job) => {
const ID = job.dataset.jobid; const ID = job.dataset.jobid;
const cloudbrainID = job.dataset.cloudbrainid; const cloudbrainID = job.dataset.cloudbrainid;
if (!ID) return; if (!ID) return;
const repoPath = job.dataset.repopath; const repoPath = job.dataset.repopath;
const dataMigrate = job.dataset.datamigrate
const centerPend = job.dataset.centerpend
// const computeResource = job.dataset.resource // const computeResource = job.dataset.resource
const versionname = job.dataset.version; const versionname = job.dataset.version;
const bootfile = job.dataset.bootfile; const bootfile = job.dataset.bootfile;
@@ -49,6 +56,10 @@ export default async function initCloudrain() {
"CHECK_FAILED", "CHECK_FAILED",
]; ];
if (finalState.includes(status_text)) { if (finalState.includes(status_text)) {
flagStopInterval++
if (flagStopInterval === $(".job-status").length) {
clearInterval(timeid)
}
return; return;
} }
// const diffResource = computeResource == "NPU" ? 'modelarts/notebook' : 'cloudbrain' // const diffResource = computeResource == "NPU" ? 'modelarts/notebook' : 'cloudbrain'
@@ -59,9 +70,20 @@ export default async function initCloudrain() {
const status = data.JobStatus; const status = data.JobStatus;
const duration = data.JobDuration; const duration = data.JobDuration;
const aiCenter = data.AiCenter || '--' const aiCenter = data.AiCenter || '--'
const detailStatus = data.DetailedStatus
$("#duration-" + ID).text(duration); $("#duration-" + ID).text(duration);
data.AiCenter != undefined && $("#cluster-" + ID).text(aiCenter); data.AiCenter != undefined && $("#cluster-" + ID).text(aiCenter);
data.AiCenter != undefined && $("#" + versionname + "-ai_center").text(data.AiCenter); data.AiCenter != undefined && $("#" + versionname + "-ai_center").text(data.AiCenter);
if (detailStatus === 'dataMigrating' || detailStatus === 'centerPending') {
if (document.getElementById(`${ID}-icon-detail`)) {
document.getElementById(`${ID}-icon-detail`).remove()
}
$("#" + ID + "-text").parent().append(`<i id="${ID}-icon-detail" class="${detailStatus}" style="vertical-align: middle;" title="${detailStatus === 'dataMigrating'? dataMigrate:centerPend}"></i>`)
} else {
if (document.getElementById(`${ID}-icon-detail`)) {
document.getElementById(`${ID}-icon-detail`).remove()
}
}
if (status != status_text) { if (status != status_text) {
$("#" + ID + "-icon") $("#" + ID + "-icon")
.removeClass() .removeClass()
@@ -209,6 +231,7 @@ export default async function initCloudrain() {
"CREATED_FAILED", "CREATED_FAILED",
].includes(status) ].includes(status)
) { ) {
clearInterval(timeidShow)
return; return;
} }
let stopArray = [ let stopArray = [


+ 2
- 2
web_src/less/openi.less View File

@@ -319,7 +319,7 @@ i.INFO {
.i-bg-orange { .i-bg-orange {
background-position: -495px -51px; background-position: -495px -51px;
} }
.data-migrating{
.dataMigrating{
display: inline-block; display: inline-block;
width: 18px; width: 18px;
height: 18px; height: 18px;
@@ -327,7 +327,7 @@ i.INFO {
background: url("/img/icons.svg"); background: url("/img/icons.svg");
background-position: -56px -52px; background-position: -56px -52px;
} }
.center-pending{
.centerPending{
display: inline-block; display: inline-block;
width: 18px; width: 18px;
height: 18px; height: 18px;


+ 5
- 1
web_src/vuepages/pages/cloudbrain/detail/index.vue View File

@@ -22,7 +22,11 @@
<div class="title-l"> <div class="title-l">
<span class="task-create-time">{{ item.task.createTimeStr }}</span> <span class="task-create-time">{{ item.task.createTimeStr }}</span>
<span class="task-status"> <span class="task-status">
<span>{{ $t('status') }}:</span><i :class="item.task.status"></i><span>{{ item.task.status }}</span>
<span>{{ $t('status') }}:</span>
<i :class="item.task.status"></i>
<span>{{ item.task.status }}</span>
<i v-if="item.task.detailed_status==='dataMigrating'" :class="item.task.detailed_status" :title="$t('cloudbrainObj.migratingData')"></i>
<i v-if="item.task.detailed_status==='centerPending'" :class="item.task.detailed_status" :title="$t('cloudbrainObj.centerPending')"></i>
</span> </span>
<span class="task-duration"> <span class="task-duration">
<span>{{ $t('cloudbrainObj.runDuration') }}:</span><span>{{ item.task.formatted_duration }}</span> <span>{{ $t('cloudbrainObj.runDuration') }}:</span><span>{{ item.task.formatted_duration }}</span>


+ 2
- 2
web_src/vuepages/pages/cloudbrain/list/index.vue View File

@@ -43,8 +43,8 @@
<div class="status-wrap"> <div class="status-wrap">
<i :class="scope.row.task.status"></i> <i :class="scope.row.task.status"></i>
<span>{{ scope.row.task.status }}</span> <span>{{ scope.row.task.status }}</span>
<i v-if="scope.row.task.detailed_status==='dataMigrating'" class="data-migrating" :title="$t('cloudbrainObj.migratingData')"></i>
<i v-if="scope.row.task.detailed_status==='centerPending'" class="center-pending" :title="$t('cloudbrainObj.centerPending')"></i>
<i v-if="scope.row.task.detailed_status==='dataMigrating'" :class="scope.row.task.detailed_status" :title="$t('cloudbrainObj.migratingData')"></i>
<i v-if="scope.row.task.detailed_status==='centerPending'" :class="scope.row.task.detailed_status" :title="$t('cloudbrainObj.centerPending')"></i>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>


Loading…
Cancel
Save