From dedc98b533f3f8ab711ef0da8239bee4c93d03ec Mon Sep 17 00:00:00 2001 From: Jesse Jaggars Date: Wed, 27 May 2026 12:32:10 -0400 Subject: [PATCH] CNTRLPLANE-2262: Enable Azure scale-from-zero in CI Add scale-from-zero configuration to the Azure self-managed install path and include TestNodePoolAutoscalingScaleFromZero in the e2e-azure-self-managed test regex. Temporarily override hypershift-operator and hypershift-tests images with pre-built images from quay.io/jjaggars/ to test the full scale-from-zero flow via pj-rehearse before merging the companion hypershift PR #8337. --- .../hypershift/openshift-hypershift-main.yaml | 12 ++-- .../openshift-hypershift-main-periodics.yaml | 12 ---- ...openshift-hypershift-main-postsubmits.yaml | 2 - .../openshift-hypershift-main-presubmits.yaml | 72 ------------------- .../install/hypershift-install-commands.sh | 12 ++++ 5 files changed, 19 insertions(+), 91 deletions(-) diff --git a/ci-operator/config/openshift/hypershift/openshift-hypershift-main.yaml b/ci-operator/config/openshift/hypershift/openshift-hypershift-main.yaml index 6e3f3a73c3617..e11db6dda1b13 100644 --- a/ci-operator/config/openshift/hypershift/openshift-hypershift-main.yaml +++ b/ci-operator/config/openshift/hypershift/openshift-hypershift-main.yaml @@ -28,15 +28,17 @@ build_root: use_build_cache: true images: items: - - to: hypershift-operator + - dockerfile_literal: | + FROM quay.io/jjaggars/hypershift-operator:azure-sfz + to: hypershift-operator - dockerfile_path: Dockerfile.control-plane to: hypershift - - dockerfile_path: Dockerfile.e2e + - dockerfile_literal: | + FROM quay.io/jjaggars/hypershift-tests:azure-sfz to: hypershift-tests - dockerfile_literal: | - FROM hypershift-operator + FROM quay.io/jjaggars/hypershift-operator:azure-sfz RUN yum install -y jq && yum clean all - from: hypershift-operator to: hypershift-cli promotion: to: @@ -232,7 +234,7 @@ tests: OCP_IMAGE_N1: release:n1minor OCP_IMAGE_N2: release:n2minor env: - CI_TESTS_RUN: ^(TestCreateCluster$|TestAutoscaling|TestNodePool|TestUpgradeControlPlane|TestHAEtcdChaos|TestAzureOAuthLoadBalancer|TestAzurePrivateTopology)$ + CI_TESTS_RUN: ^(TestCreateCluster$|TestAutoscaling|TestNodePool|TestUpgradeControlPlane|TestHAEtcdChaos|TestAzureOAuthLoadBalancer|TestAzurePrivateTopology|TestNodePoolAutoscalingScaleFromZero)$ E2E_RESOURCE_REQUEST_OVERRIDES: "1" ENABLE_HYPERSHIFT_CERT_ROTATION_SCALE: "true" HYPERSHIFT_AZURE_LOCATION: centralus diff --git a/ci-operator/jobs/openshift/hypershift/openshift-hypershift-main-periodics.yaml b/ci-operator/jobs/openshift/hypershift/openshift-hypershift-main-periodics.yaml index 46c06ecf90dc3..0147d271c59da 100644 --- a/ci-operator/jobs/openshift/hypershift/openshift-hypershift-main-periodics.yaml +++ b/ci-operator/jobs/openshift/hypershift/openshift-hypershift-main-periodics.yaml @@ -6,18 +6,14 @@ periodics: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e extra_refs: - base_ref: main org: openshift repo: hypershift sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci.openshift.io/generator: prowgen pj-rehearse.openshift.io/can-be-rehearsed: "true" @@ -257,18 +253,14 @@ periodics: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e extra_refs: - base_ref: main org: openshift repo: hypershift sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci.openshift.io/generator: prowgen pj-rehearse.openshift.io/can-be-rehearsed: "true" @@ -344,18 +336,14 @@ periodics: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e extra_refs: - base_ref: main org: openshift repo: hypershift sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci.openshift.io/generator: prowgen pj-rehearse.openshift.io/can-be-rehearsed: "true" diff --git a/ci-operator/jobs/openshift/hypershift/openshift-hypershift-main-postsubmits.yaml b/ci-operator/jobs/openshift/hypershift/openshift-hypershift-main-postsubmits.yaml index a733727835067..345f664a28dd9 100644 --- a/ci-operator/jobs/openshift/hypershift/openshift-hypershift-main-postsubmits.yaml +++ b/ci-operator/jobs/openshift/hypershift/openshift-hypershift-main-postsubmits.yaml @@ -9,9 +9,7 @@ postsubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/is-promotion: "true" ci.openshift.io/generator: prowgen diff --git a/ci-operator/jobs/openshift/hypershift/openshift-hypershift-main-presubmits.yaml b/ci-operator/jobs/openshift/hypershift/openshift-hypershift-main-presubmits.yaml index efc82a36049b6..14e2a3c9d8901 100644 --- a/ci-operator/jobs/openshift/hypershift/openshift-hypershift-main-presubmits.yaml +++ b/ci-operator/jobs/openshift/hypershift/openshift-hypershift-main-presubmits.yaml @@ -11,9 +11,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci.openshift.io/generator: prowgen pj-rehearse.openshift.io/can-be-rehearsed: "true" @@ -97,9 +95,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aws ci-operator.openshift.io/cloud-cluster-profile: hypershift-aws @@ -186,9 +182,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aks ci-operator.openshift.io/cloud-cluster-profile: hypershift-aks @@ -274,9 +268,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aks ci-operator.openshift.io/cloud-cluster-profile: hypershift-aks @@ -360,9 +352,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aks ci-operator.openshift.io/cloud-cluster-profile: hypershift-aks @@ -449,9 +439,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: capability/build-tmpfs: build-tmpfs ci-operator.openshift.io/cloud: hypershift-aws @@ -538,9 +526,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: capability/build-tmpfs: build-tmpfs ci-operator.openshift.io/cloud: hypershift-aws @@ -625,9 +611,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aws ci-operator.openshift.io/cloud-cluster-profile: hypershift-aws @@ -712,9 +696,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aws ci-operator.openshift.io/cloud-cluster-profile: hypershift-aws @@ -799,9 +781,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aws ci-operator.openshift.io/cloud-cluster-profile: hypershift-aws @@ -886,9 +866,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aws ci-operator.openshift.io/cloud-cluster-profile: hypershift-aws @@ -973,9 +951,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: capability/build-tmpfs: build-tmpfs ci-operator.openshift.io/cloud: hypershift-aws @@ -1061,9 +1037,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aws ci-operator.openshift.io/cloud-cluster-profile: hypershift-aws @@ -1150,9 +1124,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: capability/build-tmpfs: build-tmpfs ci-operator.openshift.io/cloud: hypershift-aws @@ -1237,9 +1209,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aks ci-operator.openshift.io/cloud-cluster-profile: hypershift-aks @@ -1324,9 +1294,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aks ci-operator.openshift.io/cloud-cluster-profile: hypershift-aks @@ -1411,9 +1379,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: azure4 ci-operator.openshift.io/cloud-cluster-profile: openshift-org-azure @@ -1500,9 +1466,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-azure ci-operator.openshift.io/cloud-cluster-profile: hypershift-azure @@ -1586,9 +1550,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-azure ci-operator.openshift.io/cloud-cluster-profile: hypershift-azure @@ -1673,9 +1635,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aws ci-operator.openshift.io/cloud-cluster-profile: hypershift-aws @@ -1760,9 +1720,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: capability/build-tmpfs: build-tmpfs ci-operator.openshift.io/cloud: hypershift-gcp @@ -1849,9 +1807,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: aws ci-operator.openshift.io/cloud-cluster-profile: openshift-org-aws @@ -1938,9 +1894,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: aws ci-operator.openshift.io/cloud-cluster-profile: openshift-org-aws @@ -2024,9 +1978,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: azure4 ci-operator.openshift.io/cloud-cluster-profile: openshift-org-azure @@ -2111,9 +2063,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aws ci-operator.openshift.io/cloud-cluster-profile: hypershift-aws @@ -2198,9 +2148,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aws ci-operator.openshift.io/cloud-cluster-profile: hypershift-aws @@ -2285,9 +2233,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aws ci-operator.openshift.io/cloud-cluster-profile: hypershift-aws @@ -2372,9 +2318,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aws ci-operator.openshift.io/cloud-cluster-profile: hypershift-aws @@ -2459,9 +2403,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aws ci-operator.openshift.io/cloud-cluster-profile: hypershift-aws @@ -2548,9 +2490,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aws ci-operator.openshift.io/cloud-cluster-profile: hypershift-aws @@ -2634,9 +2574,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci-operator.openshift.io/cloud: hypershift-aws ci-operator.openshift.io/cloud-cluster-profile: hypershift-aws @@ -2723,9 +2661,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: capability/build-tmpfs: build-tmpfs ci-operator.openshift.io/cloud: hypershift-gcp @@ -2810,9 +2746,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci.openshift.io/generator: prowgen pj-rehearse.openshift.io/can-be-rehearsed: "true" @@ -3017,9 +2951,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: capability/build-tmpfs: build-tmpfs ci-operator.openshift.io/cloud: aws @@ -3105,9 +3037,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci.openshift.io/generator: prowgen pj-rehearse.openshift.io/can-be-rehearsed: "true" @@ -3190,9 +3120,7 @@ presubmits: decoration_config: sparse_checkout_files: - .ci-operator.yaml - - Dockerfile - Dockerfile.control-plane - - Dockerfile.e2e labels: ci.openshift.io/generator: prowgen pj-rehearse.openshift.io/can-be-rehearsed: "true" diff --git a/ci-operator/step-registry/hypershift/install/hypershift-install-commands.sh b/ci-operator/step-registry/hypershift/install/hypershift-install-commands.sh index 655846a787c7b..240ec9e7ae603 100755 --- a/ci-operator/step-registry/hypershift/install/hypershift-install-commands.sh +++ b/ci-operator/step-registry/hypershift/install/hypershift-install-commands.sh @@ -119,6 +119,18 @@ case "${CLOUD_PROVIDER}" in --azure-private-creds=${PRIVATE_CREDS} \ --azure-pls-resource-group=${PLS_RG}" fi + + # Enable Azure scale-from-zero if self-managed credentials are available + if [ -f "/etc/hypershift-ci-jobs-self-managed-azure/credentials.json" ]; then + SUBSCRIPTION_ID=$(az account show --query id -o tsv 2>/dev/null || true) + if [ -n "${SUBSCRIPTION_ID}" ]; then + SCALE_FROM_ZERO_CREDS=$(mktemp) + jq --arg sub "${SUBSCRIPTION_ID}" --arg loc "${HYPERSHIFT_AZURE_LOCATION:-centralus}" \ + '. + {subscriptionId: $sub, location: $loc}' \ + /etc/hypershift-ci-jobs-self-managed-azure/credentials.json > "${SCALE_FROM_ZERO_CREDS}" + EXTRA_ARGS="${EXTRA_ARGS} --scale-from-zero-provider azure --scale-from-zero-creds ${SCALE_FROM_ZERO_CREDS}" + fi + fi fi "${HCP_CLI}" install --hypershift-image="${OPERATOR_IMAGE}" \