From 692385810ae03b9ad7f613c9645b1dd424ac94cf Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Tue, 12 Apr 2022 19:46:36 +0800 Subject: [PATCH 001/137] opt --- routers/repo/cloudbrain.go | 6 ++++-- routers/repo/modelarts.go | 14 ++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 0d007a27d..fecd34faf 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -53,6 +53,7 @@ var ( ) const BENCHMARK_TYPE_CODE = "repo.cloudbrain.benchmark.types" +const CLONE_FILE_PREFIX = "file:///" var benchmarkTypesMap = make(map[string]*models.BenchmarkTypes, 0) @@ -909,7 +910,8 @@ func GetRate(ctx *context.Context) { } func downloadCode(repo *models.Repository, codePath, branchName string) error { - if err := git.Clone(repo.RepoPath(), codePath, git.CloneRepoOptions{Branch: branchName}); err != nil { + //add "file:///" prefix to make the depth valid + if err := git.Clone(CLONE_FILE_PREFIX+repo.RepoPath(), codePath, git.CloneRepoOptions{Branch: branchName, Depth: 1}); err != nil { log.Error("Failed to clone repository: %s (%v)", repo.FullName(), err) return err } @@ -969,7 +971,7 @@ func downloadRateCode(repo *models.Repository, taskName, rateOwnerName, rateRepo return err } - if err := git.Clone(repoExt.RepoPath(), codePath, git.CloneRepoOptions{}); err != nil { + if err := git.Clone(CLONE_FILE_PREFIX+repoExt.RepoPath(), codePath, git.CloneRepoOptions{Depth: 1}); err != nil { log.Error("Failed to clone repository: %s (%v)", repoExt.FullName(), err) return err } diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 8b785a395..29387133d 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -1023,10 +1023,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 @@ -1241,9 +1239,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) @@ -1867,9 +1863,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) From 21a4934beec74b3097e79d6fd5825683d8293ee5 Mon Sep 17 00:00:00 2001 From: wangjr Date: Thu, 14 Apr 2022 15:42:44 +0800 Subject: [PATCH 002/137] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BC=BA=E7=9C=81?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/user/dashboard/dashboard.tmpl | 123 ++++++++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/templates/user/dashboard/dashboard.tmpl b/templates/user/dashboard/dashboard.tmpl index f5b0e3f37..f692b638a 100644 --- a/templates/user/dashboard/dashboard.tmpl +++ b/templates/user/dashboard/dashboard.tmpl @@ -5,13 +5,136 @@ {{template "base/alert" .}}
+
+
+ 欢迎来到启智AI协作平台! +
+
+

探索更好的AI,来这里发现更有意思的 项目数据集

+

使用本平台提供的AI协作功能,如:托管代码、共享数据、调试算法或训练模型,请先创建项目

+

平台目前免费提供CPU、GPU、NPU的算力资源,可进行多种类型的AI任务。

+
+ + +
{{if .EnableHeatmap}} {{template "user/dashboard/heatmap" .}} {{end}} {{template "user/dashboard/feeds" .}} +
+
+ 活动: +
+
+

+ 还没有与你相关的活动 +

+
+
{{template "user/dashboard/repolist" .}}
{{template "base/footer" .}} + + + \ No newline at end of file From 7c59ecb7a97be4957b75a34c40d43a61e34b1198 Mon Sep 17 00:00:00 2001 From: wangjr Date: Fri, 15 Apr 2022 09:20:50 +0800 Subject: [PATCH 003/137] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- options/locale/locale_en-US.ini | 9 ++++ options/locale/locale_zh-CN.ini | 11 +++++ templates/user/dashboard/dashboard.tmpl | 56 +++++++++++-------------- 3 files changed, 44 insertions(+), 32 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 09bb5015f..f06c32f2f 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -266,6 +266,15 @@ search_related=related search_maybe=maybe search_ge= +wecome_AI_plt = Welcome to Qizhi AI Collaboration Platform! +explore_AI = Explore better AI, come here to find more interesting +datasets = Datasets +repositories = Repositories +use_plt__fuction = To use the AI collaboration functions provided by this platform, such as: hosting code, sharing data, debugging algorithms or training models, please first +provide_resoure = The platform currently provides free computing resources of CPU, GPU, and NPU, and can perform various types of AI tasks. +activity = Activity +no_events = There are no events related to you yet + [explore] repos = Repositories select_repos = Select the project diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index d26065363..b2696c570 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -268,6 +268,17 @@ search_related=相关 search_maybe=约为 search_ge=个 +wecome_AI_plt=欢迎来到启智AI协作平台! +explore_AI = 探索更好的AI,来这里发现更有意思的 +datasets = 数据集 +repositories = 项目 +use_plt__fuction = 使用本平台提供的AI协作功能,如:托管代码、共享数据、调试算法或训练模型,请先 +provide_resoure = 平台目前免费提供CPU、GPU、NPU的算力资源,可进行多种类型的AI任务。 +create_pro = 创建项目 +activity = 活动 +no_events = 还没有与您相关的活动 + + [explore] repos=项目 select_repos=精选项目 diff --git a/templates/user/dashboard/dashboard.tmpl b/templates/user/dashboard/dashboard.tmpl index f692b638a..adf091f9f 100644 --- a/templates/user/dashboard/dashboard.tmpl +++ b/templates/user/dashboard/dashboard.tmpl @@ -7,34 +7,29 @@
- 欢迎来到启智AI协作平台! + {{.i18n.Tr "home.wecome_AI_plt"}}
-

探索更好的AI,来这里发现更有意思的 项目数据集

-

使用本平台提供的AI协作功能,如:托管代码、共享数据、调试算法或训练模型,请先创建项目

-

平台目前免费提供CPU、GPU、NPU的算力资源,可进行多种类型的AI任务。

+

{{.i18n.Tr "home.explore_AI"}} {{.i18n.Tr "home.repositories"}}{{.i18n.Tr "home.datasets"}}

+

{{.i18n.Tr "home.use_plt__fuction"}}{{.i18n.Tr "repo.create_repo"}}

+

{{.i18n.Tr "home.provide_resoure"}}

- - {{if .EnableHeatmap}} {{template "user/dashboard/heatmap" .}} {{end}} - {{template "user/dashboard/feeds" .}} -
-
- 活动: -
-
-

- 还没有与你相关的活动 -

+ {{template "user/dashboard/feeds" .}} +
+
+ {{.i18n.Tr "home.activity"}}:
+
+

+ {{.i18n.Tr "home.no_events"}} +

{{template "user/dashboard/repolist" .}} @@ -63,9 +58,9 @@ margin-bottom: 20px; border-radius: 15px; line-height: 20px; + padding:0px 25px; } .title{ - padding-left: 25px; padding-top: 25px; color: rgba(16, 16, 16, 100); font-size: 20px; @@ -77,7 +72,6 @@ font-size: 14px; text-align: left; font-family: SourceHanSansSC-regular; - padding-left: 25px; margin-top: 20px; } .btn_create{ @@ -97,16 +91,8 @@ font-family: SourceHanSansSC-regular; margin-top: 30px; } - .look{ - padding-left: 29px; - } - .comm{ - padding-right: 20%; - float:right; - vertical-align: middle; - } + .guide{ - margin-left: 25px; margin-top:30px; padding-bottom: 30px; } @@ -118,8 +104,9 @@ text-align: center; font-family: Microsoft Yahei; border: 1px solid rgba(24, 144, 255, 100); - padding: 10px 20px; + padding: 5px 5px; vertical-align: middle; + border-radius: 4px; } .activity{ margin-top: 20px; @@ -136,5 +123,10 @@ text-align: center; font-family: SourceHanSansSC-regular; } - + .padding_none{ + padding: 0px !important; + } + .content >p{ + line-height: 2em !important; + } \ No newline at end of file From 9a933beb60d77ce6efdaa426e4b063177eaa0b00 Mon Sep 17 00:00:00 2001 From: wangjr Date: Fri, 15 Apr 2022 09:24:40 +0800 Subject: [PATCH 004/137] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/user/dashboard/dashboard.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/user/dashboard/dashboard.tmpl b/templates/user/dashboard/dashboard.tmpl index adf091f9f..0258c1461 100644 --- a/templates/user/dashboard/dashboard.tmpl +++ b/templates/user/dashboard/dashboard.tmpl @@ -22,7 +22,7 @@ {{template "user/dashboard/heatmap" .}} {{end}} {{template "user/dashboard/feeds" .}} -
+
{{.i18n.Tr "home.activity"}}:
From 8dbb98e29c3a295e74bbc73181428ff2459aa342 Mon Sep 17 00:00:00 2001 From: wangjr Date: Fri, 15 Apr 2022 18:00:32 +0800 Subject: [PATCH 005/137] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/user/dashboard/dashboard.tmpl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/user/dashboard/dashboard.tmpl b/templates/user/dashboard/dashboard.tmpl index 0258c1461..4156b94a8 100644 --- a/templates/user/dashboard/dashboard.tmpl +++ b/templates/user/dashboard/dashboard.tmpl @@ -44,8 +44,9 @@ let URL = AppSubUrl + '/api/v1/repos/search?sort=updated&order=desc&uid=true&q=&page=1&limit=10&mode= '; $.getJSON(URL, (result, _textStatus, request) => { - const count = request.getResponseHeader('X-Total-Count'); - if (count != 0){ + const counts_pro = request.getResponseHeader('X-Total-Count'); + console.log("count:",counts_pro) + if (counts_pro != 0){ document.getElementById("default_page").style.display = "none"; document.getElementById("activity_cont").style.display = "none" } From ba93a3ea2510bb853867a5ccd3f9cde2fe416f96 Mon Sep 17 00:00:00 2001 From: wangjr Date: Fri, 15 Apr 2022 18:35:20 +0800 Subject: [PATCH 006/137] =?UTF-8?q?=E8=8E=B7=E5=8F=96uid=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/user/dashboard/dashboard.tmpl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/user/dashboard/dashboard.tmpl b/templates/user/dashboard/dashboard.tmpl index 4156b94a8..828679153 100644 --- a/templates/user/dashboard/dashboard.tmpl +++ b/templates/user/dashboard/dashboard.tmpl @@ -40,8 +40,9 @@ diff --git a/web_src/less/openi.less b/web_src/less/openi.less index c195bac38..31a8932c0 100644 --- a/web_src/less/openi.less +++ b/web_src/less/openi.less @@ -250,6 +250,23 @@ footer .column{margin-bottom:0!important; padding-bottom:0!important;} .CREATING, .STOPPING, .DELETING, .STARTING, i.WAITING ,.INIT,.KILLING{display:inline-block;background-image:url('/img/loading.gif');background-repeat:no-repeat;width:16px;height:16px;background-size:16px 16px;margin-right:5px;} i.COMPLETED,i.SUCCEEDED{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;background-position: -441px -52px;} +.icon-to-bottom{ + background:url("/img/icons.svg"); + background-position: -574px -208px; + width: 30px; + height: 30px; + display: inline-block; +} +.icon-to-top{ + background:url("/img/icons.svg"); + background-position: -540px -208px; + width: 30px; + height: 30px; + display: inline-block; +} + + + .text_over{ overflow: hidden; text-overflow: ellipsis; From 39cdb60b8f61779cc1d32b578cb4cace014ff9b5 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Mon, 18 Apr 2022 10:48:03 +0800 Subject: [PATCH 010/137] fix issue --- 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 b99a50f1f..dbdf6af09 100755 --- a/templates/repo/debugjob/index.tmpl +++ b/templates/repo/debugjob/index.tmpl @@ -380,7 +380,7 @@