|
|
|
@@ -131,6 +131,8 @@ func CloudBrainNew(ctx *context.Context) { |
|
|
|
ctx.Data["model_path"] = cloudbrain.ModelMountPath |
|
|
|
ctx.Data["benchmark_path"] = cloudbrain.BenchMarkMountPath |
|
|
|
ctx.Data["is_benchmark_enabled"] = setting.IsBenchmarkEnabled |
|
|
|
ctx.Data["snn4imagenet_path"] = cloudbrain.Snn4imagenetMountPath |
|
|
|
ctx.Data["is_snn4imagenet_enabled"] = setting.IsSnn4imagenetEnabled |
|
|
|
ctx.HTML(200, tplCloudBrainNew) |
|
|
|
} |
|
|
|
|
|
|
|
@@ -320,6 +322,23 @@ func CloudBrainBenchmark(ctx *context.Context) { |
|
|
|
ctx.Redirect(setting.BenchmarkServerHost) |
|
|
|
} |
|
|
|
|
|
|
|
func GetRate(ctx *context.Context) { |
|
|
|
var jobID = ctx.Params(":jobid") |
|
|
|
job, err := models.GetCloudbrainByJobID(jobID) |
|
|
|
if err != nil { |
|
|
|
ctx.ServerError("GetCloudbrainByJobID failed", err) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if job.JobType == string(models.JobTypeBenchmark) { |
|
|
|
ctx.Redirect(setting.BenchmarkServerHost) |
|
|
|
} else if job.JobType == string(models.JobTypeSnn4imagenet) { |
|
|
|
ctx.Redirect(setting.Snn4imagenetServerHost) |
|
|
|
} else { |
|
|
|
log.Error("JobType error:", job.JobType) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func downloadCode(repo *models.Repository, codePath string) error { |
|
|
|
if err := git.Clone(repo.RepoPath(), codePath, git.CloneRepoOptions{}); err != nil { |
|
|
|
log.Error("Failed to clone repository: %s (%v)", repo.FullName(), err) |
|
|
|
|