Skip to content

Commit 87ff0aa

Browse files
committed
Merge branch 'develop' into fix-jq-install
2 parents e80a686 + 6c0fad0 commit 87ff0aa

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/xpk/core/nap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@ def create_autoprovisioning_config(
183183
# is not controlled by NAP.
184184
cpu_limits = """
185185
minimum: 1
186-
maximum: 10000
186+
maximum: 1000000
187187
"""
188188
memory_limits = """
189189
minimum: 1
190-
maximum: 10000
190+
maximum: 10000000
191191
"""
192192

193193
# By default, the maximum chips is set to be the current number of resources used

src/xpk/core/nodepool.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
create_or_update_cluster_configmap,
3333
)
3434
from .system_characteristics import AcceleratorType
35+
from functools import reduce
36+
from operator import mul
3537

3638
CLOUD_PLATFORM_AUTH_SCOPE_URL = (
3739
'"https://www.googleapis.com/auth/cloud-platform"'
@@ -275,20 +277,24 @@ def run_gke_node_pool_create_command(
275277
f' --host-maintenance-interval={args.host_maintenance_interval}'
276278
f' {capacity_args}'
277279
' --enable-gvnic'
278-
f' {args.custom_nodepool_arguments}'
279280
)
280281
if system.accelerator_type == AcceleratorType['TPU']:
281282
command += f' --node-version={gke_node_pool_version}'
283+
topology_product = reduce(
284+
mul, (int(x) for x in system.topology.split('x')), 1
285+
)
282286
if capacity_type == CapacityType.FLEX_START:
283287
command += ' --num-nodes=0'
284-
else:
288+
elif topology_product > 1:
285289
command += f' --num-nodes={system.vms_per_slice}'
286-
command += ' --placement-type=COMPACT --max-pods-per-node 15'
287290
command += (
288291
f' --scopes=storage-full,gke-default,{CLOUD_PLATFORM_AUTH_SCOPE_URL}'
289292
)
290-
command += f' --tpu-topology={system.topology}'
291-
command += f' {args.custom_tpu_nodepool_arguments}'
293+
294+
if topology_product > 1:
295+
command += ' --placement-type=COMPACT --max-pods-per-node 15'
296+
command += f' --tpu-topology={system.topology}'
297+
command += f' {args.custom_tpu_nodepool_arguments}'
292298
elif system.accelerator_type == AcceleratorType['GPU']:
293299
subnet_prefix = f'{args.cluster}-{zone_to_region(args.zone)}'
294300
if capacity_type == CapacityType.FLEX_START:
@@ -319,6 +325,8 @@ def run_gke_node_pool_create_command(
319325
if args.enable_workload_identity or args.enable_gcsfuse_csi_driver:
320326
command += ' --workload-metadata=GKE_METADATA'
321327

328+
command += args.custom_nodepool_arguments
329+
322330
task = f'NodepoolCreate-{node_pool_name}'
323331
create_commands.append(command)
324332
create_task_names.append(task)

0 commit comments

Comments
 (0)