diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index ab24be53a..590438e7f 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -243,11 +243,11 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { } repo := ctx.Repo.Repository downloadCode(repo, codePath) - uploadCodeToMinio(codePath + "/", jobName, "/code/") + uploadCodeToMinio(codePath+"/", jobName, "/code/") modelPath := setting.JobPath + jobName + cloudbrain.ModelMountPath + "/" mkModelPath(modelPath) - uploadCodeToMinio(modelPath, jobName, cloudbrain.ModelMountPath + "/") + uploadCodeToMinio(modelPath, jobName, cloudbrain.ModelMountPath+"/") benchmarkPath := setting.JobPath + jobName + cloudbrain.BenchMarkMountPath if setting.IsBenchmarkEnabled && jobType == string(models.JobTypeBenchmark) { @@ -258,30 +258,31 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { } } downloadRateCode(repo, jobName, setting.BenchmarkOwner, setting.BrainScoreName, benchmarkPath, form.BenchmarkCategory, gpuType) - uploadCodeToMinio(benchmarkPath + "/", jobName, cloudbrain.BenchMarkMountPath + "/") + uploadCodeToMinio(benchmarkPath+"/", jobName, cloudbrain.BenchMarkMountPath+"/") } snn4imagenetPath := setting.JobPath + jobName + cloudbrain.Snn4imagenetMountPath if setting.IsSnn4imagenetEnabled && jobType == string(models.JobTypeSnn4imagenet) { downloadRateCode(repo, jobName, setting.Snn4imagenetOwner, setting.Snn4imagenetName, snn4imagenetPath, "", "") - uploadCodeToMinio(snn4imagenetPath + "/", jobName, cloudbrain.Snn4imagenetMountPath + "/") + uploadCodeToMinio(snn4imagenetPath+"/", jobName, cloudbrain.Snn4imagenetMountPath+"/") } brainScorePath := setting.JobPath + jobName + cloudbrain.BrainScoreMountPath if setting.IsBrainScoreEnabled && jobType == string(models.JobTypeBrainScore) { downloadRateCode(repo, jobName, setting.BrainScoreOwner, setting.BrainScoreName, brainScorePath, "", "") - uploadCodeToMinio(brainScorePath + "/", jobName, cloudbrain.BrainScoreMountPath + "/") + uploadCodeToMinio(brainScorePath+"/", jobName, cloudbrain.BrainScoreMountPath+"/") } - err = cloudbrain.GenerateTask(ctx, jobName, image, command, uuid, codePath, getMinioPath(jobName, cloudbrain.ModelMountPath + "/"), - getMinioPath(jobName, cloudbrain.BenchMarkMountPath + "/"), getMinioPath(jobName, cloudbrain.Snn4imagenetMountPath + "/"), - getMinioPath(jobName, cloudbrain.BrainScoreMountPath + "/"), jobType, gpuQueue, resourceSpecId) + err = cloudbrain.GenerateTask(ctx, jobName, image, command, uuid, codePath, getMinioPath(jobName, cloudbrain.ModelMountPath+"/"), + getMinioPath(jobName, cloudbrain.BenchMarkMountPath+"/"), getMinioPath(jobName, cloudbrain.Snn4imagenetMountPath+"/"), + getMinioPath(jobName, cloudbrain.BrainScoreMountPath+"/"), jobType, gpuQueue, resourceSpecId) if err != nil { cloudBrainNewDataPrepare(ctx) ctx.RenderWithErr(err.Error(), tplCloudBrainNew, &form) return } - ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain") + // ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain") + ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob") } func CloudBrainShow(ctx *context.Context) { @@ -608,7 +609,7 @@ func getImages(ctx *context.Context, imageType string) { func GetModelDirs(jobName string, parentDir string) (string, error) { var req string - modelActualPath := getMinioPath(jobName, cloudbrain.ModelMountPath + "/") + modelActualPath := getMinioPath(jobName, cloudbrain.ModelMountPath+"/") if parentDir == "" { req = "baseDir=" + modelActualPath } else { diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index d4c9978f8..14c6f97f8 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -41,12 +41,20 @@ const ( ) func DebugJobIndex(ctx *context.Context) { + debugListType := ctx.Query("debugListType") MustEnableCloudbrain(ctx) repo := ctx.Repo.Repository page := ctx.QueryInt("page") if page <= 0 { page = 1 } + debugType := modelarts.DebugType + if debugListType == modelarts.GPUResource { + debugType = models.TypeCloudBrainOne + } + if debugListType == modelarts.NPUResource { + debugType = models.TypeCloudBrainTwo + } ciTasks, count, err := models.Cloudbrains(&models.CloudbrainsOptions{ ListOptions: models.ListOptions{ @@ -54,7 +62,7 @@ func DebugJobIndex(ctx *context.Context) { PageSize: setting.UI.IssuePagingNum, }, RepoID: repo.ID, - Type: modelarts.DebugType, + Type: debugType, JobType: string(models.JobTypeDebug), }) if err != nil { @@ -185,7 +193,8 @@ func NotebookCreate(ctx *context.Context, form auth.CreateModelArtsNotebookForm) return } - ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/notebook") + // ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/notebook") + ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob") } func NotebookShow(ctx *context.Context) {