|
| 1 | +# Copyright 2025 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.gke-job-template |
| 18 | +- gke |
| 19 | +- m.gke-cluster |
| 20 | +- m.gke-node-pool |
| 21 | +- m.service-account |
| 22 | +- m.gpu-rdma-vpc |
| 23 | +- m.kubectl-apply |
| 24 | +- m.vpc |
| 25 | +- m.cloud-storage-bucket |
| 26 | +- m.gke-persistent-volume |
| 27 | +- m.pre-existing-network-storage |
| 28 | + |
| 29 | +timeout: 14400s # 4hr |
| 30 | +steps: |
| 31 | +# While using static network names we are guarding against more than 1 instance running at a time (for multi-group tests) |
| 32 | +- id: check_for_running_build |
| 33 | + name: gcr.io/cloud-builders/gcloud |
| 34 | + script: "tools/cloud-build/check_running_build.sh tools/cloud-build/daily-tests/builds/gke-a3-ultragpu-onspot.yaml" |
| 35 | + |
| 36 | +- id: gke-a3-ultragpu-onspot |
| 37 | + name: us-central1-docker.pkg.dev/$PROJECT_ID/hpc-toolkit-repo/test-runner |
| 38 | + entrypoint: /bin/bash |
| 39 | + env: |
| 40 | + - "ANSIBLE_HOST_KEY_CHECKING=false" |
| 41 | + - "ANSIBLE_CONFIG=/workspace/tools/cloud-build/ansible.cfg" |
| 42 | + - "PROJECT_ID=$PROJECT_ID" |
| 43 | + - "NUM_NODES=4" |
| 44 | + - "MACHINE_TYPE=a3-ultragpu-8g" |
| 45 | + - "INSTANCE_PREFIX=a3uspgke" |
| 46 | + - "BUILD_ID=$BUILD_ID" |
| 47 | + - "OPTIONS_GCS_PATH=gs://hpc-ctk1357/a3uoptions.txt" |
| 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 |
| 59 | + cd /workspace && make |
| 60 | + REGION="$${ZONE%-*}" |
| 61 | + BUILD_ID_SHORT=$${BUILD_ID:0:6} |
| 62 | + EXAMPLE_BP=examples/gke-a3-ultragpu/gke-a3-ultragpu.yaml |
| 63 | +
|
| 64 | + # adding vm to act as remote node |
| 65 | + echo ' - id: remote-node' >> $${EXAMPLE_BP} |
| 66 | + echo ' source: modules/compute/vm-instance' >> $${EXAMPLE_BP} |
| 67 | + echo ' use: [gke-a3-ultra-net-0]' >> $${EXAMPLE_BP} |
| 68 | + echo ' settings:' >> $${EXAMPLE_BP} |
| 69 | + echo ' machine_type: e2-standard-2' >> $${EXAMPLE_BP} |
| 70 | + echo ' name_prefix: remote-node' >> $${EXAMPLE_BP} |
| 71 | + echo ' add_deployment_name_before_prefix: true' >> $${EXAMPLE_BP} |
| 72 | + echo '' |
| 73 | + echo ' - id: job_template_hostname' >> $${EXAMPLE_BP} |
| 74 | + echo ' source: modules/compute/gke-job-template' >> $${EXAMPLE_BP} |
| 75 | + echo ' use: [a3-ultragpu-pool]' >> $${EXAMPLE_BP} |
| 76 | + echo ' settings:' >> $${EXAMPLE_BP} |
| 77 | + echo ' image: nvidia/cuda:11.0.3-runtime-ubuntu20.04' >> $${EXAMPLE_BP} |
| 78 | + echo ' command:' >> $${EXAMPLE_BP} |
| 79 | + echo ' - nvidia-smi' >> $${EXAMPLE_BP} |
| 80 | + echo ' node_count: 1' >> $${EXAMPLE_BP} |
| 81 | + echo ' outputs: [instructions]' >> $${EXAMPLE_BP} |
| 82 | + # Setting placement policy as compact for nccl test to run on spot VMs, adding spot variable as true and removing reservation from blueprint. |
| 83 | + sed -i -e '/reservation_affinity:/,+3c\ placement_policy:\n type: COMPACT\n spot: true' $${EXAMPLE_BP} |
| 84 | + sed -i '/reservation/d' $${EXAMPLE_BP} |
| 85 | + ansible-playbook tools/cloud-build/daily-tests/ansible_playbooks/base-integration-test.yml \ |
| 86 | + --user=sa_106486320838376751393 --extra-vars="project=${PROJECT_ID} build=$${BUILD_ID_SHORT}" \ |
| 87 | + --extra-vars="region=$${REGION} zone=$${ZONE}" \ |
| 88 | + --extra-vars="@tools/cloud-build/daily-tests/tests/gke-a3-ultragpu-onspot.yml" |
0 commit comments