Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update machine types #313

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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