From 0fc14efeefcba04037d21e8dfa5dc74423d925e5 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Mon, 18 Jul 2022 14:22:45 +0800 Subject: [PATCH 1/2] fix issue --- web_src/js/features/cloudrbanin.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web_src/js/features/cloudrbanin.js b/web_src/js/features/cloudrbanin.js index 15cb47e97..86e9577b5 100644 --- a/web_src/js/features/cloudrbanin.js +++ b/web_src/js/features/cloudrbanin.js @@ -458,10 +458,15 @@ export default async function initCloudrain() { }); function setWaitNums() { - console.log($(".cloudbrain-type")); if ($(".cloudbrain-type").length === 0 && $(".gpu-type").length === 0) { return; } + if ( + $(".cloudbrain-type").length !== 0 && + !$(".cloudbrain-type").data("queue") + ) { + return; + } let waitNums = $(".cloudbrain-type").data("queue").split("map")[1]; let test = new Map(); let waitNumsArray = waitNums.split(" "); From 953be48243c7374918d26569329dcfd781500c04 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Mon, 18 Jul 2022 14:58:45 +0800 Subject: [PATCH 2/2] =?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/api/v1/api.go | 2 +- routers/repo/cloudbrain.go | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 9a4774fa3..3d9452f93 100755 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -925,7 +925,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("/inference-job", func() { m.Group("/:jobid", func() { m.Get("", repo.GetCloudBrainInferenceJob) - m.Post("/del", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.DelCloudBrainJob) + m.Post("/del", cloudbrain.AdminOrOwnerOrJobCreaterRightForTrain, repo.DelCloudBrainJob) m.Get("/result_list", repo.InferencJobResultList) }) }) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 5c03e26a7..ddf1c7ff2 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -131,10 +131,12 @@ func cloudBrainNewDataPrepare(ctx *context.Context) error { } ctx.Data["train_gpu_types"] = trainGpuInfos.GpuInfo - if inferenceGpuInfos == nil { + if inferenceGpuInfos == nil && setting.InferenceGpuTypes != "" { json.Unmarshal([]byte(setting.InferenceGpuTypes), &inferenceGpuInfos) } - ctx.Data["inference_gpu_types"] = inferenceGpuInfos.GpuInfo + if inferenceGpuInfos != nil { + ctx.Data["inference_gpu_types"] = inferenceGpuInfos.GpuInfo + } if benchmarkGpuInfos == nil { json.Unmarshal([]byte(setting.BenchmarkGpuTypes), &benchmarkGpuInfos) @@ -156,10 +158,12 @@ func cloudBrainNewDataPrepare(ctx *context.Context) error { } ctx.Data["train_resource_specs"] = cloudbrain.TrainResourceSpecs.ResourceSpec - if cloudbrain.InferenceResourceSpecs == nil { + if cloudbrain.InferenceResourceSpecs == nil && setting.InferenceResourceSpecs != "" { json.Unmarshal([]byte(setting.InferenceResourceSpecs), &cloudbrain.InferenceResourceSpecs) } - ctx.Data["inference_resource_specs"] = cloudbrain.InferenceResourceSpecs.ResourceSpec + if cloudbrain.InferenceResourceSpecs != nil { + ctx.Data["inference_resource_specs"] = cloudbrain.InferenceResourceSpecs.ResourceSpec + } if cloudbrain.SpecialPools != nil { var debugGpuTypes []*models.GpuInfo