|
|
|
@@ -11,6 +11,7 @@ import ( |
|
|
|
"io" |
|
|
|
"net/http" |
|
|
|
"os" |
|
|
|
"path" |
|
|
|
"sort" |
|
|
|
"strconv" |
|
|
|
"strings" |
|
|
|
@@ -117,32 +118,31 @@ func GetFileNoteBookInfo(ctx *context.APIContext) { |
|
|
|
return |
|
|
|
} |
|
|
|
waitCountGPU := (*queuesMap)[specGpuQueueCode] |
|
|
|
if !setting.ModelartsCD.Enabled{ |
|
|
|
if !setting.ModelartsCD.Enabled { |
|
|
|
ctx.JSON(http.StatusOK, map[string]interface{}{ |
|
|
|
"code": 0, |
|
|
|
"projectName":setting.FileNoteBook.ProjectName, |
|
|
|
"specCpu": specCPU, |
|
|
|
"specGpu": specGpu, |
|
|
|
"specNpu": specNPU, |
|
|
|
"waitCountGpu": waitCountGPU, |
|
|
|
"waitCountNpu": waitCountNpu, |
|
|
|
"imageCpuDescription": setting.FileNoteBook.ImageCPUDescription, |
|
|
|
"imageGpuDescription": setting.FileNoteBook.ImageGPUDescription, |
|
|
|
"imageNpuDescription": setting.FileNoteBook.ImageNPUDescription, |
|
|
|
|
|
|
|
"code": 0, |
|
|
|
"projectName": setting.FileNoteBook.ProjectName, |
|
|
|
"specCpu": specCPU, |
|
|
|
"specGpu": specGpu, |
|
|
|
"specNpu": specNPU, |
|
|
|
"waitCountGpu": waitCountGPU, |
|
|
|
"waitCountNpu": waitCountNpu, |
|
|
|
"imageCpuDescription": setting.FileNoteBook.ImageCPUDescription, |
|
|
|
"imageGpuDescription": setting.FileNoteBook.ImageGPUDescription, |
|
|
|
"imageNpuDescription": setting.FileNoteBook.ImageNPUDescription, |
|
|
|
}) |
|
|
|
} else{ |
|
|
|
} else { |
|
|
|
ctx.JSON(http.StatusOK, map[string]interface{}{ |
|
|
|
"code": 0, |
|
|
|
"projectName":setting.FileNoteBook.ProjectName, |
|
|
|
"specCpu": specCPU, |
|
|
|
"specGpu": specGpu, |
|
|
|
"specNpu": specNPUCD, |
|
|
|
"waitCountGpu": waitCountGPU, |
|
|
|
"waitCountNpu": waitCountNpu, |
|
|
|
"imageCpuDescription": setting.FileNoteBook.ImageCPUDescription, |
|
|
|
"imageGpuDescription": setting.FileNoteBook.ImageGPUDescription, |
|
|
|
"imageNpuDescription": setting.FileNoteBook.ImageNPUCDDescription, |
|
|
|
"code": 0, |
|
|
|
"projectName": setting.FileNoteBook.ProjectName, |
|
|
|
"specCpu": specCPU, |
|
|
|
"specGpu": specGpu, |
|
|
|
"specNpu": specNPUCD, |
|
|
|
"waitCountGpu": waitCountGPU, |
|
|
|
"waitCountNpu": waitCountNpu, |
|
|
|
"imageCpuDescription": setting.FileNoteBook.ImageCPUDescription, |
|
|
|
"imageGpuDescription": setting.FileNoteBook.ImageGPUDescription, |
|
|
|
"imageNpuDescription": setting.FileNoteBook.ImageNPUCDDescription, |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
@@ -211,7 +211,7 @@ func GetCloudbrainTask(ctx *context.APIContext) { |
|
|
|
|
|
|
|
ID := ctx.Params(":id") |
|
|
|
|
|
|
|
job,err := cloudbrain.GetCloudBrainByIdOrJobId(ID) |
|
|
|
job, err := cloudbrain.GetCloudBrainByIdOrJobId(ID) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
ctx.NotFound(err) |
|
|
|
@@ -557,6 +557,12 @@ func ModelSafetyGetLog(ctx *context.APIContext) { |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
prefix := strings.TrimPrefix(path.Join(setting.TrainJobModelPath, job.JobName, modelarts.LogPath, job.VersionName), "/") + "/job" |
|
|
|
_, err = storage.GetObsLogFileName(prefix) |
|
|
|
canLogDownload := isCanDownloadLog(ctx, job) |
|
|
|
if err != nil { |
|
|
|
canLogDownload = false |
|
|
|
} |
|
|
|
ctx.Data["log_file_name"] = resultLogFile.LogFileList[0] |
|
|
|
ctx.JSON(http.StatusOK, map[string]interface{}{ |
|
|
|
"JobID": job.JobID, |
|
|
|
@@ -565,7 +571,7 @@ func ModelSafetyGetLog(ctx *context.APIContext) { |
|
|
|
"EndLine": result.EndLine, |
|
|
|
"Content": result.Content, |
|
|
|
"Lines": result.Lines, |
|
|
|
"CanLogDownload": isCanDownloadLog(ctx, job), |
|
|
|
"CanLogDownload": canLogDownload, |
|
|
|
"StartTime": job.StartTime, |
|
|
|
}) |
|
|
|
} |
|
|
|
|