|
|
@@ -1027,10 +1027,8 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) |
|
|
|
gitRepo, _ := git.OpenRepository(repo.RepoPath()) |
|
|
|
commitID, _ := gitRepo.GetBranchCommitID(branch_name) |
|
|
|
|
|
|
|
if err := git.Clone(repo.RepoPath(), codeLocalPath, git.CloneRepoOptions{ |
|
|
|
Branch: branch_name, |
|
|
|
}); err != nil { |
|
|
|
log.Error("Create task failed, server timed out: %s (%v)", repo.FullName(), err) |
|
|
|
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) |
|
|
|
return |
|
|
@@ -1245,9 +1243,7 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ |
|
|
|
|
|
|
|
gitRepo, _ := git.OpenRepository(repo.RepoPath()) |
|
|
|
commitID, _ := gitRepo.GetBranchCommitID(branch_name) |
|
|
|
if err := git.Clone(repo.RepoPath(), codeLocalPath, git.CloneRepoOptions{ |
|
|
|
Branch: branch_name, |
|
|
|
}); err != nil { |
|
|
|
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) |
|
|
@@ -1874,9 +1870,7 @@ func InferenceJobCreate(ctx *context.Context, form auth.CreateModelArtsInference |
|
|
|
gitRepo, _ := git.OpenRepository(repo.RepoPath()) |
|
|
|
commitID, _ := gitRepo.GetBranchCommitID(branch_name) |
|
|
|
|
|
|
|
if err := git.Clone(repo.RepoPath(), codeLocalPath, git.CloneRepoOptions{ |
|
|
|
Branch: branch_name, |
|
|
|
}); err != nil { |
|
|
|
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) |
|
|
|