Browse Source

boot file

tags/v1.22.6.2
lewis 3 years ago
parent
commit
6ca210784a
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      routers/repo/grampus.go

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

@@ -93,7 +93,7 @@ func grampusTrainJobNewDataPrepare(ctx *context.Context, processType string) err
}

func grampusParamCheckCreateTrainJob(form auth.CreateGrampusTrainJobForm) error {
if !strings.HasSuffix(form.BootFile, ".py") {
if !strings.HasSuffix(strings.TrimSpace(form.BootFile), ".py") {
log.Error("the boot file(%s) must be a python file", form.BootFile)
return errors.New("启动文件必须是python文件")
}
@@ -111,7 +111,7 @@ func GrampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
jobName := util.ConvertDisplayJobNameToJobName(displayJobName)
uuid := form.Attachment
description := form.Description
bootFile := form.BootFile
bootFile := strings.TrimSpace(form.BootFile)
params := form.Params
repo := ctx.Repo.Repository
codeLocalPath := setting.JobPath + jobName + cloudbrain.CodeMountPath + "/"
@@ -262,7 +262,7 @@ func GrampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain
jobName := util.ConvertDisplayJobNameToJobName(displayJobName)
uuid := form.Attachment
description := form.Description
bootFile := form.BootFile
bootFile := strings.TrimSpace(form.BootFile)
params := form.Params
repo := ctx.Repo.Repository
codeLocalPath := setting.JobPath + jobName + modelarts.CodePath


Loading…
Cancel
Save