From d2379a7c96758ea5d4838309f6c599d680741fda Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Thu, 13 Jan 2022 15:46:21 +0800 Subject: [PATCH 001/105] fix bug: task count --- models/cloudbrain.go | 4 ++-- modules/cloudbrain/cloudbrain.go | 5 ++++- routers/repo/cloudbrain.go | 19 +++++++++++++++---- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/models/cloudbrain.go b/models/cloudbrain.go index efaa9ffeb..713729a28 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -1194,8 +1194,8 @@ func GetCloudBrainUnStoppedJob() ([]*Cloudbrain, error) { Find(&cloudbrains) } -func GetCloudbrainCountByUserID(userID int64) (int, error) { - count, err := x.In("status", JobWaiting, JobRunning).And("job_type = ? and user_id = ? and type = ?", JobTypeDebug, userID, TypeCloudBrainOne).Count(new(Cloudbrain)) +func GetCloudbrainCountByUserID(userID int64, jobType string) (int, error) { + count, err := x.In("status", JobWaiting, JobRunning).And("job_type = ? and user_id = ? and type = ?", jobType, userID, TypeCloudBrainOne).Count(new(Cloudbrain)) return int(count), err } diff --git a/modules/cloudbrain/cloudbrain.go b/modules/cloudbrain/cloudbrain.go index 74dcbe7b0..397ff3842 100755 --- a/modules/cloudbrain/cloudbrain.go +++ b/modules/cloudbrain/cloudbrain.go @@ -14,7 +14,10 @@ import ( ) const ( - Command = `pip3 install jupyterlab==2.2.5 -i https://pypi.tuna.tsinghua.edu.cn/simple;service ssh stop;jupyter lab --no-browser --ip=0.0.0.0 --allow-root --notebook-dir="/code" --port=80 --LabApp.token="" --LabApp.allow_origin="self https://cloudbrain.pcl.ac.cn"` + Command = `pip3 install jupyterlab==2.2.5 -i https://pypi.tuna.tsinghua.edu.cn/simple; + service ssh stop; + jupyter lab --no-browser --ip=0.0.0.0 --allow-root --notebook-dir="/code" --port=80 --LabApp.token="" --LabApp.allow_origin="self https://cloudbrain.pcl.ac.cn"` + CommandBenchmark = `echo "begin";python /code/test.py` CodeMountPath = "/code" DataSetMountPath = "/dataset" ModelMountPath = "/model" diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index ca1d08101..0ea750fdd 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -155,7 +155,6 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { ctx.Data["PageIsCloudBrain"] = true jobName := form.JobName image := form.Image - command := form.Command uuid := form.Attachment jobType := form.JobType gpuQueue := form.GpuType @@ -174,7 +173,14 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { return } - count, err := models.GetCloudbrainCountByUserID(ctx.User.ID) + var command string + if jobType == string(models.JobTypeBenchmark) { + command = cloudbrain.CommandBenchmark + } else { + command = cloudbrain.Command + } + + count, err := models.GetCloudbrainCountByUserID(ctx.User.ID, jobType) if err != nil { log.Error("GetCloudbrainCountByUserID failed:%v", err, ctx.Data["MsgID"]) cloudBrainNewDataPrepare(ctx) @@ -244,7 +250,12 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { ctx.RenderWithErr(err.Error(), tplCloudBrainNew, &form) return } - ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=all") + + if jobType == string(models.JobTypeBenchmark) { + ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=all") + } else { + ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=all") + } } func CloudBrainRestart(ctx *context.Context) { @@ -276,7 +287,7 @@ func CloudBrainRestart(ctx *context.Context) { break } - count, err := models.GetCloudbrainCountByUserID(ctx.User.ID) + count, err := models.GetCloudbrainCountByUserID(ctx.User.ID, string(models.JobTypeDebug)) if err != nil { log.Error("GetCloudbrainCountByUserID failed:%v", err, ctx.Data["MsgID"]) resultCode = "-1" From 0af40b880773f9b1d9803ae6cd96d392d9e30d09 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 13 Jan 2022 16:39:57 +0800 Subject: [PATCH 002/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=84=E6=B5=8B?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- options/locale/locale_en-US.ini | 2 + options/locale/locale_zh-CN.ini | 2 + .../repo/cloudbrain/benchmark/index.tmpl | 361 ++++++++++++++++++ templates/repo/debugjob/index.tmpl | 1 + 4 files changed, 366 insertions(+) create mode 100644 templates/repo/cloudbrain/benchmark/index.tmpl diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 21890babe..973ec0a5d 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -927,6 +927,8 @@ modelarts.back=Back modelarts.train_job_para_admin=train_job_para_admin modelarts.train_job_para.edit=train_job_para.edit modelarts.train_job_para.connfirm=train_job_para.connfirm +modelarts.evaluate_job=Model Evaluation +modelarts.evaluate_job.new_job=New Model Evaluation model.manage.import_new_model=Import New Model model.manage.create_error=Equal Name and Version has existed. diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 6dd44d848..20e979f70 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -938,6 +938,8 @@ modelarts.back=返回 modelarts.train_job_para_admin=任务参数管理 modelarts.train_job_para.edit=编辑 modelarts.train_job_para.connfirm=确定 +modelarts.evaluate_job=评测任务 +modelarts.evaluate_job.new_job=创建评测任务 model.manage.import_new_model=导入新模型 model.manage.create_error=相同的名称和版本的模型已经存在。 diff --git a/templates/repo/cloudbrain/benchmark/index.tmpl b/templates/repo/cloudbrain/benchmark/index.tmpl new file mode 100644 index 000000000..13cfc6e4c --- /dev/null +++ b/templates/repo/cloudbrain/benchmark/index.tmpl @@ -0,0 +1,361 @@ + +{{template "base/head" .}} + + + + +
+
+
+
+
+
+
+
+
+ + +
+ +
+ {{template "repo/header" .}} + +
+ {{template "base/alert" .}} + + {{if eq 0 (len .Tasks)}} +
+
+
未创建过评测任务
+
+ {{if $.RepoIsEmpty}} +
代码版本:您还没有初始化代码仓库,请先创建代码版本;
+ {{end}} +
使用说明:可以参考启智AI协作平台小白训练营课程。
+
+
+ {{else}} + +
+
+
+ +
+ + +
+
+
+ {{$.i18n.Tr "repo.cloudbrain_task"}} +
+
+ {{$.i18n.Tr "repo.modelarts.version_nums"}} +
+
+ {{$.i18n.Tr "repo.modelarts.status"}} +
+
+ {{$.i18n.Tr "repo.modelarts.createtime"}} +
+
+ {{$.i18n.Tr "repo.cloudbrain_status_runtime"}} +
+
+ {{$.i18n.Tr "repo.modelarts.computing_resources"}} +
+
+ {{$.i18n.Tr "repo.cloudbrain_creator"}} +
+
+ {{$.i18n.Tr "repo.cloudbrain_operate"}} +
+
+
+ + {{range .Tasks}} +
+
+ + + + +
+ {{.VersionCount}} +
+ +
+ + {{.Status}} + +
+ +
+ {{TimeSinceUnix .Cloudbrain.CreatedUnix $.Lang}} +
+ +
+ {{.TrainJobDuration}} +
+ +
+ {{.ComputeResource}} +
+ +
+ {{if .User.Name}} + + {{else}} + + {{end}} +
+ +
+ +
+ {{$.CsrfTokenHtml}} + {{if .CanDel}} + + {{$.i18n.Tr "repo.stop"}} + + {{else}} + + {{$.i18n.Tr "repo.stop"}} + + {{end}} + +
+ +
+ {{$.CsrfTokenHtml}} + {{if .CanDel}} + + {{$.i18n.Tr "repo.delete"}} + + {{else}} + + {{$.i18n.Tr "repo.delete"}} + + {{end}} +
+
+
+
+ {{end}} {{template "base/paginate" .}} +
+ +
+
+
+ {{end}} + +
+ +
+ + + + + +
+ +
+ + +{{template "base/footer" .}} + + \ No newline at end of file diff --git a/templates/repo/debugjob/index.tmpl b/templates/repo/debugjob/index.tmpl index dcededd33..e6e7e0351 100755 --- a/templates/repo/debugjob/index.tmpl +++ b/templates/repo/debugjob/index.tmpl @@ -217,6 +217,7 @@
From 1d05333b26379f328efbad627d5c189664ec5a4d Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Thu, 13 Jan 2022 19:03:38 +0800 Subject: [PATCH 003/105] route --- models/cloudbrain.go | 10 ++ modules/auth/cloudbrain.go | 1 + modules/cloudbrain/cloudbrain.go | 4 +- modules/setting/setting.go | 2 + routers/repo/cloudbrain.go | 174 ++++++++++++++++++++++++++++--- routers/routes/routes.go | 12 +++ 6 files changed, 188 insertions(+), 15 deletions(-) diff --git a/models/cloudbrain.go b/models/cloudbrain.go index 713729a28..2f41a478f 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -99,6 +99,7 @@ type Cloudbrain struct { CanDel bool `xorm:"-"` CanModify bool `xorm:"-"` Type int + BenchmarkType string `xorm:"DEFAULT ''"` VersionID int64 //版本id VersionName string `xorm:"INDEX"` //当前版本 @@ -380,6 +381,15 @@ type Category struct { Value string `json:"value"` } +type BenchmarkTypes struct { + BenchmarkType []*BenchmarkType `json:"type"` +} + +type BenchmarkType struct { + Id int `json:"id"` + Value string `json:"value"` +} + type GpuInfos struct { GpuInfo []*GpuInfo `json:"gpu_type"` } diff --git a/modules/auth/cloudbrain.go b/modules/auth/cloudbrain.go index d598b495c..c5b5c1f47 100755 --- a/modules/auth/cloudbrain.go +++ b/modules/auth/cloudbrain.go @@ -14,6 +14,7 @@ type CreateCloudBrainForm struct { BenchmarkCategory string `form:"get_benchmark_category"` GpuType string `form:"gpu_type"` ResourceSpecId int `form:"resource_spec_id" binding:"Required"` + BenchmarkType string `form:"benchmark_type"` } type CommitImageCloudBrainForm struct { diff --git a/modules/cloudbrain/cloudbrain.go b/modules/cloudbrain/cloudbrain.go index 397ff3842..5bdebad25 100755 --- a/modules/cloudbrain/cloudbrain.go +++ b/modules/cloudbrain/cloudbrain.go @@ -105,7 +105,7 @@ func AdminOrJobCreaterRight(ctx *context.Context) { } -func GenerateTask(ctx *context.Context, jobName, image, command, uuid, codePath, modelPath, benchmarkPath, snn4imagenetPath, brainScorePath, jobType, gpuQueue string, resourceSpecId int) error { +func GenerateTask(ctx *context.Context, jobName, image, command, uuid, codePath, modelPath, benchmarkPath, snn4imagenetPath, brainScorePath, jobType, gpuQueue, benchmarkType string, resourceSpecId int) error { dataActualPath := setting.Attachment.Minio.RealPath + setting.Attachment.Minio.Bucket + "/" + setting.Attachment.Minio.BasePath + @@ -217,6 +217,7 @@ func GenerateTask(ctx *context.Context, jobName, image, command, uuid, codePath, GpuQueue: gpuQueue, ResourceSpecId: resourceSpecId, ComputeResource: models.GPUResource, + BenchmarkType: benchmarkType, }) if err != nil { @@ -339,6 +340,7 @@ func RestartTask(ctx *context.Context, task *models.Cloudbrain, newJobID *string GpuQueue: task.GpuQueue, ResourceSpecId: task.ResourceSpecId, ComputeResource: task.ComputeResource, + BenchmarkType: task.BenchmarkType, } err = models.RestartCloudbrain(task, newTask) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index e7ab0b7d2..a327a25d6 100755 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -467,6 +467,7 @@ var ( BenchmarkName string BenchmarkServerHost string BenchmarkCategory string + BenchmarkTypes string //snn4imagenet config IsSnn4imagenetEnabled bool @@ -1270,6 +1271,7 @@ func NewContext() { BenchmarkName = sec.Key("NAME").MustString("") BenchmarkServerHost = sec.Key("HOST").MustString("") BenchmarkCategory = sec.Key("CATEGORY").MustString("") + BenchmarkTypes = sec.Key("TYPES").MustString("") sec = Cfg.Section("snn4imagenet") IsSnn4imagenetEnabled = sec.Key("ENABLED").MustBool(false) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 0ea750fdd..d1e01c243 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -28,15 +28,17 @@ import ( ) const ( - tplCloudBrainIndex base.TplName = "repo/cloudbrain/index" tplCloudBrainNew base.TplName = "repo/cloudbrain/new" tplCloudBrainShow base.TplName = "repo/cloudbrain/show" tplCloudBrainShowModels base.TplName = "repo/cloudbrain/models/index" + + tplCloudBrainBenchmarkNew base.TplName = "repo/cloudbrain/benchmark/new" ) var ( gpuInfos *models.GpuInfos categories *models.Categories + benchmarkTypes *models.BenchmarkTypes ) var jobNamePattern = regexp.MustCompile(`^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$`) @@ -124,6 +126,11 @@ func cloudBrainNewDataPrepare(ctx *context.Context) error { } ctx.Data["benchmark_categories"] = categories.Category + if benchmarkTypes == nil { + json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes) + } + ctx.Data["benchmark_types"] = benchmarkTypes.BenchmarkType + if gpuInfos == nil { json.Unmarshal([]byte(setting.GpuTypes), &gpuInfos) } @@ -157,6 +164,7 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { image := form.Image uuid := form.Attachment jobType := form.JobType + command := cloudbrain.Command gpuQueue := form.GpuType codePath := setting.JobPath + jobName + cloudbrain.CodeMountPath resourceSpecId := form.ResourceSpecId @@ -173,13 +181,6 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { return } - var command string - if jobType == string(models.JobTypeBenchmark) { - command = cloudbrain.CommandBenchmark - } else { - command = cloudbrain.Command - } - count, err := models.GetCloudbrainCountByUserID(ctx.User.ID, jobType) if err != nil { log.Error("GetCloudbrainCountByUserID failed:%v", err, ctx.Data["MsgID"]) @@ -244,18 +245,14 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { err = cloudbrain.GenerateTask(ctx, jobName, image, command, uuid, storage.GetMinioPath(jobName, cloudbrain.CodeMountPath+"/"), storage.GetMinioPath(jobName, cloudbrain.ModelMountPath+"/"), storage.GetMinioPath(jobName, cloudbrain.BenchMarkMountPath+"/"), storage.GetMinioPath(jobName, cloudbrain.Snn4imagenetMountPath+"/"), - storage.GetMinioPath(jobName, cloudbrain.BrainScoreMountPath+"/"), jobType, gpuQueue, resourceSpecId) + storage.GetMinioPath(jobName, cloudbrain.BrainScoreMountPath+"/"), jobType, gpuQueue, "", resourceSpecId) if err != nil { cloudBrainNewDataPrepare(ctx) ctx.RenderWithErr(err.Error(), tplCloudBrainNew, &form) return } - if jobType == string(models.JobTypeBenchmark) { - ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=all") - } else { - ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=all") - } + ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/debugjob?debugListType=all") } func CloudBrainRestart(ctx *context.Context) { @@ -934,3 +931,152 @@ func SyncCloudbrainStatus() { return } + +func CloudBrainBenchmarkIndex(ctx *context.Context) { + MustEnableCloudbrain(ctx) + repo := ctx.Repo.Repository + page := ctx.QueryInt("page") + if page <= 0 { + page = 1 + } + + ciTasks, count, err := models.Cloudbrains(&models.CloudbrainsOptions{ + ListOptions: models.ListOptions{ + Page: page, + PageSize: setting.UI.IssuePagingNum, + }, + RepoID: repo.ID, + Type: models.TypeCloudBrainOne, + JobType: string(models.JobTypeBenchmark), + }) + if err != nil { + ctx.ServerError("Get debugjob faild:", err) + return + } + + for i, task := range ciTasks { + ciTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain) + ciTasks[i].Cloudbrain.ComputeResource = task.ComputeResource + } + + pager := context.NewPagination(int(count), setting.UI.IssuePagingNum, page, 5) + pager.AddParam(ctx, "debugListType", "ListType") + ctx.Data["Page"] = pager + ctx.Data["PageIsCloudBrain"] = true + ctx.Data["Tasks"] = ciTasks + ctx.Data["CanCreate"] = cloudbrain.CanCreateOrDebugJob(ctx) + ctx.Data["RepoIsEmpty"] = repo.IsEmpty + ctx.HTML(200, tplDebugJobIndex) +} + +func CloudBrainBenchmarkNew(ctx *context.Context) { + err := cloudBrainNewDataPrepare(ctx) + if err != nil { + ctx.ServerError("get new cloudbrain info failed", err) + return + } + ctx.HTML(200, tplCloudBrainBenchmarkNew) +} + +func CloudBrainBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { + ctx.Data["PageIsCloudBrain"] = true + jobName := form.JobName + image := form.Image + uuid := form.Attachment + jobType := form.JobType + gpuQueue := form.GpuType + command := cloudbrain.CommandBenchmark + codePath := setting.JobPath + jobName + cloudbrain.CodeMountPath + resourceSpecId := form.ResourceSpecId + benchmarkType := form.BenchmarkType + + if !jobNamePattern.MatchString(jobName) { + ctx.RenderWithErr(ctx.Tr("repo.cloudbrain_jobname_err"), tplCloudBrainBenchmarkNew, &form) + return + } + + if jobType != string(models.JobTypeBenchmark) { + log.Error("jobtype error:", jobType, ctx.Data["MsgID"]) + cloudBrainNewDataPrepare(ctx) + ctx.RenderWithErr("jobtype error", tplCloudBrainBenchmarkNew, &form) + return + } + + count, err := models.GetCloudbrainCountByUserID(ctx.User.ID, jobType) + if err != nil { + log.Error("GetCloudbrainCountByUserID failed:%v", err, ctx.Data["MsgID"]) + cloudBrainNewDataPrepare(ctx) + ctx.RenderWithErr("system error", tplCloudBrainBenchmarkNew, &form) + return + } else { + if count >= 1 { + log.Error("the user already has running or waiting task", ctx.Data["MsgID"]) + cloudBrainNewDataPrepare(ctx) + ctx.RenderWithErr("you have already a running or waiting task, can not create more", tplCloudBrainBenchmarkNew, &form) + return + } + } + + _, err = models.GetCloudbrainByName(jobName) + if err == nil { + log.Error("the job name did already exist", ctx.Data["MsgID"]) + cloudBrainNewDataPrepare(ctx) + ctx.RenderWithErr("the job name did already exist", tplCloudBrainBenchmarkNew, &form) + return + } else { + if !models.IsErrJobNotExist(err) { + log.Error("system error, %v", err, ctx.Data["MsgID"]) + cloudBrainNewDataPrepare(ctx) + ctx.RenderWithErr("system error", tplCloudBrainBenchmarkNew, &form) + return + } + } + repo := ctx.Repo.Repository + if err := downloadCode(repo, codePath); err != nil { + log.Error("system error, %v", err, ctx.Data["MsgID"]) + cloudBrainNewDataPrepare(ctx) + ctx.RenderWithErr("system error", tplCloudBrainBenchmarkNew, &form) + return + } + + if err := uploadCodeToMinio(codePath+"/", jobName, cloudbrain.CodeMountPath+"/"); err != nil { + log.Error("system error, %v", err, ctx.Data["MsgID"]) + cloudBrainNewDataPrepare(ctx) + ctx.RenderWithErr("system error", tplCloudBrainBenchmarkNew, &form) + return + } + + benchmarkPath := setting.JobPath + jobName + cloudbrain.BenchMarkMountPath + var gpuType string + for _, gpuInfo := range gpuInfos.GpuInfo { + if gpuInfo.Queue == gpuQueue { + gpuType = gpuInfo.Value + } + } + + if err := downloadRateCode(repo, jobName, setting.BenchmarkOwner, setting.BenchmarkName, benchmarkPath, form.BenchmarkCategory, gpuType); err != nil { + log.Error("system error, %v", err, ctx.Data["MsgID"]) + cloudBrainNewDataPrepare(ctx) + ctx.RenderWithErr("system error", tplCloudBrainBenchmarkNew, &form) + return + } + + if err := uploadCodeToMinio(benchmarkPath+"/", jobName, cloudbrain.BenchMarkMountPath+"/"); err != nil { + log.Error("system error, %v", err, ctx.Data["MsgID"]) + cloudBrainNewDataPrepare(ctx) + ctx.RenderWithErr("system error", tplCloudBrainBenchmarkNew, &form) + return + } + + err = cloudbrain.GenerateTask(ctx, jobName, image, command, uuid, storage.GetMinioPath(jobName, cloudbrain.CodeMountPath+"/"), + storage.GetMinioPath(jobName, cloudbrain.ModelMountPath+"/"), + storage.GetMinioPath(jobName, cloudbrain.BenchMarkMountPath+"/"), storage.GetMinioPath(jobName, cloudbrain.Snn4imagenetMountPath+"/"), + storage.GetMinioPath(jobName, cloudbrain.BrainScoreMountPath+"/"), jobType, gpuQueue, benchmarkType, resourceSpecId) + if err != nil { + cloudBrainNewDataPrepare(ctx) + ctx.RenderWithErr(err.Error(), tplCloudBrainBenchmarkNew, &form) + return + } + + ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/cloudbrain/benchmark") +} diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 439c17a92..8302cd7b6 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -979,6 +979,18 @@ func RegisterRoutes(m *macaron.Macaron) { }) m.Get("/create", reqRepoCloudBrainWriter, repo.CloudBrainNew) m.Post("/create", reqRepoCloudBrainWriter, bindIgnErr(auth.CreateCloudBrainForm{}), repo.CloudBrainCreate) + + m.Group("/benchmark", func() { + m.Get("", reqRepoCloudBrainReader, repo.CloudBrainBenchmarkIndex) + m.Group("/:jobid", func() { + m.Get("", reqRepoCloudBrainReader, repo.CloudBrainShow) + m.Post("/stop", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.CloudBrainStop) + m.Post("/del", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.CloudBrainDel) + m.Get("/rate", reqRepoCloudBrainReader, repo.GetRate) + }) + m.Get("/create", reqRepoCloudBrainWriter, repo.CloudBrainBenchmarkNew) + m.Post("/create", reqRepoCloudBrainWriter, bindIgnErr(auth.CreateCloudBrainForm{}), repo.CloudBrainBenchmarkCreate) + }) }, context.RepoRef()) m.Group("/modelmanage", func() { m.Post("/create_model", reqRepoModelManageWriter, repo.SaveModel) From 739cd1289b25652f4295d723fbe996d8cf22f527 Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 14 Jan 2022 11:33:29 +0800 Subject: [PATCH 004/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/cloudbrain.go | 14 +++++++------- routers/repo/modelarts.go | 2 ++ templates/repo/cloudbrain/benchmark/index.tmpl | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index d1e01c243..bb167e833 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -32,12 +32,12 @@ const ( tplCloudBrainShow base.TplName = "repo/cloudbrain/show" tplCloudBrainShowModels base.TplName = "repo/cloudbrain/models/index" - tplCloudBrainBenchmarkNew base.TplName = "repo/cloudbrain/benchmark/new" + tplCloudBrainBenchmarkNew base.TplName = "repo/cloudbrain/benchmark/new" ) var ( - gpuInfos *models.GpuInfos - categories *models.Categories + gpuInfos *models.GpuInfos + categories *models.Categories benchmarkTypes *models.BenchmarkTypes ) @@ -945,9 +945,9 @@ func CloudBrainBenchmarkIndex(ctx *context.Context) { Page: page, PageSize: setting.UI.IssuePagingNum, }, - RepoID: repo.ID, - Type: models.TypeCloudBrainOne, - JobType: string(models.JobTypeBenchmark), + RepoID: repo.ID, + Type: models.TypeCloudBrainOne, + JobType: string(models.JobTypeBenchmark), }) if err != nil { ctx.ServerError("Get debugjob faild:", err) @@ -966,7 +966,7 @@ func CloudBrainBenchmarkIndex(ctx *context.Context) { ctx.Data["Tasks"] = ciTasks ctx.Data["CanCreate"] = cloudbrain.CanCreateOrDebugJob(ctx) ctx.Data["RepoIsEmpty"] = repo.IsEmpty - ctx.HTML(200, tplDebugJobIndex) + ctx.HTML(200, tplBenchMarkIndex) } func CloudBrainBenchmarkNew(ctx *context.Context) { diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 7a952394e..2ec2e2236 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -37,6 +37,8 @@ const ( tplModelArtsTrainJobNew base.TplName = "repo/modelarts/trainjob/new" tplModelArtsTrainJobShow base.TplName = "repo/modelarts/trainjob/show" tplModelArtsTrainJobVersionNew base.TplName = "repo/modelarts/trainjob/version_new" + + tplBenchMarkIndex base.TplName = "repo/cloudbrain/benchmark/index" ) func DebugJobIndex(ctx *context.Context) { diff --git a/templates/repo/cloudbrain/benchmark/index.tmpl b/templates/repo/cloudbrain/benchmark/index.tmpl index 13cfc6e4c..165c8d463 100644 --- a/templates/repo/cloudbrain/benchmark/index.tmpl +++ b/templates/repo/cloudbrain/benchmark/index.tmpl @@ -34,12 +34,12 @@
{{if .Permission.CanWrite $.UnitTypeCloudBrain}} - {{$.i18n.Tr "repo.modelarts.evaluate_job.new_job"}} + {{$.i18n.Tr "repo.modelarts.evaluate_job.new_job"}} {{else}} {{$.i18n.Tr "repo.modelarts.evaluate_job.new_job"}} {{end}} From 9bd7acfb28437aabd03886401562127dc79b99b1 Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 14 Jan 2022 11:41:15 +0800 Subject: [PATCH 005/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/debugjob/index.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/debugjob/index.tmpl b/templates/repo/debugjob/index.tmpl index e6e7e0351..5017462a2 100755 --- a/templates/repo/debugjob/index.tmpl +++ b/templates/repo/debugjob/index.tmpl @@ -217,7 +217,7 @@
From 06ab8e9ce9eec06e0f1d940aed7161b8a30ebdeb Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Fri, 14 Jan 2022 14:40:33 +0800 Subject: [PATCH 006/105] benchmark types --- models/cloudbrain.go | 13 ++++++++++--- routers/repo/cloudbrain.go | 4 +++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/models/cloudbrain.go b/models/cloudbrain.go index 2f41a478f..087b082cd 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -99,7 +99,7 @@ type Cloudbrain struct { CanDel bool `xorm:"-"` CanModify bool `xorm:"-"` Type int - BenchmarkType string `xorm:"DEFAULT ''"` + BenchmarkType string `xorm:"DEFAULT ''"` VersionID int64 //版本id VersionName string `xorm:"INDEX"` //当前版本 @@ -386,8 +386,15 @@ type BenchmarkTypes struct { } type BenchmarkType struct { - Id int `json:"id"` - Value string `json:"value"` + Id int `json:"id"` + First string `json:"first"` //一级算法类型名称 + Second []*BenchmarkDataset `json:"second"` +} + +type BenchmarkDataset struct { + Id int `json:"id"` + Value string `json:"value"` //二级算法类型名称 + Attachment string `json:"attachment"` //数据集的uuid } type GpuInfos struct { diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index bb167e833..587c275ad 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -127,7 +127,9 @@ func cloudBrainNewDataPrepare(ctx *context.Context) error { ctx.Data["benchmark_categories"] = categories.Category if benchmarkTypes == nil { - json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes) + if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil { + log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", setting.BenchmarkTypes, err, ctx.Data["MsgID"]) + } } ctx.Data["benchmark_types"] = benchmarkTypes.BenchmarkType From 25c1adb1185df121601338a2808df15ef3c6ff70 Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 14 Jan 2022 15:12:21 +0800 Subject: [PATCH 007/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/new.tmpl | 511 +++++++++++++++++++ 1 file changed, 511 insertions(+) create mode 100644 templates/repo/cloudbrain/benchmark/new.tmpl diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl new file mode 100644 index 000000000..790b6d1eb --- /dev/null +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -0,0 +1,511 @@ +{{template "base/head" .}} + + +
+
+
+
+
+
+
+
+
+
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} +

+ {{.i18n.Tr "repo.modelarts.train_job.new"}} +

+
+ +
+ {{.CsrfTokenHtml}} + + + +

{{.i18n.Tr "repo.modelarts.train_job.basic_info"}}:

+
+ + +
+ +
+ + +
+
+ +

{{.i18n.Tr "repo.modelarts.train_job.parameter_setting"}}:

+ + +
+ + +
+ + + +
+ +
+ +
+ +
+ + +
+ +
+ +
+ + {{if .bootFile}} + + {{else}} + + {{end}} + + + + 查看样例 +
+
+ + + 数据集位置存储在环境变量data_url中,训练输出路径存储在环境变量train_url中。 +
+ +
+ + {{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}} + +
+ {{if ne 0 (len .params)}} + {{range $k ,$v := .params}} +
+
+ +
+
+ +
+ + + + +
+ {{end}} + {{end}} +
+
+ + + + + + +
+ + +
+
+ + +
+ + + + +
+
+ +
+ + {{.i18n.Tr "repo.cloudbrain.cancel"}} +
+ + + +
+
+
+
+{{template "base/footer" .}} + + \ No newline at end of file From 75b9194b1b42e10893575edd5d710d44233f6fdf Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 14 Jan 2022 16:37:52 +0800 Subject: [PATCH 008/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/new.tmpl | 117 +++---------------- 1 file changed, 14 insertions(+), 103 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index 790b6d1eb..0394148d6 100644 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -92,30 +92,7 @@

{{.i18n.Tr "repo.modelarts.train_job.parameter_setting"}}:

-
- - -
- - - +
@@ -137,100 +114,34 @@
-
- - {{if .bootFile}} - - {{else}} - - {{end}} - - - - 查看样例 -
- {{if $.uuid}} {{end}} {{range .attachments}} - + {{end}} - 数据集位置存储在环境变量data_url中,训练输出路径存储在环境变量train_url中。 +
- -
- - {{.i18n.Tr "repo.modelarts.train_job.add_run_parameter"}} - -
- {{if ne 0 (len .params)}} - {{range $k ,$v := .params}} -
-
- -
-
- -
- - - -
- {{end}} - {{end}} -
-
- - - - - - -
- - + {{else}} + {{end}} - + + + +
-
- - -
- - -
-
+
+ +
+ +
+
+ + +
+ +{{template "base/footer" .}} + + \ No newline at end of file From 69fe6fda6bf5f363365f6fe45473e4241aeb599a Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 18 Jan 2022 10:05:40 +0800 Subject: [PATCH 041/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/show.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/show.tmpl b/templates/repo/cloudbrain/benchmark/show.tmpl index 1b8c13ef8..068bf6324 100644 --- a/templates/repo/cloudbrain/benchmark/show.tmpl +++ b/templates/repo/cloudbrain/benchmark/show.tmpl @@ -179,8 +179,8 @@ td, th { {{.i18n.Tr "repo.cloudbrain"}}
/
- - {{$.i18n.Tr "repo.modelarts.train_job"}} + + {{$.i18n.Tr "repo.modelarts.evaluate_job"}}
/
{{.jobName}}
From 063622ff40e509dcb6641952e884e3b9a1ab5959 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 18 Jan 2022 10:11:44 +0800 Subject: [PATCH 042/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/cloudbrain.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 75850bbce..107b034d1 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -345,6 +345,7 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { } if result != nil { + log.Info("task is ...") jobRes, _ := models.ConvertToJobResultPayload(result.Payload) jobRes.Resource.Memory = strings.ReplaceAll(jobRes.Resource.Memory, "Mi", "MB") taskRoles := jobRes.TaskRoles @@ -371,6 +372,8 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { } ctx.Data["result"] = jobRes + } else { + log.Info("error:" + err.Error()) } ctx.Data["task"] = task From 074f7e69d30a03229f07a9de4b598843d56bf618 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 18 Jan 2022 11:29:09 +0800 Subject: [PATCH 043/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/cloudbrain.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 107b034d1..c45efc069 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -378,6 +378,10 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { ctx.Data["task"] = task ctx.Data["jobID"] = jobID + ctx.Data["jobName"] = task.JobName + version_list_task := make([]*models.Cloudbrain, 0) + version_list_task = append(version_list_task, task) + ctx.Data["version_list_task"] = version_list_task ctx.HTML(200, tpName) } From bc8c1c9bdc706bf353a0b99455a9579b02e04bff Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 18 Jan 2022 11:32:08 +0800 Subject: [PATCH 044/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/show.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/show.tmpl b/templates/repo/cloudbrain/benchmark/show.tmpl index 068bf6324..ecc84a85c 100644 --- a/templates/repo/cloudbrain/benchmark/show.tmpl +++ b/templates/repo/cloudbrain/benchmark/show.tmpl @@ -223,7 +223,7 @@ td, th {
- {{TimeSinceUnix1 .Cloudbrain.CreatedUnix}} + {{TimeSinceUnix1 .CreatedUnix}} {{$.i18n.Tr "repo.modelarts.current_version"}}:{{.VersionName}} {{$.i18n.Tr "repo.modelarts.parent_version"}}:{{.PreVersionName}} {{$.i18n.Tr "repo.modelarts.status"}}: @@ -293,7 +293,7 @@ td, th {
- {{TimeSinceUnix1 .Cloudbrain.CreatedUnix}} + {{TimeSinceUnix1 .CreatedUnix}}
@@ -396,8 +396,8 @@ td, th { -
- {{.Cloudbrain.Description}} +
+ {{.Description}}
From cefc20ff4f9214c73c0bb919d6381c40a32ded45 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Tue, 18 Jan 2022 11:59:24 +0800 Subject: [PATCH 045/105] opt --- modules/setting/setting.go | 2 + routers/repo/cloudbrain.go | 50 ++++++++++++++++++-- templates/repo/cloudbrain/benchmark/new.tmpl | 2 +- 3 files changed, 48 insertions(+), 6 deletions(-) mode change 100644 => 100755 templates/repo/cloudbrain/benchmark/new.tmpl diff --git a/modules/setting/setting.go b/modules/setting/setting.go index a327a25d6..92928639a 100755 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -468,6 +468,7 @@ var ( BenchmarkServerHost string BenchmarkCategory string BenchmarkTypes string + BenchmarkGpuTypes string //snn4imagenet config IsSnn4imagenetEnabled bool @@ -1272,6 +1273,7 @@ func NewContext() { BenchmarkServerHost = sec.Key("HOST").MustString("") BenchmarkCategory = sec.Key("CATEGORY").MustString("") BenchmarkTypes = sec.Key("TYPES").MustString("") + BenchmarkGpuTypes = sec.Key("GPU_TYPES").MustString("") sec = Cfg.Section("snn4imagenet") IsSnn4imagenetEnabled = sec.Key("ENABLED").MustBool(false) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index c45efc069..2181eb098 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -41,6 +41,7 @@ var ( gpuInfos *models.GpuInfos categories *models.Categories benchmarkTypes *models.BenchmarkTypes + benchmarkGpuInfos *models.GpuInfos ) var jobNamePattern = regexp.MustCompile(`^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$`) @@ -140,6 +141,11 @@ func cloudBrainNewDataPrepare(ctx *context.Context) error { } ctx.Data["gpu_types"] = gpuInfos.GpuInfo + if benchmarkGpuInfos == nil { + json.Unmarshal([]byte(setting.BenchmarkGpuTypes), &benchmarkGpuInfos) + } + ctx.Data["benchmark_gpu_types"] = benchmarkGpuInfos.GpuInfo + if cloudbrain.ResourceSpecs == nil { json.Unmarshal([]byte(setting.ResourceSpecs), &cloudbrain.ResourceSpecs) } @@ -1084,6 +1090,32 @@ func getBenchmarkAttachment(benchmarkTypeID, benchmarkChildTypeID int) (string, return uuid, nil } +func getBenchmarkGpuQueue(gpuQueue string) (string, error) { + queue := "" + if benchmarkGpuInfos == nil { + if err := json.Unmarshal([]byte(setting.BenchmarkGpuTypes), &benchmarkGpuInfos); err != nil { + log.Error("json.Unmarshal BenchmarkGpuTypes(%s) failed:%v", setting.BenchmarkGpuTypes, err) + return queue, err + } + } + + var isExist bool + for _, gpuInfo := range benchmarkGpuInfos.GpuInfo { + if gpuQueue == gpuInfo.Queue { + isExist = true + queue = gpuQueue + break + } + } + + if !isExist { + log.Error("no such gpuQueue, %s", gpuQueue) + return queue, errors.New("no such gpuQueue") + } + + return queue, nil +} + func CloudBrainBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { ctx.Data["PageIsCloudBrain"] = true jobName := form.JobName @@ -1108,6 +1140,14 @@ func CloudBrainBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainF return } + _, err = getBenchmarkGpuQueue(gpuQueue) + if err != nil { + log.Error("getBenchmarkGpuQueue failed:%v", err, ctx.Data["MsgID"]) + cloudBrainNewDataPrepare(ctx) + ctx.RenderWithErr("gpu queue error", tplCloudBrainBenchmarkNew, &form) + return + } + count, err := models.GetCloudbrainCountByUserID(ctx.User.ID, string(models.JobTypeBenchmark)) if err != nil { log.Error("GetCloudbrainCountByUserID failed:%v", err, ctx.Data["MsgID"]) @@ -1131,7 +1171,7 @@ func CloudBrainBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainF return } else { if !models.IsErrJobNotExist(err) { - log.Error("system error, %v", err, ctx.Data["MsgID"]) + log.Error("GetCloudbrainByName failed, %v", err, ctx.Data["MsgID"]) cloudBrainNewDataPrepare(ctx) ctx.RenderWithErr("system error", tplCloudBrainBenchmarkNew, &form) return @@ -1140,14 +1180,14 @@ func CloudBrainBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainF repo := ctx.Repo.Repository os.RemoveAll(codePath) if err := downloadCode(repo, codePath); err != nil { - log.Error("system error, %v", err, ctx.Data["MsgID"]) + log.Error("downloadCode failed, %v", err, ctx.Data["MsgID"]) cloudBrainNewDataPrepare(ctx) ctx.RenderWithErr("system error", tplCloudBrainBenchmarkNew, &form) return } if err := uploadCodeToMinio(codePath+"/", jobName, cloudbrain.CodeMountPath+"/"); err != nil { - log.Error("system error, %v", err, ctx.Data["MsgID"]) + log.Error("uploadCodeToMinio failed, %v", err, ctx.Data["MsgID"]) cloudBrainNewDataPrepare(ctx) ctx.RenderWithErr("system error", tplCloudBrainBenchmarkNew, &form) return @@ -1162,14 +1202,14 @@ func CloudBrainBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainF } if err := downloadRateCode(repo, jobName, setting.BenchmarkOwner, setting.BenchmarkName, benchmarkPath, form.BenchmarkCategory, gpuType); err != nil { - log.Error("system error, %v", err, ctx.Data["MsgID"]) + log.Error("downloadRateCode failed, %v", err, ctx.Data["MsgID"]) //cloudBrainNewDataPrepare(ctx) //ctx.RenderWithErr("system error", tplCloudBrainBenchmarkNew, &form) //return } if err := uploadCodeToMinio(benchmarkPath+"/", jobName, cloudbrain.BenchMarkMountPath+"/"); err != nil { - log.Error("system error, %v", err, ctx.Data["MsgID"]) + log.Error("uploadCodeToMinio failed, %v", err, ctx.Data["MsgID"]) //cloudBrainNewDataPrepare(ctx) //ctx.RenderWithErr("system error", tplCloudBrainBenchmarkNew, &form) //return diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl old mode 100644 new mode 100755 index fad6496e0..2be134126 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -85,7 +85,7 @@
From 23f075893575fb4094b35f72559148884a1d1ad3 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 18 Jan 2022 14:50:59 +0800 Subject: [PATCH 046/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/show.tmpl | 29 ++----------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/show.tmpl b/templates/repo/cloudbrain/benchmark/show.tmpl index ecc84a85c..46e73752d 100644 --- a/templates/repo/cloudbrain/benchmark/show.tmpl +++ b/templates/repo/cloudbrain/benchmark/show.tmpl @@ -195,18 +195,6 @@ td, th {
- {{$.CsrfTokenHtml}} - {{if and (.CanModify) (eq .Status "COMPLETED")}} - {{$.i18n.Tr "repo.modelarts.create_model"}} - {{else}} - {{$.i18n.Tr "repo.modelarts.create_model"}} - {{end}} - {{$.CsrfTokenHtml}} - {{if .CanModify}} - {{$.i18n.Tr "repo.modelarts.modify"}} - {{else}} - {{$.i18n.Tr "repo.modelarts.modify"}} - {{end}} {{$.CsrfTokenHtml}} {{if .CanDel}} {{$.i18n.Tr "repo.stop"}} @@ -224,8 +212,7 @@ td, th {
{{TimeSinceUnix1 .CreatedUnix}} - {{$.i18n.Tr "repo.modelarts.current_version"}}:{{.VersionName}} - {{$.i18n.Tr "repo.modelarts.parent_version"}}:{{.PreVersionName}} + {{$.i18n.Tr "repo.modelarts.status"}}: {{.Status}} @@ -423,19 +410,7 @@ td, th {
-
- - - -
- -
-
- +
From 0dcc7fc9d9c66bc27af775db6318b8e4591aa5c7 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 18 Jan 2022 14:56:05 +0800 Subject: [PATCH 047/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/show.tmpl | 114 +----------------- 1 file changed, 3 insertions(+), 111 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/show.tmpl b/templates/repo/cloudbrain/benchmark/show.tmpl index 46e73752d..dd5aaa971 100644 --- a/templates/repo/cloudbrain/benchmark/show.tmpl +++ b/templates/repo/cloudbrain/benchmark/show.tmpl @@ -436,62 +436,8 @@ td, th { - -
- + +
{{template "base/footer" .}} @@ -525,61 +471,7 @@ td, th { } let timeid = window.setInterval(loadJobStatus, 30000); $(document).ready(loadJobStatus); - function showcreate(obj){ - $('.ui.modal.second') - .modal({ - centered: false, - onShow:function(){ - $('input[name="Version"]').addClass('model_disabled') - // $('input[name="JobId"]').text(obj.JobName) - $('#JobName').val(obj.JobName).addClass('model_disabled') - $('input[name="JobId"]').val(obj.JobID) - $('input[name="VersionName"]').val(obj.VersionName).addClass('model_disabled') - $('.ui.dimmer').css({"background-color":"rgb(136, 136, 136,0.7)"}) - createModelName() - - - }, - onHide:function(){ - document.getElementById("formId").reset(); - $('.ui.dimmer').css({"background-color":""}) - $('.ui.error.message').text() - $('.ui.error.message').css('display','none') - - } - }) - .modal('show') - } - function createModel(){ - let url_href = `/${userName}/${repoPath}/modelmanage/create_new_model` - let data = $("#formId").serialize() - $("#mask").css({"display":"block","z-index":"9999"}) - $.ajax({ - url:url_href, - type:'POST', - data:data, - success:function(res){ - location.href=`/${userName}/${repoPath}/modelmanage/show_model` - $('.ui.modal.second').modal('hide') - }, - error: function(xhr){ - // 隐藏 loading - // 只有请求不正常(状态码不为200)才会执行 - $('.ui.error.message').text(xhr.responseText) - $('.ui.error.message').css('display','block') - }, - complete:function(xhr){ - $("#mask").css({"display":"none","z-index":"1"}) - } - }) - - } - function createModelName(){ - let repoName = location.pathname.split('/')[2] - let modelName = repoName + '_model_' + Math.random().toString(36).substr(2, 4) - $('#name').val(modelName) - $('#version').val("0.0.1") - } + function renderSize(value){ if(null==value||value==''){ return "0 Bytes"; From fb821e5150d641b08017c265f875dc57fb482be6 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Tue, 18 Jan 2022 15:01:08 +0800 Subject: [PATCH 048/105] resource spec --- modules/setting/setting.go | 16 ++++---- routers/repo/cloudbrain.go | 42 ++++++++++++++++++++ templates/repo/cloudbrain/benchmark/new.tmpl | 2 +- 3 files changed, 52 insertions(+), 8 deletions(-) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 92928639a..02ce26576 100755 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -462,13 +462,14 @@ var ( MaxDuration int64 //benchmark config - IsBenchmarkEnabled bool - BenchmarkOwner string - BenchmarkName string - BenchmarkServerHost string - BenchmarkCategory string - BenchmarkTypes string - BenchmarkGpuTypes string + IsBenchmarkEnabled bool + BenchmarkOwner string + BenchmarkName string + BenchmarkServerHost string + BenchmarkCategory string + BenchmarkTypes string + BenchmarkGpuTypes string + BenchmarkResourceSpecs string //snn4imagenet config IsSnn4imagenetEnabled bool @@ -1274,6 +1275,7 @@ func NewContext() { BenchmarkCategory = sec.Key("CATEGORY").MustString("") BenchmarkTypes = sec.Key("TYPES").MustString("") BenchmarkGpuTypes = sec.Key("GPU_TYPES").MustString("") + BenchmarkResourceSpecs = sec.Key("RESOURCE_SPECS").MustString("") sec = Cfg.Section("snn4imagenet") IsSnn4imagenetEnabled = sec.Key("ENABLED").MustBool(false) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 2181eb098..8b435e5e1 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -42,6 +42,7 @@ var ( categories *models.Categories benchmarkTypes *models.BenchmarkTypes benchmarkGpuInfos *models.GpuInfos + benchmarkResourceSpecs *models.ResourceSpecs ) var jobNamePattern = regexp.MustCompile(`^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$`) @@ -146,6 +147,11 @@ func cloudBrainNewDataPrepare(ctx *context.Context) error { } ctx.Data["benchmark_gpu_types"] = benchmarkGpuInfos.GpuInfo + if benchmarkResourceSpecs == nil { + json.Unmarshal([]byte(setting.BenchmarkResourceSpecs), &benchmarkResourceSpecs) + } + ctx.Data["benchmark_resource_specs"] = benchmarkResourceSpecs.ResourceSpec + if cloudbrain.ResourceSpecs == nil { json.Unmarshal([]byte(setting.ResourceSpecs), &cloudbrain.ResourceSpecs) } @@ -1116,6 +1122,32 @@ func getBenchmarkGpuQueue(gpuQueue string) (string, error) { return queue, nil } +func getBenchmarkResourceSpec(resourceSpecID int) (int, error) { + var id int + if benchmarkResourceSpecs == nil { + if err := json.Unmarshal([]byte(setting.BenchmarkResourceSpecs), &benchmarkResourceSpecs); err != nil { + log.Error("json.Unmarshal BenchmarkResourceSpecs(%s) failed:%v", setting.BenchmarkResourceSpecs, err) + return id, err + } + } + + var isExist bool + for _, resourceSpec := range benchmarkResourceSpecs.ResourceSpec { + if resourceSpecID == resourceSpec.Id { + isExist = true + id = resourceSpecID + break + } + } + + if !isExist { + log.Error("no such resourceSpecID, %d", resourceSpecID) + return id, errors.New("no such resourceSpec") + } + + return id, nil +} + func CloudBrainBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { ctx.Data["PageIsCloudBrain"] = true jobName := form.JobName @@ -1148,6 +1180,14 @@ func CloudBrainBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainF return } + _, err = getBenchmarkResourceSpec(resourceSpecId) + if err != nil { + log.Error("getBenchmarkResourceSpec failed:%v", err, ctx.Data["MsgID"]) + cloudBrainNewDataPrepare(ctx) + ctx.RenderWithErr("resource spec error", tplCloudBrainBenchmarkNew, &form) + return + } + count, err := models.GetCloudbrainCountByUserID(ctx.User.ID, string(models.JobTypeBenchmark)) if err != nil { log.Error("GetCloudbrainCountByUserID failed:%v", err, ctx.Data["MsgID"]) @@ -1186,6 +1226,8 @@ func CloudBrainBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainF return } + //todo: check the boot file(train.py&test.py) + if err := uploadCodeToMinio(codePath+"/", jobName, cloudbrain.CodeMountPath+"/"); err != nil { log.Error("uploadCodeToMinio failed, %v", err, ctx.Data["MsgID"]) cloudBrainNewDataPrepare(ctx) diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index 2be134126..a8bd056ae 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -129,7 +129,7 @@
From eb8c05781782b103fdaade141ecf339af580b0e9 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 18 Jan 2022 15:05:09 +0800 Subject: [PATCH 049/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/show.tmpl | 61 ++----------------- 1 file changed, 5 insertions(+), 56 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/show.tmpl b/templates/repo/cloudbrain/benchmark/show.tmpl index dd5aaa971..497a22cc0 100644 --- a/templates/repo/cloudbrain/benchmark/show.tmpl +++ b/templates/repo/cloudbrain/benchmark/show.tmpl @@ -229,10 +229,8 @@ td, th {
@@ -262,17 +260,7 @@ td, th {
- - - {{$.i18n.Tr "repo.modelarts.run_version"}} - - - -
- {{.VersionName}} -
- - + {{$.i18n.Tr "repo.modelarts.train_job.start_time"}} @@ -306,43 +294,15 @@ td, th {
- - - {{$.i18n.Tr "repo.modelarts.train_job.compute_node"}} - - -
- {{.WorkServerNumber}} -
- - +
- - - - - - - - - + + - - - - - - + - - - - - +
- {{$.i18n.Tr "repo.modelarts.train_job.AI_driver"}} - -
- {{.EngineName}} -
-
- {{$.i18n.Tr "repo.modelarts.code_version"}} - -
- {{.BranchName}} -
-
{{$.i18n.Tr "repo.modelarts.train_job.start_file"}} @@ -365,18 +325,7 @@ td, th {
- {{$.i18n.Tr "repo.modelarts.train_job.run_parameter"}} - -
- {{.Parameters}} -
-
{{$.i18n.Tr "repo.modelarts.train_job.description"}} From 32d2e48a52543889e62c100ffc092ad54076efe0 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 18 Jan 2022 15:23:26 +0800 Subject: [PATCH 050/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/new.tmpl | 6 +++- templates/repo/cloudbrain/benchmark/show.tmpl | 34 ++++++++++--------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index a8bd056ae..89afd9480 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -81,7 +81,11 @@ - +
+ + +
+
- {{$.i18n.Tr "repo.modelarts.train_job.standard"}} - -
- {{.FlavorName}} -
-
@@ -305,23 +295,23 @@ td, th { - {{$.i18n.Tr "repo.modelarts.train_job.start_file"}} + 训练程序
- {{.BootFile}} + train.py
- {{$.i18n.Tr "repo.modelarts.train_job.train_dataset"}} + 测试程序
- {{.DatasetName}} + test.py
@@ -337,6 +327,18 @@ td, th {
+ + + + {{$.i18n.Tr "repo.modelarts.train_job.standard"}} + + + +
+ {{.FlavorName}} +
+ +
From 9b292bf927ccb2af0b9de7067f96dab3e029bd11 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Tue, 18 Jan 2022 15:24:43 +0800 Subject: [PATCH 051/105] train_url --- modules/auth/cloudbrain.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/auth/cloudbrain.go b/modules/auth/cloudbrain.go index 277588f40..cfa1e81c3 100755 --- a/modules/auth/cloudbrain.go +++ b/modules/auth/cloudbrain.go @@ -13,6 +13,8 @@ type CreateCloudBrainForm struct { JobType string `form:"job_type" binding:"Required"` BenchmarkCategory string `form:"get_benchmark_category"` GpuType string `form:"gpu_type"` + TrainUrl string `form:"train_url"` + TestUrl string `form:"test_url"` ResourceSpecId int `form:"resource_spec_id" binding:"Required"` BenchmarkTypeID int `form:"benchmark_types_id"` BenchmarkChildTypeID int `form:"benchmark_child_types_id"` From 75f970e60450cc26990e8c66ac12a491178e78be Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 18 Jan 2022 15:33:21 +0800 Subject: [PATCH 052/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/show.tmpl | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/show.tmpl b/templates/repo/cloudbrain/benchmark/show.tmpl index 6837595c5..0ddaa5dcb 100644 --- a/templates/repo/cloudbrain/benchmark/show.tmpl +++ b/templates/repo/cloudbrain/benchmark/show.tmpl @@ -283,7 +283,29 @@ td, th {
- + + + 镜像 + + + +
+ {{.Image}} +
+ + + + + + 创建者 + + + +
+ {{.User.Name}} +
+ + @@ -335,7 +357,7 @@ td, th {
- {{.FlavorName}} + {{.GpuQueue}}
From 9ded0237473906b6033c83408599bf5afc8cef53 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 18 Jan 2022 15:38:37 +0800 Subject: [PATCH 053/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/cloudbrain.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 8b435e5e1..bdb63a130 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -38,10 +38,10 @@ const ( ) var ( - gpuInfos *models.GpuInfos - categories *models.Categories - benchmarkTypes *models.BenchmarkTypes - benchmarkGpuInfos *models.GpuInfos + gpuInfos *models.GpuInfos + categories *models.Categories + benchmarkTypes *models.BenchmarkTypes + benchmarkGpuInfos *models.GpuInfos benchmarkResourceSpecs *models.ResourceSpecs ) @@ -387,7 +387,7 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { } else { log.Info("error:" + err.Error()) } - + ctx.Data["userName"] = task.User.Name ctx.Data["task"] = task ctx.Data["jobID"] = jobID ctx.Data["jobName"] = task.JobName From 34c1909c5aa5c6fcf54f994b3beeccde8d0b0671 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 18 Jan 2022 15:42:27 +0800 Subject: [PATCH 054/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/cloudbrain.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index bdb63a130..426cab39c 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -387,7 +387,10 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { } else { log.Info("error:" + err.Error()) } - ctx.Data["userName"] = task.User.Name + user, err := models.GetUserByID(task.UserID) + if err == nil { + task.User = user + } ctx.Data["task"] = task ctx.Data["jobID"] = jobID ctx.Data["jobName"] = task.JobName From 20c87f8d86ed3740d6a465bc3f5c3d561b0ba0e4 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Tue, 18 Jan 2022 16:02:48 +0800 Subject: [PATCH 055/105] description --- modules/auth/cloudbrain.go | 1 + modules/cloudbrain/cloudbrain.go | 3 ++- routers/repo/cloudbrain.go | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/auth/cloudbrain.go b/modules/auth/cloudbrain.go index cfa1e81c3..0d7ef1b02 100755 --- a/modules/auth/cloudbrain.go +++ b/modules/auth/cloudbrain.go @@ -15,6 +15,7 @@ type CreateCloudBrainForm struct { GpuType string `form:"gpu_type"` TrainUrl string `form:"train_url"` TestUrl string `form:"test_url"` + Description string `form:"description"` ResourceSpecId int `form:"resource_spec_id" binding:"Required"` BenchmarkTypeID int `form:"benchmark_types_id"` BenchmarkChildTypeID int `form:"benchmark_child_types_id"` diff --git a/modules/cloudbrain/cloudbrain.go b/modules/cloudbrain/cloudbrain.go index 58775df5a..3af7d1019 100755 --- a/modules/cloudbrain/cloudbrain.go +++ b/modules/cloudbrain/cloudbrain.go @@ -106,7 +106,7 @@ func AdminOrJobCreaterRight(ctx *context.Context) { } -func GenerateTask(ctx *context.Context, jobName, image, command, uuid, codePath, modelPath, benchmarkPath, snn4imagenetPath, brainScorePath, jobType, gpuQueue string, benchmarkTypeID, benchmarkChildTypeID, resourceSpecId int) error { +func GenerateTask(ctx *context.Context, jobName, image, command, uuid, codePath, modelPath, benchmarkPath, snn4imagenetPath, brainScorePath, jobType, gpuQueue, description string, benchmarkTypeID, benchmarkChildTypeID, resourceSpecId int) error { dataActualPath := setting.Attachment.Minio.RealPath + setting.Attachment.Minio.Bucket + "/" + setting.Attachment.Minio.BasePath + @@ -220,6 +220,7 @@ func GenerateTask(ctx *context.Context, jobName, image, command, uuid, codePath, ComputeResource: models.GPUResource, BenchmarkTypeID: benchmarkTypeID, BenchmarkChildTypeID: benchmarkChildTypeID, + Description: description, }) if err != nil { diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 426cab39c..6f6760e47 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -261,7 +261,8 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { err = cloudbrain.GenerateTask(ctx, jobName, image, command, uuid, storage.GetMinioPath(jobName, cloudbrain.CodeMountPath+"/"), storage.GetMinioPath(jobName, cloudbrain.ModelMountPath+"/"), storage.GetMinioPath(jobName, cloudbrain.BenchMarkMountPath+"/"), storage.GetMinioPath(jobName, cloudbrain.Snn4imagenetMountPath+"/"), - storage.GetMinioPath(jobName, cloudbrain.BrainScoreMountPath+"/"), jobType, gpuQueue, 0, 0, resourceSpecId) + storage.GetMinioPath(jobName, cloudbrain.BrainScoreMountPath+"/"), jobType, gpuQueue, form.Description, + 0, 0, resourceSpecId) if err != nil { cloudBrainNewDataPrepare(ctx) ctx.RenderWithErr(err.Error(), tplCloudBrainNew, &form) @@ -1263,7 +1264,8 @@ func CloudBrainBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainF err = cloudbrain.GenerateTask(ctx, jobName, image, command, uuid, storage.GetMinioPath(jobName, cloudbrain.CodeMountPath+"/"), storage.GetMinioPath(jobName, cloudbrain.ModelMountPath+"/"), storage.GetMinioPath(jobName, cloudbrain.BenchMarkMountPath+"/"), storage.GetMinioPath(jobName, cloudbrain.Snn4imagenetMountPath+"/"), - storage.GetMinioPath(jobName, cloudbrain.BrainScoreMountPath+"/"), string(models.JobTypeBenchmark), gpuQueue, benchmarkTypeID, benchmarkChildTypeID, resourceSpecId) + storage.GetMinioPath(jobName, cloudbrain.BrainScoreMountPath+"/"), string(models.JobTypeBenchmark), gpuQueue, form.Description, + benchmarkTypeID, benchmarkChildTypeID, resourceSpecId) if err != nil { cloudBrainNewDataPrepare(ctx) ctx.RenderWithErr(err.Error(), tplCloudBrainBenchmarkNew, &form) From 5682dd6c5e3e7176f789795af6c62f0cf99d617b Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 18 Jan 2022 16:24:53 +0800 Subject: [PATCH 056/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/cloudbrain.go | 30 +++++-------------- .../repo/cloudbrain/benchmark/index.tmpl | 3 ++ templates/repo/cloudbrain/benchmark/new.tmpl | 21 +++++++------ templates/repo/cloudbrain/benchmark/show.tmpl | 24 ++++++++------- 4 files changed, 35 insertions(+), 43 deletions(-) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 426cab39c..66473c171 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -1014,49 +1014,33 @@ func CloudBrainBenchmarkIndex(ctx *context.Context) { func GetChildTypes(ctx *context.Context) { benchmarkTypeID := ctx.QueryInt("benchmark_type_id") - resultCode := "-1" - errMsg := "" - childTypes := "" - + re := make(map[string]interface{}) for { if benchmarkTypes == nil { if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil { log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", setting.BenchmarkTypes, err, ctx.Data["MsgID"]) - errMsg = "system error" + re["errMsg"] = "system error" break } } - var isExist bool for id, benchmarkType := range benchmarkTypes.BenchmarkType { if id == benchmarkTypeID { isExist = true - temp, err := json.Marshal(benchmarkType.Second) - if err != nil { - log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", setting.BenchmarkTypes, err, ctx.Data["MsgID"]) - errMsg = "system error" - break - } - childTypes = string(temp) - resultCode = "0" + re["child_types"] = benchmarkType.Second + re["result_code"] = "0" break } } - if !isExist { + re["result_code"] = "1" log.Error("no such benchmark_type_id", ctx.Data["MsgID"]) - errMsg = "system error" + re["errMsg"] = "system error" break } - break } - - ctx.JSON(200, map[string]string{ - "result_code": resultCode, - "error_msg": errMsg, - "child_types": childTypes, - }) + ctx.JSON(200, re) } func CloudBrainBenchmarkNew(ctx *context.Context) { diff --git a/templates/repo/cloudbrain/benchmark/index.tmpl b/templates/repo/cloudbrain/benchmark/index.tmpl index 21f7985e2..3e40ae9d1 100644 --- a/templates/repo/cloudbrain/benchmark/index.tmpl +++ b/templates/repo/cloudbrain/benchmark/index.tmpl @@ -38,6 +38,7 @@
+ 目标检测算法排行榜 {{if .Permission.CanWrite $.UnitTypeCloudBrain}} {{$.i18n.Tr "repo.modelarts.evaluate_job.new_job"}} {{else}} @@ -176,10 +177,12 @@
{{end}} + {{template "base/paginate" .}} diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index 89afd9480..4e0a5b3e6 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -85,7 +85,7 @@ - +
+ {{range .images}} From fc7e5075536180c68f5076f73063b938b7ef9b8e Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 20 Jan 2022 14:23:44 +0800 Subject: [PATCH 085/105] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/new.tmpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index 68700700e..d81d7f542 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -115,7 +115,8 @@
- + +         From 0403f6e7ee823d270e280a4bf80468df63d66990 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 20 Jan 2022 14:26:33 +0800 Subject: [PATCH 086/105] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/new.tmpl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index d81d7f542..269dcf040 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -104,8 +104,9 @@ {{end}}
- +
+ @@ -116,7 +117,7 @@
-         +        From 19aec76cc43ac659a9566d4a0b91eab7138f57f9 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 20 Jan 2022 14:43:48 +0800 Subject: [PATCH 087/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/new.tmpl | 21 +++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index 269dcf040..1fd412f13 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -95,29 +95,26 @@
-
- -
- {{range .benchmark_types}} {{end}} -
- -
+
+
- -
- +
-        +       From 621771ae09001e5575980f03a8a53c120ba420f3 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 20 Jan 2022 14:44:57 +0800 Subject: [PATCH 088/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/new.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index 1fd412f13..0e34cf31e 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -98,7 +98,7 @@
- +
- +
From 27e406364e2c7bb4e7358cd029bc17942a43eb30 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 20 Jan 2022 14:52:09 +0800 Subject: [PATCH 089/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/new.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index 0e34cf31e..ee2a44e32 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -98,16 +98,16 @@
- - {{range .benchmark_types}} {{end}}
- -
From f1b4f98209f51d218e8984c55e1645c92a905206 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 20 Jan 2022 14:54:12 +0800 Subject: [PATCH 090/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/new.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index ee2a44e32..9c2f00952 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -98,7 +98,7 @@
- + +
@@ -98,7 +98,8 @@
- + +   + {{range .images}} From e8be5b65a4b654bccc5c3746775bb87cedd0d285 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 20 Jan 2022 15:09:29 +0800 Subject: [PATCH 092/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- .../repo/cloudbrain/benchmark/index.tmpl | 19 ------------------- templates/repo/cloudbrain/benchmark/show.tmpl | 3 +++ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/index.tmpl b/templates/repo/cloudbrain/benchmark/index.tmpl index 17fc7e1e6..9c55d0847 100644 --- a/templates/repo/cloudbrain/benchmark/index.tmpl +++ b/templates/repo/cloudbrain/benchmark/index.tmpl @@ -384,23 +384,4 @@ } - - // 显示弹窗,弹出相应的信息 - function showmask() { - $('#imageModal').css('display', 'none') - $('#mask').css('display', 'block') - - $("iframe[name=iframeContent]").on("load", function() {   - var responseText = $("iframe")[0].contentDocument.body.getElementsByTagName("pre")[0].innerHTML;  - var json1 = JSON.parse(responseText) - $('#mask').css('display', 'none') - parent.location.href - - if (json1.result_code === "0") { - $('.alert').html('操作成功!').removeClass('alert-danger').addClass('alert-success').show().delay(1500).fadeOut(); - } else { - $('.alert').html(json1.error_msg).removeClass('alert-success').addClass('alert-danger').show().delay(5000).fadeOut(); - } - }) - } \ No newline at end of file diff --git a/templates/repo/cloudbrain/benchmark/show.tmpl b/templates/repo/cloudbrain/benchmark/show.tmpl index 7ef2985f1..30696738b 100755 --- a/templates/repo/cloudbrain/benchmark/show.tmpl +++ b/templates/repo/cloudbrain/benchmark/show.tmpl @@ -422,13 +422,16 @@ td, th { function loadLog(version_name){ + document.getElementById("mask").style.display = "block" $.get(`/api/v1/repos/${userName}/${repoPath}/cloudbrain/${jobID}/log?version_name=${version_name}&lines=50&order=asc`, (data) => { $('input[name=end_line]').val(data.EndLine) $('input[name=start_line]').val(data.StartLine) $(`#log_file${version_name}`).text(data.Content) + document.getElementById("mask").style.display = "none" }).fail(function(err) { console.log(err); }); + } \ No newline at end of file From 13278e96b9f49a60a14cfe3ffbec27606924c6d2 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 20 Jan 2022 15:52:43 +0800 Subject: [PATCH 093/105] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/show.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/cloudbrain/benchmark/show.tmpl b/templates/repo/cloudbrain/benchmark/show.tmpl index 30696738b..b9e4d12e4 100755 --- a/templates/repo/cloudbrain/benchmark/show.tmpl +++ b/templates/repo/cloudbrain/benchmark/show.tmpl @@ -430,8 +430,8 @@ td, th { document.getElementById("mask").style.display = "none" }).fail(function(err) { console.log(err); + document.getElementById("mask").style.display = "none" }); - } \ No newline at end of file From 6c9a9d8e540ae7fa9b796b4654437fa6dc2ee747 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Thu, 20 Jan 2022 16:01:46 +0800 Subject: [PATCH 094/105] fix bug --- routers/repo/cloudbrain.go | 37 ++++++++++++++++++- templates/repo/cloudbrain/benchmark/show.tmpl | 4 +- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 462e79bef..0e9db504b 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -358,9 +358,10 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { } if result != nil { - log.Info("task is ...") jobRes, _ := models.ConvertToJobResultPayload(result.Payload) jobRes.Resource.Memory = strings.ReplaceAll(jobRes.Resource.Memory, "Mi", "MB") + spec := "GPU数:" + strconv.Itoa(jobRes.Resource.NvidiaComGpu) + ",CPU数:" + strconv.Itoa(jobRes.Resource.CPU) + ",内存(MB):" + jobRes.Resource.Memory + ctx.Data["resource_spec"] = spec taskRoles := jobRes.TaskRoles if jobRes.JobStatus.State != string(models.JobFailed) { taskRes, _ := models.ConvertToTaskPod(taskRoles[cloudbrain.SubTaskName].(map[string]interface{})) @@ -392,6 +393,14 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { if err == nil { task.User = user } + + var duration int64 + if task.Status == string(models.JobRunning) { + duration = time.Now().Unix() - int64(task.CreatedUnix) + } else { + duration = int64(task.UpdatedUnix) - int64(task.CreatedUnix) + } + ctx.Data["duration"] = util.AddZero(duration/3600000) + ":" + util.AddZero(duration%3600000/60000) + ":" + util.AddZero(duration%60000/1000) ctx.Data["task"] = task ctx.Data["jobID"] = jobID ctx.Data["jobName"] = task.JobName @@ -1237,7 +1246,31 @@ func CloudBrainBenchmarkCreate(ctx *context.Context, form auth.CreateCloudBrainF return } - //todo: check the boot file(train.py&test.py) + if _, err := os.Stat(codePath + "/train.py"); err != nil { + if os.IsNotExist(err) { + // file does not exist + log.Error("train.py is not exist, %v", err, ctx.Data["MsgID"]) + cloudBrainNewDataPrepare(ctx) + ctx.RenderWithErr("train.py is not exist", tplCloudBrainBenchmarkNew, &form) + } else { + log.Error("Stat failed, %v", err, ctx.Data["MsgID"]) + cloudBrainNewDataPrepare(ctx) + ctx.RenderWithErr("system error", tplCloudBrainBenchmarkNew, &form) + } + return + } else if _, err := os.Stat(codePath + "/test.py"); err != nil { + if os.IsNotExist(err) { + // file does not exist + log.Error("test.py is not exist, %v", err, ctx.Data["MsgID"]) + cloudBrainNewDataPrepare(ctx) + ctx.RenderWithErr("test.py is not exist", tplCloudBrainBenchmarkNew, &form) + } else { + log.Error("Stat failed, %v", err, ctx.Data["MsgID"]) + cloudBrainNewDataPrepare(ctx) + ctx.RenderWithErr("system error", tplCloudBrainBenchmarkNew, &form) + } + return + } if err := uploadCodeToMinio(codePath+"/", jobName, cloudbrain.CodeMountPath+"/"); err != nil { log.Error("uploadCodeToMinio failed, %v", err, ctx.Data["MsgID"]) diff --git a/templates/repo/cloudbrain/benchmark/show.tmpl b/templates/repo/cloudbrain/benchmark/show.tmpl index b9e4d12e4..810a3f6c3 100755 --- a/templates/repo/cloudbrain/benchmark/show.tmpl +++ b/templates/repo/cloudbrain/benchmark/show.tmpl @@ -262,7 +262,7 @@ td, th {
- {{.TrainJobDuration}} + {{$.duration}}
@@ -330,7 +330,7 @@ td, th {
- {{.GpuQueue}} + {{$.resource_spec}}
From 190a3d8477b0af7e82f87d15b00c2329504e322e Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 20 Jan 2022 16:12:12 +0800 Subject: [PATCH 095/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/new.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index f369178e5..b28da5735 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -142,13 +142,13 @@
- 查看样例 + 查看样例
- 查看样例 + 查看样例
From 7f4b331b662dc9c24649372021d96678d5a44383 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 20 Jan 2022 16:40:43 +0800 Subject: [PATCH 096/105] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/index.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/cloudbrain/benchmark/index.tmpl b/templates/repo/cloudbrain/benchmark/index.tmpl index 9c55d0847..b2315f2f2 100644 --- a/templates/repo/cloudbrain/benchmark/index.tmpl +++ b/templates/repo/cloudbrain/benchmark/index.tmpl @@ -39,7 +39,7 @@
- 目标检测算法排行榜 + 基准测试排行榜 {{if .Permission.CanWrite $.UnitTypeCloudBrain}} {{$.i18n.Tr "repo.modelarts.evaluate_job.new_job"}} {{else}} From 8a0e0b4e026fa0094e31402ca0d7fc2b88ccf367 Mon Sep 17 00:00:00 2001 From: OpenIhu Date: Thu, 20 Jan 2022 16:46:21 +0800 Subject: [PATCH 097/105] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E9=A1=B5=E9=80=82=E9=85=8D=E5=B0=8F=E5=B1=8F=E5=B9=95=E5=88=86?= =?UTF-8?q?=E8=BE=A8=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/less/openi.less | 106 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 2 deletions(-) diff --git a/web_src/less/openi.less b/web_src/less/openi.less index a0b533173..39789d9d9 100644 --- a/web_src/less/openi.less +++ b/web_src/less/openi.less @@ -15,8 +15,8 @@ a { } .following.bar #navbar .brand{ padding-left: 0; - padding-top: 0; - padding-bottom: 0; + padding-top: 0; + padding-bottom: 0; } .following.bar .brand .ui.mini.image { width: auto; @@ -615,4 +615,106 @@ display: block; } .a_margin{ margin: 0px !important; +} +@media only screen and (max-width: 767px) { + .following.bar #navbar .brand{ + padding-top: 6px; + } + .secondary.menu + .ui.container{ + margin-left:0 !important; + margin-right:0 !important; + } + .repo-title{ + position: absolute; + top: 6px; + left: 50px; + right: 70px; + height: 40px; + line-height: 40px !important; + text-align: center; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + color: #FFF; + background-color: #363840; + padding-left: 20px; + } + .repo-title a{ + color: #FFF !important; + } + .repo-title img + a{ + display: none !important; + } + .repository .header-wrapper{ + margin-bottom: 36px; + } + .header-wrapper .tabs.divider{ + margin-top: 40px !important; + } + .repository .ui.tabs.container{ + margin-top: -60px; + } + + .repo-title .divider, + .repo-title svg, + .repo-title img, + .ui.tabular.menu .item svg, + .ui.tabular.menu .item i, + .ui.tabular.menu .item .label, + .ui.tabular.menu .dropdown-content, + .repository.file .repository-summary, + .repository-summary + .menu, + .desc-home .edit-icon, + #repo-files-table .message, + #repo-files-table .age, + #repo-files-table .ui.sha.label, + #repo-files-table .commit-button, + .members + { + display: none !important; + } + .header-wrapper{ + display: flex; + flex-direction: column-reverse; + } + .ui.tabular.menu .item{ + padding: .5em; + } + .ui.tabular.menu .active.item{ + border: none; + background: none; + color: #000000; + border-bottom: 2px solid #000; + white-space: nowrap; + } + .repository .repo-header{ + margin-bottom: -50px; + } + .repo-header .repo-buttons{ + position: absolute; + right: 15px; + margin-bottom: -60px; + } + .repo-buttons .ui.labeled.button>.button{ + box-shadow: none !important; + width: 16px; + overflow: hidden; + white-space: nowrap; + } + .repo-buttons .ui.labeled.button>.label{ + border: none !important; + } + .repository.file.list #repo-files-table td.name{ + max-width: 100%; + } + #repo-files-table tr{ + padding-top: 0; + padding-bottom: 0; + } + .ui.attached:not(.message)+.ui.attached.segment:not(.top){ + border: none; + } + .markdown:not(code).file-view{ + padding: 2em 0!important; + } } \ No newline at end of file From dd9f3c402f757dc9107b4a312be49a452e39c41b Mon Sep 17 00:00:00 2001 From: OpenIhu Date: Thu, 20 Jan 2022 16:52:48 +0800 Subject: [PATCH 098/105] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E9=A1=B5=E8=8F=9C=E5=8D=95=E5=8F=96=E6=B6=88=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E7=AB=96=E6=8E=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/repo/header.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 2091610df..26f0acc6e 100755 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -90,7 +90,7 @@ {{end}}
{{if not .Repository.IsBeingCreated}} -