Skip to content

Commit 2edb313

Browse files
committed
Increase the number of CPU nodes in the Pathways CPU nodepool.
1 parent 78d1a31 commit 2edb313

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/xpk/core/nodepool.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,17 @@ def run_gke_node_pool_create_command(
315315
# Pathways needs CPU nodepools in addition to TPU nodepools
316316
for node_pool_name in desired_pw_cpu_node_pools:
317317
if node_pool_name in existing_node_pool_names:
318-
continue
319-
command = (
320-
'gcloud beta container node-pools create'
321-
f' {node_pool_name} --node-version={gke_node_pool_version} --cluster={args.cluster} --project={args.project} --node-locations={args.zone} --region={zone_to_region(args.zone)} --num-nodes=1'
322-
f' --machine-type={args.pathways_gce_machine_type} --scopes=storage-full,gke-default,{CLOUD_PLATFORM_AUTH_SCOPE_URL} --enable-autoscaling'
323-
' --min-nodes=1 --max-nodes=20'
324-
)
318+
# Resize Pathways CPU nodepool to have at least 4 nodes
319+
command = (
320+
f'gcloud container clusters resize {args.cluster} --project={args.project} --node-pool {node_pool_name} --num-nodes=4 --region={zone_to_region(args.zone)} --quiet'
321+
)
322+
else:
323+
command = (
324+
'gcloud beta container node-pools create'
325+
f' {node_pool_name} --node-version={gke_node_pool_version} --cluster={args.cluster} --project={args.project} --node-locations={args.zone} --region={zone_to_region(args.zone)} --num-nodes=4'
326+
f' --machine-type={args.pathways_gce_machine_type} --scopes=storage-full,gke-default,{CLOUD_PLATFORM_AUTH_SCOPE_URL} --enable-autoscaling'
327+
' --min-nodes=1 --max-nodes=20'
328+
)
325329
task = f'NodepoolCreate-{node_pool_name}'
326330
create_commands.append(command)
327331
create_task_names.append(task)

0 commit comments

Comments
 (0)