From 1598ba395584b2b6068d75de66e2c7e4426b02ac Mon Sep 17 00:00:00 2001 From: wangwei10061 Date: Wed, 6 Sep 2023 18:41:08 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20'docs/=E6=8C=81?= =?UTF-8?q?=E7=BB=AD=E9=9B=86=E6=88=90=E6=93=8D=E4=BD=9C=E6=8C=87=E5=8D=97?= =?UTF-8?q?.md'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/持续集成操作指南.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/持续集成操作指南.md diff --git a/docs/持续集成操作指南.md b/docs/持续集成操作指南.md new file mode 100644 index 0000000000..e69de29bb2 -- 2.34.1 From 23909340738d009d3339300b073583ea0f8d6949 Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 21 Dec 2023 16:52:27 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=B9=B4=E5=BA=A6?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E6=95=B0=E6=8D=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/user_business_analysis.go | 5 +---- modules/base/tool.go | 2 +- routers/repo/user_data_analysis.go | 12 ++++++------ 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index 9f14077855..0175e048d7 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -2322,12 +2322,9 @@ func queryCloudBrainTask(start_unix int64, end_unix int64) (map[int64]int, map[s if _, ok := resourceItemMap[cloudTaskRecord.UserID]; !ok { resourceItemMap[cloudTaskRecord.UserID] = make(map[string]int) } - if cloudTaskRecord.Duration < 100000000 && cloudTaskRecord.Duration > 0 { setMapKey("CloudBrainRunTime", cloudTaskRecord.UserID, int(cloudTaskRecord.Duration), resultItemMap) resourceItemMap[cloudTaskRecord.UserID][cloudTaskRecord.ComputeResource] = resourceItemMap[cloudTaskRecord.UserID][cloudTaskRecord.ComputeResource] + int(cloudTaskRecord.Duration) - } else { - resourceItemMap[cloudTaskRecord.UserID][cloudTaskRecord.ComputeResource] = 0 } if cloudTaskRecord.Type == 1 { //npu setMapKey("CloudBrainTwo", cloudTaskRecord.UserID, 1, resultItemMap) @@ -2359,7 +2356,7 @@ func queryCloudBrainTask(start_unix int64, end_unix int64) (map[int64]int, map[s } else { setMapKey("NpuDebugJob", cloudTaskRecord.UserID, 1, resultItemMap) } - } else if cloudTaskRecord.ComputeResource == GPUResource { + } else { if cloudTaskRecord.JobType == "TRAIN" { setMapKey("GpuTrainJob", cloudTaskRecord.UserID, 1, resultItemMap) } else if cloudTaskRecord.JobType == "ONLINEINFERENCE" { diff --git a/modules/base/tool.go b/modules/base/tool.go index 2b6243f572..a9ddc639b7 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -224,7 +224,7 @@ func SizedAvatarLinkWithDomain(email string, size int) string { // FileSize calculates the file size and generate user-friendly string. func FileSize(s int64) string { - return humanize.Bytes(uint64(s)) + return humanize.IBytes(uint64(s)) } // PrettyNumber produces a string form of the given number in base 10 with diff --git a/routers/repo/user_data_analysis.go b/routers/repo/user_data_analysis.go index e23d9cdebe..cc8d7af68e 100755 --- a/routers/repo/user_data_analysis.go +++ b/routers/repo/user_data_analysis.go @@ -724,12 +724,6 @@ func TimingCountDataByDateAndReCount(date string, isReCount bool) { startYear := time.Date(USER_YEAR, 1, 1, 0, 0, 0, 1, t.Location()) endYear := startYear.AddDate(1, 0, 0) - if time.Now().Year() == 2024 { - log.Info("the day is 2024,so not update.") - return - } - models.RefreshUserYearTable(startYear, endYear) - //query wiki data log.Info("start to time count data") wikiMap, err := queryWikiCountMap(startTime, endTime) @@ -740,6 +734,12 @@ func TimingCountDataByDateAndReCount(date string, isReCount bool) { mailer.SendWarnNotifyMail(setting.Warn_Notify_Mails, warnEmailMessage) } + if time.Now().Year() == 2024 { + log.Info("the day is 2024,so not update.") + return + } + models.RefreshUserYearTable(startYear, endYear) + log.Info("end to count all user info data") } -- 2.34.1 From 8957b475cf724d232a04a94752415b0df406c31c Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 22 Dec 2023 08:56:21 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A1=8C=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1Bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/user_business_analysis.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index 0175e048d7..e0d8fd8918 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -579,18 +579,19 @@ func refreshUserStaticTable(wikiCountMap map[string]int, tableName string, pageS var CommitCodeSizeMap map[string]*git.UserKPIStats var err error var existCommitCodeSize map[int64]int - if tableName == "user_business_analysis_all" || tableName == "user_business_analysis_current_year" { - + if tableName == "user_business_analysis_all" { oneDayStartTime := pageEndTime.AddDate(0, 0, -1) + oneDayStartTime = time.Date(oneDayStartTime.Year(), oneDayStartTime.Month(), oneDayStartTime.Day(), 0, 0, 0, 1, oneDayStartTime.Location()) if oneDayStartTime.Format("2006-01-02") == pageStartTime.Format("2006-01-02") { existCommitCodeSize = make(map[int64]int, 0) } else { existCommitCodeSize = queryCommitCodeSizeFromDb("public." + tableName) } + oneDayEndTime := time.Date(oneDayStartTime.Year(), oneDayStartTime.Month(), oneDayStartTime.Day(), 23, 59, 59, 1, oneDayStartTime.Location()) log.Info("GetAllUserKPIStats oneDayStartTime=" + oneDayStartTime.Format("2006-01-02 15:04:05")) - log.Info("GetAllUserKPIStats pageEndTime=" + pageEndTime.Format("2006-01-02 15:04:05")) + log.Info("GetAllUserKPIStats pageEndTime=" + oneDayEndTime.Format("2006-01-02 15:04:05")) log.Info("existCommitCodeSize len=" + fmt.Sprint(len(existCommitCodeSize))) - CommitCodeSizeMap, err = GetAllUserKPIStats(oneDayStartTime, pageEndTime) + CommitCodeSizeMap, err = GetAllUserKPIStats(oneDayStartTime, oneDayEndTime) if err != nil { log.Info("query commit code errr.") } else { -- 2.34.1 From 14fdaf420baf7d615d42ec77c72478172382476f Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 22 Dec 2023 10:11:13 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/user_year_summary.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/user_year_summary.go b/models/user_year_summary.go index 0cb258b8ff..8e599f192e 100644 --- a/models/user_year_summary.go +++ b/models/user_year_summary.go @@ -342,7 +342,7 @@ func queryUserYearModel(start_unix int64, end_unix int64) map[int64]map[string]i var indexTotal int64 indexTotal = 0 for { - sess.Select("id,user_id,download_count,reference_count").Table("ai_model_manage").Where(cond).OrderBy("id asc").Limit(PAGE_SIZE, int(indexTotal)) + sess.Select("id,name,user_id,download_count,reference_count").Table("ai_model_manage").Where(cond).OrderBy("id asc").Limit(PAGE_SIZE, int(indexTotal)) aiModelList := make([]*AiModelManage, 0) sess.Find(&aiModelList) log.Info("query user year AiModelManage size=" + fmt.Sprint(len(aiModelList))) -- 2.34.1 From 3b8c7bff89ab36663303837325bb134cdf1bb1a9 Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 22 Dec 2023 11:44:33 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E8=AF=84=E6=B5=8B=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=BD=92=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- models/user_business_analysis.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/user_business_analysis.go b/models/user_business_analysis.go index e0d8fd8918..273c2340fc 100644 --- a/models/user_business_analysis.go +++ b/models/user_business_analysis.go @@ -2287,7 +2287,7 @@ func queryUserModelConvert(start_unix int64, end_unix int64) map[int64]int { } func isBenchMark(JobType string) bool { - if JobType == "BENCHMARK" || JobType == "MODELSAFETY" || JobType == "SNN4IMAGENET" || JobType == "BRAINSCORE" || JobType == "SNN4ECOSET" { + if JobType == "BENCHMARK" || JobType == "MODELSAFETY" || JobType == "SNN4IMAGENET" || JobType == "BRAINSCORE" || JobType == "SNN4ECOSET" || JobType == "SIM2BRAIN_SNN" { return true } return false -- 2.34.1 From 4b422d14be94b3d262af184f7f8154bfb5745ff2 Mon Sep 17 00:00:00 2001 From: youys <1272586223@qq.com> Date: Wed, 27 Dec 2023 10:07:58 +0800 Subject: [PATCH 06/10] =?UTF-8?q?fix(home.tmpl)=20=E6=B2=A1=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=A6=81=E6=AD=A2=E7=82=B9=E5=87=BBWEB=20IDE=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/repo/home.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 86c2df086f..011da989ce 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -245,8 +245,8 @@ {{if eq $n 0}}
-
-
WEB IDE
+ {{if not $.DisableHTTP}}