|
|
@@ -168,11 +168,24 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { |
|
|
|
ctx.RenderWithErr("jobtype error", tplCloudBrainNew, &form) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
_, err := models.GetCloudbrainByName(jobName) |
|
|
|
if err == nil { |
|
|
|
log.Error("the job name did already exist", ctx.Data["MsgID"]) |
|
|
|
ctx.RenderWithErr("the job name did already exist", tplCloudBrainNew, &form) |
|
|
|
return |
|
|
|
} else { |
|
|
|
if !models.IsErrJobNotExist(err) { |
|
|
|
log.Error("system error, %v", err, ctx.Data["MsgID"]) |
|
|
|
ctx.RenderWithErr("system error", tplCloudBrainNew, &form) |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
repo := ctx.Repo.Repository |
|
|
|
downloadCode(repo, codePath) |
|
|
|
|
|
|
|
modelPath := setting.JobPath + jobName + cloudbrain.ModelMountPath |
|
|
|
err := os.MkdirAll(modelPath, os.ModePerm) |
|
|
|
err = os.MkdirAll(modelPath, os.ModePerm) |
|
|
|
if err != nil { |
|
|
|
ctx.RenderWithErr(err.Error(), tplCloudBrainNew, &form) |
|
|
|
return |
|
|
|