@@ -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) | ||||
@@ -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> | ||||
@@ -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> | ||||
@@ -345,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> | ||||
@@ -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> | ||||
@@ -407,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> | ||||
@@ -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> | ||||