Commit 386118d 1 parent 16db3aa commit 386118d Copy full SHA for 386118d
File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ class MachineType:
134
134
guest_cpus : int
135
135
memory_mb : int
136
136
accelerators : List [AcceleratorInfo ]
137
-
137
+
138
138
@classmethod
139
139
def from_json (cls , jo : dict ) -> "MachineType" :
140
140
return cls (
@@ -150,7 +150,7 @@ def family(self) -> str:
150
150
# TODO: doesn't work with N1 custom machine types
151
151
# See https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#create
152
152
return self .name .split ("-" )[0 ]
153
-
153
+
154
154
@property
155
155
def supports_smt (self ) -> bool :
156
156
# https://cloud.google.com/compute/docs/cpu-platforms
@@ -159,7 +159,7 @@ def supports_smt(self) -> bool:
159
159
if self .guest_cpus == 1 :
160
160
return False
161
161
return True
162
-
162
+
163
163
@property
164
164
def sockets (self ) -> int :
165
165
return {
@@ -171,8 +171,10 @@ def sockets(self) -> int:
171
171
"c3" : 2 if self .guest_cpus > 88 else 1 ,
172
172
"c3d" : 2 if self .guest_cpus > 180 else 1 ,
173
173
"c4" : 2 if self .guest_cpus > 96 else 1 ,
174
+ "c4d" : 2 if self .guest_cpus > 192 else 1 ,
174
175
}.get (
175
- self .family , 1 , # assume 1 socket for all other families
176
+ self .family ,
177
+ 1 , # assume 1 socket for all other families
176
178
)
177
179
178
180
You can’t perform that action at this time.
0 commit comments