From 6ca210784a06727620177c768012bca7f7eb6068 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Thu, 23 Jun 2022 19:36:32 +0800 Subject: [PATCH] boot file --- routers/repo/grampus.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/routers/repo/grampus.go b/routers/repo/grampus.go index 2c3d76a09..066f29585 100755 --- a/routers/repo/grampus.go +++ b/routers/repo/grampus.go @@ -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