diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 049e84e6c..4d9426c50 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -662,14 +662,35 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo if cloudbrain.TrainResourceSpecs == nil { json.Unmarshal([]byte(setting.TrainResourceSpecs), &cloudbrain.TrainResourceSpecs) } + hasSpec := false for _, tmp := range cloudbrain.TrainResourceSpecs.ResourceSpec { if tmp.Id == task.ResourceSpecId { + hasSpec = true ctx.Data["GpuNum"] = tmp.GpuNum ctx.Data["CpuNum"] = tmp.CpuNum ctx.Data["MemMiB"] = tmp.MemMiB ctx.Data["ShareMemMiB"] = tmp.ShareMemMiB } } + + if !hasSpec && cloudbrain.SpecialPools != nil { + for _, specialPool := range cloudbrain.SpecialPools.Pools { + + if specialPool.ResourceSpec != nil { + + for _, spec := range specialPool.ResourceSpec { + if task.ResourceSpecId == spec.Id { + ctx.Data["GpuNum"] = spec.GpuNum + ctx.Data["CpuNum"] = spec.CpuNum + ctx.Data["MemMiB"] = spec.MemMiB + ctx.Data["ShareMemMiB"] = spec.ShareMemMiB + break + } + } + } + } + } + } else if task.JobType == string(models.JobTypeInference) { if cloudbrain.InferenceResourceSpecs == nil { json.Unmarshal([]byte(setting.InferenceResourceSpecs), &cloudbrain.InferenceResourceSpecs) @@ -710,6 +731,15 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo ctx.Data["resource_type"] = resourceType.Value } } + for _, specialPool := range cloudbrain.SpecialPools.Pools { + + for _, resourceType := range specialPool.Pool { + if resourceType.Queue == jobRes.Config.GpuType { + ctx.Data["resource_type"] = resourceType.Value + } + } + } + } else if task.JobType == string(models.JobTypeInference) { if inferenceGpuInfos == nil { json.Unmarshal([]byte(setting.InferenceGpuTypes), &inferenceGpuInfos) diff --git a/templates/custom/wait_count_train.tmpl b/templates/custom/wait_count_train.tmpl index a0e130c61..fcfadc5be 100644 --- a/templates/custom/wait_count_train.tmpl +++ b/templates/custom/wait_count_train.tmpl @@ -1,13 +1,13 @@
{{$queue := ""}} {{$gpuQueue := 0}} - {{range $k,$v :=.gpu_types}} + {{range $k,$v :=.type}} {{if eq $k 0}} {{ $queue = $v.Queue }} {{ end }} {{ end }} - {{ range $k,$v :=.QueuesDetail }} + {{ range $k,$v :=.ctx.QueuesDetail }} {{if eq $k $queue}} {{$gpuQueue =$v}} {{ end }} @@ -16,13 +16,13 @@ class="ri-error-warning-line" style="margin-right: 0.5rem; font-size: 16px" > - {{.i18n.Tr "repo.wait_count_start"}} - {{if .QueuesDetail}} + {{.ctx.i18n.Tr "repo.wait_count_start"}} + {{if .type}} {{ $gpuQueue }} {{else}} - {{.WaitCount}} + {{.ctx.WaitCount}} {{ end }} - {{.i18n.Tr "repo.wait_count_end"}}
diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index 0509ce5bc..fb1296d27 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -62,7 +62,7 @@ {{.i18n.Tr "repo.cloudbrain.benchmark.model"}} - {{template "custom/wait_count_train" .}} + {{template "custom/wait_count_train" Dict "ctx" $ "type" .benchmark_gpu_types}}
@@ -157,7 +157,7 @@ {{.i18n.Tr "repo.cloudbrain.benchmark.model"}}
- {{template "custom/wait_count_train" .}} + {{template "custom/wait_count_train" Dict "ctx" $ "type" .benchmark_gpu_types}}
diff --git a/templates/repo/cloudbrain/benchmark/show.tmpl b/templates/repo/cloudbrain/benchmark/show.tmpl index 59ce3c471..ff4e5e7ea 100755 --- a/templates/repo/cloudbrain/benchmark/show.tmpl +++ b/templates/repo/cloudbrain/benchmark/show.tmpl @@ -232,12 +232,7 @@
- {{if not (eq .StartTime 0)}} - {{TimeSinceUnix1 .StartTime}} - {{else}} - {{TimeSinceUnix1 .CreatedUnix}} - - {{end}} + {{TimeSinceUnix1 .CreatedUnix}} {{$.i18n.Tr "repo.modelarts.status"}}: diff --git a/templates/repo/cloudbrain/inference/new.tmpl b/templates/repo/cloudbrain/inference/new.tmpl index e42c7240a..223fcfe1c 100644 --- a/templates/repo/cloudbrain/inference/new.tmpl +++ b/templates/repo/cloudbrain/inference/new.tmpl @@ -92,7 +92,7 @@ Ascend NPU
- {{template "custom/wait_count_train" .}} + {{template "custom/wait_count_train" Dict "ctx" $ "type" .inference_gpu_types}}
diff --git a/templates/repo/cloudbrain/inference/show.tmpl b/templates/repo/cloudbrain/inference/show.tmpl index 909cde468..00ad25644 100644 --- a/templates/repo/cloudbrain/inference/show.tmpl +++ b/templates/repo/cloudbrain/inference/show.tmpl @@ -317,9 +317,9 @@ {{if not (eq .StartTime 0)}} {{TimeSinceUnix1 .StartTime}} - {{else}} - {{TimeSinceUnix1 .CreatedUnix}} - {{end}} + {{else}} + -- + {{end}}
diff --git a/templates/repo/cloudbrain/show.tmpl b/templates/repo/cloudbrain/show.tmpl index f5ad6b5db..e4769c65c 100755 --- a/templates/repo/cloudbrain/show.tmpl +++ b/templates/repo/cloudbrain/show.tmpl @@ -240,12 +240,7 @@
- {{if not (eq .StartTime 0)}} - {{TimeSinceUnix1 .StartTime}} - {{else}} - {{TimeSinceUnix1 .CreatedUnix}} - - {{end}} + {{TimeSinceUnix1 .CreatedUnix}} {{$.i18n.Tr "repo.modelarts.status"}}: diff --git a/templates/repo/cloudbrain/trainjob/new.tmpl b/templates/repo/cloudbrain/trainjob/new.tmpl index 22465492b..c410889b2 100755 --- a/templates/repo/cloudbrain/trainjob/new.tmpl +++ b/templates/repo/cloudbrain/trainjob/new.tmpl @@ -126,7 +126,7 @@ Ascend NPU
- {{template "custom/wait_count_train" .}} + {{template "custom/wait_count_train" Dict "ctx" $ "type" .train_gpu_types}}
diff --git a/templates/repo/cloudbrain/trainjob/show.tmpl b/templates/repo/cloudbrain/trainjob/show.tmpl index da7402eb0..20e5cb55d 100644 --- a/templates/repo/cloudbrain/trainjob/show.tmpl +++ b/templates/repo/cloudbrain/trainjob/show.tmpl @@ -326,8 +326,13 @@
- {{TimeSinceUnix1 .CreatedUnix}} + + {{if not (eq .StartTime 0)}} + {{TimeSinceUnix1 .StartTime}} + {{else}} + -- + {{end}} +
diff --git a/templates/repo/grampus/trainjob/gpu/new.tmpl b/templates/repo/grampus/trainjob/gpu/new.tmpl index 2e365fdc6..75b8bcff2 100755 --- a/templates/repo/grampus/trainjob/gpu/new.tmpl +++ b/templates/repo/grampus/trainjob/gpu/new.tmpl @@ -113,7 +113,7 @@ Ascend NPU
- {{template "custom/wait_count_train" .}} + {{template "custom/wait_count_train" Dict "ctx" $}}
diff --git a/templates/repo/grampus/trainjob/npu/new.tmpl b/templates/repo/grampus/trainjob/npu/new.tmpl index 1e863ce17..f23942e13 100755 --- a/templates/repo/grampus/trainjob/npu/new.tmpl +++ b/templates/repo/grampus/trainjob/npu/new.tmpl @@ -108,7 +108,7 @@ Ascend NPU
- {{template "custom/wait_count_train" .}} + {{template "custom/wait_count_train" Dict "ctx" $}}
diff --git a/templates/repo/grampus/trainjob/show.tmpl b/templates/repo/grampus/trainjob/show.tmpl index 53201a467..5d4321736 100755 --- a/templates/repo/grampus/trainjob/show.tmpl +++ b/templates/repo/grampus/trainjob/show.tmpl @@ -251,12 +251,7 @@
- - {{if not (eq .StartTime 0)}} - {{TimeSinceUnix1 .StartTime}} - {{else}} - {{TimeSinceUnix1 .CreatedUnix}} - {{end}} + {{TimeSinceUnix1 .CreatedUnix}} {{$.i18n.Tr "repo.modelarts.current_version"}}:{{.VersionName}} @@ -350,7 +345,7 @@ {{if not (eq .StartTime 0)}} {{TimeSinceUnix1 .StartTime}} {{else}} - {{TimeSinceUnix1 .CreatedUnix}} + -- {{end}}
diff --git a/templates/repo/modelarts/inferencejob/new.tmpl b/templates/repo/modelarts/inferencejob/new.tmpl index 116f53a45..89f4180c0 100644 --- a/templates/repo/modelarts/inferencejob/new.tmpl +++ b/templates/repo/modelarts/inferencejob/new.tmpl @@ -90,7 +90,7 @@ Ascend NPU
- {{template "custom/wait_count_train" .}} + {{template "custom/wait_count_train" Dict "ctx" $}}
diff --git a/templates/repo/modelarts/inferencejob/show.tmpl b/templates/repo/modelarts/inferencejob/show.tmpl index 99deee551..14bb5cf24 100644 --- a/templates/repo/modelarts/inferencejob/show.tmpl +++ b/templates/repo/modelarts/inferencejob/show.tmpl @@ -266,9 +266,9 @@ td, th { {{if not (eq .StartTime 0)}} {{TimeSinceUnix1 .StartTime}} - {{else}} - {{TimeSinceUnix1 .CreatedUnix}} - {{end}} + {{else}} + -- + {{end}}
diff --git a/templates/repo/modelarts/notebook/show.tmpl b/templates/repo/modelarts/notebook/show.tmpl index c36a5b104..7d49ace86 100755 --- a/templates/repo/modelarts/notebook/show.tmpl +++ b/templates/repo/modelarts/notebook/show.tmpl @@ -246,14 +246,8 @@
- {{if not (eq .StartTime 0)}} - {{TimeSinceUnix1 .StartTime}} - {{else}} - {{TimeSinceUnix1 .CreatedUnix}} - - {{end}} + {{TimeSinceUnix1 .CreatedUnix}} - {{$.i18n.Tr "repo.modelarts.status"}}: - + {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}} diff --git a/templates/repo/modelarts/trainjob/new.tmpl b/templates/repo/modelarts/trainjob/new.tmpl index 39f9f30f5..e89482dc2 100755 --- a/templates/repo/modelarts/trainjob/new.tmpl +++ b/templates/repo/modelarts/trainjob/new.tmpl @@ -118,7 +118,7 @@ Ascend NPU
- {{template "custom/wait_count_train" .}} + {{template "custom/wait_count_train" Dict "ctx" $}}
diff --git a/templates/repo/modelarts/trainjob/show.tmpl b/templates/repo/modelarts/trainjob/show.tmpl index bbe2c4e84..585a3c99d 100755 --- a/templates/repo/modelarts/trainjob/show.tmpl +++ b/templates/repo/modelarts/trainjob/show.tmpl @@ -292,11 +292,8 @@
- {{if not (eq .Cloudbrain.StartTime 0)}} - {{TimeSinceUnix1 .Cloudbrain.StartTime}} - {{else}} {{TimeSinceUnix1 .Cloudbrain.CreatedUnix}} - {{end}} + {{$.i18n.Tr "repo.modelarts.current_version"}}:{{.VersionName}} @@ -380,7 +377,7 @@ {{if not (eq .Cloudbrain.StartTime 0)}} {{TimeSinceUnix1 .Cloudbrain.StartTime}} {{else}} - {{TimeSinceUnix1 .Cloudbrain.CreatedUnix}} + -- {{end}}
diff --git a/web_src/js/features/cloudrbanin.js b/web_src/js/features/cloudrbanin.js index b7a9e4eef..172e6b0bd 100644 --- a/web_src/js/features/cloudrbanin.js +++ b/web_src/js/features/cloudrbanin.js @@ -123,7 +123,7 @@ export default async function initCloudrain() { "KILLED", "COMPLETED", "SUCCEEDED", - "CREATE_FAILED" + "CREATE_FAILED", ].includes(status) ) { $("#ai-delete-" + ID)