Skip to content

Commit c08df75

Browse files
LAVEENlaveen
andauthored
Fix G4 GKE Rapid Version & Add Onboard On-Spot Test Support For Same (#5591)
Co-authored-by: laveen <laveenekka@google.com>
1 parent 97a464e commit c08df75

3 files changed

Lines changed: 148 additions & 1 deletion

File tree

examples/gke-g4/gke-g4.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ deployment_groups:
143143
))
144144
# Cluster versions cannot be updated through the toolkit after creation
145145
# Please manage cluster version from the Google Cloud Console directly
146-
version_prefix: "1.35.2-gke.1485000"
146+
version_prefix: "1.35.3-gke.1522000"
147147
release_channel: RAPID
148148
maintenance_exclusions:
149149
- name: no-minor-or-node-upgrades-indefinite
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
---
16+
tags:
17+
- gke
18+
- m.gke-cluster
19+
- m.gke-node-pool
20+
- m.service-account
21+
- m.vpc
22+
- m.kubectl-apply
23+
- m.gke-job-template
24+
25+
substitutions:
26+
_TEST_PREFIX: "" # Default to no prefix
27+
28+
timeout: 14400s # 4hr
29+
steps:
30+
# While using static network names we are guarding against more than 1 instance running at a time (for multi-group tests)
31+
- id: check_for_running_build
32+
name: gcr.io/cloud-builders/gcloud
33+
script: "tools/cloud-build/check_running_build.sh tools/cloud-build/daily-tests/builds/gke-g4-onspot.yaml"
34+
35+
- id: gke-g4-onspot
36+
name: us-central1-docker.pkg.dev/$PROJECT_ID/hpc-toolkit-repo/test-runner
37+
entrypoint: /bin/bash
38+
env:
39+
- "ANSIBLE_HOST_KEY_CHECKING=false"
40+
- "ANSIBLE_CONFIG=/workspace/tools/cloud-build/ansible.cfg"
41+
- "PROJECT_ID=$PROJECT_ID"
42+
- "NUM_NODES=2"
43+
- "MACHINE_TYPE=g4-standard-48"
44+
- "INSTANCE_PREFIX=g4spgke"
45+
- "BUILD_ID=$BUILD_ID"
46+
- "OPTIONS_GCS_PATH=gs://hpc-ctk1357/g4options.txt"
47+
- "ENABLE_SPOT_FALLBACK=true"
48+
args:
49+
- -c
50+
- |
51+
set -e -u -o pipefail
52+
echo "Sourcing find_available_zone.sh to determine zone."
53+
source /workspace/tools/cloud-build/find_available_zone.sh
54+
if [ -z "$${ZONE:-}" ]; then
55+
echo "ERROR: ZONE not found" >&2
56+
exit 1
57+
fi
58+
set -x -e
59+
cd /workspace
60+
if [ "${_TEST_PREFIX}" == "daily-" ]; then
61+
gsutil cp gs://$${GCLUSTER_GCS_PATH}/latest/gcluster-bundle.zip .
62+
unzip -o gcluster-bundle.zip
63+
# Grant execution permissions to the binary
64+
chmod +x gcluster
65+
else
66+
make
67+
fi
68+
REGION="$${ZONE%-*}"
69+
BUILD_ID_FULL=$BUILD_ID
70+
BUILD_ID_SHORT=$${BUILD_ID_FULL:0:6}
71+
EXAMPLE_BP=examples/gke-g4/gke-g4.yaml
72+
# adding vm to act as remote node
73+
echo ' - id: remote-node' >> $${EXAMPLE_BP}
74+
echo ' source: modules/compute/vm-instance' >> $${EXAMPLE_BP}
75+
echo ' use: [gke-g4-net-0]' >> $${EXAMPLE_BP}
76+
echo ' settings:' >> $${EXAMPLE_BP}
77+
echo ' machine_type: e2-standard-2' >> $${EXAMPLE_BP}
78+
echo ' name_prefix: remote-node' >> $${EXAMPLE_BP}
79+
echo ' add_deployment_name_before_prefix: true' >> $${EXAMPLE_BP}
80+
81+
ENABLE_SPOT="true"
82+
GKE_VARS_FILE="tools/cloud-build/daily-tests/tests/gke-g4-onspot.yml"
83+
if [[ "$$PROVISIONING_MODEL" == "STANDARD" ]]; then
84+
ENABLE_SPOT="false"
85+
sed -i '/instance_labels:/,+1d' "$${GKE_VARS_FILE}"
86+
sed -i '/enable_spot: true/d' "$${GKE_VARS_FILE}"
87+
else
88+
echo "INFO: Using $${GKE_VARS_FILE} as it is for SPOT provisioning."
89+
fi
90+
91+
# Inject spot setting after auto_upgrade: true
92+
sed -i 's/auto_upgrade: true/auto_upgrade: true\n spot: '"$$ENABLE_SPOT"'/' $${EXAMPLE_BP}
93+
sed -i 's/name: run-nvidia-smi/name: my-job/' $${EXAMPLE_BP}
94+
95+
bash tools/add_ttl_label.sh "$${EXAMPLE_BP}"
96+
cat $${EXAMPLE_BP}
97+
98+
ansible-playbook tools/cloud-build/daily-tests/ansible_playbooks/base-integration-test.yml \
99+
--extra-vars="test_prefix=${_TEST_PREFIX}" \
100+
--user=sa_106486320838376751393 \
101+
--extra-vars="project=${PROJECT_ID} build=$${BUILD_ID_SHORT}" \
102+
--extra-vars="region=$${REGION} zone=$${ZONE}" \
103+
--extra-vars="enable_spot=$${ENABLE_SPOT}" \
104+
--extra-vars="@$${GKE_VARS_FILE}"
105+
secretEnv: ['GCLUSTER_GCS_PATH']
106+
availableSecrets:
107+
secretManager:
108+
- versionName: projects/${PROJECT_ID}/secrets/gcluster-develop-release-bucket/versions/latest
109+
env: 'GCLUSTER_GCS_PATH'
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
---
16+
17+
# region, zone must be defined in build file with --extra-vars flag!
18+
test_name: gke-g4-spot
19+
deployment_name: gke-g4-spot-{{ build }}
20+
workspace: /workspace
21+
blueprint_yaml: "{{ workspace }}/examples/gke-g4/gke-g4.yaml"
22+
network: "{{ deployment_name }}-net-0"
23+
remote_node: "{{ deployment_name }}-remote-node-0"
24+
static_node_count: 2
25+
cli_deployment_vars:
26+
region: "{{ region }}"
27+
zone: "{{ zone }}"
28+
static_node_count: "{{ static_node_count }}"
29+
authorized_cidr: "{{ build_ip.stdout }}/32"
30+
machine_type: g4-standard-48
31+
num_gpus: 1
32+
custom_vars:
33+
project: "{{ project }}"
34+
instance_labels:
35+
g4_onspot: true
36+
enable_spot: true
37+
post_deploy_tests:
38+
- test-validation/test-gke-job.yml

0 commit comments

Comments
 (0)