Browse Source

Merge branch 'V20220718' of git.openi.org.cn:OpenI/aiforge into fix-2419

fix-2419
lewis 3 years ago
parent
commit
29ea504f64
18 changed files with 67 additions and 56 deletions
  1. +30
    -0
      routers/repo/cloudbrain.go
  2. +7
    -7
      templates/custom/wait_count_train.tmpl
  3. +2
    -2
      templates/repo/cloudbrain/benchmark/new.tmpl
  4. +1
    -6
      templates/repo/cloudbrain/benchmark/show.tmpl
  5. +1
    -1
      templates/repo/cloudbrain/inference/new.tmpl
  6. +3
    -3
      templates/repo/cloudbrain/inference/show.tmpl
  7. +1
    -6
      templates/repo/cloudbrain/show.tmpl
  8. +1
    -1
      templates/repo/cloudbrain/trainjob/new.tmpl
  9. +7
    -2
      templates/repo/cloudbrain/trainjob/show.tmpl
  10. +1
    -1
      templates/repo/grampus/trainjob/gpu/new.tmpl
  11. +1
    -1
      templates/repo/grampus/trainjob/npu/new.tmpl
  12. +2
    -7
      templates/repo/grampus/trainjob/show.tmpl
  13. +1
    -1
      templates/repo/modelarts/inferencejob/new.tmpl
  14. +3
    -3
      templates/repo/modelarts/inferencejob/show.tmpl
  15. +2
    -8
      templates/repo/modelarts/notebook/show.tmpl
  16. +1
    -1
      templates/repo/modelarts/trainjob/new.tmpl
  17. +2
    -5
      templates/repo/modelarts/trainjob/show.tmpl
  18. +1
    -1
      web_src/js/features/cloudrbanin.js

+ 30
- 0
routers/repo/cloudbrain.go View File

@@ -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)


+ 7
- 7
templates/custom/wait_count_train.tmpl View File

@@ -1,13 +1,13 @@
<div class="tooltip-wati-count" style="margin-left: 155px">
{{$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"
></i>
<span
>{{.i18n.Tr "repo.wait_count_start"}}
{{if .QueuesDetail}}
<span id="gpu-nums"
>{{.ctx.i18n.Tr "repo.wait_count_start"}}
{{if .type}}
{{ $gpuQueue }}
{{else}}
{{.WaitCount}}
{{.ctx.WaitCount}}
{{ end }}
{{.i18n.Tr "repo.wait_count_end"}}</span
{{.ctx.i18n.Tr "repo.wait_count_end"}}</span
>
</div>

+ 2
- 2
templates/repo/cloudbrain/benchmark/new.tmpl View File

@@ -62,7 +62,7 @@
<a class="active item model_benchmark"
href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a>
</div>
{{template "custom/wait_count_train" .}}
{{template "custom/wait_count_train" Dict "ctx" $ "type" .benchmark_gpu_types}}
</div>
<div>
<div class="required min_title inline field">
@@ -157,7 +157,7 @@
<a class="item model_benchmark"
href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a>
</div>
{{template "custom/wait_count_train" .}}
{{template "custom/wait_count_train" Dict "ctx" $ "type" .benchmark_gpu_types}}
</div>

<div>


+ 1
- 6
templates/repo/cloudbrain/benchmark/show.tmpl View File

@@ -232,12 +232,7 @@
<span>
<div class="ac-display-inblock title_text acc-margin-bottom">
<span class="cti-mgRight-sm">
{{if not (eq .StartTime 0)}}
<td>{{TimeSinceUnix1 .StartTime}}</td>
{{else}}
<td>{{TimeSinceUnix1 .CreatedUnix}}
<td>
{{end}}
<td>{{TimeSinceUnix1 .CreatedUnix}}</td>
</span>

<span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}:


+ 1
- 1
templates/repo/cloudbrain/inference/new.tmpl View File

@@ -92,7 +92,7 @@
</svg>
Ascend NPU</a>
</div>
{{template "custom/wait_count_train" .}}
{{template "custom/wait_count_train" Dict "ctx" $ "type" .inference_gpu_types}}
</div>
<div class="required min_title inline field">
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>


+ 3
- 3
templates/repo/cloudbrain/inference/show.tmpl View File

@@ -317,9 +317,9 @@
<span style="font-size: 12px;" class="">
{{if not (eq .StartTime 0)}}
{{TimeSinceUnix1 .StartTime}}
{{else}}
{{TimeSinceUnix1 .CreatedUnix}}
{{end}}
{{else}}
--
{{end}}
</span>
</div>
</td>


+ 1
- 6
templates/repo/cloudbrain/show.tmpl View File

@@ -240,12 +240,7 @@
<span>
<div class="ac-display-inblock title_text acc-margin-bottom">
<span class="cti-mgRight-sm">
{{if not (eq .StartTime 0)}}
<td>{{TimeSinceUnix1 .StartTime}}</td>
{{else}}
<td>{{TimeSinceUnix1 .CreatedUnix}}
<td>
{{end}}
<td>{{TimeSinceUnix1 .CreatedUnix}}</td>
</span>

<span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}:


+ 1
- 1
templates/repo/cloudbrain/trainjob/new.tmpl View File

@@ -126,7 +126,7 @@
</svg>
Ascend NPU</a>
</div>
{{template "custom/wait_count_train" .}}
{{template "custom/wait_count_train" Dict "ctx" $ "type" .train_gpu_types}}
</div>
<div class="required min_title inline field">
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>


+ 7
- 2
templates/repo/cloudbrain/trainjob/show.tmpl View File

@@ -326,8 +326,13 @@

<td class="ti-text-form-content">
<div class="text-span text-span-w">
<span style="font-size: 12px;"
class="">{{TimeSinceUnix1 .CreatedUnix}}</span>
<span style="font-size: 12px;">
{{if not (eq .StartTime 0)}}
{{TimeSinceUnix1 .StartTime}}
{{else}}
--
{{end}}
</span>
</div>
</td>
</tr>


+ 1
- 1
templates/repo/grampus/trainjob/gpu/new.tmpl View File

@@ -113,7 +113,7 @@
</svg>
Ascend NPU</a>
</div>
{{template "custom/wait_count_train" .}}
{{template "custom/wait_count_train" Dict "ctx" $}}
</div>
<div class="required min_title inline field">
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>


+ 1
- 1
templates/repo/grampus/trainjob/npu/new.tmpl View File

@@ -108,7 +108,7 @@
</svg>
Ascend NPU</a>
</div>
{{template "custom/wait_count_train" .}}
{{template "custom/wait_count_train" Dict "ctx" $}}
</div>
<div class="required min_title inline field">


+ 2
- 7
templates/repo/grampus/trainjob/show.tmpl View File

@@ -251,12 +251,7 @@
<div class="ac-display-inblock title_text acc-margin-bottom">

<span class="cti-mgRight-sm">
{{if not (eq .StartTime 0)}}
{{TimeSinceUnix1 .StartTime}}
{{else}}
{{TimeSinceUnix1 .CreatedUnix}}
{{end}}</span>
<span class="cti-mgRight-sm">{{TimeSinceUnix1 .CreatedUnix}}</span>
<span class="cti-mgRight-sm">
{{$.i18n.Tr "repo.modelarts.current_version"}}:{{.VersionName}}</span>
<span class="cti-mgRight-sm">
@@ -350,7 +345,7 @@
{{if not (eq .StartTime 0)}}
{{TimeSinceUnix1 .StartTime}}
{{else}}
{{TimeSinceUnix1 .CreatedUnix}}
--
{{end}}</span>
</div>
</td>


+ 1
- 1
templates/repo/modelarts/inferencejob/new.tmpl View File

@@ -90,7 +90,7 @@
</svg>
Ascend NPU</a>
</div>
{{template "custom/wait_count_train" .}}
{{template "custom/wait_count_train" Dict "ctx" $}}
</div>
<div class="required min_title inline field">
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>


+ 3
- 3
templates/repo/modelarts/inferencejob/show.tmpl View File

@@ -266,9 +266,9 @@ td, th {
<span style="font-size: 12px;" class="">
{{if not (eq .StartTime 0)}}
{{TimeSinceUnix1 .StartTime}}
{{else}}
{{TimeSinceUnix1 .CreatedUnix}}
{{end}}
{{else}}
--
{{end}}
</span>
</div>
</td>


+ 2
- 8
templates/repo/modelarts/notebook/show.tmpl View File

@@ -246,14 +246,8 @@
<span>
<div class="ac-display-inblock title_text acc-margin-bottom">
<span class="cti-mgRight-sm">
{{if not (eq .StartTime 0)}}
<td>{{TimeSinceUnix1 .StartTime}}</td>
{{else}}
<td>{{TimeSinceUnix1 .CreatedUnix}}
<td>
{{end}}
{{TimeSinceUnix1 .CreatedUnix}}
</span>

<span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}:
<span id="{{.VersionName}}-status-span"><i id="icon"
style="vertical-align: middle;" class="{{.Status}}"></i><span id="text"
@@ -413,7 +407,7 @@
</div>
</td>
</tr>
<tr class="ti-no-ng-animate">
<tr class="ti-no-ng-animate">
<td class="ti-no-ng-animate ti-text-form-label text-width80">
{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}
</td>


+ 1
- 1
templates/repo/modelarts/trainjob/new.tmpl View File

@@ -118,7 +118,7 @@
</svg>
Ascend NPU</a>
</div>
{{template "custom/wait_count_train" .}}
{{template "custom/wait_count_train" Dict "ctx" $}}
</div>
<div class="required inline min_title field">
<label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label>


+ 2
- 5
templates/repo/modelarts/trainjob/show.tmpl View File

@@ -292,11 +292,8 @@
<div class="ac-display-inblock title_text acc-margin-bottom">

<span class="cti-mgRight-sm">
{{if not (eq .Cloudbrain.StartTime 0)}}
{{TimeSinceUnix1 .Cloudbrain.StartTime}}
{{else}}
{{TimeSinceUnix1 .Cloudbrain.CreatedUnix}}
{{end}}</span>
</span>
<span class="cti-mgRight-sm">
{{$.i18n.Tr "repo.modelarts.current_version"}}:{{.VersionName}}</span>
<span class="cti-mgRight-sm">
@@ -380,7 +377,7 @@
{{if not (eq .Cloudbrain.StartTime 0)}}
{{TimeSinceUnix1 .Cloudbrain.StartTime}}
{{else}}
{{TimeSinceUnix1 .Cloudbrain.CreatedUnix}}
--
{{end}}</span>
</div>
</td>


+ 1
- 1
web_src/js/features/cloudrbanin.js View File

@@ -123,7 +123,7 @@ export default async function initCloudrain() {
"KILLED",
"COMPLETED",
"SUCCEEDED",
"CREATE_FAILED"
"CREATE_FAILED",
].includes(status)
) {
$("#ai-delete-" + ID)


Loading…
Cancel
Save