Skip to content

Commit 88f97a9

Browse files
authored
Merge branch 'develop' into chzheng/docker_image_flag
2 parents 16e76b1 + dfafdcb commit 88f97a9

File tree

12 files changed

+135
-23
lines changed

12 files changed

+135
-23
lines changed

src/xpk/commands/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def is_TAS_possible(
7171
xpk_print('capacity_type data was not found in configmaps.')
7272
xpk_exit(1)
7373

74-
if flex:
74+
if not flex:
7575
return False
7676

7777
if (

src/xpk/commands/workload.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@
226226
metadata:
227227
labels:
228228
xpk.google.com/workload: {args.workload}
229-
annotations: {annotations}
229+
annotations:
230+
{annotations}
230231
spec:
231232
priorityClassName: {args.priority}
232233
restartPolicy: Never

src/xpk/core/blueprint/blueprint_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
}
5353

5454
cluster_toolkit_url = "github.com/GoogleCloudPlatform/cluster-toolkit"
55-
cluster_toolkit_version = "v1.57.1"
55+
cluster_toolkit_version = "v1.62.2"
5656

5757

5858
class BlueprintGeneratorOutput:

src/xpk/core/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from ..utils.console import xpk_print
2323

2424
# This is the version for XPK PyPI package
25-
__version__ = 'v0.10.1'
25+
__version__ = 'v0.11.0'
2626
XPK_CURRENT_VERSION = __version__
2727
XPK_CONFIG_FILE = os.path.expanduser('~/.config/xpk/config.yaml')
2828

src/xpk/core/docker_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
DockerRunCommandExitCode = 135
3131
dockerBuildErrorCode = 134
3232
ctk_dockerfile_path = "Dockerfile"
33-
ctk_build_ref = "v1.57.1"
33+
ctk_build_ref = "v1.62.2"
3434
ctk_docker_image = "xpk-ctk"
3535
ctk_container_name = "xpk-ctk-container"
3636
gcloud_cfg_mount_path = "/root/.config/gcloud"

src/xpk/core/kueue.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@
8989
name: dws-config
9090
spec:
9191
provisioningClassName: queued-provisioning.gke.io
92+
podSetUpdates:
93+
nodeSelector:
94+
- key: autoscaling.gke.io/provisioning-request
95+
valueFromProvisioningClassDetail: ResizeRequestName
9296
managedResources:
9397
- {managed_resource}
9498
---

src/xpk/core/nodepool.py

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
limitations under the License.
1515
"""
1616

17+
from typing import List
1718
from ..utils.console import get_user_input, xpk_print
1819
from .capacity import (
1920
AUTOPROVISIONING_CONFIG_VALUE,
@@ -90,20 +91,26 @@ def run_gke_node_pool_create_command(
9091
xpk_print('Parsing capacity arguments failed!')
9192
return return_code
9293

93-
if system.accelerator_type == AcceleratorType['GPU']:
94-
xpk_print(
95-
f'Creating 1 node pool with {args.num_nodes} nodes of'
96-
f' {system.device_type}\nUnderlyingly, we assume that means: {system}'
97-
)
98-
desired_node_pool_names = [f'{args.cluster}-np-0']
99-
else:
100-
xpk_print(
101-
f'Creating {args.num_slices} node pool or pools of'
102-
f' {system.device_type}\nUnderlyingly, we assume that means: {system}'
103-
)
104-
desired_node_pool_names = [
105-
f'{args.cluster}-np-{slice_num}' for slice_num in range(args.num_slices)
106-
]
94+
desired_node_pool_count = (
95+
1
96+
if system.accelerator_type == AcceleratorType['GPU']
97+
else args.num_slices
98+
)
99+
message = (
100+
(
101+
f'Creating 1 node pool with {args.num_nodes} nodes of'
102+
f' {system.device_type}\nUnderlyingly, we assume that means: {system}'
103+
)
104+
if system.accelerator_type == AcceleratorType['GPU']
105+
else (
106+
f'Creating {args.num_slices} node pool or pools of'
107+
f' {system.device_type}\nUnderlyingly, we assume that means: {system}'
108+
)
109+
)
110+
xpk_print(message)
111+
desired_node_pool_names = get_desired_node_pool_names(
112+
existing_node_pool_names, args.cluster, desired_node_pool_count
113+
)
107114

108115
node_pools_to_remain = []
109116
delete_commands = []
@@ -602,3 +609,21 @@ def get_nodepool_workload_metadata_mode(
602609
return 1, None
603610

604611
return 0, nodepool_WI_mode.strip()
612+
613+
614+
def get_desired_node_pool_names(
615+
existing_node_pool_names: List[str],
616+
cluster_name: str,
617+
desired_node_pool_count: int,
618+
) -> List[str]:
619+
cluster_node_pools = [
620+
np
621+
for np in existing_node_pool_names
622+
if np.startswith(f'{cluster_name}-np-')
623+
]
624+
result = set(cluster_node_pools[:desired_node_pool_count])
625+
i = 0
626+
while len(result) < desired_node_pool_count:
627+
result.add(f'{cluster_name}-np-{i}')
628+
i += 1
629+
return list(result)

src/xpk/core/tests/data/a3_mega.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
!Blueprint
1717
blueprint_name: xpk-gke-a3-megagpu
1818
toolkit_modules_url: github.com/GoogleCloudPlatform/cluster-toolkit
19-
toolkit_modules_version: v1.57.1
19+
toolkit_modules_version: v1.62.2
2020

2121
vars:
2222
project_id: "foo"

src/xpk/core/tests/data/a3_mega_spot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
!Blueprint
1717
blueprint_name: xpk-gke-a3-megagpu
1818
toolkit_modules_url: github.com/GoogleCloudPlatform/cluster-toolkit
19-
toolkit_modules_version: v1.57.1
19+
toolkit_modules_version: v1.62.2
2020

2121
vars:
2222
project_id: "foo"

src/xpk/core/tests/data/a3_ultra.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
!Blueprint
1515
blueprint_name: xpk-gke-a3-ultra
1616
toolkit_modules_url: github.com/GoogleCloudPlatform/cluster-toolkit
17-
toolkit_modules_version: v1.57.1
17+
toolkit_modules_version: v1.62.2
1818

1919
vars:
2020

0 commit comments

Comments
 (0)