From af7a63a19824d425ba4a1b0631e5cba10b10cc93 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 28 Jul 2022 09:15:11 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- modules/cloudbrain/cloudbrain.go | 40 ++++++++++--------- routers/repo/user_data_analysis.go | 2 +- .../js/components/dataset/selectDataset.vue | 2 +- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/modules/cloudbrain/cloudbrain.go b/modules/cloudbrain/cloudbrain.go index e09937df3..1872375da 100755 --- a/modules/cloudbrain/cloudbrain.go +++ b/modules/cloudbrain/cloudbrain.go @@ -466,11 +466,14 @@ func RestartTask(ctx *context.Context, task *models.Cloudbrain, newID *string) e log.Error("no such resourceSpecId(%d)", task.ResourceSpecId, ctx.Data["MsgID"]) return errors.New("no such resourceSpec") } - - datasetInfos, _, err := models.GetDatasetInfo(task.Uuid) - if err != nil { - log.Error("GetDatasetInfo failed:%v", err, ctx.Data["MsgID"]) - return err + var datasetInfos map[string]models.DatasetInfo + if task.Uuid != "" { + var err error + datasetInfos, _, err = models.GetDatasetInfo(task.Uuid) + if err != nil { + log.Error("GetDatasetInfo failed:%v", err, ctx.Data["MsgID"]) + return err + } } volumes := []models.Volume{ @@ -510,24 +513,25 @@ func RestartTask(ctx *context.Context, task *models.Cloudbrain, newID *string) e }, }, } - - if len(datasetInfos) == 1 { - volumes = append(volumes, models.Volume{ - HostPath: models.StHostPath{ - Path: datasetInfos[task.Uuid].DataLocalPath, - MountPath: DataSetMountPath, - ReadOnly: true, - }, - }) - } else { - for _, dataset := range datasetInfos { + if datasetInfos != nil { + if len(datasetInfos) == 1 { volumes = append(volumes, models.Volume{ HostPath: models.StHostPath{ - Path: dataset.DataLocalPath, - MountPath: DataSetMountPath + "/" + dataset.Name, + Path: datasetInfos[task.Uuid].DataLocalPath, + MountPath: DataSetMountPath, ReadOnly: true, }, }) + } else { + for _, dataset := range datasetInfos { + volumes = append(volumes, models.Volume{ + HostPath: models.StHostPath{ + Path: dataset.DataLocalPath, + MountPath: DataSetMountPath + "/" + dataset.Name, + ReadOnly: true, + }, + }) + } } } diff --git a/routers/repo/user_data_analysis.go b/routers/repo/user_data_analysis.go index 9063e0458..508addf75 100755 --- a/routers/repo/user_data_analysis.go +++ b/routers/repo/user_data_analysis.go @@ -896,7 +896,7 @@ func QueryUserLoginInfo(ctx *context.Context) { xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userLogin.IpAddr) tmp = tmp + 1 formatTime := userLogin.CreatedUnix.Format("2006-01-02 15:04:05") - xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, formatTime[0:len(formatTime)-3]) + xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, formatTime) } //设置默认打开的表单 xlsx.SetActiveSheet(index) diff --git a/web_src/js/components/dataset/selectDataset.vue b/web_src/js/components/dataset/selectDataset.vue index 3596fea1f..cfc1cdd81 100755 --- a/web_src/js/components/dataset/selectDataset.vue +++ b/web_src/js/components/dataset/selectDataset.vue @@ -956,7 +956,7 @@ export default { this.benchmarkNew = true; } if (location.href.indexOf("modelarts/notebook/create") !== -1 || location.href.indexOf("/cloudbrain/create") !== -1) { - console.log("required is false;"); + //console.log("required is false;"); this.required = false; } window.onresize = () => { From 29d0762246094b8aba9d57cd8ed647da74f6cb87 Mon Sep 17 00:00:00 2001 From: chenshihai Date: Thu, 28 Jul 2022 09:25:03 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=B1fix=20#1345?= =?UTF-8?q?=E5=BC=95=E5=85=A5=E7=9A=84=E8=A1=A8=E5=8D=95=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/repo/cloudbrain/inference/new.tmpl | 3 ++- templates/repo/cloudbrain/trainjob/new.tmpl | 3 ++- templates/repo/grampus/trainjob/gpu/new.tmpl | 3 ++- templates/repo/grampus/trainjob/npu/new.tmpl | 3 ++- templates/repo/modelarts/inferencejob/new.tmpl | 3 ++- templates/repo/modelarts/trainjob/new.tmpl | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/templates/repo/cloudbrain/inference/new.tmpl b/templates/repo/cloudbrain/inference/new.tmpl index b27ea0558..d4fa4c535 100644 --- a/templates/repo/cloudbrain/inference/new.tmpl +++ b/templates/repo/cloudbrain/inference/new.tmpl @@ -497,6 +497,7 @@ } validate(); $('.ui.create_train_job.green.button').click(function(e) { - send_run_para() + send_run_para(); + validate(); }) diff --git a/templates/repo/cloudbrain/trainjob/new.tmpl b/templates/repo/cloudbrain/trainjob/new.tmpl index c22287d03..3a6bc0e0e 100755 --- a/templates/repo/cloudbrain/trainjob/new.tmpl +++ b/templates/repo/cloudbrain/trainjob/new.tmpl @@ -499,6 +499,7 @@ } validate(); $('.ui.create_train_job.green.button').click(function (e) { - send_run_para() + send_run_para(); + validate(); }) \ No newline at end of file diff --git a/templates/repo/grampus/trainjob/gpu/new.tmpl b/templates/repo/grampus/trainjob/gpu/new.tmpl index ee0ceb84a..85fc1ef67 100755 --- a/templates/repo/grampus/trainjob/gpu/new.tmpl +++ b/templates/repo/grampus/trainjob/gpu/new.tmpl @@ -446,6 +446,7 @@ } validate(); $('.ui.create_train_job.green.button').click(function(e) { - send_run_para() + send_run_para(); + validate(); }) \ No newline at end of file diff --git a/templates/repo/grampus/trainjob/npu/new.tmpl b/templates/repo/grampus/trainjob/npu/new.tmpl index 0397d07f6..612c61833 100755 --- a/templates/repo/grampus/trainjob/npu/new.tmpl +++ b/templates/repo/grampus/trainjob/npu/new.tmpl @@ -478,6 +478,7 @@ validate(); $('.ui.create_train_job.green.button').click(function(e) { get_name() - send_run_para() + send_run_para(); + validate(); }) diff --git a/templates/repo/modelarts/inferencejob/new.tmpl b/templates/repo/modelarts/inferencejob/new.tmpl index 419981c58..3ab25fba9 100644 --- a/templates/repo/modelarts/inferencejob/new.tmpl +++ b/templates/repo/modelarts/inferencejob/new.tmpl @@ -522,6 +522,7 @@ validate(); $('.ui.create_train_job.green.button').click(function(e) { send_run_para() - get_name() + get_name(); + validate(); }) diff --git a/templates/repo/modelarts/trainjob/new.tmpl b/templates/repo/modelarts/trainjob/new.tmpl index 770e2df89..081d39f70 100755 --- a/templates/repo/modelarts/trainjob/new.tmpl +++ b/templates/repo/modelarts/trainjob/new.tmpl @@ -531,6 +531,7 @@ validate(); $('.ui.create_train_job.green.button').click(function (e) { get_name() - send_run_para() + send_run_para(); + validate(); }) \ No newline at end of file From a7c55788f4bb21f7097a4e2896bff29acbb88d35 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 28 Jul 2022 09:25:22 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- web_src/js/components/dataset/selectDataset.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/web_src/js/components/dataset/selectDataset.vue b/web_src/js/components/dataset/selectDataset.vue index cfc1cdd81..78d44f775 100755 --- a/web_src/js/components/dataset/selectDataset.vue +++ b/web_src/js/components/dataset/selectDataset.vue @@ -956,7 +956,6 @@ export default { this.benchmarkNew = true; } if (location.href.indexOf("modelarts/notebook/create") !== -1 || location.href.indexOf("/cloudbrain/create") !== -1) { - //console.log("required is false;"); this.required = false; } window.onresize = () => { From da9137d638bca9f136012ebeea13aa1ab906ca52 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Thu, 28 Jul 2022 09:53:32 +0800 Subject: [PATCH 4/4] fix-1358 --- routers/routes/routes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/routes/routes.go b/routers/routes/routes.go index f917aebf1..03b53c5cd 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -1136,7 +1136,7 @@ func RegisterRoutes(m *macaron.Macaron) { }) }, context.RepoRef()) m.Group("/modelmanage", func() { - m.Post("/create_model", reqRepoModelManageWriter, repo.SaveModel) + m.Post("/create_model", repo.SaveModel) m.Post("/create_model_convert", reqRepoModelManageWriter, repo.SaveModelConvert) m.Post("/create_new_model", repo.SaveNewNameModel) m.Delete("/delete_model", repo.DeleteModel)