Skip to content

Commit 196e72f

Browse files
Integrating G4 onspot (GoogleCloudPlatform#5102)
1 parent 37e8cac commit 196e72f

3 files changed

Lines changed: 121 additions & 2 deletions

File tree

examples/ml-slurm-g4.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ vars:
4040

4141
# Cluster Settings
4242
disk_size_gb: 100
43+
#Provisioning models (set to true or fill in reservation name, pick only one)
44+
g4_reservation_name: "" # To use a reservation, provide its name here.
45+
g4_enable_spot_vm: false # To use Spot VMs, set this to true.
4346

4447
deployment_groups:
4548
- group: image-env
@@ -108,8 +111,6 @@ deployment_groups:
108111
name: "{{ item }}"
109112
selection: hold
110113
loop: "{{ nvidia_packages }}"
111-
112-
113114
- type: data
114115
destination: /var/tmp/slurm_vars.json
115116
content: |
@@ -287,6 +288,9 @@ deployment_groups:
287288
family: $(vars.built_image_family)
288289
instance_image_custom: true
289290
enable_placement: false
291+
#Provisioning models
292+
reservation_name: $(vars.g4_reservation_name)
293+
enable_spot_vm: $(vars.g4_enable_spot_vm)
290294

291295
# Instructions for Dual NIC on g4-standard-384:
292296
# 4. Uncomment the 'network_interfaces' block below to define the two NICs.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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+
- m.custom-image
18+
- m.filestore
19+
- m.schedmd-slurm-gcp-v6-controller
20+
- m.schedmd-slurm-gcp-v6-login
21+
- m.schedmd-slurm-gcp-v6-nodeset
22+
- m.schedmd-slurm-gcp-v6-partition
23+
- m.startup-script
24+
- m.vpc
25+
- slurm6
26+
27+
timeout: 14400s # 4hr
28+
steps:
29+
# While using static network names we are gaurding against more than 1 instance running at a time (for multi-group tests)
30+
- id: check_for_running_build
31+
name: gcr.io/cloud-builders/gcloud
32+
script: "tools/cloud-build/check_running_build.sh tools/cloud-build/daily-tests/builds/ml-g4-onspot-slurm.yaml"
33+
34+
- id: ml-g4-onspot-slurm
35+
name: us-central1-docker.pkg.dev/$PROJECT_ID/hpc-toolkit-repo/test-runner
36+
entrypoint: /bin/bash
37+
env:
38+
- "ANSIBLE_HOST_KEY_CHECKING=false"
39+
- "ANSIBLE_CONFIG=/workspace/tools/cloud-build/ansible.cfg"
40+
- "PROJECT_ID=$PROJECT_ID"
41+
- "NUM_NODES=2"
42+
- "MACHINE_TYPE=g4-standard-48"
43+
- "INSTANCE_PREFIX=g4osp"
44+
- "BUILD_ID=$BUILD_ID"
45+
- "OPTIONS_GCS_PATH=gs://hpc-ctk1357/g4options.txt"
46+
args:
47+
- -c
48+
- |
49+
set -e -u -o pipefail
50+
echo "Sourcing find_available_zone.sh to determine zone."
51+
source /workspace/tools/cloud-build/find_available_zone.sh
52+
if [ -z "$${ZONE:-}" ]; then
53+
echo "ERROR: ZONE not found" >&2
54+
exit 1
55+
fi
56+
set -x
57+
cd /workspace && make
58+
REGION="$${ZONE%-*}"
59+
BUILD_ID_SHORT="$${BUILD_ID:0:6}"
60+
BLUEPRINT="/workspace/examples/ml-slurm-g4.yaml"
61+
62+
ansible-playbook tools/cloud-build/daily-tests/ansible_playbooks/slurm-integration-test.yml \
63+
--user=sa_106486320838376751393 \
64+
--extra-vars="project=$${PROJECT_ID} build=$${BUILD_ID_SHORT}" \
65+
--extra-vars="region=$${REGION} zone=$${ZONE}" \
66+
--extra-vars="@tools/cloud-build/daily-tests/tests/ml-g4-onspot-slurm.yml"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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: g4-onspot-slurm
19+
deployment_name: g4-onspot-slurm-{{ build }}
20+
slurm_cluster_name: "g4osp{{ build[0:5] }}"
21+
workspace: /workspace
22+
blueprint_yaml: "{{ workspace }}/examples/ml-slurm-g4.yaml"
23+
login_node: "{{ slurm_cluster_name }}-slurm-login-*"
24+
controller_node: "{{ slurm_cluster_name }}-controller"
25+
network: "{{ deployment_name }}-net-0"
26+
post_deploy_tests:
27+
- test-validation/test-mounts.yml
28+
- test-validation/test-partitions.yml
29+
- test-validation/test-default-partition.yml
30+
post_destroy_tasks:
31+
- post-destroy-tasks/delete-image.yml
32+
custom_vars:
33+
gpu_count: 1
34+
gpu_partition: g4
35+
test_persistenced: true
36+
partitions:
37+
- g4
38+
mounts:
39+
- /home
40+
instance_labels:
41+
g4_onspot: true
42+
enable_spot: true
43+
cli_deployment_vars:
44+
region: "{{ region }}"
45+
zone: "{{ zone }}"
46+
slurm_cluster_name: "{{ slurm_cluster_name }}"
47+
disk_size_gb: 100
48+
cluster_size: 2
49+
g4_enable_spot_vm: true

0 commit comments

Comments
 (0)