Browse Source

update

tags/v1.22.7.2^2
liuzx 3 years ago
parent
commit
cd725d6ab6
1 changed files with 18 additions and 0 deletions
  1. +18
    -0
      models/cloudbrain.go

+ 18
- 0
models/cloudbrain.go View File

@@ -2121,3 +2121,21 @@ func GetCloudbrainResourceSpec(jobType string, clusterType int, resourceSpecId i
return nil

}
func GetCloudbrainTaskCardNum(task Cloudbrain) int {
spec := GetCloudbrainResourceSpec(task.JobType, task.Type, task.ResourceSpecId, task.FlavorCode)
if spec == nil {
return 1
}
if task.Type == TypeCloudBrainOne {
if spec.ResourceSpec == nil {
return 1
}
return spec.ResourceSpec.GpuNum
} else if task.Type == TypeCloudBrainTwo {
if spec.FlavorInfo == nil {
return 1
}
return spec.FlavorInfo.UnitPrice
}
return 1
}

Loading…
Cancel
Save