Skip to content

Commit 6e606c6

Browse files
authored
Merge pull request #5772 from jackfrancis/AZURE_LOCATION-fix
CI: Always use AZURE_LOCATION
2 parents 8e98848 + ce3da30 commit 6e606c6

File tree

6 files changed

+25
-15
lines changed

6 files changed

+25
-15
lines changed

scripts/ci-conformance.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ KIND="${REPO_ROOT}/hack/tools/bin/kind"
3030
KUSTOMIZE="${REPO_ROOT}/hack/tools/bin/kustomize"
3131
make --directory="${REPO_ROOT}" "${KUBECTL##*/}" "${KIND##*/}" "${KUSTOMIZE##*/}"
3232

33+
WORKER_MACHINE_COUNT="${WORKER_MACHINE_COUNT:-2}"
34+
3335
# shellcheck source=hack/ensure-go.sh
3436
source "${REPO_ROOT}/hack/ensure-go.sh"
3537
# shellcheck source=hack/ensure-tags.sh
@@ -65,10 +67,18 @@ defaultTag=$(date -u '+%Y%m%d%H%M%S')
6567
export TAG="${defaultTag:-dev}"
6668
export GINKGO_NODES=1
6769

68-
export AZURE_LOCATION="${AZURE_LOCATION:-$(capz::util::get_random_region)}"
70+
if [ "${WORKER_MACHINE_COUNT}" -gt "10" ]; then
71+
export AZURE_LOCATION="${AZURE_LOCATION:-$(capz::util::get_random_region_load)}"
72+
echo "Using AZURE_LOCATION: ${AZURE_LOCATION}"
73+
else
74+
export AZURE_LOCATION="${AZURE_LOCATION:-$(capz::util::get_random_region)}"
75+
echo "Using AZURE_LOCATION: ${AZURE_LOCATION}"
76+
fi
77+
# TODO these AZURE_LOCATION_* overrides may have the effect of
78+
# disassociating VM regions from disks, leading to attachment failures.
79+
# Less likely with GPU scenarios but FYI.
6980
export AZURE_LOCATION_GPU="${AZURE_LOCATION_GPU:-$(capz::util::get_random_region_gpu)}"
7081
export AZURE_LOCATION_EDGEZONE="${AZURE_LOCATION_EDGEZONE:-$(capz::util::get_random_region_edgezone)}"
71-
export AZURE_LOCATION_LOAD="${AZURE_LOCATION_LOAD:-$(capz::util::get_random_region_load)}"
7282
export AZURE_CONTROL_PLANE_MACHINE_TYPE="${AZURE_CONTROL_PLANE_MACHINE_TYPE:-"Standard_B2s"}"
7383
export AZURE_NODE_MACHINE_TYPE="${AZURE_NODE_MACHINE_TYPE:-"Standard_B2s"}"
7484
export WINDOWS="${WINDOWS:-false}"

scripts/ci-entrypoint.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ KIND="${REPO_ROOT}/hack/tools/bin/kind"
3030
KUSTOMIZE="${REPO_ROOT}/hack/tools/bin/kustomize"
3131
make --directory="${REPO_ROOT}" "${KUBECTL##*/}" "${HELM##*/}" "${KIND##*/}" "${KUSTOMIZE##*/}"
3232
KIND_CLUSTER_NAME="${KIND_CLUSTER_NAME:-capz}"
33+
WORKER_MACHINE_COUNT="${WORKER_MACHINE_COUNT:-2}"
3334
export KIND_CLUSTER_NAME
3435
# export the variables so they are available in bash -c wait_for_nodes below
3536
export KUBECTL
@@ -94,14 +95,20 @@ setup() {
9495
echo ''
9596
)}"
9697
export AZURE_RESOURCE_GROUP="${CLUSTER_NAME}"
97-
export AZURE_LOCATION="${AZURE_LOCATION:-$(capz::util::get_random_region)}"
98-
echo "Using AZURE_LOCATION: ${AZURE_LOCATION}"
98+
if [ "${WORKER_MACHINE_COUNT}" -gt "10" ]; then
99+
export AZURE_LOCATION="${AZURE_LOCATION:-$(capz::util::get_random_region_load)}"
100+
echo "Using AZURE_LOCATION: ${AZURE_LOCATION}"
101+
else
102+
export AZURE_LOCATION="${AZURE_LOCATION:-$(capz::util::get_random_region)}"
103+
echo "Using AZURE_LOCATION: ${AZURE_LOCATION}"
104+
fi
105+
# TODO these AZURE_LOCATION_* overrides may have the effect of
106+
# disassociating VM regions from disks, leading to attachment failures.
107+
# Less likely with GPU scenarios but FYI.
99108
export AZURE_LOCATION_GPU="${AZURE_LOCATION_GPU:-$(capz::util::get_random_region_gpu)}"
100109
echo "Using AZURE_LOCATION_GPU: ${AZURE_LOCATION_GPU}"
101110
export AZURE_LOCATION_EDGEZONE="${AZURE_LOCATION_EDGEZONE:-$(capz::util::get_random_region_edgezone)}"
102111
echo "Using AZURE_LOCATION_EDGEZONE: ${AZURE_LOCATION_EDGEZONE}"
103-
export AZURE_LOCATION_LOAD="${AZURE_LOCATION_LOAD:-$(capz::util::get_random_region_load)}"
104-
echo "Using AZURE_LOCATION_LOAD: ${AZURE_LOCATION_LOAD}"
105112
# Need a cluster with at least 2 nodes
106113
export CONTROL_PLANE_MACHINE_COUNT="${CONTROL_PLANE_MACHINE_COUNT:-1}"
107114
export CCM_COUNT="${CCM_COUNT:-1}"

templates/test/dev/cluster-template-custom-builds-load-dra.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/test/dev/cluster-template-custom-builds-load.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/test/dev/custom-builds-load/kustomization.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ resources:
55
- ../custom-builds
66
- storageclass-resource-set.yaml
77
patches:
8-
- path: patches/location.yaml
98
- path: patches/cluster-label-storageclass.yaml
109
- path: patches/cluster-label-azuredisk.yaml
1110
- path: patches/kcp-scheduler.yaml

templates/test/dev/custom-builds-load/patches/location.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)