|
|
|
@@ -149,6 +149,8 @@ func cloudBrainNewDataPrepare(ctx *context.Context) error { |
|
|
|
|
|
|
|
ctx.Data["benchmark_types"] = GetBenchmarkTypes(ctx).BenchmarkType |
|
|
|
|
|
|
|
cloudbrain.InitSpecialPool() |
|
|
|
|
|
|
|
if gpuInfos == nil { |
|
|
|
json.Unmarshal([]byte(setting.GpuTypes), &gpuInfos) |
|
|
|
} |
|
|
|
@@ -178,6 +180,44 @@ func cloudBrainNewDataPrepare(ctx *context.Context) error { |
|
|
|
json.Unmarshal([]byte(setting.TrainResourceSpecs), &cloudbrain.TrainResourceSpecs) |
|
|
|
} |
|
|
|
ctx.Data["train_resource_specs"] = cloudbrain.TrainResourceSpecs.ResourceSpec |
|
|
|
|
|
|
|
if cloudbrain.SpecialPools != nil { |
|
|
|
var debugGpuTypes []*models.GpuInfo |
|
|
|
var trainGpuTypes []*models.GpuInfo |
|
|
|
|
|
|
|
for _, pool := range cloudbrain.SpecialPools.Pools { |
|
|
|
org, _ := models.GetOrgByName(pool.Org) |
|
|
|
if org != nil { |
|
|
|
isOrgMember, _ := models.IsOrganizationMember(org.ID, ctx.User.ID) |
|
|
|
if isOrgMember { |
|
|
|
for _, jobType := range pool.JobType { |
|
|
|
if jobType == string(models.JobTypeDebug) { |
|
|
|
debugGpuTypes = append(debugGpuTypes, pool.Pool...) |
|
|
|
if pool.ResourceSpec != nil { |
|
|
|
ctx.Data["resource_specs"] = pool.ResourceSpec |
|
|
|
} |
|
|
|
} else if jobType == string(models.JobTypeTrain) { |
|
|
|
trainGpuTypes = append(trainGpuTypes, pool.Pool...) |
|
|
|
if pool.ResourceSpec != nil { |
|
|
|
ctx.Data["train_resource_specs"] = pool.ResourceSpec |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if len(debugGpuTypes) > 0 { |
|
|
|
ctx.Data["gpu_types"] = debugGpuTypes |
|
|
|
} |
|
|
|
|
|
|
|
if len(trainGpuTypes) > 0 { |
|
|
|
ctx.Data["train_gpu_types"] = trainGpuInfos |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ctx.Data["params"] = "" |
|
|
|
ctx.Data["branchName"] = ctx.Repo.BranchName |
|
|
|
|
|
|
|
|