Skip to content

Commit

Permalink
chore: update machine types (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
nlacourte authored Nov 11, 2023
1 parent 7c39454 commit e020d15
Showing 1 changed file with 177 additions and 100 deletions.
277 changes: 177 additions & 100 deletions rules/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,157 @@ import (

var validMachineTypes = map[string]bool{
// Regular machine types: https://cloud.google.com/compute/docs/machine-types
"e2-standard-2": true,
"e2-standard-4": true,
"e2-standard-8": true,
"e2-standard-16": true,
"e2-standard-32": true,
"e2-highmem-2": true,
"e2-highmem-4": true,
"e2-highmem-8": true,
"e2-highmem-16": true,
"e2-highcpu-2": true,
"e2-highcpu-4": true,
"e2-highcpu-8": true,
"e2-highcpu-16": true,
"e2-highcpu-32": true,
// C2
"c2-standard-4": true,
"c2-standard-8": true,
"c2-standard-16": true,
"c2-standard-30": true,
"c2-standard-60": true,
"c2d-standard-2": true,
"c2d-standard-4": true,
"c2d-standard-8": true,
"c2d-standard-16": true,
"c2d-standard-32": true,
"c2d-standard-56": true,
"c2d-standard-112": true,
"c2d-highmem-2": true,
"c2d-highmem-4": true,
"c2d-highmem-8": true,
"c2d-highmem-16": true,
"c2d-highmem-32": true,
"c2d-highmem-56": true,
"c2d-highmem-112": true,
"c2d-highcpu-2": true,
"c2d-highcpu-4": true,
"c2d-highcpu-8": true,
"c2d-highcpu-16": true,
"c2d-highcpu-32": true,
"c2d-highcpu-56": true,
"c2d-highcpu-112": true,
// C3
"c3-standard-4": true,
"c3-standard-4-lssd": true,
"c3-standard-8": true,
"c3-standard-8-lssd": true,
"c3-standard-22": true,
"c3-standard-22-lssd": true,
"c3-standard-44": true,
"c3-standard-44-lssd": true,
"c3-standard-88": true,
"c3-standard-88-lssd": true,
"c3-standard-176": true,
"c3-standard-176-lssd": true,
"c3-highmem-4": true,
"c3-highmem-8": true,
"c3-highmem-22": true,
"c3-highmem-44": true,
"c3-highmem-88": true,
"c3-highmem-176": true,
"c3-highcpu-4": true,
"c3-highcpu-8": true,
"c3-highcpu-22": true,
"c3-highcpu-44": true,
"c3-highcpu-88": true,
"c3-highcpu-176": true,
"c3d-standard-4": true,
"c3d-standard-8": true,
"c3d-standard-8-lssd": true,
"c3d-standard-16": true,
"c3d-standard-16-lssd": true,
"c3d-standard-30": true,
"c3d-standard-30-lssd": true,
"c3d-standard-60": true,
"c3d-standard-60-lssd": true,
"c3d-standard-90": true,
"c3d-standard-90-lssd": true,
"c3d-standard-180": true,
"c3d-standard-180-lssd": true,
"c3d-standard-360": true,
"c3d-standard-360-lssd": true,
"c3d-highmem-4": true,
"c3d-highmem-8": true,
"c3d-highmem-16": true,
"c3d-highmem-30": true,
"c3d-highmem-60": true,
"c3d-highmem-90": true,
"c3d-highmem-180": true,
"c3d-highmem-360": true,
"c3d-highcpu-4": true,
"c3d-highcpu-8": true,
"c3d-highcpu-16": true,
"c3d-highcpu-30": true,
"c3d-highcpu-60": true,
"c3d-highcpu-90": true,
"c3d-highcpu-180": true,
"c3d-highcpu-360": true,
// E2
"e2-micro": true,
"e2-small": true,
"e2-medium": true,
"e2-standard-2": true,
"e2-standard-4": true,
"e2-standard-8": true,
"e2-standard-16": true,
"e2-standard-32": true,
"e2-highmem-2": true,
"e2-highmem-4": true,
"e2-highmem-8": true,
"e2-highmem-16": true,
"e2-highcpu-2": true,
"e2-highcpu-4": true,
"e2-highcpu-8": true,
"e2-highcpu-16": true,
"e2-highcpu-32": true,
// F1
"f1-micro": true,
// G1
"g1-small": true,
// H3
"h3-standard-88": true,
// M1
"m1-megamem-96": true,
"m1-ultramem-40": true,
"m1-ultramem-80": true,
"m1-ultramem-160": true,
// M2
"m2-megamem-416": true,
"m2-hypermem-416": true,
"m2-ultramem-208": true,
"m2-ultramem-416": true,
// M3
"m3-megamem-64": true,
"m3-megamem-128": true,
"m3-ultramem-32": true,
"m3-ultramem-64": true,
"m3-ultramem-128": true,
// N1
"n1-standard-1": true,
"n1-standard-2": true,
"n1-standard-4": true,
"n1-standard-8": true,
"n1-standard-16": true,
"n1-standard-32": true,
"n1-standard-64": true,
"n1-standard-96": true,
"n1-highmem-2": true,
"n1-highmem-4": true,
"n1-highmem-8": true,
"n1-highmem-16": true,
"n1-highmem-32": true,
"n1-highmem-64": true,
"n1-highmem-96": true,
"n1-megamem-96": true,
"n1-ultramem-40": true,
"n1-ultramem-80": true,
"n1-ultramem-160": true,
"n1-highcpu-2": true,
"n1-highcpu-4": true,
"n1-highcpu-8": true,
"n1-highcpu-16": true,
"n1-highcpu-32": true,
"n1-highcpu-64": true,
"n1-highcpu-96": true,
// N2
"n2-standard-2": true,
"n2-standard-4": true,
"n2-standard-8": true,
Expand Down Expand Up @@ -73,102 +210,33 @@ var validMachineTypes = map[string]bool{
"n2d-highmem-64": true,
"n2d-highmem-80": true,
"n2d-highmem-96": true,
"n2d-highcpu-80": true,
"n2d-highcpu-2": true,
"n2d-highcpu-4": true,
"n2d-highcpu-8": true,
"n2d-highcpu-16": true,
"n2d-highcpu-32": true,
"n2d-highcpu-48": true,
"n2d-highcpu-64": true,
"n2d-highcpu-80": true,
"n2d-highcpu-96": true,
"n2d-highcpu-128": true,
"n2d-highcpu-224": true,
"t2a-standard-1": true,
"t2a-standard-2": true,
"t2a-standard-4": true,
"t2a-standard-8": true,
"t2a-standard-16": true,
"t2a-standard-32": true,
"t2a-standard-48": true,
"t2d-standard-1": true,
"t2d-standard-2": true,
"t2d-standard-4": true,
"t2d-standard-8": true,
"t2d-standard-16": true,
"t2d-standard-32": true,
"t2d-standard-48": true,
"t2d-standard-60": true,
"n1-standard-1": true,
"n1-standard-2": true,
"n1-standard-4": true,
"n1-standard-8": true,
"n1-standard-16": true,
"n1-standard-32": true,
"n1-standard-64": true,
"n1-standard-96": true,
"n1-highmem-2": true,
"n1-highmem-4": true,
"n1-highmem-8": true,
"n1-highmem-16": true,
"n1-highmem-32": true,
"n1-highmem-64": true,
"n1-highmem-96": true,
"n1-highcpu-2": true,
"n1-highcpu-4": true,
"n1-highcpu-8": true,
"n1-highcpu-16": true,
"n1-highcpu-32": true,
"n1-highcpu-64": true,
"n1-highcpu-96": true,
"c2-standard-4": true,
"c2-standard-8": true,
"c2-standard-16": true,
"c2-standard-30": true,
"c2-standard-60": true,
"c2d-standard-2": true,
"c2d-standard-4": true,
"c2d-standard-8": true,
"c2d-standard-16": true,
"c2d-standard-32": true,
"c2d-standard-56": true,
"c2d-standard-112": true,
"c2d-highmem-2": true,
"c2d-highmem-4": true,
"c2d-highmem-8": true,
"c2d-highmem-16": true,
"c2d-highmem-32": true,
"c2d-highmem-56": true,
"c2d-highmem-112": true,
"c2d-highcpu-2": true,
"c2d-highcpu-4": true,
"c2d-highcpu-8": true,
"c2d-highcpu-16": true,
"c2d-highcpu-32": true,
"c2d-highcpu-56": true,
"c2d-highcpu-112": true,
"m3-megamem-64": true,
"m3-megamem-128": true,
"m3-ultramem-32": true,
"m3-ultramem-64": true,
"m3-ultramem-128": true,
"m2-ultramem-208": true,
"m2-ultramem-416": true,
"m2-megamem-416": true,
"m2-hypermem-416": true,
"m1-ultramem-40": true,
"m1-ultramem-80": true,
"m1-ultramem-160": true,
"m1-megamem-96": true,
"n1-megamem-96": true,
"n1-ultramem-40": true,
"n1-ultramem-80": true,
"n1-ultramem-160": true,
"e2-micro": true,
"e2-small": true,
"e2-medium": true,
"f1-micro": true,
"g1-small": true,
// T2
"t2a-standard-1": true,
"t2a-standard-2": true,
"t2a-standard-4": true,
"t2a-standard-8": true,
"t2a-standard-16": true,
"t2a-standard-32": true,
"t2a-standard-48": true,
"t2d-standard-1": true,
"t2d-standard-2": true,
"t2d-standard-4": true,
"t2d-standard-8": true,
"t2d-standard-16": true,
"t2d-standard-32": true,
"t2d-standard-48": true,
"t2d-standard-60": true,

// A100 machine types: https://cloud.google.com/compute/docs/gpus
"a2-highgpu-1g": true,
Expand All @@ -190,6 +258,15 @@ var validMachineTypes = map[string]bool{
"g2-standard-32": true,
"g2-standard-48": true,
"g2-standard-96": true,

// CT TPU machine types https://cloud.google.com/tpu/docs/tpus-in-gke
"ct4p-hightpu-4t": true,
"ct5l-hightpu-1t": true,
"ct5l-hightpu-4t": true,
"ct5l-hightpu-8t": true,
"ct5lp-hightpu-1t": true,
"ct5lp-hightpu-4t": true,
"ct5lp-hightpu-8t": true,
}

func isCustomType(machineType string) bool {
Expand Down

0 comments on commit e020d15

Please sign in to comment.