From 464de2a6afd966dcf8005ce2c977a03281fd4bd7 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Tue, 15 Nov 2022 17:44:25 +0800 Subject: [PATCH] =?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/repo/cloudbrain.go | 42 ++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/routers/api/v1/repo/cloudbrain.go b/routers/api/v1/repo/cloudbrain.go index 22b533baa..53eaf28c6 100755 --- a/routers/api/v1/repo/cloudbrain.go +++ b/routers/api/v1/repo/cloudbrain.go @@ -117,19 +117,33 @@ func GetFileNoteBookInfo(ctx *context.APIContext) { return } waitCountGPU := (*queuesMap)[specGpuQueueCode] - ctx.JSON(http.StatusOK, map[string]interface{}{ - "code": 0, - "specCpu": specCPU, - "specGpu": specGpu, - "specNpu": specNPU, - "specNpuCd": specNPUCD, - "waitCountGpu": waitCountGPU, - "waitCountNpu": waitCountNpu, - "imageCpuDescription": setting.FileNoteBook.ImageCPUDescription, - "imageGpuDescription": setting.FileNoteBook.ImageGPUDescription, - "imageNpuDescription": setting.FileNoteBook.ImageNPUDescription, - "imageNpuCDDescription": setting.FileNoteBook.ImageNPUCDDescription, - }) + if !setting.ModelartsCD.Enabled{ + ctx.JSON(http.StatusOK, map[string]interface{}{ + "code": 0, + "specCpu": specCPU, + "specGpu": specGpu, + "specNpu": specNPU, + "waitCountGpu": waitCountGPU, + "waitCountNpu": waitCountNpu, + "imageCpuDescription": setting.FileNoteBook.ImageCPUDescription, + "imageGpuDescription": setting.FileNoteBook.ImageGPUDescription, + "imageNpuDescription": setting.FileNoteBook.ImageNPUDescription, + + }) + } else{ + ctx.JSON(http.StatusOK, map[string]interface{}{ + "code": 0, + "specCpu": specCPU, + "specGpu": specGpu, + "specNpu": specNPUCD, + "waitCountGpu": waitCountGPU, + "waitCountNpu": waitCountNpu, + "imageCpuDescription": setting.FileNoteBook.ImageCPUDescription, + "imageGpuDescription": setting.FileNoteBook.ImageGPUDescription, + "imageNpuDescription": setting.FileNoteBook.ImageNPUCDDescription, + }) + + } } @@ -690,7 +704,7 @@ func CloudbrainGetLog(ctx *context.APIContext) { endLine += 1 } } - + result = getLogFromModelDir(job.JobName, startLine, endLine, resultPath) if result == nil { log.Error("GetJobLog failed: %v", err, ctx.Data["MsgID"])