From cd30cfc202ea6cd0b898e94da813feb8fc1c0057 Mon Sep 17 00:00:00 2001 From: Tuomo Tanskanen Date: Tue, 10 Sep 2024 17:20:06 +0300 Subject: [PATCH] Add BMO 0.8 e2e Add BMO 0.8 e2e and drop BMO 0.4. Add ironic 25.0 and 26.0 to overlays. Signed-off-by: Tuomo Tanskanen --- ...e2e-test-optional-periodic-release-0.8.yml | 26 +++++++++++ .../e2e-test-periodic-release-0.8.yml | 25 +++++++++++ config/overlays/e2e-release-0.8/ironic.env | 3 ++ .../e2e-release-0.8/kustomization.yaml | 32 +++++++++++++ .../fixture-release-0.8/kustomization.yaml | 21 +++++++++ docs/releasing.md | 8 ++++ hack/ci-e2e.sh | 16 ++++++- .../e2e-release-25.0/ironic-patch.yaml | 10 +++++ .../e2e-release-25.0/ironic_bmo_configmap.env | 6 +++ .../e2e-release-25.0/kustomization.yaml | 45 +++++++++++++++++++ .../e2e-release-26.0/ironic-patch.yaml | 10 +++++ .../e2e-release-26.0/ironic_bmo_configmap.env | 6 +++ .../e2e-release-26.0/kustomization.yaml | 45 +++++++++++++++++++ test/e2e/config/fixture.yaml | 8 ++-- test/e2e/config/ironic.yaml | 26 ++++++++--- 15 files changed, 274 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/e2e-test-optional-periodic-release-0.8.yml create mode 100644 .github/workflows/e2e-test-periodic-release-0.8.yml create mode 100644 config/overlays/e2e-release-0.8/ironic.env create mode 100644 config/overlays/e2e-release-0.8/kustomization.yaml create mode 100644 config/overlays/fixture-release-0.8/kustomization.yaml create mode 100644 ironic-deployment/overlays/e2e-release-25.0/ironic-patch.yaml create mode 100644 ironic-deployment/overlays/e2e-release-25.0/ironic_bmo_configmap.env create mode 100644 ironic-deployment/overlays/e2e-release-25.0/kustomization.yaml create mode 100644 ironic-deployment/overlays/e2e-release-26.0/ironic-patch.yaml create mode 100644 ironic-deployment/overlays/e2e-release-26.0/ironic_bmo_configmap.env create mode 100644 ironic-deployment/overlays/e2e-release-26.0/kustomization.yaml diff --git a/.github/workflows/e2e-test-optional-periodic-release-0.8.yml b/.github/workflows/e2e-test-optional-periodic-release-0.8.yml new file mode 100644 index 0000000000..d59cca99de --- /dev/null +++ b/.github/workflows/e2e-test-optional-periodic-release-0.8.yml @@ -0,0 +1,26 @@ +name: Periodic E2E Test Optional release-0.8 + +on: + schedule: + # Run every day at 04:20 UTC (it is recommended to avoid running at the start of the hour) + - cron: '20 4 * * *' + +permissions: {} + +jobs: + periodic-e2e-test-optional: + if: github.repository == 'metal3-io/baremetal-operator' + strategy: + fail-fast: false + matrix: + bmc-protocol: + - redfish + - redfish-virtualmedia + - ipmi + uses: ./.github/workflows/e2e-test.yml + with: + bmc-protocol: ${{ matrix.bmc-protocol }} + ginkgo-focus: upgrade + ref: release-0.8 + permissions: + contents: read diff --git a/.github/workflows/e2e-test-periodic-release-0.8.yml b/.github/workflows/e2e-test-periodic-release-0.8.yml new file mode 100644 index 0000000000..28b8978659 --- /dev/null +++ b/.github/workflows/e2e-test-periodic-release-0.8.yml @@ -0,0 +1,25 @@ +name: Periodic E2E Test release-0.8 + +on: + schedule: + # Run every day at 02:20 UTC (it is recommended to avoid running at the start of the hour) + - cron: '20 2 * * *' + +permissions: {} + +jobs: + periodic-e2e-test: + if: github.repository == 'metal3-io/baremetal-operator' + strategy: + fail-fast: false + matrix: + bmc-protocol: + - redfish + - redfish-virtualmedia + - ipmi + uses: ./.github/workflows/e2e-test.yml + with: + bmc-protocol: ${{ matrix.bmc-protocol }} + ref: release-0.8 + permissions: + contents: read diff --git a/config/overlays/e2e-release-0.8/ironic.env b/config/overlays/e2e-release-0.8/ironic.env new file mode 100644 index 0000000000..0187ae15e4 --- /dev/null +++ b/config/overlays/e2e-release-0.8/ironic.env @@ -0,0 +1,3 @@ +DEPLOY_KERNEL_URL=http://192.168.222.199:6180/images/ironic-python-agent.kernel +DEPLOY_RAMDISK_URL=http://192.168.222.199:6180/images/ironic-python-agent.initramfs +IRONIC_ENDPOINT=https://192.168.222.199:6385/v1/ diff --git a/config/overlays/e2e-release-0.8/kustomization.yaml b/config/overlays/e2e-release-0.8/kustomization.yaml new file mode 100644 index 0000000000..1a378288c9 --- /dev/null +++ b/config/overlays/e2e-release-0.8/kustomization.yaml @@ -0,0 +1,32 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: baremetal-operator-system +resources: +- https://github.com/metal3-io/baremetal-operator/config/overlays/basic-auth_tls?ref=release-0.8&timeout=120s +configMapGenerator: +- name: ironic + behavior: create + envs: + - ironic.env +patches: +- patch: | + # Don't try to pull again the pre-loaded image + - op: replace + path: /spec/template/spec/containers/0/imagePullPolicy + value: IfNotPresent + target: + kind: Deployment + name: controller-manager +images: +- name: quay.io/metal3-io/baremetal-operator + newTag: release-0.8 +# We cannot use suffix hashes since the kustomizations we build on +# cannot be aware of what suffixes we add. +generatorOptions: + disableNameSuffixHash: true +# NOTE: These credentials are generated automatically in hack/ci-e2e.sh +secretGenerator: +- name: ironic-credentials + files: + - username=ironic-username + - password=ironic-password diff --git a/config/overlays/fixture-release-0.8/kustomization.yaml b/config/overlays/fixture-release-0.8/kustomization.yaml new file mode 100644 index 0000000000..79b6d52546 --- /dev/null +++ b/config/overlays/fixture-release-0.8/kustomization.yaml @@ -0,0 +1,21 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- https://github.com/metal3-io/baremetal-operator/config/namespace?ref=release-0.8 +- https://github.com/metal3-io/baremetal-operator/config/default?ref=release-0.8 +patches: +- patch: | + # Enable test mode (fixture provider instead of ironic) + - op: add + path: /spec/template/spec/containers/0/args/- + value: --test-mode + # Don't try to pull again the pre-loaded image + - op: replace + path: /spec/template/spec/containers/0/imagePullPolicy + value: IfNotPresent + target: + kind: Deployment + name: controller-manager +images: +- name: quay.io/metal3-io/baremetal-operator + newTag: release-0.8 diff --git a/docs/releasing.md b/docs/releasing.md index 1bef69f09b..a9b06f0752 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -147,6 +147,14 @@ release! Some post-release actions are needed if new minor or major branch was created. +### Add BMO e2e test configs + +[Prior art](https://github.com/metal3-io/baremetal-operator/pull/1945) + +BMO e2e is running as GitHub Actions. We need to add released branch and remove +the non-maintained branches there, along with the suitable configurations with +recently released Ironic-image releases as well in the fixtures. + ### Branch protection rules Branch protection rules need to be applied to the new release branch. Copy the diff --git a/hack/ci-e2e.sh b/hack/ci-e2e.sh index 795a6d9988..8b51614309 100755 --- a/hack/ci-e2e.sh +++ b/hack/ci-e2e.sh @@ -162,8 +162,20 @@ export ISO_IMAGE_URL="http://${IP_ADDRESS}/sysrescue-out.iso" popd # Generate credentials -BMO_OVERLAYS=("${REPO_ROOT}/config/overlays/e2e" "${REPO_ROOT}/config/overlays/e2e-release-0.4" "${REPO_ROOT}/config/overlays/e2e-release-0.5" "${REPO_ROOT}/config/overlays/e2e-release-0.6") -IRONIC_OVERLAYS=("${REPO_ROOT}/ironic-deployment/overlays/e2e" "${REPO_ROOT}/ironic-deployment/overlays/e2e-with-inspector" "${REPO_ROOT}/ironic-deployment/overlays/e2e-release-24.0-with-inspector" "${REPO_ROOT}/ironic-deployment/overlays/e2e-release-24.1") +BMO_OVERLAYS=( + "${REPO_ROOT}/config/overlays/e2e" + "${REPO_ROOT}/config/overlays/e2e-release-0.5" + "${REPO_ROOT}/config/overlays/e2e-release-0.6" + "${REPO_ROOT}/config/overlays/e2e-release-0.8" +) +IRONIC_OVERLAYS=( + "${REPO_ROOT}/ironic-deployment/overlays/e2e" + "${REPO_ROOT}/ironic-deployment/overlays/e2e-with-inspector" + "${REPO_ROOT}/ironic-deployment/overlays/e2e-release-24.0-with-inspector" + "${REPO_ROOT}/ironic-deployment/overlays/e2e-release-24.1" + "${REPO_ROOT}/ironic-deployment/overlays/e2e-release-25.0" + "${REPO_ROOT}/ironic-deployment/overlays/e2e-release-26.0" +) IRONIC_USERNAME="$(uuidgen)" IRONIC_PASSWORD="$(uuidgen)" diff --git a/ironic-deployment/overlays/e2e-release-25.0/ironic-patch.yaml b/ironic-deployment/overlays/e2e-release-25.0/ironic-patch.yaml new file mode 100644 index 0000000000..6e378383e6 --- /dev/null +++ b/ironic-deployment/overlays/e2e-release-25.0/ironic-patch.yaml @@ -0,0 +1,10 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ironic +spec: + template: + spec: + containers: + - name: ironic-dnsmasq + $patch: delete diff --git a/ironic-deployment/overlays/e2e-release-25.0/ironic_bmo_configmap.env b/ironic-deployment/overlays/e2e-release-25.0/ironic_bmo_configmap.env new file mode 100644 index 0000000000..a0840f4859 --- /dev/null +++ b/ironic-deployment/overlays/e2e-release-25.0/ironic_bmo_configmap.env @@ -0,0 +1,6 @@ +HTTP_PORT=6180 +PROVISIONING_IP=192.168.222.199 +CACHEURL=http://192.168.222.199/images +IRONIC_KERNEL_PARAMS=console=ttyS0 +IRONIC_INSPECTOR_VLAN_INTERFACES=all +USE_IRONIC_INSPECTOR=false diff --git a/ironic-deployment/overlays/e2e-release-25.0/kustomization.yaml b/ironic-deployment/overlays/e2e-release-25.0/kustomization.yaml new file mode 100644 index 0000000000..8a84c06107 --- /dev/null +++ b/ironic-deployment/overlays/e2e-release-25.0/kustomization.yaml @@ -0,0 +1,45 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: baremetal-operator-system +resources: +- https://github.com/metal3-io/baremetal-operator/config/namespace?ref=release-0.8&timeout=120s +- https://github.com/metal3-io/baremetal-operator/ironic-deployment/base?ref=release-0.8&timeout=120s + +components: +- https://github.com/metal3-io/baremetal-operator/ironic-deployment/components/basic-auth?ref=release-0.8&timeout=120s +- https://github.com/metal3-io/baremetal-operator/ironic-deployment/components/tls?ref=release-0.8&timeout=120s + +configMapGenerator: +- envs: + - ironic_bmo_configmap.env + name: ironic-bmo-configmap + behavior: create + +patches: +- path: ironic-patch.yaml + +images: +- name: quay.io/metal3-io/ironic + newTag: release-25.0 + +# NOTE: These credentials are generated automatically in hack/ci-e2e.sh +secretGenerator: +- name: ironic-htpasswd + behavior: create + envs: + - ironic-htpasswd + +replacements: +# Replace IRONIC_HOST_IP in certificates with the PROVISIONING_IP from the configmap +- source: + kind: ConfigMap + name: ironic-bmo-configmap + fieldPath: .data.PROVISIONING_IP + targets: + - select: + version: v1 + group: cert-manager.io + kind: Certificate + name: + fieldPaths: + - .spec.ipAddresses.0 diff --git a/ironic-deployment/overlays/e2e-release-26.0/ironic-patch.yaml b/ironic-deployment/overlays/e2e-release-26.0/ironic-patch.yaml new file mode 100644 index 0000000000..6e378383e6 --- /dev/null +++ b/ironic-deployment/overlays/e2e-release-26.0/ironic-patch.yaml @@ -0,0 +1,10 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ironic +spec: + template: + spec: + containers: + - name: ironic-dnsmasq + $patch: delete diff --git a/ironic-deployment/overlays/e2e-release-26.0/ironic_bmo_configmap.env b/ironic-deployment/overlays/e2e-release-26.0/ironic_bmo_configmap.env new file mode 100644 index 0000000000..a0840f4859 --- /dev/null +++ b/ironic-deployment/overlays/e2e-release-26.0/ironic_bmo_configmap.env @@ -0,0 +1,6 @@ +HTTP_PORT=6180 +PROVISIONING_IP=192.168.222.199 +CACHEURL=http://192.168.222.199/images +IRONIC_KERNEL_PARAMS=console=ttyS0 +IRONIC_INSPECTOR_VLAN_INTERFACES=all +USE_IRONIC_INSPECTOR=false diff --git a/ironic-deployment/overlays/e2e-release-26.0/kustomization.yaml b/ironic-deployment/overlays/e2e-release-26.0/kustomization.yaml new file mode 100644 index 0000000000..d6d52e8d4a --- /dev/null +++ b/ironic-deployment/overlays/e2e-release-26.0/kustomization.yaml @@ -0,0 +1,45 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: baremetal-operator-system +resources: +- https://github.com/metal3-io/baremetal-operator/config/namespace?ref=release-0.8&timeout=120s +- https://github.com/metal3-io/baremetal-operator/ironic-deployment/base?ref=release-0.8&timeout=120s + +components: +- https://github.com/metal3-io/baremetal-operator/ironic-deployment/components/basic-auth?ref=release-0.8&timeout=120s +- https://github.com/metal3-io/baremetal-operator/ironic-deployment/components/tls?ref=release-0.8&timeout=120s + +configMapGenerator: +- envs: + - ironic_bmo_configmap.env + name: ironic-bmo-configmap + behavior: create + +patches: +- path: ironic-patch.yaml + +images: +- name: quay.io/metal3-io/ironic + newTag: release-26.0 + +# NOTE: These credentials are generated automatically in hack/ci-e2e.sh +secretGenerator: +- name: ironic-htpasswd + behavior: create + envs: + - ironic-htpasswd + +replacements: +# Replace IRONIC_HOST_IP in certificates with the PROVISIONING_IP from the configmap +- source: + kind: ConfigMap + name: ironic-bmo-configmap + fieldPath: .data.PROVISIONING_IP + targets: + - select: + version: v1 + group: cert-manager.io + kind: Certificate + name: + fieldPaths: + - .spec.ipAddresses.0 diff --git a/test/e2e/config/fixture.yaml b/test/e2e/config/fixture.yaml index bdf38e1aa0..a7098e019a 100644 --- a/test/e2e/config/fixture.yaml +++ b/test/e2e/config/fixture.yaml @@ -3,7 +3,7 @@ images: - name: quay.io/metal3-io/baremetal-operator:e2e loadBehavior: tryLoad # Save some time and network by using cached images if available -- name: quay.io/metal3-io/baremetal-operator:release-0.4 +- name: quay.io/metal3-io/baremetal-operator:release-0.8 loadBehavior: tryLoad - name: quay.io/jetstack/cert-manager-cainjector:v1.13.1 loadBehavior: tryLoad @@ -51,16 +51,16 @@ intervals: bmoIronicUpgradeSpecs: - deployIronic: false deployBMO: true - initBMOKustomization: "../../config/overlays/fixture-release-0.4" + initBMOKustomization: "../../config/overlays/fixture-release-0.5" upgradeEntityKustomization: "../../config/overlays/fixture" upgradeEntityName: "bmo" - deployIronic: false deployBMO: true - initBMOKustomization: "../../config/overlays/fixture-release-0.5" + initBMOKustomization: "../../config/overlays/fixture-release-0.6" upgradeEntityKustomization: "../../config/overlays/fixture" upgradeEntityName: "bmo" - deployIronic: false deployBMO: true - initBMOKustomization: "../../config/overlays/fixture-release-0.6" + initBMOKustomization: "../../config/overlays/fixture-release-0.8" upgradeEntityKustomization: "../../config/overlays/fixture" upgradeEntityName: "bmo" diff --git a/test/e2e/config/ironic.yaml b/test/e2e/config/ironic.yaml index 6c275faece..dd54c51bdf 100644 --- a/test/e2e/config/ironic.yaml +++ b/test/e2e/config/ironic.yaml @@ -5,7 +5,7 @@ images: - name: quay.io/metal3-io/ironic:e2e loadBehavior: tryLoad # Save some time and network by using cached images if available -- name: quay.io/metal3-io/baremetal-operator:release-0.4 +- name: quay.io/metal3-io/baremetal-operator:release-0.8 loadBehavior: tryLoad - name: quay.io/jetstack/cert-manager-cainjector:v1.13.1 loadBehavior: tryLoad @@ -56,31 +56,43 @@ intervals: bmoIronicUpgradeSpecs: - deployIronic: true deployBMO: true - initBMOKustomization: "../../config/overlays/e2e-release-0.4" - initIronicKustomization: "../../ironic-deployment/overlays/e2e-with-inspector" + initBMOKustomization: "../../config/overlays/e2e-release-0.5" + initIronicKustomization: "../../ironic-deployment/overlays/e2e" upgradeEntityKustomization: "../../config/overlays/e2e" upgradeEntityName: "bmo" - deployIronic: true deployBMO: true - initBMOKustomization: "../../config/overlays/e2e-release-0.5" + initBMOKustomization: "../../config/overlays/e2e-release-0.6" initIronicKustomization: "../../ironic-deployment/overlays/e2e" upgradeEntityKustomization: "../../config/overlays/e2e" upgradeEntityName: "bmo" - deployIronic: true deployBMO: true - initBMOKustomization: "../../config/overlays/e2e-release-0.6" + initBMOKustomization: "../../config/overlays/e2e-release-0.8" initIronicKustomization: "../../ironic-deployment/overlays/e2e" upgradeEntityKustomization: "../../config/overlays/e2e" upgradeEntityName: "bmo" - deployIronic: true deployBMO: true - initBMOKustomization: "../../config/overlays/e2e-release-0.6" + initBMOKustomization: "../../config/overlays/e2e-release-0.8" initIronicKustomization: "../../ironic-deployment/overlays/e2e-release-24.0-with-inspector" upgradeEntityKustomization: "../../ironic-deployment/overlays/e2e" upgradeEntityName: "ironic" - deployIronic: true deployBMO: true - initBMOKustomization: "../../config/overlays/e2e-release-0.6" + initBMOKustomization: "../../config/overlays/e2e-release-0.8" initIronicKustomization: "../../ironic-deployment/overlays/e2e-release-24.1" upgradeEntityKustomization: "../../ironic-deployment/overlays/e2e" upgradeEntityName: "ironic" +- deployIronic: true + deployBMO: true + initBMOKustomization: "../../config/overlays/e2e-release-0.8" + initIronicKustomization: "../../ironic-deployment/overlays/e2e-release-25.0" + upgradeEntityKustomization: "../../ironic-deployment/overlays/e2e" + upgradeEntityName: "ironic" +- deployIronic: true + deployBMO: true + initBMOKustomization: "../../config/overlays/e2e-release-0.8" + initIronicKustomization: "../../ironic-deployment/overlays/e2e-release-26.0" + upgradeEntityKustomization: "../../ironic-deployment/overlays/e2e" + upgradeEntityName: "ironic"