Skip to content

Commit e020d15

Browse files
authored
chore: update machine types (#313)
1 parent 7c39454 commit e020d15

File tree

1 file changed

+177
-100
lines changed

1 file changed

+177
-100
lines changed

rules/utils.go

Lines changed: 177 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,157 @@ import (
1010

1111
var validMachineTypes = map[string]bool{
1212
// Regular machine types: https://cloud.google.com/compute/docs/machine-types
13-
"e2-standard-2": true,
14-
"e2-standard-4": true,
15-
"e2-standard-8": true,
16-
"e2-standard-16": true,
17-
"e2-standard-32": true,
18-
"e2-highmem-2": true,
19-
"e2-highmem-4": true,
20-
"e2-highmem-8": true,
21-
"e2-highmem-16": true,
22-
"e2-highcpu-2": true,
23-
"e2-highcpu-4": true,
24-
"e2-highcpu-8": true,
25-
"e2-highcpu-16": true,
26-
"e2-highcpu-32": true,
13+
// C2
14+
"c2-standard-4": true,
15+
"c2-standard-8": true,
16+
"c2-standard-16": true,
17+
"c2-standard-30": true,
18+
"c2-standard-60": true,
19+
"c2d-standard-2": true,
20+
"c2d-standard-4": true,
21+
"c2d-standard-8": true,
22+
"c2d-standard-16": true,
23+
"c2d-standard-32": true,
24+
"c2d-standard-56": true,
25+
"c2d-standard-112": true,
26+
"c2d-highmem-2": true,
27+
"c2d-highmem-4": true,
28+
"c2d-highmem-8": true,
29+
"c2d-highmem-16": true,
30+
"c2d-highmem-32": true,
31+
"c2d-highmem-56": true,
32+
"c2d-highmem-112": true,
33+
"c2d-highcpu-2": true,
34+
"c2d-highcpu-4": true,
35+
"c2d-highcpu-8": true,
36+
"c2d-highcpu-16": true,
37+
"c2d-highcpu-32": true,
38+
"c2d-highcpu-56": true,
39+
"c2d-highcpu-112": true,
40+
// C3
41+
"c3-standard-4": true,
42+
"c3-standard-4-lssd": true,
43+
"c3-standard-8": true,
44+
"c3-standard-8-lssd": true,
45+
"c3-standard-22": true,
46+
"c3-standard-22-lssd": true,
47+
"c3-standard-44": true,
48+
"c3-standard-44-lssd": true,
49+
"c3-standard-88": true,
50+
"c3-standard-88-lssd": true,
51+
"c3-standard-176": true,
52+
"c3-standard-176-lssd": true,
53+
"c3-highmem-4": true,
54+
"c3-highmem-8": true,
55+
"c3-highmem-22": true,
56+
"c3-highmem-44": true,
57+
"c3-highmem-88": true,
58+
"c3-highmem-176": true,
59+
"c3-highcpu-4": true,
60+
"c3-highcpu-8": true,
61+
"c3-highcpu-22": true,
62+
"c3-highcpu-44": true,
63+
"c3-highcpu-88": true,
64+
"c3-highcpu-176": true,
65+
"c3d-standard-4": true,
66+
"c3d-standard-8": true,
67+
"c3d-standard-8-lssd": true,
68+
"c3d-standard-16": true,
69+
"c3d-standard-16-lssd": true,
70+
"c3d-standard-30": true,
71+
"c3d-standard-30-lssd": true,
72+
"c3d-standard-60": true,
73+
"c3d-standard-60-lssd": true,
74+
"c3d-standard-90": true,
75+
"c3d-standard-90-lssd": true,
76+
"c3d-standard-180": true,
77+
"c3d-standard-180-lssd": true,
78+
"c3d-standard-360": true,
79+
"c3d-standard-360-lssd": true,
80+
"c3d-highmem-4": true,
81+
"c3d-highmem-8": true,
82+
"c3d-highmem-16": true,
83+
"c3d-highmem-30": true,
84+
"c3d-highmem-60": true,
85+
"c3d-highmem-90": true,
86+
"c3d-highmem-180": true,
87+
"c3d-highmem-360": true,
88+
"c3d-highcpu-4": true,
89+
"c3d-highcpu-8": true,
90+
"c3d-highcpu-16": true,
91+
"c3d-highcpu-30": true,
92+
"c3d-highcpu-60": true,
93+
"c3d-highcpu-90": true,
94+
"c3d-highcpu-180": true,
95+
"c3d-highcpu-360": true,
96+
// E2
97+
"e2-micro": true,
98+
"e2-small": true,
99+
"e2-medium": true,
100+
"e2-standard-2": true,
101+
"e2-standard-4": true,
102+
"e2-standard-8": true,
103+
"e2-standard-16": true,
104+
"e2-standard-32": true,
105+
"e2-highmem-2": true,
106+
"e2-highmem-4": true,
107+
"e2-highmem-8": true,
108+
"e2-highmem-16": true,
109+
"e2-highcpu-2": true,
110+
"e2-highcpu-4": true,
111+
"e2-highcpu-8": true,
112+
"e2-highcpu-16": true,
113+
"e2-highcpu-32": true,
114+
// F1
115+
"f1-micro": true,
116+
// G1
117+
"g1-small": true,
118+
// H3
119+
"h3-standard-88": true,
120+
// M1
121+
"m1-megamem-96": true,
122+
"m1-ultramem-40": true,
123+
"m1-ultramem-80": true,
124+
"m1-ultramem-160": true,
125+
// M2
126+
"m2-megamem-416": true,
127+
"m2-hypermem-416": true,
128+
"m2-ultramem-208": true,
129+
"m2-ultramem-416": true,
130+
// M3
131+
"m3-megamem-64": true,
132+
"m3-megamem-128": true,
133+
"m3-ultramem-32": true,
134+
"m3-ultramem-64": true,
135+
"m3-ultramem-128": true,
136+
// N1
137+
"n1-standard-1": true,
138+
"n1-standard-2": true,
139+
"n1-standard-4": true,
140+
"n1-standard-8": true,
141+
"n1-standard-16": true,
142+
"n1-standard-32": true,
143+
"n1-standard-64": true,
144+
"n1-standard-96": true,
145+
"n1-highmem-2": true,
146+
"n1-highmem-4": true,
147+
"n1-highmem-8": true,
148+
"n1-highmem-16": true,
149+
"n1-highmem-32": true,
150+
"n1-highmem-64": true,
151+
"n1-highmem-96": true,
152+
"n1-megamem-96": true,
153+
"n1-ultramem-40": true,
154+
"n1-ultramem-80": true,
155+
"n1-ultramem-160": true,
156+
"n1-highcpu-2": true,
157+
"n1-highcpu-4": true,
158+
"n1-highcpu-8": true,
159+
"n1-highcpu-16": true,
160+
"n1-highcpu-32": true,
161+
"n1-highcpu-64": true,
162+
"n1-highcpu-96": true,
163+
// N2
27164
"n2-standard-2": true,
28165
"n2-standard-4": true,
29166
"n2-standard-8": true,
@@ -73,102 +210,33 @@ var validMachineTypes = map[string]bool{
73210
"n2d-highmem-64": true,
74211
"n2d-highmem-80": true,
75212
"n2d-highmem-96": true,
213+
"n2d-highcpu-80": true,
76214
"n2d-highcpu-2": true,
77215
"n2d-highcpu-4": true,
78216
"n2d-highcpu-8": true,
79217
"n2d-highcpu-16": true,
80218
"n2d-highcpu-32": true,
81219
"n2d-highcpu-48": true,
82220
"n2d-highcpu-64": true,
83-
"n2d-highcpu-80": true,
84221
"n2d-highcpu-96": true,
85222
"n2d-highcpu-128": true,
86223
"n2d-highcpu-224": true,
87-
"t2a-standard-1": true,
88-
"t2a-standard-2": true,
89-
"t2a-standard-4": true,
90-
"t2a-standard-8": true,
91-
"t2a-standard-16": true,
92-
"t2a-standard-32": true,
93-
"t2a-standard-48": true,
94-
"t2d-standard-1": true,
95-
"t2d-standard-2": true,
96-
"t2d-standard-4": true,
97-
"t2d-standard-8": true,
98-
"t2d-standard-16": true,
99-
"t2d-standard-32": true,
100-
"t2d-standard-48": true,
101-
"t2d-standard-60": true,
102-
"n1-standard-1": true,
103-
"n1-standard-2": true,
104-
"n1-standard-4": true,
105-
"n1-standard-8": true,
106-
"n1-standard-16": true,
107-
"n1-standard-32": true,
108-
"n1-standard-64": true,
109-
"n1-standard-96": true,
110-
"n1-highmem-2": true,
111-
"n1-highmem-4": true,
112-
"n1-highmem-8": true,
113-
"n1-highmem-16": true,
114-
"n1-highmem-32": true,
115-
"n1-highmem-64": true,
116-
"n1-highmem-96": true,
117-
"n1-highcpu-2": true,
118-
"n1-highcpu-4": true,
119-
"n1-highcpu-8": true,
120-
"n1-highcpu-16": true,
121-
"n1-highcpu-32": true,
122-
"n1-highcpu-64": true,
123-
"n1-highcpu-96": true,
124-
"c2-standard-4": true,
125-
"c2-standard-8": true,
126-
"c2-standard-16": true,
127-
"c2-standard-30": true,
128-
"c2-standard-60": true,
129-
"c2d-standard-2": true,
130-
"c2d-standard-4": true,
131-
"c2d-standard-8": true,
132-
"c2d-standard-16": true,
133-
"c2d-standard-32": true,
134-
"c2d-standard-56": true,
135-
"c2d-standard-112": true,
136-
"c2d-highmem-2": true,
137-
"c2d-highmem-4": true,
138-
"c2d-highmem-8": true,
139-
"c2d-highmem-16": true,
140-
"c2d-highmem-32": true,
141-
"c2d-highmem-56": true,
142-
"c2d-highmem-112": true,
143-
"c2d-highcpu-2": true,
144-
"c2d-highcpu-4": true,
145-
"c2d-highcpu-8": true,
146-
"c2d-highcpu-16": true,
147-
"c2d-highcpu-32": true,
148-
"c2d-highcpu-56": true,
149-
"c2d-highcpu-112": true,
150-
"m3-megamem-64": true,
151-
"m3-megamem-128": true,
152-
"m3-ultramem-32": true,
153-
"m3-ultramem-64": true,
154-
"m3-ultramem-128": true,
155-
"m2-ultramem-208": true,
156-
"m2-ultramem-416": true,
157-
"m2-megamem-416": true,
158-
"m2-hypermem-416": true,
159-
"m1-ultramem-40": true,
160-
"m1-ultramem-80": true,
161-
"m1-ultramem-160": true,
162-
"m1-megamem-96": true,
163-
"n1-megamem-96": true,
164-
"n1-ultramem-40": true,
165-
"n1-ultramem-80": true,
166-
"n1-ultramem-160": true,
167-
"e2-micro": true,
168-
"e2-small": true,
169-
"e2-medium": true,
170-
"f1-micro": true,
171-
"g1-small": true,
224+
// T2
225+
"t2a-standard-1": true,
226+
"t2a-standard-2": true,
227+
"t2a-standard-4": true,
228+
"t2a-standard-8": true,
229+
"t2a-standard-16": true,
230+
"t2a-standard-32": true,
231+
"t2a-standard-48": true,
232+
"t2d-standard-1": true,
233+
"t2d-standard-2": true,
234+
"t2d-standard-4": true,
235+
"t2d-standard-8": true,
236+
"t2d-standard-16": true,
237+
"t2d-standard-32": true,
238+
"t2d-standard-48": true,
239+
"t2d-standard-60": true,
172240

173241
// A100 machine types: https://cloud.google.com/compute/docs/gpus
174242
"a2-highgpu-1g": true,
@@ -190,6 +258,15 @@ var validMachineTypes = map[string]bool{
190258
"g2-standard-32": true,
191259
"g2-standard-48": true,
192260
"g2-standard-96": true,
261+
262+
// CT TPU machine types https://cloud.google.com/tpu/docs/tpus-in-gke
263+
"ct4p-hightpu-4t": true,
264+
"ct5l-hightpu-1t": true,
265+
"ct5l-hightpu-4t": true,
266+
"ct5l-hightpu-8t": true,
267+
"ct5lp-hightpu-1t": true,
268+
"ct5lp-hightpu-4t": true,
269+
"ct5lp-hightpu-8t": true,
193270
}
194271

195272
func isCustomType(machineType string) bool {

0 commit comments

Comments
 (0)