From e907bfd13286b0056034ca8e6c0378c1b5f0672c Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 19 Jul 2022 15:39:01 +0800 Subject: [PATCH 1/8] fix issue --- templates/repo/modelarts/trainjob/show.tmpl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/templates/repo/modelarts/trainjob/show.tmpl b/templates/repo/modelarts/trainjob/show.tmpl index 794e42457..464fc9f30 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}} From 346db1fd08360e83ae9031e1b96ae9e0460bb141 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 19 Jul 2022 16:30:51 +0800 Subject: [PATCH 2/8] fix issue --- templates/repo/cloudbrain/trainjob/show.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/cloudbrain/trainjob/show.tmpl b/templates/repo/cloudbrain/trainjob/show.tmpl index da7402eb0..c5880a343 100644 --- a/templates/repo/cloudbrain/trainjob/show.tmpl +++ b/templates/repo/cloudbrain/trainjob/show.tmpl @@ -327,7 +327,7 @@
{{TimeSinceUnix1 .CreatedUnix}} + class="">{{TimeSinceUnix1 .StartTime}}
From d2e9e7de8563e0bd196d6831a7a7d9d8d1f54f4f Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 19 Jul 2022 16:49:58 +0800 Subject: [PATCH 3/8] fix issue --- templates/repo/cloudbrain/inference/show.tmpl | 6 +++--- templates/repo/cloudbrain/trainjob/show.tmpl | 9 +++++++-- templates/repo/grampus/trainjob/show.tmpl | 2 +- templates/repo/modelarts/inferencejob/show.tmpl | 6 +++--- templates/repo/modelarts/trainjob/show.tmpl | 2 +- 5 files changed, 15 insertions(+), 10 deletions(-) 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/trainjob/show.tmpl b/templates/repo/cloudbrain/trainjob/show.tmpl index c5880a343..20e5cb55d 100644 --- a/templates/repo/cloudbrain/trainjob/show.tmpl +++ b/templates/repo/cloudbrain/trainjob/show.tmpl @@ -326,8 +326,13 @@
- {{TimeSinceUnix1 .StartTime}} + + {{if not (eq .StartTime 0)}} + {{TimeSinceUnix1 .StartTime}} + {{else}} + -- + {{end}} +
diff --git a/templates/repo/grampus/trainjob/show.tmpl b/templates/repo/grampus/trainjob/show.tmpl index 0572e9de1..5d4321736 100755 --- a/templates/repo/grampus/trainjob/show.tmpl +++ b/templates/repo/grampus/trainjob/show.tmpl @@ -345,7 +345,7 @@ {{if not (eq .StartTime 0)}} {{TimeSinceUnix1 .StartTime}} {{else}} - {{TimeSinceUnix1 .CreatedUnix}} + -- {{end}} 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/trainjob/show.tmpl b/templates/repo/modelarts/trainjob/show.tmpl index 464fc9f30..7a727cf4c 100755 --- a/templates/repo/modelarts/trainjob/show.tmpl +++ b/templates/repo/modelarts/trainjob/show.tmpl @@ -377,7 +377,7 @@ {{if not (eq .Cloudbrain.StartTime 0)}} {{TimeSinceUnix1 .Cloudbrain.StartTime}} {{else}} - {{TimeSinceUnix1 .Cloudbrain.CreatedUnix}} + -- {{end}} From e3856f7b6325b76546a1027c43ba08e78ca079ef Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Tue, 19 Jul 2022 16:53:32 +0800 Subject: [PATCH 4/8] fix issue --- templates/repo/modelarts/notebook/show.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/modelarts/notebook/show.tmpl b/templates/repo/modelarts/notebook/show.tmpl index 6eb93b509..7d49ace86 100755 --- a/templates/repo/modelarts/notebook/show.tmpl +++ b/templates/repo/modelarts/notebook/show.tmpl @@ -407,7 +407,7 @@ - + {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}} From fceebb9e8c429bc1acc8f5b095608c2d825acbdf Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Tue, 19 Jul 2022 18:09:44 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/repo/cloudbrain.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 7af36641d..31bf1b887 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) From 38ef62470f012920f4fc689681b4aedb8b2eb36b Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Tue, 19 Jul 2022 18:32:11 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/repo/cloudbrain.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 31bf1b887..0d20f83f0 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -731,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) From eeea057bd8c3e0dbb46f513057798c6e8c0f6ec0 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Tue, 19 Jul 2022 18:34:04 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/custom_migrations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/custom_migrations.go b/models/custom_migrations.go index 041c4fb93..29c43b29a 100755 --- a/models/custom_migrations.go +++ b/models/custom_migrations.go @@ -17,7 +17,7 @@ type CustomMigrationStatic struct { var customMigrations = []CustomMigration{ //手机号功能可以不启用,不启用时手机号为空串,为了避免启用时唯一性约束报错,定制唯一性约束(对null和空字符串不做唯一性检查) - {"set phone number unique index", setPhoneNumberUniqueIndex}, + //{"set phone number unique index", setPhoneNumberUniqueIndex}, } var customMigrationsStatic []CustomMigrationStatic From 62ea71cb3a1258ffae670d98062e90d598031537 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Tue, 19 Jul 2022 18:40:50 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/custom_migrations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/custom_migrations.go b/models/custom_migrations.go index 29c43b29a..041c4fb93 100755 --- a/models/custom_migrations.go +++ b/models/custom_migrations.go @@ -17,7 +17,7 @@ type CustomMigrationStatic struct { var customMigrations = []CustomMigration{ //手机号功能可以不启用,不启用时手机号为空串,为了避免启用时唯一性约束报错,定制唯一性约束(对null和空字符串不做唯一性检查) - //{"set phone number unique index", setPhoneNumberUniqueIndex}, + {"set phone number unique index", setPhoneNumberUniqueIndex}, } var customMigrationsStatic []CustomMigrationStatic