Merge pull request #1011 from losipiuk/lo/gce-supported-gpus

Add gpus to supportedResources map in GCE cloud provider
This commit is contained in:
Marcin Wielgus 2018-06-22 17:16:13 +02:00 committed by GitHub
commit bbe99a27d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -96,9 +96,17 @@ var (
"https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/service.management.readonly", "https://www.googleapis.com/auth/service.management.readonly",
"https://www.googleapis.com/auth/servicecontrol"} "https://www.googleapis.com/auth/servicecontrol"}
supportedResources = map[string]bool{cloudprovider.ResourceNameCores: true, cloudprovider.ResourceNameMemory: true} supportedResources = map[string]bool{}
) )
func init() {
supportedResources[cloudprovider.ResourceNameCores] = true
supportedResources[cloudprovider.ResourceNameMemory] = true
for _, gpuType := range supportedGpuTypes {
supportedResources[gpuType] = true
}
}
type migInformation struct { type migInformation struct {
config *Mig config *Mig
basename string basename string

View File

@ -83,6 +83,12 @@ var (
8: 96, 8: 96,
}, },
} }
supportedGpuTypes = []string{
"nvidia-tesla-k80",
"nvidia-tesla-p100",
"nvidia-tesla-v100",
}
) )
func validateGpuConfig(gpuType string, gpuCount int64, zone, machineType string) error { func validateGpuConfig(gpuType string, gpuCount int64, zone, machineType string) error {