Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
357 changes: 284 additions & 73 deletions tools/cloud-build/daily-tests/builds/gke-a3-highgpu-onspot.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
Comment thread
sudheer-quad marked this conversation as resolved.
tags:
- m.gke-cluster
- m.gke-node-pool
- m.vpc
- m.multivpc
- m.service-account
- m.kubectl-apply
- gke

substitutions:
_TEST_PREFIX: "" # Default to no prefix

timeout: 14400s # 4hr
steps:
# While using static network names we are guarding against more than 1 instance running at a time (for multi-group tests)
- id: check_for_running_build
name: gcr.io/cloud-builders/gcloud
script: "tools/cloud-build/check_running_build.sh tools/cloud-build/daily-tests/builds/gke-a3-highgpu-onspot.yaml"

- id: gke-a3-highgpu-onspot
name: us-central1-docker.pkg.dev/$PROJECT_ID/hpc-toolkit-repo/test-runner
entrypoint: /bin/bash
env:
- "ANSIBLE_HOST_KEY_CHECKING=false"
- "ANSIBLE_CONFIG=/workspace/tools/cloud-build/ansible.cfg"
- "PROJECT_ID=$PROJECT_ID"
- "NUM_NODES=4"
- "MACHINE_TYPE=a3-highgpu-8g"
- "INSTANCE_PREFIX=a3hspgke"
- "BUILD_ID=$BUILD_ID"
- "OPTIONS_GCS_PATH=gs://hpc-ctk1357/a3hoptions.txt"
- "ENABLE_SPOT_FALLBACK=true"
args:
- -c
- |
set -e -u -o pipefail
echo "Sourcing find_available_zone.sh to determine zone."
source /workspace/tools/cloud-build/find_available_zone.sh
if [ -z "$${ZONE:-}" ]; then
echo "ERROR: ZONE not found" >&2
exit 1
fi
set -x
cd /workspace
bash tools/get_binary.sh "${_TEST_PREFIX}"
REGION="$${ZONE%-*}"
BUILD_ID_SHORT=$${BUILD_ID:0:6}
EXAMPLE_BP=examples/gke-a3-highgpu/gke-a3-highgpu.yaml

# adding vm to act as remote node
echo ' - id: remote-node' >> $${EXAMPLE_BP}
echo ' source: modules/compute/vm-instance' >> $${EXAMPLE_BP}
echo ' use: [network1]' >> $${EXAMPLE_BP}
echo ' settings:' >> $${EXAMPLE_BP}
echo ' machine_type: e2-standard-2' >> $${EXAMPLE_BP}
echo ' name_prefix: remote-node' >> $${EXAMPLE_BP}
echo ' add_deployment_name_before_prefix: true' >> $${EXAMPLE_BP}
echo ''
echo ' - id: job_template_hostname' >> $${EXAMPLE_BP}
echo ' source: modules/compute/gke-job-template' >> $${EXAMPLE_BP}
echo ' use: [a3_highgpu_pool]' >> $${EXAMPLE_BP}
echo ' settings:' >> $${EXAMPLE_BP}
echo ' image: nvidia/cuda:11.0.3-runtime-ubuntu20.04' >> $${EXAMPLE_BP}
echo ' command:' >> $${EXAMPLE_BP}
echo ' - nvidia-smi' >> $${EXAMPLE_BP}
echo ' node_count: 1' >> $${EXAMPLE_BP}
echo ' outputs: [instructions]' >> $${EXAMPLE_BP}

bash tools/add_ttl_label.sh "$${EXAMPLE_BP}"
ENABLE_SPOT="true"
GKE_VARS_FILE="tools/cloud-build/daily-tests/tests/gke-a3-highgpu-onspot.yml"
if [[ "$$PROVISIONING_MODEL" == "STANDARD" ]]; then
ENABLE_SPOT="false"
sed -i '/instance_labels:/,+1d' "$${GKE_VARS_FILE}"
sed -i '/enable_spot: true/d' "$${GKE_VARS_FILE}"
else
echo "INFO: Using $${GKE_VARS_FILE} as it is for SPOT provisioning."
fi

# Replace the existing reservation block in the blueprint with a compact placement policy and the dynamic spot variable.
sed -i -e '/reservation_affinity:/,+3c\ placement_policy:\n type: COMPACT\n spot: '"$$ENABLE_SPOT"'' $${EXAMPLE_BP}
# Remove the empty reservation variable to pass ghpc validation, since reservations are not used.
sed -i '/^ reservation:/d' $${EXAMPLE_BP}
ansible-playbook tools/cloud-build/daily-tests/ansible_playbooks/base-integration-test.yml \
--user=sa_106486320838376751393 \
--extra-vars="project=${PROJECT_ID} build=$${BUILD_ID_SHORT} full_build_id=$BUILD_ID" \
--extra-vars="region=$${REGION} zone=$${ZONE}" \
--extra-vars="enable_spot=$${ENABLE_SPOT}" \
--extra-vars="@$${GKE_VARS_FILE}" \
--extra-vars="triage_gcs_bucket_override=$$TRIAGE_GCS_BUCKET" \
--extra-vars="triage_project_number_override=$$TRIAGE_PROJECT_NUMBER" \
--extra-vars="triage_invoker_sa_override=$$TRIAGE_INVOKER_SA" \
--extra-vars="triage_cloud_run_url_override=$$TRIAGE_CLOUD_RUN_URL"
secretEnv: ['GCLUSTER_GCS_PATH', 'TRIAGE_GCS_BUCKET', 'TRIAGE_PROJECT_NUMBER', 'TRIAGE_INVOKER_SA', 'TRIAGE_CLOUD_RUN_URL']
availableSecrets:
secretManager:
- versionName: projects/${PROJECT_ID}/secrets/gcluster-develop-release-bucket/versions/latest
env: 'GCLUSTER_GCS_PATH'
- versionName: projects/${PROJECT_ID}/secrets/triage-gcs-bucket/versions/latest
env: 'TRIAGE_GCS_BUCKET'
- versionName: projects/${PROJECT_ID}/secrets/triage-project-number/versions/latest
env: 'TRIAGE_PROJECT_NUMBER'
- versionName: projects/${PROJECT_ID}/secrets/triage-invoker-sa/versions/latest
env: 'TRIAGE_INVOKER_SA'
- versionName: projects/${PROJECT_ID}/secrets/triage-cloud-run-url/versions/latest
env: 'TRIAGE_CLOUD_RUN_URL'
Loading
Loading