Browse Source

benchmark config

tags/v0.1.8
yuyuanshifu 5 years ago
parent
commit
729dfa8f16
2 changed files with 10 additions and 1 deletions
  1. +6
    -0
      modules/setting/setting.go
  2. +4
    -1
      routers/repo/cloudbrain.go

+ 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