|
|
|
@@ -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 |
|
|
|
} |