| @@ -662,14 +662,35 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo | |||||
| if cloudbrain.TrainResourceSpecs == nil { | if cloudbrain.TrainResourceSpecs == nil { | ||||
| json.Unmarshal([]byte(setting.TrainResourceSpecs), &cloudbrain.TrainResourceSpecs) | json.Unmarshal([]byte(setting.TrainResourceSpecs), &cloudbrain.TrainResourceSpecs) | ||||
| } | } | ||||
| hasSpec := false | |||||
| for _, tmp := range cloudbrain.TrainResourceSpecs.ResourceSpec { | for _, tmp := range cloudbrain.TrainResourceSpecs.ResourceSpec { | ||||
| if tmp.Id == task.ResourceSpecId { | if tmp.Id == task.ResourceSpecId { | ||||
| hasSpec = true | |||||
| ctx.Data["GpuNum"] = tmp.GpuNum | ctx.Data["GpuNum"] = tmp.GpuNum | ||||
| ctx.Data["CpuNum"] = tmp.CpuNum | ctx.Data["CpuNum"] = tmp.CpuNum | ||||
| ctx.Data["MemMiB"] = tmp.MemMiB | ctx.Data["MemMiB"] = tmp.MemMiB | ||||
| ctx.Data["ShareMemMiB"] = tmp.ShareMemMiB | 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) { | } else if task.JobType == string(models.JobTypeInference) { | ||||
| if cloudbrain.InferenceResourceSpecs == nil { | if cloudbrain.InferenceResourceSpecs == nil { | ||||
| json.Unmarshal([]byte(setting.InferenceResourceSpecs), &cloudbrain.InferenceResourceSpecs) | 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 | 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) { | } else if task.JobType == string(models.JobTypeInference) { | ||||
| if inferenceGpuInfos == nil { | if inferenceGpuInfos == nil { | ||||
| json.Unmarshal([]byte(setting.InferenceGpuTypes), &inferenceGpuInfos) | json.Unmarshal([]byte(setting.InferenceGpuTypes), &inferenceGpuInfos) | ||||
| @@ -1,13 +1,13 @@ | |||||
| <div class="tooltip-wati-count" style="margin-left: 155px"> | <div class="tooltip-wati-count" style="margin-left: 155px"> | ||||
| {{$queue := ""}} | {{$queue := ""}} | ||||
| {{$gpuQueue := 0}} | {{$gpuQueue := 0}} | ||||
| {{range $k,$v :=.gpu_types}} | |||||
| {{range $k,$v :=.type}} | |||||
| {{if eq $k 0}} | {{if eq $k 0}} | ||||
| {{ $queue = $v.Queue }} | {{ $queue = $v.Queue }} | ||||
| {{ end }} | {{ end }} | ||||
| {{ end }} | {{ end }} | ||||
| {{ range $k,$v :=.QueuesDetail }} | |||||
| {{ range $k,$v :=.ctx.QueuesDetail }} | |||||
| {{if eq $k $queue}} | {{if eq $k $queue}} | ||||
| {{$gpuQueue =$v}} | {{$gpuQueue =$v}} | ||||
| {{ end }} | {{ end }} | ||||
| @@ -16,13 +16,13 @@ | |||||
| class="ri-error-warning-line" | class="ri-error-warning-line" | ||||
| style="margin-right: 0.5rem; font-size: 16px" | style="margin-right: 0.5rem; font-size: 16px" | ||||
| ></i> | ></i> | ||||
| <span | |||||
| >{{.i18n.Tr "repo.wait_count_start"}} | |||||
| {{if .QueuesDetail}} | |||||
| <span id="gpu-nums" | |||||
| >{{.ctx.i18n.Tr "repo.wait_count_start"}} | |||||
| {{if .type}} | |||||
| {{ $gpuQueue }} | {{ $gpuQueue }} | ||||
| {{else}} | {{else}} | ||||
| {{.WaitCount}} | |||||
| {{.ctx.WaitCount}} | |||||
| {{ end }} | {{ end }} | ||||
| {{.i18n.Tr "repo.wait_count_end"}}</span | |||||
| {{.ctx.i18n.Tr "repo.wait_count_end"}}</span | |||||
| > | > | ||||
| </div> | </div> | ||||
| @@ -62,7 +62,7 @@ | |||||
| <a class="active item model_benchmark" | <a class="active item model_benchmark" | ||||
| href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a> | href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a> | ||||
| </div> | </div> | ||||
| {{template "custom/wait_count_train" .}} | |||||
| {{template "custom/wait_count_train" Dict "ctx" $ "type" .benchmark_gpu_types}} | |||||
| </div> | </div> | ||||
| <div> | <div> | ||||
| <div class="required min_title inline field"> | <div class="required min_title inline field"> | ||||
| @@ -157,7 +157,7 @@ | |||||
| <a class="item model_benchmark" | <a class="item model_benchmark" | ||||
| href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a> | href="{{.Link}}?benchmarkMode=model">{{.i18n.Tr "repo.cloudbrain.benchmark.model"}}</a> | ||||
| </div> | </div> | ||||
| {{template "custom/wait_count_train" .}} | |||||
| {{template "custom/wait_count_train" Dict "ctx" $ "type" .benchmark_gpu_types}} | |||||
| </div> | </div> | ||||
| <div> | <div> | ||||
| @@ -232,12 +232,7 @@ | |||||
| <span> | <span> | ||||
| <div class="ac-display-inblock title_text acc-margin-bottom"> | <div class="ac-display-inblock title_text acc-margin-bottom"> | ||||
| <span class="cti-mgRight-sm"> | <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> | ||||
| <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}: | <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}: | ||||
| @@ -92,7 +92,7 @@ | |||||
| </svg> | </svg> | ||||
| Ascend NPU</a> | Ascend NPU</a> | ||||
| </div> | </div> | ||||
| {{template "custom/wait_count_train" .}} | |||||
| {{template "custom/wait_count_train" Dict "ctx" $ "type" .inference_gpu_types}} | |||||
| </div> | </div> | ||||
| <div class="required min_title inline field"> | <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> | <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label> | ||||
| @@ -317,9 +317,9 @@ | |||||
| <span style="font-size: 12px;" class=""> | <span style="font-size: 12px;" class=""> | ||||
| {{if not (eq .StartTime 0)}} | {{if not (eq .StartTime 0)}} | ||||
| {{TimeSinceUnix1 .StartTime}} | {{TimeSinceUnix1 .StartTime}} | ||||
| {{else}} | |||||
| {{TimeSinceUnix1 .CreatedUnix}} | |||||
| {{end}} | |||||
| {{else}} | |||||
| -- | |||||
| {{end}} | |||||
| </span> | </span> | ||||
| </div> | </div> | ||||
| </td> | </td> | ||||
| @@ -240,12 +240,7 @@ | |||||
| <span> | <span> | ||||
| <div class="ac-display-inblock title_text acc-margin-bottom"> | <div class="ac-display-inblock title_text acc-margin-bottom"> | ||||
| <span class="cti-mgRight-sm"> | <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> | ||||
| <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}: | <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}: | ||||
| @@ -126,7 +126,7 @@ | |||||
| </svg> | </svg> | ||||
| Ascend NPU</a> | Ascend NPU</a> | ||||
| </div> | </div> | ||||
| {{template "custom/wait_count_train" .}} | |||||
| {{template "custom/wait_count_train" Dict "ctx" $ "type" .train_gpu_types}} | |||||
| </div> | </div> | ||||
| <div class="required min_title inline field"> | <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> | <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label> | ||||
| @@ -326,8 +326,13 @@ | |||||
| <td class="ti-text-form-content"> | <td class="ti-text-form-content"> | ||||
| <div class="text-span text-span-w"> | <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> | </div> | ||||
| </td> | </td> | ||||
| </tr> | </tr> | ||||
| @@ -113,7 +113,7 @@ | |||||
| </svg> | </svg> | ||||
| Ascend NPU</a> | Ascend NPU</a> | ||||
| </div> | </div> | ||||
| {{template "custom/wait_count_train" .}} | |||||
| {{template "custom/wait_count_train" Dict "ctx" $}} | |||||
| </div> | </div> | ||||
| <div class="required min_title inline field"> | <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> | <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label> | ||||
| @@ -108,7 +108,7 @@ | |||||
| </svg> | </svg> | ||||
| Ascend NPU</a> | Ascend NPU</a> | ||||
| </div> | </div> | ||||
| {{template "custom/wait_count_train" .}} | |||||
| {{template "custom/wait_count_train" Dict "ctx" $}} | |||||
| </div> | </div> | ||||
| <div class="required min_title inline field"> | <div class="required min_title inline field"> | ||||
| @@ -251,12 +251,7 @@ | |||||
| <div class="ac-display-inblock title_text acc-margin-bottom"> | <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"> | <span class="cti-mgRight-sm"> | ||||
| {{$.i18n.Tr "repo.modelarts.current_version"}}:{{.VersionName}}</span> | {{$.i18n.Tr "repo.modelarts.current_version"}}:{{.VersionName}}</span> | ||||
| <span class="cti-mgRight-sm"> | <span class="cti-mgRight-sm"> | ||||
| @@ -350,7 +345,7 @@ | |||||
| {{if not (eq .StartTime 0)}} | {{if not (eq .StartTime 0)}} | ||||
| {{TimeSinceUnix1 .StartTime}} | {{TimeSinceUnix1 .StartTime}} | ||||
| {{else}} | {{else}} | ||||
| {{TimeSinceUnix1 .CreatedUnix}} | |||||
| -- | |||||
| {{end}}</span> | {{end}}</span> | ||||
| </div> | </div> | ||||
| </td> | </td> | ||||
| @@ -90,7 +90,7 @@ | |||||
| </svg> | </svg> | ||||
| Ascend NPU</a> | Ascend NPU</a> | ||||
| </div> | </div> | ||||
| {{template "custom/wait_count_train" .}} | |||||
| {{template "custom/wait_count_train" Dict "ctx" $}} | |||||
| </div> | </div> | ||||
| <div class="required min_title inline field"> | <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> | <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label> | ||||
| @@ -266,9 +266,9 @@ td, th { | |||||
| <span style="font-size: 12px;" class=""> | <span style="font-size: 12px;" class=""> | ||||
| {{if not (eq .StartTime 0)}} | {{if not (eq .StartTime 0)}} | ||||
| {{TimeSinceUnix1 .StartTime}} | {{TimeSinceUnix1 .StartTime}} | ||||
| {{else}} | |||||
| {{TimeSinceUnix1 .CreatedUnix}} | |||||
| {{end}} | |||||
| {{else}} | |||||
| -- | |||||
| {{end}} | |||||
| </span> | </span> | ||||
| </div> | </div> | ||||
| </td> | </td> | ||||
| @@ -246,14 +246,8 @@ | |||||
| <span> | <span> | ||||
| <div class="ac-display-inblock title_text acc-margin-bottom"> | <div class="ac-display-inblock title_text acc-margin-bottom"> | ||||
| <span class="cti-mgRight-sm"> | <span class="cti-mgRight-sm"> | ||||
| {{if not (eq .StartTime 0)}} | |||||
| <td>{{TimeSinceUnix1 .StartTime}}</td> | |||||
| {{else}} | |||||
| <td>{{TimeSinceUnix1 .CreatedUnix}} | |||||
| <td> | |||||
| {{end}} | |||||
| {{TimeSinceUnix1 .CreatedUnix}} | |||||
| </span> | </span> | ||||
| <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}: | <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}: | ||||
| <span id="{{.VersionName}}-status-span"><i id="icon" | <span id="{{.VersionName}}-status-span"><i id="icon" | ||||
| style="vertical-align: middle;" class="{{.Status}}"></i><span id="text" | style="vertical-align: middle;" class="{{.Status}}"></i><span id="text" | ||||
| @@ -413,7 +407,7 @@ | |||||
| </div> | </div> | ||||
| </td> | </td> | ||||
| </tr> | </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"> | <td class="ti-no-ng-animate ti-text-form-label text-width80"> | ||||
| {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}} | {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}} | ||||
| </td> | </td> | ||||
| @@ -118,7 +118,7 @@ | |||||
| </svg> | </svg> | ||||
| Ascend NPU</a> | Ascend NPU</a> | ||||
| </div> | </div> | ||||
| {{template "custom/wait_count_train" .}} | |||||
| {{template "custom/wait_count_train" Dict "ctx" $}} | |||||
| </div> | </div> | ||||
| <div class="required inline min_title field"> | <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> | <label class="label-fix-width" style="font-weight: normal;">{{.i18n.Tr "repo.modelarts.train_job.job_name"}}</label> | ||||
| @@ -292,11 +292,8 @@ | |||||
| <div class="ac-display-inblock title_text acc-margin-bottom"> | <div class="ac-display-inblock title_text acc-margin-bottom"> | ||||
| <span class="cti-mgRight-sm"> | <span class="cti-mgRight-sm"> | ||||
| {{if not (eq .Cloudbrain.StartTime 0)}} | |||||
| {{TimeSinceUnix1 .Cloudbrain.StartTime}} | |||||
| {{else}} | |||||
| {{TimeSinceUnix1 .Cloudbrain.CreatedUnix}} | {{TimeSinceUnix1 .Cloudbrain.CreatedUnix}} | ||||
| {{end}}</span> | |||||
| </span> | |||||
| <span class="cti-mgRight-sm"> | <span class="cti-mgRight-sm"> | ||||
| {{$.i18n.Tr "repo.modelarts.current_version"}}:{{.VersionName}}</span> | {{$.i18n.Tr "repo.modelarts.current_version"}}:{{.VersionName}}</span> | ||||
| <span class="cti-mgRight-sm"> | <span class="cti-mgRight-sm"> | ||||
| @@ -380,7 +377,7 @@ | |||||
| {{if not (eq .Cloudbrain.StartTime 0)}} | {{if not (eq .Cloudbrain.StartTime 0)}} | ||||
| {{TimeSinceUnix1 .Cloudbrain.StartTime}} | {{TimeSinceUnix1 .Cloudbrain.StartTime}} | ||||
| {{else}} | {{else}} | ||||
| {{TimeSinceUnix1 .Cloudbrain.CreatedUnix}} | |||||
| -- | |||||
| {{end}}</span> | {{end}}</span> | ||||
| </div> | </div> | ||||
| </td> | </td> | ||||
| @@ -123,7 +123,7 @@ export default async function initCloudrain() { | |||||
| "KILLED", | "KILLED", | ||||
| "COMPLETED", | "COMPLETED", | ||||
| "SUCCEEDED", | "SUCCEEDED", | ||||
| "CREATE_FAILED" | |||||
| "CREATE_FAILED", | |||||
| ].includes(status) | ].includes(status) | ||||
| ) { | ) { | ||||
| $("#ai-delete-" + ID) | $("#ai-delete-" + ID) | ||||