Browse Source

fix-3262

tags/v1.22.12.2^2
Gitea 2 years ago
parent
commit
504f6bd462
4 changed files with 6 additions and 8 deletions
  1. +1
    -1
      modules/setting/setting.go
  2. +1
    -1
      modules/templates/helper.go
  3. +2
    -3
      routers/repo/cloudbrain.go
  4. +2
    -3
      routers/repo/modelarts.go

+ 1
- 1
modules/setting/setting.go View File

@@ -1480,7 +1480,7 @@ func NewContext() {
MaxDatasetNum = sec.Key("MAX_DATASET_NUM").MustInt(5)
CullIdleTimeout = sec.Key("CULL_IDLE_TIMEOUT").MustString("900")
CullInterval = sec.Key("CULL_INTERVAL").MustString("60")
DebugAttachSize = sec.Key("DEBUG_DATASET_SIZE").MustInt(20 * 1024 * 1024 * 1024)
DebugAttachSize = sec.Key("DEBUG_ATTACH_SIZE").MustInt(20)

sec = Cfg.Section("benchmark")
IsBenchmarkEnabled = sec.Key("ENABLED").MustBool(false)


+ 1
- 1
modules/templates/helper.go View File

@@ -98,7 +98,7 @@ func NewFuncMap() []template.FuncMap {
return setting.UI.Reactions
},
"DebugAttachSize": func() int {
return setting.DebugAttachSize
return setting.DebugAttachSize * 1024 * 1024 * 1024
},
"AvatarLink": models.AvatarLink,
"Safe": Safe,


+ 2
- 3
routers/repo/cloudbrain.go View File

@@ -295,9 +295,8 @@ func cloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) {

if jobType == string(models.JobTypeDebug) {
for _, infos := range datasetInfos {
if infos.Size > int(setting.DebugAttachSize) {
log.Info("datasize exceed limit, the size of dataset(GB)::", infos.Size)
log.Error("The DatasetSize exceeds the limit (%d)", int(setting.DebugAttachSize/(1024*1024*1024))) // GB
if infos.Size > int(setting.DebugAttachSize * 1024 * 1024 * 1024) {
log.Error("The DatasetSize exceeds the limit (%d)", int(setting.DebugAttachSize)) // GB
cloudBrainNewDataPrepare(ctx, jobType)
ctx.RenderWithErr(ctx.Tr("cloudbrain.error.debug_datasetsize"), tpl, &form)
return


+ 2
- 3
routers/repo/modelarts.go View File

@@ -223,9 +223,8 @@ func Notebook2Create(ctx *context.Context, form auth.CreateModelArtsNotebookForm
if uuid != "" {
datasetInfos, _, err = models.GetDatasetInfo(uuid)
for _, infos := range datasetInfos {
if infos.Size > int(setting.DebugAttachSize) {
log.Info("datasize exceed limit, the size of dataset(GB)::", infos.Size)
log.Error("The DatasetSize exceeds the limit (%d)", int(setting.DebugAttachSize))
if infos.Size > int(setting.DebugAttachSize * 1024 * 1024 * 1024) {
log.Error("The DatasetSize exceeds the limit (%d)", int(setting.DebugAttachSize)) //GB
notebookNewDataPrepare(ctx)
ctx.RenderWithErr(ctx.Tr("cloudbrain.error.debug_datasetsize"), tplModelArtsNotebookNew, &form)
return


Loading…
Cancel
Save