Browse Source

代码走查相关修改。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.10.1^2
zouap 3 years ago
parent
commit
f8202de2d7
6 changed files with 43 additions and 59 deletions
  1. +0
    -4
      routers/api/v1/api.go
  2. +0
    -13
      routers/api/v1/repo/cloudbrain.go
  3. +5
    -0
      routers/repo/aisafety.go
  4. +0
    -3
      routers/repo/cloudbrain.go
  5. +38
    -38
      routers/repo/grampus.go
  6. +0
    -1
      routers/routes/routes.go

+ 0
- 4
routers/api/v1/api.go View File

@@ -952,10 +952,6 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Get("/:id/modelartlog", repo.TrainJobForModelConvertGetLog)
m.Get("/:id/model_list", repo.CloudBrainModelConvertList)
}, reqRepoReader(models.UnitTypeModelManage))
// m.Group("/modelsafety", func() {
// m.Get("/:id/log", repo.ModelSafetyGetLog)
// m.Get("/:id/down_log_file", repo.ModelSafetyDownloadLogFile)
// }, reqRepoReader(models.UnitTypeModelManage))
m.Group("/modelarts", func() {
m.Group("/notebook", func() {
//m.Get("/:jobid", repo.GetModelArtsNotebook)


+ 0
- 13
routers/api/v1/repo/cloudbrain.go View File

@@ -393,19 +393,6 @@ func ModelSafetyGetLog(ctx *context.APIContext) {
return
}
if job.JobType == string(models.JobTypeModelSafety) {
// if job.Type == models.TypeCloudBrainOne {
// // result, err := cloudbrain.GetJob(job.JobID)
// // existStr := ""
// // if err == nil && result != nil {
// // jobRes, _ := models.ConvertToJobResultPayload(result.Payload)
// // taskRoles := jobRes.TaskRoles
// // taskRes, _ := models.ConvertToTaskPod(taskRoles[cloudbrain.SubTaskName].(map[string]interface{}))
// // existStr = taskRes.TaskStatuses[0].ExitDiagnostics
// // }
// // ctx.Data["existStr"] = existStr
// // log.Info("existStr=" + existStr)
// // CloudbrainGetLog(ctx)
// } else
if job.Type == models.TypeCloudBrainTwo {
//TrainJobForModelConvertGetLog(ctx)
var baseLine = ctx.Query("base_line")


+ 5
- 0
routers/repo/aisafety.go View File

@@ -862,6 +862,11 @@ func createForGPU(ctx *context.Context, jobName string) error {
return errors.New("Resource specification not available")
}

if !account.IsPointBalanceEnough(ctx.User.ID, spec.UnitPrice) {
log.Error("point balance is not enough,userId=%d specId=%d ", ctx.User.ID, spec.ID)
return errors.New(ctx.Tr("points.insufficient_points_balance"))
}

repo := ctx.Repo.Repository
codePath := setting.JobPath + jobName + cloudbrain.CodeMountPath
os.RemoveAll(codePath)


+ 0
- 3
routers/repo/cloudbrain.go View File

@@ -54,9 +54,6 @@ const (
tplCloudBrainModelSafetyNewGpu base.TplName = "repo/modelsafety/newgpu"
tplCloudBrainModelSafetyNewNpu base.TplName = "repo/modelsafety/newnpu"

tplCloudBrainModelSafetyNewGrampusGpu base.TplName = "repo/modelsafety/newgrampusgpu"
tplCloudBrainModelSafetyNewGrampusNpu base.TplName = "repo/modelsafety/newgrampusnpu"

tplCloudBrainImageSubmit base.TplName = "repo/cloudbrain/image/submit"
tplCloudBrainImageEdit base.TplName = "repo/cloudbrain/image/edit"



+ 38
- 38
routers/repo/grampus.go View File

@@ -49,7 +49,7 @@ const (

func GrampusTrainJobGPUNew(ctx *context.Context) {
ctx.Data["IsCreate"] = true
err := GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
err := grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
if err != nil {
ctx.ServerError("get new train-job info failed", err)
return
@@ -60,7 +60,7 @@ func GrampusTrainJobGPUNew(ctx *context.Context) {

func GrampusTrainJobNPUNew(ctx *context.Context) {
ctx.Data["IsCreate"] = true
err := GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
err := grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
if err != nil {
ctx.ServerError("get new train-job info failed", err)
return
@@ -68,7 +68,7 @@ func GrampusTrainJobNPUNew(ctx *context.Context) {
ctx.HTML(200, tplGrampusTrainJobNPUNew)
}

func GrampusTrainJobNewDataPrepare(ctx *context.Context, processType string) error {
func grampusTrainJobNewDataPrepare(ctx *context.Context, processType string) error {
ctx.Data["PageIsCloudBrain"] = true

t := time.Now()
@@ -176,14 +176,14 @@ func GrampusTrainJobVersionNew(ctx *context.Context) {
task := ctx.Cloudbrain
ctx.Data["IsCreate"] = false
if task.ComputeResource == models.GPUResource {
err := GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
err := grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
if err != nil {
ctx.ServerError("get new train-job version info failed", err)
return
}
ctx.HTML(http.StatusOK, tplGrampusTrainJobGPUNew)
} else if task.ComputeResource == models.NPUResource {
err := GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
err := grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
if err != nil {
ctx.ServerError("get new train-job version info failed", err)
return
@@ -279,14 +279,14 @@ func grampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
isOk, err := lock.Lock(models.CloudbrainKeyDuration)
if !isOk {
log.Error("lock processed failed:%v", err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr(ctx.Tr("repo.cloudbrain_samejob_err"), tplGrampusTrainJobGPUNew, &form)
return
}
defer lock.UnLock()

if !jobNamePattern.MatchString(displayJobName) {
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr(ctx.Tr("repo.cloudbrain_jobname_err"), tpl, &form)
return
}
@@ -294,7 +294,7 @@ func grampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
bootFileExist, err := ctx.Repo.FileExists(bootFile, branchName)
if err != nil || !bootFileExist {
log.Error("Get bootfile error:", err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr(ctx.Tr("repo.cloudbrain_bootfile_err"), tpl, &form)
return
}
@@ -303,13 +303,13 @@ func grampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
count, err := models.GetGrampusCountByUserID(ctx.User.ID, string(models.JobTypeTrain), models.GPUResource)
if err != nil {
log.Error("GetGrampusCountByUserID failed:%v", err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr("system error", tpl, &form)
return
} else {
if count >= 1 {
log.Error("the user already has running or waiting task", ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr("you have already a running or waiting task, can not create more", tpl, &form)
return
}
@@ -318,7 +318,7 @@ func grampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
//check param
if err := grampusParamCheckCreateTrainJob(form); err != nil {
log.Error("paramCheckCreateTrainJob failed:(%v)", err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr(err.Error(), tpl, &form)
return
}
@@ -328,14 +328,14 @@ func grampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
if err == nil {
if len(tasks) != 0 {
log.Error("the job name did already exist", ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr("the job name did already exist", tpl, &form)
return
}
} else {
if !models.IsErrJobNotExist(err) {
log.Error("system error, %v", err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr("system error", tpl, &form)
return
}
@@ -348,14 +348,14 @@ func grampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
Cluster: models.C2NetCluster,
})
if err != nil || spec == nil {
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr("Resource specification not available", tpl, &form)
return
}

if !account.IsPointBalanceEnough(ctx.User.ID, spec.UnitPrice) {
log.Error("point balance is not enough,userId=%d specId=%d", ctx.User.ID, spec.ID)
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr(ctx.Tr("points.insufficient_points_balance"), tplGrampusTrainJobGPUNew, &form)
return
}
@@ -365,7 +365,7 @@ func grampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
datasetInfos, datasetNames, err := models.GetDatasetInfo(uuid, models.GPU)
if err != nil {
log.Error("GetDatasetInfo failed: %v", err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr(ctx.Tr("cloudbrain.error.dataset_select"), tpl, &form)
return
}
@@ -378,7 +378,7 @@ func grampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrain

if err := downloadZipCode(ctx, codeLocalPath, branchName); err != nil {
log.Error("downloadZipCode failed, server timed out: %s (%v)", repo.FullName(), err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr(ctx.Tr("cloudbrain.load_code_failed"), tpl, &form)
return
}
@@ -387,7 +387,7 @@ func grampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
//upload code
if err := uploadCodeToMinio(codeLocalPath+"/", jobName, cloudbrain.CodeMountPath+"/"); err != nil {
log.Error("Failed to uploadCodeToMinio: %s (%v)", repo.FullName(), err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr(ctx.Tr("cloudbrain.load_code_failed"), tpl, &form)
return
}
@@ -395,7 +395,7 @@ func grampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
modelPath := setting.JobPath + jobName + cloudbrain.ModelMountPath + "/"
if err := mkModelPath(modelPath); err != nil {
log.Error("Failed to mkModelPath: %s (%v)", repo.FullName(), err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr(ctx.Tr("cloudbrain.load_code_failed"), tpl, &form)
return
}
@@ -403,7 +403,7 @@ func grampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
//init model readme
if err := uploadCodeToMinio(modelPath, jobName, cloudbrain.ModelMountPath+"/"); err != nil {
log.Error("Failed to uploadCodeToMinio: %s (%v)", repo.FullName(), err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr(ctx.Tr("cloudbrain.load_code_failed"), tpl, &form)
return
}
@@ -426,7 +426,7 @@ func grampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
command, err := generateCommand(repo.Name, grampus.ProcessorTypeGPU, codeMinioPath+cloudbrain.DefaultBranchName+".zip", datasetRemotePath, bootFile, params, setting.CBCodePathPrefix+jobName+cloudbrain.ModelMountPath+"/", allFileName, preTrainModelPath, form.CkptName)
if err != nil {
log.Error("Failed to generateCommand: %s (%v)", displayJobName, err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr("Create task failed, internal error", tpl, &form)
return
}
@@ -468,7 +468,7 @@ func grampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
err = grampus.GenerateTrainJob(ctx, req)
if err != nil {
log.Error("GenerateTrainJob failed:%v", err.Error(), ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU)
ctx.RenderWithErr(err.Error(), tpl, &form)
return
}
@@ -549,14 +549,14 @@ func grampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
isOk, err := lock.Lock(models.CloudbrainKeyDuration)
if !isOk {
log.Error("lock processed failed:%v", err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
ctx.RenderWithErr(ctx.Tr("repo.cloudbrain_samejob_err"), tplGrampusTrainJobNPUNew, &form)
return
}
defer lock.UnLock()

if !jobNamePattern.MatchString(displayJobName) {
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
ctx.RenderWithErr(ctx.Tr("repo.cloudbrain_jobname_err"), tpl, &form)
return
}
@@ -564,7 +564,7 @@ func grampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
bootFileExist, err := ctx.Repo.FileExists(bootFile, branchName)
if err != nil || !bootFileExist {
log.Error("Get bootfile error:", err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
ctx.RenderWithErr(ctx.Tr("repo.cloudbrain_bootfile_err"), tpl, &form)
return
}
@@ -573,13 +573,13 @@ func grampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
count, err := models.GetGrampusCountByUserID(ctx.User.ID, string(models.JobTypeTrain), models.NPUResource)
if err != nil {
log.Error("GetGrampusCountByUserID failed:%v", err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
ctx.RenderWithErr("system error", tpl, &form)
return
} else {
if count >= 1 {
log.Error("the user already has running or waiting task", ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
ctx.RenderWithErr("you have already a running or waiting task, can not create more", tpl, &form)
return
}
@@ -588,7 +588,7 @@ func grampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
//check param
if err := grampusParamCheckCreateTrainJob(form); err != nil {
log.Error("paramCheckCreateTrainJob failed:(%v)", err)
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
ctx.RenderWithErr(err.Error(), tpl, &form)
return
}
@@ -598,14 +598,14 @@ func grampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
if err == nil {
if len(tasks) != 0 {
log.Error("the job name did already exist", ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
ctx.RenderWithErr("the job name did already exist", tpl, &form)
return
}
} else {
if !models.IsErrJobNotExist(err) {
log.Error("system error, %v", err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
ctx.RenderWithErr("system error", tpl, &form)
return
}
@@ -618,13 +618,13 @@ func grampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
Cluster: models.C2NetCluster,
})
if err != nil || spec == nil {
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
ctx.RenderWithErr("Resource specification not available", tpl, &form)
return
}
if !account.IsPointBalanceEnough(ctx.User.ID, spec.UnitPrice) {
log.Error("point balance is not enough,userId=%d specId=%d", ctx.User.ID, spec.ID)
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
ctx.RenderWithErr(ctx.Tr("points.insufficient_points_balance"), tplGrampusTrainJobNPUNew, &form)
return
}
@@ -633,7 +633,7 @@ func grampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
datasetInfos, datasetNames, err := models.GetDatasetInfo(uuid, models.NPU)
if err != nil {
log.Error("GetDatasetInfo failed: %v", err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
ctx.RenderWithErr(ctx.Tr("cloudbrain.error.dataset_select"), tpl, &form)
return
}
@@ -646,7 +646,7 @@ func grampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain

if err := downloadZipCode(ctx, codeLocalPath, branchName); err != nil {
log.Error("downloadZipCode failed, server timed out: %s (%v)", repo.FullName(), err)
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
ctx.RenderWithErr(ctx.Tr("cloudbrain.load_code_failed"), tpl, &form)
return
}
@@ -654,14 +654,14 @@ func grampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
//todo: upload code (send to file_server todo this work?)
if err := obsMkdir(setting.CodePathPrefix + jobName + modelarts.OutputPath); err != nil {
log.Error("Failed to obsMkdir_output: %s (%v)", repo.FullName(), err)
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
ctx.RenderWithErr(ctx.Tr("cloudbrain.load_code_failed"), tpl, &form)
return
}

if err := uploadCodeToObs(codeLocalPath, jobName, ""); err != nil {
log.Error("Failed to uploadCodeToObs: %s (%v)", repo.FullName(), err)
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
ctx.RenderWithErr(ctx.Tr("cloudbrain.load_code_failed"), tpl, &form)
return
}
@@ -683,7 +683,7 @@ func grampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
command, err := generateCommand(repo.Name, grampus.ProcessorTypeNPU, codeObsPath+cloudbrain.DefaultBranchName+".zip", datasetRemotePath, bootFile, params, setting.CodePathPrefix+jobName+modelarts.OutputPath, allFileName, preTrainModelPath, form.CkptName)
if err != nil {
log.Error("Failed to generateCommand: %s (%v)", displayJobName, err, ctx.Data["MsgID"])
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
ctx.RenderWithErr("Create task failed, internal error", tpl, &form)
return
}
@@ -727,7 +727,7 @@ func grampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
err = grampus.GenerateTrainJob(ctx, req)
if err != nil {
log.Error("GenerateTrainJob failed:%v", err.Error())
GrampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU)
ctx.RenderWithErr(err.Error(), tpl, &form)
return
}


+ 0
- 1
routers/routes/routes.go View File

@@ -1149,7 +1149,6 @@ func RegisterRoutes(m *macaron.Macaron) {
})
m.Get("/create", reqWechatBind, reqRepoCloudBrainWriter, context.PointAccount(), repo.CloudBrainBenchmarkNew)
m.Post("/create", reqWechatBind, reqRepoCloudBrainWriter, bindIgnErr(auth.CreateCloudBrainForm{}), repo.CloudBrainBenchmarkCreate)
m.Get("/create_safetytask_test", repo.CloudBrainAiSafetyCreateTest)
m.Get("/get_child_types", repo.GetChildTypes)
})



Loading…
Cancel
Save