Skip to content

Commit b4e802a

Browse files
authored
Merge pull request #589 from AI-Hypercomputer/scaliby/b/437370853
Fix cluster create when `--enable-autoprovisioning` is supplied
2 parents e3ae587 + 2faa737 commit b4e802a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/xpk/core/nap.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,25 @@ def enable_autoprovisioning_on_cluster(
9999
f' --region={zone_to_region(args.zone)} --enable-autoprovisioning'
100100
' --autoprovisioning-config-file'
101101
f' {autoprovisioning_config.config_filename}'
102-
' --autoscaling-profile=optimize-utilization'
103102
)
104103
task = 'Update cluster with autoprovisioning enabled'
105104
return_code = run_command_with_updates(command, task, args)
106105
if return_code != 0:
107106
xpk_print(f'{task} request returned ERROR {return_code}')
108107
return autoprovisioning_config, return_code
109108

109+
command = (
110+
'gcloud container clusters update'
111+
f' {args.cluster} --project={args.project}'
112+
f' --region={zone_to_region(args.zone)}'
113+
' --autoscaling-profile=optimize-utilization'
114+
)
115+
task = 'Update cluster with autoscaling-profile'
116+
return_code = run_command_with_updates(command, task, args)
117+
if return_code != 0:
118+
xpk_print(f'{task} request returned ERROR {return_code}')
119+
return autoprovisioning_config, return_code
120+
110121
# Update created accelerator node pools to support autoprovisioning.
111122
existing_node_pool_names, return_code = get_all_nodepools_programmatic(args)
112123
if return_code != 0:

0 commit comments

Comments
 (0)