Browse Source

云脑二的分支错误的提示信息修改,改成统一的提示。智算网络分支处理的代码问题修改(会出现内部错误)

tags/v1.22.8.1^2
ychao_1983 3 years ago
parent
commit
4c6d4dbd46
2 changed files with 9 additions and 6 deletions
  1. +3
    -0
      routers/repo/grampus.go
  2. +6
    -6
      routers/repo/modelarts.go

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

@@ -840,6 +840,9 @@ func downloadZipCode(ctx *context.Context, codePath, branchName string) error {
log.Error("GetBranchCommit failed:" + err.Error())
return err
}
} else {
log.Error("the branch is not exist: " + branchName)
return fmt.Errorf("The branch does not exist.")
}

archivePath = path.Join(archivePath, grampus.CodeArchiveName)


+ 6
- 6
routers/repo/modelarts.go View File

@@ -1147,7 +1147,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm)
if err := downloadCode(repo, codeLocalPath, branch_name); err != nil {
log.Error("downloadCode failed, server timed out: %s (%v)", repo.FullName(), err)
trainJobErrorNewDataPrepare(ctx, form)
ctx.RenderWithErr("Create task failed, server timed out", tplModelArtsTrainJobNew, &form)
ctx.RenderWithErr(ctx.Tr("cloudbrain.load_code_failed"), tplModelArtsTrainJobNew, &form)
return
}

@@ -1171,7 +1171,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm)
// if err := uploadCodeToObs(codeLocalPath, jobName, parentDir); err != nil {
log.Error("Failed to uploadCodeToObs: %s (%v)", repo.FullName(), err)
trainJobErrorNewDataPrepare(ctx, form)
ctx.RenderWithErr("Failed to uploadCodeToObs", tplModelArtsTrainJobNew, &form)
ctx.RenderWithErr(ctx.Tr("cloudbrain.load_code_failed"), tplModelArtsTrainJobNew, &form)
return
}

@@ -1426,7 +1426,7 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ
if err := downloadCode(repo, codeLocalPath, branch_name); err != nil {
log.Error("Failed git clone repo to local(!: %s (%v)", repo.FullName(), err)
versionErrorDataPrepare(ctx, form)
ctx.RenderWithErr("Failed git clone repo to local!", tplModelArtsTrainJobVersionNew, &form)
ctx.RenderWithErr(ctx.Tr("cloudbrain.load_code_failed"), tplModelArtsTrainJobVersionNew, &form)
return
}

@@ -1451,7 +1451,7 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ
if err := uploadCodeToObs(codeLocalPath, jobName, parentDir); err != nil {
log.Error("Failed to uploadCodeToObs: %s (%v)", repo.FullName(), err)
versionErrorDataPrepare(ctx, form)
ctx.RenderWithErr("Failed to uploadCodeToObs", tplModelArtsTrainJobVersionNew, &form)
ctx.RenderWithErr(ctx.Tr("cloudbrain.load_code_failed"), tplModelArtsTrainJobVersionNew, &form)
return
}

@@ -2090,7 +2090,7 @@ func InferenceJobCreate(ctx *context.Context, form auth.CreateModelArtsInference
if err := downloadCode(repo, codeLocalPath, branch_name); err != nil {
log.Error("Create task failed, server timed out: %s (%v)", repo.FullName(), err)
inferenceJobErrorNewDataPrepare(ctx, form)
ctx.RenderWithErr("Create task failed, server timed out", tplModelArtsInferenceJobNew, &form)
ctx.RenderWithErr(ctx.Tr("cloudbrain.load_code_failed"), tplModelArtsInferenceJobNew, &form)
return
}

@@ -2112,7 +2112,7 @@ func InferenceJobCreate(ctx *context.Context, form auth.CreateModelArtsInference
if err := uploadCodeToObs(codeLocalPath, jobName, ""); err != nil {
log.Error("Failed to uploadCodeToObs: %s (%v)", repo.FullName(), err)
inferenceJobErrorNewDataPrepare(ctx, form)
ctx.RenderWithErr("Failed to uploadCodeToObs", tplModelArtsInferenceJobNew, &form)
ctx.RenderWithErr(ctx.Tr("cloudbrain.load_code_failed"), tplModelArtsInferenceJobNew, &form)
return
}



Loading…
Cancel
Save