diff --git a/custom/conf/app.ini.sample b/custom/conf/app.ini.sample index 030ad888d..ff8a1a1c9 100755 --- a/custom/conf/app.ini.sample +++ b/custom/conf/app.ini.sample @@ -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] diff --git a/modules/setting/setting.go b/modules/setting/setting.go index cea5b2316..c38764088 100755 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -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") } diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 0d7937c5d..ed53e86d0 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -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 {