Browse Source

benchmark config

tags/v1.21.12.1
yuyuanshifu 4 years ago
parent
commit
715cbfb0ad
3 changed files with 13 additions and 1 deletions
  1. +3
    -0
      custom/conf/app.ini.sample
  2. +6
    -0
      modules/setting/setting.go
  3. +4
    -1
      routers/repo/cloudbrain.go

+ 3
- 0
custom/conf/app.ini.sample View File

@@ -1055,6 +1055,9 @@ DEBUG_SERVER_HOST = http://192.168.202.73/
USER = cW4cMtH24eoWPE7X
PWD = 4BPmgvK2hb2Eywwyp4YZRY4B7yQf4DA.C
JOB_TYPE = debug_openi

[benchmark]
ENABLED = true
BENCHMARKCODE = https://yangzhx:justfortest123@git.openi.org.cn/yangzhx/detection_benchmark_script.git

[decompress]


+ 6
- 0
modules/setting/setting.go View File

@@ -438,6 +438,9 @@ var (
JobPath string
JobType string
DebugServerHost string

//benchmark config
IsBenchmarkEnabled bool
BenchmarkCode string
)

@@ -1114,6 +1117,9 @@ func NewContext() {
JobPath = sec.Key("JOB_PATH").MustString("/datasets/minio/data/opendata/jobs/")
DebugServerHost = sec.Key("DEBUG_SERVER_HOST").MustString("http://192.168.202.73")
JobType = sec.Key("JOB_TYPE").MustString("debug_openi")

sec = Cfg.Section("benchmark")
IsBenchmarkEnabled = sec.Key("ENABLED").MustBool(false)
BenchmarkCode = sec.Key("BENCHMARKCODE").MustString("https://yangzhx:justfortest123@git.openi.org.cn/yangzhx/detection_benchmark_script.git")
}



+ 4
- 1
routers/repo/cloudbrain.go View File

@@ -112,6 +112,7 @@ func CloudBrainNew(ctx *context.Context) {
ctx.Data["dataset_path"] = cloudbrain.DataSetMountPath
ctx.Data["model_path"] = cloudbrain.ModelMountPath
ctx.Data["benchmark_path"] = cloudbrain.BenchMarkMountPath
ctx.Data["is_benchmark_enabled"] = setting.IsBenchmarkEnabled
ctx.HTML(200, tplCloudBrainNew)
}

@@ -133,7 +134,9 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) {
}

benchmarkPath := setting.JobPath + jobName + cloudbrain.BenchMarkMountPath
downloadBenchmarkCode(repo, jobName, benchmarkPath)
if setting.IsBenchmarkEnabled {
downloadBenchmarkCode(repo, jobName, benchmarkPath)
}

err = cloudbrain.GenerateTask(ctx, jobName, image, command, uuid, codePath, modelPath, benchmarkPath)
if err != nil {


Loading…
Cancel
Save