From fcfaee272df37a336ffd0d6d2c7a7cf1c169ddd1 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Tue, 4 Feb 2025 14:37:18 +0100 Subject: [PATCH 01/12] chore: Add test for arm64 Signed-off-by: Anatolii Bazko --- .../workflows/minikube-test-operator-arm.yaml | 36 ++++ .../minikube-tests/test-operator-arm64.sh | 203 ++++++++++++++++++ 2 files changed, 239 insertions(+) create mode 100644 .github/workflows/minikube-test-operator-arm.yaml create mode 100755 build/scripts/minikube-tests/test-operator-arm64.sh diff --git a/.github/workflows/minikube-test-operator-arm.yaml b/.github/workflows/minikube-test-operator-arm.yaml new file mode 100644 index 0000000000..3b6a3311fe --- /dev/null +++ b/.github/workflows/minikube-test-operator-arm.yaml @@ -0,0 +1,36 @@ +# +# Copyright (c) 2019-2025 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Red Hat, Inc. - initial API and implementation +# + +name: Operator test +on: pull_request +jobs: + operator-on-minikube-arm: + runs-on: ubuntu-22.04-arm + steps: + - name: Checkout source code + uses: actions/checkout@v3 + - name: Start minikube cluster + id: run-minikube + uses: che-incubator/setup-minikube-action@next + with: + minikube-version: v1.29.0 + - name: Install yq + run: sudo pip install yq + - name: Install chectl + run: bash <(curl -sL https://che-incubator.github.io/chectl/install.sh) --channel=next + - name: Run tests + run: /bin/bash build/scripts/minikube-tests/test-operator-arm64.sh + - uses: actions/upload-artifact@v3 + if: ${{ always() }} + with: + name: artifacts + path: /tmp/artifacts-che diff --git a/build/scripts/minikube-tests/test-operator-arm64.sh b/build/scripts/minikube-tests/test-operator-arm64.sh new file mode 100755 index 0000000000..d42fa4e91a --- /dev/null +++ b/build/scripts/minikube-tests/test-operator-arm64.sh @@ -0,0 +1,203 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2019-2023 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Red Hat, Inc. - initial API and implementation +# + +set -e +set -x + +# Get absolute path for root repo directory from github actions context: https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions +export OPERATOR_REPO="${GITHUB_WORKSPACE}" +if [ -z "${OPERATOR_REPO}" ]; then + OPERATOR_REPO=$(dirname "$(dirname "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")")") +fi + +source "${OPERATOR_REPO}/build/scripts/minikube-tests/common.sh" + +# Stop execution on any error +trap "catchFinish" EXIT SIGINT + +runTest() { + buildAndCopyCheOperatorImageToMinikube + yq -riSY '.spec.template.spec.containers[0].image = "'${OPERATOR_IMAGE}'"' "${CURRENT_OPERATOR_VERSION_TEMPLATE_PATH}/che-operator/kubernetes/operator.yaml" + yq -riSY '.spec.template.spec.containers[0].imagePullPolicy = "IfNotPresent"' "${CURRENT_OPERATOR_VERSION_TEMPLATE_PATH}/che-operator/kubernetes/operator.yaml" + + chectl server:deploy \ + --batch \ + --platform minikube \ + --k8spodwaittimeout=6000000 \ + --k8spodreadytimeout=6000000 \ + --templates "${CURRENT_OPERATOR_VERSION_TEMPLATE_PATH}" \ + --che-operator-cr-patch-yaml "${OPERATOR_REPO}/build/scripts/minikube-tests/minikube-checluster-patch.yaml" + + make wait-devworkspace-running NAMESPACE="devworkspace-controller" VERBOSE=1 + + # Free up some cpu resources + kubectl scale deployment che --replicas=0 -n eclipse-che + + createDevWorkspaceTest + startAndWaitDevWorkspaceTest + stopAndWaitDevWorkspace + deleteDevWorkspace +} + +createDevWorkspaceTest() { + kubectl apply -f - < /checode/entrypoint-logs.txt + 2>&1 & + component: che-code-runtime-description + id: init-che-code-command + components: + - container: + command: + - /entrypoint-init-container.sh + cpuLimit: 500m + cpuRequest: 30m + env: + - name: CHE_DASHBOARD_URL + value: https://$(minikube ip).nip.io + - name: OPENVSX_REGISTRY_URL + value: https://open-vsx.org + image: quay.io/abazko/che-code:next + memoryLimit: 256Mi + memoryRequest: 32Mi + sourceMapping: /projects + volumeMounts: + - name: checode + path: /checode + name: che-code-injector + - attributes: + app.kubernetes.io/component: che-code-runtime + app.kubernetes.io/part-of: che-code.eclipse.org + controller.devfile.io/container-contribution: true + container: + cpuLimit: 500m + cpuRequest: 30m + endpoints: + - attributes: + cookiesAuthEnabled: true + discoverable: false + type: main + urlRewriteSupported: true + exposure: public + name: che-code + protocol: https + secure: true + targetPort: 3100 + - attributes: + discoverable: false + urlRewriteSupported: false + exposure: public + name: code-redirect-1 + protocol: https + targetPort: 13131 + - attributes: + discoverable: false + urlRewriteSupported: false + exposure: public + name: code-redirect-2 + protocol: https + targetPort: 13132 + - attributes: + discoverable: false + urlRewriteSupported: false + exposure: public + name: code-redirect-3 + protocol: https + targetPort: 13133 + env: + - name: CHE_DASHBOARD_URL + value: https://$(minikube ip).nip.io + - name: OPENVSX_REGISTRY_URL + value: https://open-vsx.org + image: quay.io/abazko/universal-developer-image:pr-3 + memoryLimit: 1024Mi + memoryRequest: 256Mi + sourceMapping: /projects + volumeMounts: + - name: checode + path: /checode + name: che-code-runtime-description + - name: checode + volume: {} + events: + postStart: + - init-che-code-command + preStart: + - init-container-command +EOF + + kubectl apply -f - </dev/null +initDefaults +initTemplates +runTest +popd >/dev/null + + From 90c58494065113c742e8c27e63e3a5099df5b4d7 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Tue, 4 Feb 2025 14:39:39 +0100 Subject: [PATCH 02/12] fixup Signed-off-by: Anatolii Bazko --- .github/workflows/minikube-test-helm.yaml | 2 +- .github/workflows/minikube-test-operator-arm.yaml | 2 +- .github/workflows/minikube-test-operator.yaml | 2 +- .github/workflows/minikube-test-upgrade-stable-to-next.yaml | 2 +- .github/workflows/minikube-test-upgrade-stable-to-stable.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/minikube-test-helm.yaml b/.github/workflows/minikube-test-helm.yaml index f9882bb2d7..dd09a99a38 100644 --- a/.github/workflows/minikube-test-helm.yaml +++ b/.github/workflows/minikube-test-helm.yaml @@ -29,7 +29,7 @@ jobs: run: bash <(curl -sL https://che-incubator.github.io/chectl/install.sh) --channel=next - name: Run tests run: /bin/bash build/scripts/minikube-tests/test-helm.sh - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: ${{ always() }} with: name: artifacts diff --git a/.github/workflows/minikube-test-operator-arm.yaml b/.github/workflows/minikube-test-operator-arm.yaml index 3b6a3311fe..9d4781a123 100644 --- a/.github/workflows/minikube-test-operator-arm.yaml +++ b/.github/workflows/minikube-test-operator-arm.yaml @@ -29,7 +29,7 @@ jobs: run: bash <(curl -sL https://che-incubator.github.io/chectl/install.sh) --channel=next - name: Run tests run: /bin/bash build/scripts/minikube-tests/test-operator-arm64.sh - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@4 if: ${{ always() }} with: name: artifacts diff --git a/.github/workflows/minikube-test-operator.yaml b/.github/workflows/minikube-test-operator.yaml index 7e88e89c4b..fe0db70767 100644 --- a/.github/workflows/minikube-test-operator.yaml +++ b/.github/workflows/minikube-test-operator.yaml @@ -29,7 +29,7 @@ jobs: run: bash <(curl -sL https://che-incubator.github.io/chectl/install.sh) --channel=next - name: Run tests run: /bin/bash build/scripts/minikube-tests/test-operator.sh - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: ${{ always() }} with: name: artifacts diff --git a/.github/workflows/minikube-test-upgrade-stable-to-next.yaml b/.github/workflows/minikube-test-upgrade-stable-to-next.yaml index 5e77f60ff4..0a51b74ed6 100644 --- a/.github/workflows/minikube-test-upgrade-stable-to-next.yaml +++ b/.github/workflows/minikube-test-upgrade-stable-to-next.yaml @@ -34,7 +34,7 @@ jobs: run: /bin/bash build/scripts/minikube-tests/test-upgrade-from-stable-to-next.sh env: "GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: ${{ always() }} with: name: artifacts diff --git a/.github/workflows/minikube-test-upgrade-stable-to-stable.yaml b/.github/workflows/minikube-test-upgrade-stable-to-stable.yaml index d838977f82..fd0f6fc5d5 100644 --- a/.github/workflows/minikube-test-upgrade-stable-to-stable.yaml +++ b/.github/workflows/minikube-test-upgrade-stable-to-stable.yaml @@ -34,7 +34,7 @@ jobs: run: /bin/bash build/scripts/minikube-tests/test-upgrade-from-stable-to-stable.sh env: "GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: ${{ always() }} with: name: artifacts From 3a87f7ab882fe467804b9fb7a3d34bd2d6b310ac Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Tue, 4 Feb 2025 14:40:44 +0100 Subject: [PATCH 03/12] fixup Signed-off-by: Anatolii Bazko --- .github/workflows/minikube-test-operator-arm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/minikube-test-operator-arm.yaml b/.github/workflows/minikube-test-operator-arm.yaml index 9d4781a123..76569bc01c 100644 --- a/.github/workflows/minikube-test-operator-arm.yaml +++ b/.github/workflows/minikube-test-operator-arm.yaml @@ -29,7 +29,7 @@ jobs: run: bash <(curl -sL https://che-incubator.github.io/chectl/install.sh) --channel=next - name: Run tests run: /bin/bash build/scripts/minikube-tests/test-operator-arm64.sh - - uses: actions/upload-artifact@4 + - uses: actions/upload-artifact@v4 if: ${{ always() }} with: name: artifacts From eb76c7dedd6ad6ef58008d12b1232a57f1695caa Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Tue, 4 Feb 2025 14:43:23 +0100 Subject: [PATCH 04/12] fixup Signed-off-by: Anatolii Bazko --- .github/workflows/minikube-test-operator-arm.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/minikube-test-operator-arm.yaml b/.github/workflows/minikube-test-operator-arm.yaml index 76569bc01c..230dba43ef 100644 --- a/.github/workflows/minikube-test-operator-arm.yaml +++ b/.github/workflows/minikube-test-operator-arm.yaml @@ -19,10 +19,10 @@ jobs: - name: Checkout source code uses: actions/checkout@v3 - name: Start minikube cluster - id: run-minikube - uses: che-incubator/setup-minikube-action@next - with: - minikube-version: v1.29.0 + run: | + curl -LO https://github.com/kubernetes/minikube/releases/latest/download/minikube-linux-arm64 + install minikube-linux-arm64 /usr/local/bin/minikube && rm minikube-linux-arm64 + minikube start --vm-driver=docker --addons=ingress --cpus 2 --memory 6500 - name: Install yq run: sudo pip install yq - name: Install chectl From 6c5de935958696c0ffbb377002c03a0aa721decd Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Tue, 4 Feb 2025 15:51:21 +0100 Subject: [PATCH 05/12] fixup Signed-off-by: Anatolii Bazko --- .github/workflows/minikube-test-operator-arm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/minikube-test-operator-arm.yaml b/.github/workflows/minikube-test-operator-arm.yaml index 230dba43ef..2f031edbc0 100644 --- a/.github/workflows/minikube-test-operator-arm.yaml +++ b/.github/workflows/minikube-test-operator-arm.yaml @@ -26,7 +26,7 @@ jobs: - name: Install yq run: sudo pip install yq - name: Install chectl - run: bash <(curl -sL https://che-incubator.github.io/chectl/install.sh) --channel=next + run: bash <(curl -sL https://raw.githubusercontent.com/che-incubator/chectl/4526a1fa80e29e4cc6dfd3fb048a9f75441bf8a2/install.sh) --channel=next - name: Run tests run: /bin/bash build/scripts/minikube-tests/test-operator-arm64.sh - uses: actions/upload-artifact@v4 From 26229082956a9a5efc356b6b8dbc5f6d5ddf39ee Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 5 Feb 2025 09:46:38 +0100 Subject: [PATCH 06/12] fixup Signed-off-by: Anatolii Bazko --- .github/workflows/minikube-test-operator-arm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/minikube-test-operator-arm.yaml b/.github/workflows/minikube-test-operator-arm.yaml index 2f031edbc0..230dba43ef 100644 --- a/.github/workflows/minikube-test-operator-arm.yaml +++ b/.github/workflows/minikube-test-operator-arm.yaml @@ -26,7 +26,7 @@ jobs: - name: Install yq run: sudo pip install yq - name: Install chectl - run: bash <(curl -sL https://raw.githubusercontent.com/che-incubator/chectl/4526a1fa80e29e4cc6dfd3fb048a9f75441bf8a2/install.sh) --channel=next + run: bash <(curl -sL https://che-incubator.github.io/chectl/install.sh) --channel=next - name: Run tests run: /bin/bash build/scripts/minikube-tests/test-operator-arm64.sh - uses: actions/upload-artifact@v4 From cb26b95e04d627acf5a62c69b749a7b0290e16ac Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 5 Feb 2025 14:55:59 +0100 Subject: [PATCH 07/12] Fixup Signed-off-by: Anatolii Bazko --- .github/workflows/minikube-test-operator.yaml | 21 +- .../minikube-tests/test-operator-arm64.sh | 203 ------------------ 2 files changed, 15 insertions(+), 209 deletions(-) delete mode 100755 build/scripts/minikube-tests/test-operator-arm64.sh diff --git a/.github/workflows/minikube-test-operator.yaml b/.github/workflows/minikube-test-operator.yaml index fe0db70767..ce6121c3f3 100644 --- a/.github/workflows/minikube-test-operator.yaml +++ b/.github/workflows/minikube-test-operator.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2023 Red Hat, Inc. +# Copyright (c) 2019-2025 Red Hat, Inc. # This program and the accompanying materials are made # available under the terms of the Eclipse Public License 2.0 # which is available at https://www.eclipse.org/legal/epl-2.0/ @@ -14,15 +14,24 @@ name: Operator test on: pull_request jobs: operator-on-minikube: - runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + runners: ['ubuntu-22.04', 'ubuntu-22.04-arm'] + runs-on: ${{ matrix.runners }} steps: - name: Checkout source code uses: actions/checkout@v3 - name: Start minikube cluster - id: run-minikube - uses: che-incubator/setup-minikube-action@next - with: - minikube-version: v1.29.0 + run: | + if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then + curl -LO https://github.com/kubernetes/minikube/releases/latest/download/minikube-linux + install minikube-linux /usr/local/bin/minikube && rm minikube-linux + else + curl -LO https://github.com/kubernetes/minikube/releases/latest/download/minikube-linux-arm64 + install minikube-linux-arm64 /usr/local/bin/minikube && rm minikube-linux-arm64 + fi + minikube start --vm-driver=docker --addons=ingress --cpus 2 --memory 6500 - name: Install yq run: sudo pip install yq - name: Install chectl diff --git a/build/scripts/minikube-tests/test-operator-arm64.sh b/build/scripts/minikube-tests/test-operator-arm64.sh deleted file mode 100755 index d42fa4e91a..0000000000 --- a/build/scripts/minikube-tests/test-operator-arm64.sh +++ /dev/null @@ -1,203 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2019-2023 Red Hat, Inc. -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# Red Hat, Inc. - initial API and implementation -# - -set -e -set -x - -# Get absolute path for root repo directory from github actions context: https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions -export OPERATOR_REPO="${GITHUB_WORKSPACE}" -if [ -z "${OPERATOR_REPO}" ]; then - OPERATOR_REPO=$(dirname "$(dirname "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")")") -fi - -source "${OPERATOR_REPO}/build/scripts/minikube-tests/common.sh" - -# Stop execution on any error -trap "catchFinish" EXIT SIGINT - -runTest() { - buildAndCopyCheOperatorImageToMinikube - yq -riSY '.spec.template.spec.containers[0].image = "'${OPERATOR_IMAGE}'"' "${CURRENT_OPERATOR_VERSION_TEMPLATE_PATH}/che-operator/kubernetes/operator.yaml" - yq -riSY '.spec.template.spec.containers[0].imagePullPolicy = "IfNotPresent"' "${CURRENT_OPERATOR_VERSION_TEMPLATE_PATH}/che-operator/kubernetes/operator.yaml" - - chectl server:deploy \ - --batch \ - --platform minikube \ - --k8spodwaittimeout=6000000 \ - --k8spodreadytimeout=6000000 \ - --templates "${CURRENT_OPERATOR_VERSION_TEMPLATE_PATH}" \ - --che-operator-cr-patch-yaml "${OPERATOR_REPO}/build/scripts/minikube-tests/minikube-checluster-patch.yaml" - - make wait-devworkspace-running NAMESPACE="devworkspace-controller" VERBOSE=1 - - # Free up some cpu resources - kubectl scale deployment che --replicas=0 -n eclipse-che - - createDevWorkspaceTest - startAndWaitDevWorkspaceTest - stopAndWaitDevWorkspace - deleteDevWorkspace -} - -createDevWorkspaceTest() { - kubectl apply -f - < /checode/entrypoint-logs.txt - 2>&1 & - component: che-code-runtime-description - id: init-che-code-command - components: - - container: - command: - - /entrypoint-init-container.sh - cpuLimit: 500m - cpuRequest: 30m - env: - - name: CHE_DASHBOARD_URL - value: https://$(minikube ip).nip.io - - name: OPENVSX_REGISTRY_URL - value: https://open-vsx.org - image: quay.io/abazko/che-code:next - memoryLimit: 256Mi - memoryRequest: 32Mi - sourceMapping: /projects - volumeMounts: - - name: checode - path: /checode - name: che-code-injector - - attributes: - app.kubernetes.io/component: che-code-runtime - app.kubernetes.io/part-of: che-code.eclipse.org - controller.devfile.io/container-contribution: true - container: - cpuLimit: 500m - cpuRequest: 30m - endpoints: - - attributes: - cookiesAuthEnabled: true - discoverable: false - type: main - urlRewriteSupported: true - exposure: public - name: che-code - protocol: https - secure: true - targetPort: 3100 - - attributes: - discoverable: false - urlRewriteSupported: false - exposure: public - name: code-redirect-1 - protocol: https - targetPort: 13131 - - attributes: - discoverable: false - urlRewriteSupported: false - exposure: public - name: code-redirect-2 - protocol: https - targetPort: 13132 - - attributes: - discoverable: false - urlRewriteSupported: false - exposure: public - name: code-redirect-3 - protocol: https - targetPort: 13133 - env: - - name: CHE_DASHBOARD_URL - value: https://$(minikube ip).nip.io - - name: OPENVSX_REGISTRY_URL - value: https://open-vsx.org - image: quay.io/abazko/universal-developer-image:pr-3 - memoryLimit: 1024Mi - memoryRequest: 256Mi - sourceMapping: /projects - volumeMounts: - - name: checode - path: /checode - name: che-code-runtime-description - - name: checode - volume: {} - events: - postStart: - - init-che-code-command - preStart: - - init-container-command -EOF - - kubectl apply -f - </dev/null -initDefaults -initTemplates -runTest -popd >/dev/null - - From 055d08350730a42bef38efbf88bf7c81428444de Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 5 Feb 2025 15:00:23 +0100 Subject: [PATCH 08/12] Fixup Signed-off-by: Anatolii Bazko --- .../workflows/minikube-test-operator-arm.yaml | 36 ------------------- .github/workflows/minikube-test-operator.yaml | 12 ++++--- 2 files changed, 7 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/minikube-test-operator-arm.yaml diff --git a/.github/workflows/minikube-test-operator-arm.yaml b/.github/workflows/minikube-test-operator-arm.yaml deleted file mode 100644 index 230dba43ef..0000000000 --- a/.github/workflows/minikube-test-operator-arm.yaml +++ /dev/null @@ -1,36 +0,0 @@ -# -# Copyright (c) 2019-2025 Red Hat, Inc. -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# Red Hat, Inc. - initial API and implementation -# - -name: Operator test -on: pull_request -jobs: - operator-on-minikube-arm: - runs-on: ubuntu-22.04-arm - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - name: Start minikube cluster - run: | - curl -LO https://github.com/kubernetes/minikube/releases/latest/download/minikube-linux-arm64 - install minikube-linux-arm64 /usr/local/bin/minikube && rm minikube-linux-arm64 - minikube start --vm-driver=docker --addons=ingress --cpus 2 --memory 6500 - - name: Install yq - run: sudo pip install yq - - name: Install chectl - run: bash <(curl -sL https://che-incubator.github.io/chectl/install.sh) --channel=next - - name: Run tests - run: /bin/bash build/scripts/minikube-tests/test-operator-arm64.sh - - uses: actions/upload-artifact@v4 - if: ${{ always() }} - with: - name: artifacts - path: /tmp/artifacts-che diff --git a/.github/workflows/minikube-test-operator.yaml b/.github/workflows/minikube-test-operator.yaml index ce6121c3f3..856f351cb7 100644 --- a/.github/workflows/minikube-test-operator.yaml +++ b/.github/workflows/minikube-test-operator.yaml @@ -22,15 +22,17 @@ jobs: steps: - name: Checkout source code uses: actions/checkout@v3 - - name: Start minikube cluster + - name: Set arch environment variable run: | if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then - curl -LO https://github.com/kubernetes/minikube/releases/latest/download/minikube-linux - install minikube-linux /usr/local/bin/minikube && rm minikube-linux + echo arch="amd64" >> $GITHUB_ENV else - curl -LO https://github.com/kubernetes/minikube/releases/latest/download/minikube-linux-arm64 - install minikube-linux-arm64 /usr/local/bin/minikube && rm minikube-linux-arm64 + echo arch="arm64" >> $GITHUB_ENV fi + - name: Start minikube cluster + run: | + curl -LO https://github.com/kubernetes/minikube/releases/latest/download/minikube-linux-${{env.arch}} + install minikube-linux-${{env.arch}} /usr/local/bin/minikube && rm minikube-linux-${{env.arch}} minikube start --vm-driver=docker --addons=ingress --cpus 2 --memory 6500 - name: Install yq run: sudo pip install yq From d9249d5f7d237e70266906ddfe2f8058d87fc632 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 5 Feb 2025 15:23:19 +0100 Subject: [PATCH 09/12] fixup Signed-off-by: Anatolii Bazko --- .github/workflows/minikube-test-operator.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/minikube-test-operator.yaml b/.github/workflows/minikube-test-operator.yaml index 856f351cb7..466ccbc7a7 100644 --- a/.github/workflows/minikube-test-operator.yaml +++ b/.github/workflows/minikube-test-operator.yaml @@ -43,5 +43,5 @@ jobs: - uses: actions/upload-artifact@v4 if: ${{ always() }} with: - name: artifacts + name: artifacts-${{env.arch}} path: /tmp/artifacts-che From 67f347336e0801a5b9d3c0af6628b0eed1788ef4 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Fri, 7 Feb 2025 12:54:04 +0100 Subject: [PATCH 10/12] fixup Signed-off-by: Anatolii Bazko --- ...elease-next-catalog-and-operator-image.yaml | 18 ++++++++++++++++-- Makefile | 12 ++++++++++-- build/scripts/minikube-tests/common.sh | 2 +- build/scripts/olm/release-catalog.sh | 17 ++++++++++++++--- .../che-operator.clusterserviceversion.yaml | 8 ++++++-- .../che-operator.clusterserviceversion.yaml | 4 ++++ 6 files changed, 51 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-next-catalog-and-operator-image.yaml b/.github/workflows/release-next-catalog-and-operator-image.yaml index d5ac78edaf..c6de5ca6f2 100644 --- a/.github/workflows/release-next-catalog-and-operator-image.yaml +++ b/.github/workflows/release-next-catalog-and-operator-image.yaml @@ -52,6 +52,10 @@ jobs: steps: - name: Checkout source code uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Install yq run: sudo pip install yq - name: Login to quay.io @@ -61,13 +65,21 @@ jobs: password: ${{ secrets.QUAY_PASSWORD }} registry: quay.io - name: Build catalog source - run: ${GITHUB_WORKSPACE}/build/scripts/olm/release-catalog.sh --channel 'next' --catalog-image quay.io/eclipse/eclipse-che-olm-catalog:next + run: ${GITHUB_WORKSPACE}/build/scripts/olm/release-catalog.sh \ + --channel next \ + --image-tool docker \ + --platform linux/amd64,linux/arm64,linux/ppc64le \ + --catalog-image quay.io/eclipse/eclipse-che-olm-catalog:next build-catalog-with-digest: runs-on: ubuntu-22.04 needs: build-operator-image steps: - name: Checkout source code uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Install yq run: sudo pip install yq - name: Login to quay.io @@ -86,6 +98,8 @@ jobs: make update-dev-resources ${GITHUB_WORKSPACE}/build/scripts/release/addDigests.sh -s $(make csv-path CHANNEL=next) -t next ${GITHUB_WORKSPACE}/build/scripts/olm/release-catalog.sh \ - --channel next \ + --channel next \ + --image-tool docker \ + --platform linux/amd64,linux/arm64,linux/ppc64le \ --catalog-image quay.io/eclipse/eclipse-che-olm-catalog:next-digest \ --bundle-image quay.io/eclipse/eclipse-che-olm-bundle:$(make bundle-version CHANNEL=next)-digest diff --git a/Makefile b/Makefile index 0e038f1321..a75435de7a 100644 --- a/Makefile +++ b/Makefile @@ -488,7 +488,11 @@ bundle-build: download-opm ## Build a bundle image [[ -z "$(BUNDLE_IMG)" ]] && { echo [ERROR] BUNDLE_IMG not defined; exit 1; } BUNDLE_PATH=$$($(MAKE) bundle-path) - $(IMAGE_TOOL) build -f $${BUNDLE_PATH}/bundle.Dockerfile -t $(BUNDLE_IMG) $${BUNDLE_PATH} + if [[ -z "$(PLATFORMS)" ]]; then + $(IMAGE_TOOL) build -f $${BUNDLE_PATH}/bundle.Dockerfile -t $(BUNDLE_IMG) $${BUNDLE_PATH} + else + $(IMAGE_TOOL) buildx build --platform $(PLATFORMS) -f $${BUNDLE_PATH}/bundle.Dockerfile -t $(BUNDLE_IMG) $${BUNDLE_PATH} + fi bundle-push: SHELL := /bin/bash bundle-push: ## Push a bundle image @@ -513,7 +517,11 @@ catalog-build: download-opm ## Build a catalog image [[ -z "$(CATALOG_IMG)" ]] && { echo [ERROR] CATALOG_IMG not defined; exit 1; } $(OPM) validate olm-catalog/$(CHANNEL) - $(IMAGE_TOOL) build -f olm-catalog/index.Dockerfile -t $(CATALOG_IMG) --build-arg CHANNEL=$(CHANNEL) . + if [[ -z "$(PLATFORMS)" ]]; then + $(IMAGE_TOOL) build -f olm-catalog/index.Dockerfile -t $(CATALOG_IMG) --build-arg CHANNEL=$(CHANNEL) . + else + $(IMAGE_TOOL) buildx build --platform $(PLATFORMS) -f olm-catalog/index.Dockerfile -t $(CATALOG_IMG) --build-arg CHANNEL=$(CHANNEL) . + fi catalog-push: SHELL := /bin/bash catalog-push: ## Push a catalog image diff --git a/build/scripts/minikube-tests/common.sh b/build/scripts/minikube-tests/common.sh index e388014518..8ddd915dae 100755 --- a/build/scripts/minikube-tests/common.sh +++ b/build/scripts/minikube-tests/common.sh @@ -317,7 +317,7 @@ spec: components: - name: tooling-container container: - image: quay.io/devfile/universal-developer-image:ubi8-latest + image: quay.io/devfile/universal-developer-image:ubi9-latest cpuLimit: 100m cpuRequest: 100m EOF diff --git a/build/scripts/olm/release-catalog.sh b/build/scripts/olm/release-catalog.sh index d3af16868a..ac744e6b75 100755 --- a/build/scripts/olm/release-catalog.sh +++ b/build/scripts/olm/release-catalog.sh @@ -22,6 +22,7 @@ init() { unset CATALOG_IMAGE unset BUNDLE_IMAGE unset IMAGE_TOOL + unset PLATFORM while [[ "$#" -gt 0 ]]; do case $1 in @@ -29,6 +30,7 @@ init() { '--catalog-image'|'-i') CATALOG_IMAGE="$2"; shift 1;; '--bundle-image'|'-b') BUNDLE_IMAGE="$2"; shift 1;; '--image-tool'|'-t') IMAGE_TOOL="$2"; shift 1;; + '--platform'|'-p') PLATFORM="$2"; shift 1;; '--force'|'-f') FORCE="true";; '--help'|'-h') usage; exit;; esac @@ -57,7 +59,8 @@ usage () { echo echo "Options:" echo -e "\t-i,--catalog-image Catalog image to build" - echo -e "\t-i,--bundle-image Bundle image to build" + echo -e "\t-b,--bundle-image Bundle image to build" + echo -e "\t-p,--platform Target platform for build" echo -e "\t-c,--channel=next|stable Olm channel to build bundle from" echo -e "\t-t,--image-tool [default: docker] Image tool" echo -e "\t-f,--force [default: false] Force to build catalog and bundle images even if bundle already exists in the catalog" @@ -76,7 +79,11 @@ build () { exit 0 else echo "[INFO] Build and push the new bundle image" - make bundle-build bundle-push CHANNEL="${CHANNEL}" BUNDLE_IMG="${BUNDLE_IMAGE}" IMAGE_TOOL="${IMAGE_TOOL}" + make bundle-build bundle-push \ + CHANNEL="${CHANNEL}" \ + BUNDLE_IMG="${BUNDLE_IMAGE}" \ + IMAGE_TOOL="${IMAGE_TOOL}" \ + PLATFORM="${PLATFORM}" echo "[INFO] Add bundle to the catalog" @@ -98,7 +105,11 @@ build () { fi echo "[INFO] Build and push the catalog image" - make catalog-build catalog-push CHANNEL="${CHANNEL}" CATALOG_IMG="${CATALOG_IMAGE}" IMAGE_TOOL="${IMAGE_TOOL}" + make catalog-build catalog-push \ + CHANNEL="${CHANNEL}" \ + CATALOG_IMG="${CATALOG_IMAGE}" \ + IMAGE_TOOL="${IMAGE_TOOL}" \ + PLATFORM="${PLATFORM}" make download-addlicense make license $(make catalog-path CHANNEL="${CHANNEL}") diff --git a/bundle/next/eclipse-che/manifests/che-operator.clusterserviceversion.yaml b/bundle/next/eclipse-che/manifests/che-operator.clusterserviceversion.yaml index 883bcd4e66..addc4b7d65 100644 --- a/bundle/next/eclipse-che/manifests/che-operator.clusterserviceversion.yaml +++ b/bundle/next/eclipse-che/manifests/che-operator.clusterserviceversion.yaml @@ -104,7 +104,11 @@ metadata: operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 repository: https://github.com/eclipse-che/che-operator support: Eclipse Foundation - name: eclipse-che.v7.97.0-897.next + labels: + operatorframework.io/arch.amd64: supported + operatorframework.io/arch.arm64: supported + operatorframework.io/os.linux: supported + name: eclipse-che.v7.99.0-898.next namespace: placeholder spec: apiservicedefinitions: {} @@ -1073,7 +1077,7 @@ spec: minKubeVersion: 1.19.0 provider: name: Eclipse Foundation - version: 7.97.0-897.next + version: 7.99.0-898.next webhookdefinitions: - admissionReviewVersions: - v1 diff --git a/config/manifests/bases/che-operator.clusterserviceversion.yaml b/config/manifests/bases/che-operator.clusterserviceversion.yaml index 91253b498c..727d13f175 100644 --- a/config/manifests/bases/che-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/che-operator.clusterserviceversion.yaml @@ -35,6 +35,10 @@ metadata: operatorframework.io/suggested-namespace: openshift-operators repository: https://github.com/eclipse-che/che-operator support: Eclipse Foundation + labels: + operatorframework.io/arch.amd64: supported + operatorframework.io/arch.arm64: supported + operatorframework.io/os.linux: supported name: eclipse-che.v0.0.0 namespace: placeholder spec: From 86929f513d70de51ef2d1579f050d4fc7f53f6fa Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Thu, 13 Feb 2025 10:39:27 +0100 Subject: [PATCH 11/12] Fix testing DevWorkspace Signed-off-by: Anatolii Bazko --- build/scripts/minikube-tests/common.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/scripts/minikube-tests/common.sh b/build/scripts/minikube-tests/common.sh index 8ddd915dae..590bc30302 100755 --- a/build/scripts/minikube-tests/common.sh +++ b/build/scripts/minikube-tests/common.sh @@ -229,7 +229,7 @@ spec: value: https://$(minikube ip).nip.io - name: OPENVSX_REGISTRY_URL value: https://open-vsx.org - image: quay.io/che-incubator/che-code:latest + image: quay.io/che-incubator/che-code:next memoryLimit: 256Mi memoryRequest: 32Mi sourceMapping: /projects @@ -281,7 +281,7 @@ spec: value: https://$(minikube ip).nip.io - name: OPENVSX_REGISTRY_URL value: https://open-vsx.org - image: quay.io/devfile/universal-developer-image:ubi8-latest + image: quay.io/devfile/universal-developer-image:ubi9-latest memoryLimit: 1024Mi memoryRequest: 256Mi sourceMapping: /projects @@ -325,8 +325,8 @@ EOF startAndWaitDevWorkspace() { # pre-pull image for faster workspace startup - minikube image pull quay.io/devfile/universal-developer-image:ubi8-latest - minikube image pull quay.io/che-incubator/che-code:latest + minikube image pull quay.io/devfile/universal-developer-image:ubi9-latest + minikube image pull quay.io/che-incubator/che-code:next kubectl patch devworkspace ${DEV_WORKSPACE_NAME} -p '{"spec":{"started":true}}' --type=merge -n ${USER_NAMESPACE} kubectl wait devworkspace ${DEV_WORKSPACE_NAME} -n ${USER_NAMESPACE} --for=jsonpath='{.status.phase}'=Running --timeout=300s From 174b9cec9f23136997bcdf272c3dfae42a7ab0c3 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Thu, 13 Feb 2025 13:46:00 +0100 Subject: [PATCH 12/12] Fix building catalogs Signed-off-by: Anatolii Bazko --- .../release-next-catalog-and-operator-image.yaml | 13 +++++++------ build/scripts/olm/release-catalog.sh | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-next-catalog-and-operator-image.yaml b/.github/workflows/release-next-catalog-and-operator-image.yaml index c6de5ca6f2..8fab1a0c0f 100644 --- a/.github/workflows/release-next-catalog-and-operator-image.yaml +++ b/.github/workflows/release-next-catalog-and-operator-image.yaml @@ -65,11 +65,12 @@ jobs: password: ${{ secrets.QUAY_PASSWORD }} registry: quay.io - name: Build catalog source - run: ${GITHUB_WORKSPACE}/build/scripts/olm/release-catalog.sh \ - --channel next \ - --image-tool docker \ - --platform linux/amd64,linux/arm64,linux/ppc64le \ - --catalog-image quay.io/eclipse/eclipse-che-olm-catalog:next + run: | + ${GITHUB_WORKSPACE}/build/scripts/olm/release-catalog.sh \ + --channel next \ + --image-tool docker \ + --platform linux/amd64,linux/arm64,linux/ppc64le \ + --catalog-image quay.io/eclipse/eclipse-che-olm-catalog:next build-catalog-with-digest: runs-on: ubuntu-22.04 needs: build-operator-image @@ -98,7 +99,7 @@ jobs: make update-dev-resources ${GITHUB_WORKSPACE}/build/scripts/release/addDigests.sh -s $(make csv-path CHANNEL=next) -t next ${GITHUB_WORKSPACE}/build/scripts/olm/release-catalog.sh \ - --channel next \ + --channel next \ --image-tool docker \ --platform linux/amd64,linux/arm64,linux/ppc64le \ --catalog-image quay.io/eclipse/eclipse-che-olm-catalog:next-digest \ diff --git a/build/scripts/olm/release-catalog.sh b/build/scripts/olm/release-catalog.sh index ac744e6b75..ffcdf6820f 100755 --- a/build/scripts/olm/release-catalog.sh +++ b/build/scripts/olm/release-catalog.sh @@ -55,7 +55,7 @@ usage () { echo "Build and push catalog and bundle images." echo echo "Usage:" - echo -e "\t$0 -i CATALOG_IMAGE -c CHANNEL [-o OPERATOR_IMAGE] [-t IMAGE_TOOL]" + echo -e "\t$0 -i CATALOG_IMAGE -c CHANNEL [-t IMAGE_TOOL]" echo echo "Options:" echo -e "\t-i,--catalog-image Catalog image to build"