|
|
@@ -243,11 +243,11 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { |
|
|
} |
|
|
} |
|
|
repo := ctx.Repo.Repository |
|
|
repo := ctx.Repo.Repository |
|
|
downloadCode(repo, codePath) |
|
|
downloadCode(repo, codePath) |
|
|
uploadCodeToMinio(codePath + "/", jobName, "/code/") |
|
|
|
|
|
|
|
|
uploadCodeToMinio(codePath+"/", jobName, "/code/") |
|
|
|
|
|
|
|
|
modelPath := setting.JobPath + jobName + cloudbrain.ModelMountPath + "/" |
|
|
modelPath := setting.JobPath + jobName + cloudbrain.ModelMountPath + "/" |
|
|
mkModelPath(modelPath) |
|
|
mkModelPath(modelPath) |
|
|
uploadCodeToMinio(modelPath, jobName, cloudbrain.ModelMountPath + "/") |
|
|
|
|
|
|
|
|
uploadCodeToMinio(modelPath, jobName, cloudbrain.ModelMountPath+"/") |
|
|
|
|
|
|
|
|
benchmarkPath := setting.JobPath + jobName + cloudbrain.BenchMarkMountPath |
|
|
benchmarkPath := setting.JobPath + jobName + cloudbrain.BenchMarkMountPath |
|
|
if setting.IsBenchmarkEnabled && jobType == string(models.JobTypeBenchmark) { |
|
|
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) |
|
|
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 |
|
|
snn4imagenetPath := setting.JobPath + jobName + cloudbrain.Snn4imagenetMountPath |
|
|
if setting.IsSnn4imagenetEnabled && jobType == string(models.JobTypeSnn4imagenet) { |
|
|
if setting.IsSnn4imagenetEnabled && jobType == string(models.JobTypeSnn4imagenet) { |
|
|
downloadRateCode(repo, jobName, setting.Snn4imagenetOwner, setting.Snn4imagenetName, snn4imagenetPath, "", "") |
|
|
downloadRateCode(repo, jobName, setting.Snn4imagenetOwner, setting.Snn4imagenetName, snn4imagenetPath, "", "") |
|
|
uploadCodeToMinio(snn4imagenetPath + "/", jobName, cloudbrain.Snn4imagenetMountPath + "/") |
|
|
|
|
|
|
|
|
uploadCodeToMinio(snn4imagenetPath+"/", jobName, cloudbrain.Snn4imagenetMountPath+"/") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
brainScorePath := setting.JobPath + jobName + cloudbrain.BrainScoreMountPath |
|
|
brainScorePath := setting.JobPath + jobName + cloudbrain.BrainScoreMountPath |
|
|
if setting.IsBrainScoreEnabled && jobType == string(models.JobTypeBrainScore) { |
|
|
if setting.IsBrainScoreEnabled && jobType == string(models.JobTypeBrainScore) { |
|
|
downloadRateCode(repo, jobName, setting.BrainScoreOwner, setting.BrainScoreName, brainScorePath, "", "") |
|
|
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 { |
|
|
if err != nil { |
|
|
cloudBrainNewDataPrepare(ctx) |
|
|
cloudBrainNewDataPrepare(ctx) |
|
|
ctx.RenderWithErr(err.Error(), tplCloudBrainNew, &form) |
|
|
ctx.RenderWithErr(err.Error(), tplCloudBrainNew, &form) |
|
|
return |
|
|
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) { |
|
|
func CloudBrainShow(ctx *context.Context) { |
|
|
@@ -608,7 +609,7 @@ func getImages(ctx *context.Context, imageType string) { |
|
|
|
|
|
|
|
|
func GetModelDirs(jobName string, parentDir string) (string, error) { |
|
|
func GetModelDirs(jobName string, parentDir string) (string, error) { |
|
|
var req string |
|
|
var req string |
|
|
modelActualPath := getMinioPath(jobName, cloudbrain.ModelMountPath + "/") |
|
|
|
|
|
|
|
|
modelActualPath := getMinioPath(jobName, cloudbrain.ModelMountPath+"/") |
|
|
if parentDir == "" { |
|
|
if parentDir == "" { |
|
|
req = "baseDir=" + modelActualPath |
|
|
req = "baseDir=" + modelActualPath |
|
|
} else { |
|
|
} else { |
|
|
|