From 12554ae7256b1049288e1eea18cf3cd9bd7cf3be Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Tue, 18 Nov 2025 14:26:13 +0530 Subject: [PATCH 01/10] Enhance architecture support for tool installations Refactor installation steps for various tools to support multiple architectures and improve error handling. Signed-off-by: Prabhu K --- base/ubi9/Dockerfile | 187 ++++++++++++++++++++++++++++--------------- 1 file changed, 121 insertions(+), 66 deletions(-) diff --git a/base/ubi9/Dockerfile b/base/ubi9/Dockerfile index c251484f..bf88a52a 100644 --- a/base/ubi9/Dockerfile +++ b/base/ubi9/Dockerfile @@ -39,83 +39,121 @@ RUN dnf -y reinstall shadow-utils && \ # Download and install gh-cli depending on the architecture. # See release page for details https://github.com/cli/cli/releases/tag/v2.78.0 RUN \ - TEMP_DIR="$(mktemp -d)"; \ - cd "${TEMP_DIR}"; \ - GH_VERSION="2.78.0"; \ - GH_ARCH="linux_$TARGETARCH"; \ - GH_TGZ="gh_${GH_VERSION}_${GH_ARCH}.tar.gz"; \ - GH_TGZ_URL="https://github.com/cli/cli/releases/download/v${GH_VERSION}/${GH_TGZ}"; \ - GH_CHEKSUMS_URL="https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_checksums.txt"; \ - curl -sSLO "${GH_TGZ_URL}"; \ - curl -sSLO "${GH_CHEKSUMS_URL}"; \ - sha256sum --ignore-missing -c "gh_${GH_VERSION}_checksums.txt" 2>&1 | grep OK; \ - tar -zxv --no-same-owner -f "${GH_TGZ}"; \ - mv "gh_${GH_VERSION}_${GH_ARCH}"/bin/gh /usr/local/bin/; \ - mv "gh_${GH_VERSION}_${GH_ARCH}"/share/man/man1/* /usr/local/share/man/man1; \ - cd -; \ - rm -rf "${TEMP_DIR}" + TEMP_DIR="$(mktemp -d)" && cd "${TEMP_DIR}" && \ + GH_VERSION="2.78.0" && \ + case "$TARGETARCH" in \ + amd64) GH_ARCH="linux_amd64" ;; \ + arm64) GH_ARCH="linux_arm64" ;; \ + ppc64le) GH_ARCH="linux_ppc64le" ;; \ + *) echo "Unsupported architecture: $TARGETARCH" && exit 0 ;; \ + esac && \ + GH_TGZ="gh_${GH_VERSION}_${GH_ARCH}.tar.gz" && \ + GH_TGZ_URL="https://github.com/cli/cli/releases/download/v${GH_VERSION}/${GH_TGZ}" && \ + echo "Downloading ${GH_TGZ_URL}..." && \ + if curl -fsSL "${GH_TGZ_URL}" -o "${GH_TGZ}"; then \ + if file "${GH_TGZ}" | grep -q 'gzip compressed'; then \ + tar -zxv --no-same-owner -f "${GH_TGZ}" && \ + mv "gh_${GH_VERSION}_${GH_ARCH}"/bin/gh /usr/local/bin/ && \ + mv "gh_${GH_VERSION}_${GH_ARCH}"/share/man/man1/* /usr/local/share/man/man1; \ + else \ + echo "Downloaded gh archive invalid — skipping."; \ + fi; \ + else \ + echo "gh binary not found for ${TARGETARCH}, skipping installation."; \ + fi && \ + cd - && rm -rf "${TEMP_DIR}" # Download and install ripgrep depending on the architecture. # See release page for details https://github.com/BurntSushi/ripgrep/releases/tag/13.0.0 RUN \ - TEMP_DIR="$(mktemp -d)"; \ - cd "${TEMP_DIR}"; \ - RG_VERSION="13.0.0"; \ - if [ "$TARGETARCH" = "arm64" ]; then \ - RG_ARCH="arm-unknown-linux-gnueabihf"; \ + if [ "$TARGETARCH" = "ppc64le" ]; then \ + echo "Skipping ripgrep installation for ppc64le as binary not available"; \ else \ - RG_ARCH="x86_64-unknown-linux-musl"; \ - fi; \ - RG_TGZ="ripgrep-${RG_VERSION}-${RG_ARCH}.tar.gz"; \ - RG_TGZ_URL="https://github.com/BurntSushi/ripgrep/releases/download/${RG_VERSION}/${RG_TGZ}"; \ - curl -sSLO "${RG_TGZ_URL}"; \ - tar -zxv --no-same-owner -f "${RG_TGZ}"; \ - mv "ripgrep-${RG_VERSION}-${RG_ARCH}"/rg /usr/local/bin/; \ - mv "ripgrep-${RG_VERSION}-${RG_ARCH}"/doc/rg.1 /usr/local/share/man/man1; \ - cd -; \ - rm -rf "${TEMP_DIR}" + TEMP_DIR="$(mktemp -d)" && cd "${TEMP_DIR}" && \ + RG_VERSION="13.0.0" && \ + if [ "$TARGETARCH" = "arm64" ]; then \ + RG_ARCH="arm-unknown-linux-gnueabihf"; \ + else \ + RG_ARCH="x86_64-unknown-linux-musl"; \ + fi && \ + RG_TGZ="ripgrep-${RG_VERSION}-${RG_ARCH}.tar.gz" && \ + RG_TGZ_URL="https://github.com/BurntSushi/ripgrep/releases/download/${RG_VERSION}/${RG_TGZ}" && \ + echo "Downloading ${RG_TGZ_URL}..." && \ + if curl -fsSL "${RG_TGZ_URL}" -o "${RG_TGZ}"; then \ + if file "${RG_TGZ}" | grep -q 'gzip compressed'; then \ + tar -zxv --no-same-owner -f "${RG_TGZ}" && \ + mv "ripgrep-${RG_VERSION}-${RG_ARCH}"/rg /usr/local/bin/ && \ + mv "ripgrep-${RG_VERSION}-${RG_ARCH}"/doc/rg.1 /usr/local/share/man/man1; \ + else \ + echo "Downloaded ripgrep archive invalid — skipping."; \ + fi; \ + else \ + echo "ripgrep binary not found for ${TARGETARCH}, skipping installation."; \ + fi && \ + cd - && rm -rf "${TEMP_DIR}"; \ + fi # Download and install bat depending on the architecture. # See release page for details https://github.com/sharkdp/bat/releases/tag/v0.18.3 RUN \ - TEMP_DIR="$(mktemp -d)"; \ - cd "${TEMP_DIR}"; \ - BAT_VERSION="0.18.3"; \ - if [ "$TARGETARCH" = "arm64" ]; then \ - BAT_ARCH="aarch64-unknown-linux-gnu"; \ + if [ "$TARGETARCH" = "ppc64le" ]; then \ + echo "Skipping bat installation for ppc64le as binary not available"; \ else \ - BAT_ARCH="x86_64-unknown-linux-musl"; \ - fi; \ - BAT_TGZ="bat-v${BAT_VERSION}-${BAT_ARCH}.tar.gz"; \ - BAT_TGZ_URL="https://github.com/sharkdp/bat/releases/download/v${BAT_VERSION}/${BAT_TGZ}"; \ - curl -sSLO "${BAT_TGZ_URL}"; \ - tar -zxv --no-same-owner -f "${BAT_TGZ}"; \ - mv "bat-v${BAT_VERSION}-${BAT_ARCH}"/bat /usr/local/bin/; \ - mv "bat-v${BAT_VERSION}-${BAT_ARCH}"/bat.1 /usr/local/share/man/man1; \ - cd -; \ - rm -rf "${TEMP_DIR}" + TEMP_DIR="$(mktemp -d)" && cd "${TEMP_DIR}" && \ + BAT_VERSION="0.18.3" && \ + if [ "$TARGETARCH" = "arm64" ]; then \ + BAT_ARCH="aarch64-unknown-linux-gnu"; \ + else \ + BAT_ARCH="x86_64-unknown-linux-musl"; \ + fi && \ + BAT_TGZ="bat-v${BAT_VERSION}-${BAT_ARCH}.tar.gz" && \ + BAT_TGZ_URL="https://github.com/sharkdp/bat/releases/download/v${BAT_VERSION}/${BAT_TGZ}" && \ + echo "Downloading ${BAT_TGZ_URL}..." && \ + if curl -fsSL "${BAT_TGZ_URL}" -o "${BAT_TGZ}"; then \ + if file "${BAT_TGZ}" | grep -q 'gzip compressed'; then \ + tar -zxv --no-same-owner -f "${BAT_TGZ}" && \ + mv "bat-v${BAT_VERSION}-${BAT_ARCH}"/bat /usr/local/bin/ && \ + mv "bat-v${BAT_VERSION}-${BAT_ARCH}"/bat.1 /usr/local/share/man/man1; \ + else \ + echo "Downloaded bat archive invalid — skipping."; \ + fi; \ + else \ + echo "bat binary not found for ${TARGETARCH}, skipping installation."; \ + fi && \ + cd - && rm -rf "${TEMP_DIR}"; \ + fi # Download and install fd depending on the architecture. # See release page for details https://github.com/sharkdp/fd/releases/tag/v8.7.0 RUN \ - TEMP_DIR="$(mktemp -d)" && \ - cd "${TEMP_DIR}" && \ - FD_VERSION="8.7.0" && \ - if [ "$TARGETARCH" = "arm64" ]; then \ - FD_ARCH="aarch64-unknown-linux-gnu"; \ + if [ "$TARGETARCH" = "ppc64le" ]; then \ + echo "Skipping fd installation for ppc64le as binary not available"; \ else \ - FD_ARCH="x86_64-unknown-linux-musl"; \ - fi && \ - FD_TGZ="fd-v${FD_VERSION}-${FD_ARCH}.tar.gz" && \ - FD_TGZ_URL="https://github.com/sharkdp/fd/releases/download/v${FD_VERSION}/${FD_TGZ}" && \ - curl -sSLO "${FD_TGZ_URL}" && \ - tar -xv --no-same-owner -f "${FD_TGZ}" && \ - mv "fd-v${FD_VERSION}-${FD_ARCH}"/fd /usr/local/bin && \ - mv "fd-v${FD_VERSION}-${FD_ARCH}"/fd.1 /usr/local/share/man/man1 && \ - cd - && \ - rm -rf "${TEMP_DIR}" - - # Define user directory for binaries + TEMP_DIR="$(mktemp -d)" && cd "${TEMP_DIR}" && \ + FD_VERSION="8.7.0" && \ + if [ "$TARGETARCH" = "arm64" ]; then \ + FD_ARCH="aarch64-unknown-linux-gnu"; \ + else \ + FD_ARCH="x86_64-unknown-linux-musl"; \ + fi && \ + FD_TGZ="fd-v${FD_VERSION}-${FD_ARCH}.tar.gz" && \ + FD_TGZ_URL="https://github.com/sharkdp/fd/releases/download/v${FD_VERSION}/${FD_TGZ}" && \ + echo "Downloading ${FD_TGZ_URL}..." && \ + if curl -fsSL "${FD_TGZ_URL}" -o "${FD_TGZ}"; then \ + if file "${FD_TGZ}" | grep -q 'gzip compressed'; then \ + tar -xv --no-same-owner -f "${FD_TGZ}" && \ + mv "fd-v${FD_VERSION}-${FD_ARCH}"/fd /usr/local/bin/ && \ + mv "fd-v${FD_VERSION}-${FD_ARCH}"/fd.1 /usr/local/share/man/man1; \ + else \ + echo "Downloaded fd archive invalid — skipping."; \ + fi; \ + else \ + echo "fd binary not found for ${TARGETARCH}, skipping installation."; \ + fi && \ + cd - && rm -rf "${TEMP_DIR}"; \ + fi + +# Define user directory for binaries ENV PATH="/home/user/.local/bin:$PATH" # Set up environment variables to note that this is @@ -137,11 +175,28 @@ RUN mkdir -p /var/lib/shared/overlay-images /var/lib/shared/overlay-layers; \ # Add kubedock # See release page for details https://github.com/joyrex2001/kubedock/releases/tag/0.18.2 -ENV KUBEDOCK_VERSION 0.18.2 +ENV KUBEDOCK_VERSION=0.18.2 ENV KUBECONFIG=/home/user/.kube/config -RUN KUBEDOCK_ARCH="linux_amd64" && \ - curl -L https://github.com/joyrex2001/kubedock/releases/download/${KUBEDOCK_VERSION}/kubedock_${KUBEDOCK_VERSION}_${KUBEDOCK_ARCH}.tar.gz | tar -C /usr/local/bin -xz --no-same-owner \ - && chmod +x /usr/local/bin/kubedock +RUN \ + if [ "$TARGETARCH" = "ppc64le" ]; then \ + echo "Skipping kubedock installation for ppc64le as binary not available"; \ + else \ + KUBEDOCK_ARCH="linux_${TARGETARCH}" && \ + KUBEDOCK_URL="https://github.com/joyrex2001/kubedock/releases/download/${KUBEDOCK_VERSION}/kubedock_${KUBEDOCK_VERSION}_${KUBEDOCK_ARCH}.tar.gz"; \ + echo "Downloading ${KUBEDOCK_URL}..."; \ + if curl -fsSL "${KUBEDOCK_URL}" -o /tmp/kubedock.tar.gz; then \ + if file /tmp/kubedock.tar.gz | grep -q 'gzip compressed'; then \ + tar -C /usr/local/bin -xz --no-same-owner -f /tmp/kubedock.tar.gz && \ + chmod +x /usr/local/bin/kubedock && \ + echo "Kubedock installed successfully."; \ + else \ + echo "Downloaded kubedock file invalid — skipping extraction."; \ + fi; \ + else \ + echo "Kubedock binary not found for ${TARGETARCH}, skipping installation."; \ + fi; \ + rm -f /tmp/kubedock.tar.gz; \ + fi COPY --chown=0:0 kubedock_setup.sh /usr/local/bin/kubedock_setup # Configure Podman wrapper From 86d9599a35e1ce8f81d5e5d33d3fab97cbd1b598 Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Tue, 18 Nov 2025 14:33:24 +0530 Subject: [PATCH 02/10] Enhance UBI 9 build workflow for multi-arch support Updated the GitHub Actions workflow to support multi-architecture builds for UBI 9 base images, including amd64, arm64, and ppc64le. Adjusted the build and publish steps accordingly. Signed-off-by: Prabhu K --- .github/workflows/ubi9-build.yaml | 54 ++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ubi9-build.yaml b/.github/workflows/ubi9-build.yaml index fdf4a695..7af9e8a2 100644 --- a/.github/workflows/ubi9-build.yaml +++ b/.github/workflows/ubi9-build.yaml @@ -1,4 +1,3 @@ - name: Build of UBI 9 based Developer Images on: @@ -28,37 +27,55 @@ jobs: strategy: fail-fast: false matrix: - runners: ['ubuntu-22.04', 'ubuntu-22.04-arm'] - runs-on: ${{matrix.runners}} + include: + - name: amd64-build + runner: ubuntu-22.04 + arch: amd64 + - name: arm64-build + runner: ubuntu-22.04-arm + arch: arm64 + - name: ppc64le-build + runner: ubuntu-22.04 + arch: ppc64le + runs-on: ${{ matrix.runner }} steps: - name: Checkout uses: actions/checkout@v4 - name: Set arch environment variable - run: | - if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then - echo arch="amd64" >> $GITHUB_ENV - else - echo arch="arm64" >> $GITHUB_ENV - fi + run: echo "arch=${{ matrix.arch }}" >> $GITHUB_ENV - name: Set short_sha environment variable run: echo short_sha="$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Free runner space run: sudo rm -rf /usr/local/lib/android - name: Cleanup docker images run: docker system prune -af + + # Setup QEMU for cross-platform builds + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + # Setup Docker Buildx with container driver + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + platforms: linux/amd64,linux/arm64,linux/ppc64le + + # Login to registry - name: Login to Registry uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_PASSWORD }} - - name: Build base image + + - name: Build base image (multi-arch) run: | - cd base/ubi9 && docker buildx build \ - --platform linux/${{env.arch}} \ - --progress=plain \ - --push \ - -t ${{ env.REGISTRY }}/base-developer-image:${{env.arch}}-${{env.short_sha}} . + cd base/ubi9 + docker buildx build \ + --platform linux/amd64,linux/arm64,linux/ppc64le \ + --progress=plain \ + -t ${{ env.REGISTRY }}/base-developer-image:${{ env.arch }}-${{ env.short_sha }} . publish-base-image: name: Publish base image @@ -81,7 +98,8 @@ jobs: do docker manifest create ${{ env.REGISTRY }}/base-developer-image:${tag} \ --amend ${{ env.REGISTRY }}/base-developer-image:amd64-${{env.short_sha}} \ - --amend ${{ env.REGISTRY }}/base-developer-image:arm64-${{env.short_sha}} + --amend ${{ env.REGISTRY }}/base-developer-image:arm64-${{env.short_sha}} \ + --amend ${{ env.REGISTRY }}/base-developer-image:ppc64le-${{env.short_sha}} docker manifest annotate ${{ env.REGISTRY }}/base-developer-image:${tag} \ ${{ env.REGISTRY }}/base-developer-image:amd64-${{env.short_sha}} \ @@ -90,6 +108,10 @@ jobs: docker manifest annotate ${{ env.REGISTRY }}/base-developer-image:${tag} \ ${{ env.REGISTRY }}/base-developer-image:arm64-${{env.short_sha}} \ --os linux --arch arm64 + + docker manifest annotate ${{ env.REGISTRY }}/base-developer-image:${tag} \ + ${{ env.REGISTRY }}/base-developer-image:ppc64le-${{env.short_sha}} \ + --os linux --arch ppc64le docker manifest push ${{ env.REGISTRY }}/base-developer-image:${tag} done From a6e41e7e5a0ddf2fd67d73eae2e29eba3a103964 Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Tue, 18 Nov 2025 18:21:38 +0530 Subject: [PATCH 03/10] Refactor UBI9 build workflow and update steps Refactor UBI9 build workflow for improved clarity and functionality. Signed-off-by: Prabhu K --- .github/workflows/ubi9-build.yaml | 60 ++++++++++++++++++------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ubi9-build.yaml b/.github/workflows/ubi9-build.yaml index 7af9e8a2..c934ffa6 100644 --- a/.github/workflows/ubi9-build.yaml +++ b/.github/workflows/ubi9-build.yaml @@ -4,7 +4,6 @@ on: push: branches: [ main ] workflow_dispatch: - workflow_call: # Map the workflow outputs to job outputs secrets: @@ -14,8 +13,8 @@ on: required: true outputs: uniq_tag: - description: "The first output string" - value: ${{ jobs.build_universal_ubi9_image.outputs.output1 }} + description: "The uniqe tag for universal developer image" + value: ${{ jobs.publish-udi.outputs.uniq_tag }} env: # Use repository variable if set, otherwise fallback to default registry @@ -49,33 +48,28 @@ jobs: run: sudo rm -rf /usr/local/lib/android - name: Cleanup docker images run: docker system prune -af - # Setup QEMU for cross-platform builds - name: Set up QEMU uses: docker/setup-qemu-action@v2 - # Setup Docker Buildx with container driver - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: driver: docker-container platforms: linux/amd64,linux/arm64,linux/ppc64le - - # Login to registry - name: Login to Registry uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_PASSWORD }} - - - name: Build base image (multi-arch) + - name: Build base image run: | - cd base/ubi9 - docker buildx build \ - --platform linux/amd64,linux/arm64,linux/ppc64le \ - --progress=plain \ - -t ${{ env.REGISTRY }}/base-developer-image:${{ env.arch }}-${{ env.short_sha }} . + cd base/ubi9 && docker buildx build \ + --platform linux/${{env.arch}} \ + --progress=plain \ + --push \ + -t ${{ env.REGISTRY }}/base-developer-image:${{env.arch}}-${{env.short_sha}} . publish-base-image: name: Publish base image @@ -121,25 +115,38 @@ jobs: strategy: fail-fast: false matrix: - runners: ['ubuntu-22.04', 'ubuntu-22.04-arm'] - runs-on: ${{matrix.runners}} + include: + - name: amd64-build + runner: ubuntu-22.04 + arch: amd64 + - name: arm64-build + runner: ubuntu-22.04-arm + arch: arm64 + - name: ppc64le-build + runner: ubuntu-22.04 + arch: ppc64le + runs-on: ${{ matrix.runner }} needs: publish-base-image steps: - name: Checkout uses: actions/checkout@v4 - name: Set arch environment variable - run: | - if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then - echo arch="amd64" >> $GITHUB_ENV - else - echo arch="arm64" >> $GITHUB_ENV - fi + run: echo "arch=${{ matrix.arch }}" >> $GITHUB_ENV - name: Set short_sha environment variable run: echo short_sha="$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV - name: Free runner space run: sudo rm -rf /usr/local/lib/android - name: Cleanup docker images run: docker system prune -af + # Setup QEMU for cross-platform builds + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + # Setup Docker Buildx with container driver + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + platforms: linux/amd64,linux/arm64,linux/ppc64le - name: Login to Registry uses: docker/login-action@v3 with: @@ -175,7 +182,8 @@ jobs: do docker manifest create ${{ env.REGISTRY }}/universal-developer-image:${tag} \ --amend ${{ env.REGISTRY }}/universal-developer-image:amd64-${{env.short_sha}} \ - --amend ${{ env.REGISTRY }}/universal-developer-image:arm64-${{env.short_sha}} + --amend ${{ env.REGISTRY }}/universal-developer-image:arm64-${{env.short_sha}} \ + --amend ${{ env.REGISTRY }}/universal-developer-image:ppc64le-${{env.short_sha}} docker manifest annotate ${{ env.REGISTRY }}/universal-developer-image:${tag} \ ${{ env.REGISTRY }}/universal-developer-image:amd64-${{env.short_sha}} \ @@ -185,11 +193,13 @@ jobs: ${{ env.REGISTRY }}/universal-developer-image:arm64-${{env.short_sha}} \ --os linux --arch arm64 + docker manifest annotate ${{ env.REGISTRY }}/universal-developer-image:${tag} \ + ${{ env.REGISTRY }}/universal-developer-image:ppc64le-${{env.short_sha}} \ + --os linux --arch ppc64le + docker manifest push ${{ env.REGISTRY }}/universal-developer-image:${tag} done - name: Get tag with uniq prefix id: setTagName - # set the image with uniq tag prefix (for example: quay.io/..../base-developer-image:ubi9-7ad6cab) to env. var - # and define it for output. This output with tag image will be used in caller job run: | echo "uniq_tag=${{ env.REGISTRY }}/universal-developer-image:ubi9-${{env.short_sha}}" >> $GITHUB_OUTPUT From 83c785551013bbed22c51646dcbebd783f4ade53 Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Thu, 20 Nov 2025 01:07:14 +0530 Subject: [PATCH 04/10] Refactor GitHub Actions workflow for multi-architecture builds Enhanced for ppc64le arch Signed-off-by: Prabhu K --- ...workspace-smoke-test-on-minikube-ubi9.yaml | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/empty-workspace-smoke-test-on-minikube-ubi9.yaml b/.github/workflows/empty-workspace-smoke-test-on-minikube-ubi9.yaml index d33496ba..3099073f 100644 --- a/.github/workflows/empty-workspace-smoke-test-on-minikube-ubi9.yaml +++ b/.github/workflows/empty-workspace-smoke-test-on-minikube-ubi9.yaml @@ -31,8 +31,17 @@ jobs: strategy: fail-fast: false matrix: - runners: ['ubuntu-22.04', 'ubuntu-22.04-arm'] - runs-on: ${{matrix.runners}} + include: + - name: amd64-build + runner: ubuntu-22.04 + arch: amd64 + - name: arm64-build + runner: ubuntu-22.04-arm + arch: arm64 + - name: ppc64le-build + runner: ubuntu-22.04 + arch: ppc64le + runs-on: ${{ matrix.runner }} steps: - name: Checkout @@ -59,12 +68,7 @@ jobs: docker rmi -f $(docker images -aq) - name: Set arch environment variable - run: | - if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then - echo arch="amd64" >> $GITHUB_ENV - else - echo arch="arm64" >> $GITHUB_ENV - fi + run: echo "arch=${{ matrix.arch }}" >> $GITHUB_ENV - name: Start minikube cluster run: | From 21f859b23d70a4bfd50a00d8cfbdc57d937511ab Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Thu, 20 Nov 2025 01:12:19 +0530 Subject: [PATCH 05/10] Refactor PR check workflow for multi-architecture builds Enhanced for ppc64le arch Signed-off-by: Prabhu K --- .github/workflows/pr-check.yaml | 86 ++++++++++++++++++++++++--------- 1 file changed, 63 insertions(+), 23 deletions(-) diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index ee0c271a..07f74665 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -22,28 +22,37 @@ jobs: strategy: fail-fast: false matrix: - runners: ['ubuntu-22.04', 'ubuntu-22.04-arm'] - runs-on: ${{matrix.runners}} + include: + - name: amd64-build + runner: ubuntu-22.04 + arch: amd64 + - name: arm64-build + runner: ubuntu-22.04-arm + arch: arm64 + - name: ppc64le-build + runner: ubuntu-22.04 + arch: ppc64le + runs-on: ${{ matrix.runner }} steps: - name: Checkout uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - name: Set arch environment variable - run: | - if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then - echo arch="amd64" >> $GITHUB_ENV - else - echo arch="arm64" >> $GITHUB_ENV - fi + run: echo "arch=${{ matrix.arch }}" >> $GITHUB_ENV - name: Free runner space run: sudo rm -rf /usr/local/lib/android - name: Cleanup docker images run: docker system prune -af - name: Add expiration label to base Dockerfile (UBI9) run: sed -i '/^FROM/a LABEL quay.expires-after=4w' base/ubi9/Dockerfile + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + platforms: linux/amd64,linux/arm64,linux/ppc64le - name: Login to Registry uses: docker/login-action@v3 with: @@ -81,17 +90,21 @@ jobs: strategy: fail-fast: false matrix: - runners: ['ubuntu-22.04', 'ubuntu-22.04-arm'] - runs-on: ${{matrix.runners}} + include: + - name: amd64-build + runner: ubuntu-22.04 + arch: amd64 + - name: arm64-build + runner: ubuntu-22.04-arm + arch: arm64 + - name: ppc64le-build + runner: ubuntu-22.04 + arch: ppc64le + runs-on: ${{ matrix.runner }} needs: build-base-image steps: - name: Set arch environment variable - run: | - if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then - echo arch="amd64" >> $GITHUB_ENV - else - echo arch="arm64" >> $GITHUB_ENV - fi + run: echo "arch=${{ matrix.arch }}" >> $GITHUB_ENV - name: Checkout uses: actions/checkout@v4 with: @@ -100,8 +113,13 @@ jobs: run: sudo rm -rf /usr/local/lib/android - name: Cleanup docker images run: docker system prune -af + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + driver: docker-container + platforms: linux/amd64,linux/arm64,linux/ppc64le - name: Login to Registry uses: docker/login-action@v3 with: @@ -147,7 +165,7 @@ jobs: echo "==========================================" echo "Publishing UBI9 base image manifest" echo "==========================================" - echo "Verifying both architecture images exist..." + echo "Verifying all architecture images exist..." docker manifest inspect ${{ env.REGISTRY }}/base-developer-image:amd64-pr-${{github.event.number}} || { echo "ERROR: amd64 base image not found" exit 1 @@ -156,21 +174,29 @@ jobs: echo "ERROR: arm64 base image not found" exit 1 } - echo "Both images verified, extracting digests..." + docker manifest inspect ${{ env.REGISTRY }}/base-developer-image:ppc64le-pr-${{github.event.number}} || { + echo "ERROR: ppc64le base image not found" + exit 1 + } + echo "All images verified, extracting digests..." # Extract the actual image digest for each architecture from the manifest list AMD64_DIGEST=$(docker manifest inspect ${{ env.REGISTRY }}/base-developer-image:amd64-pr-${{github.event.number}} | \ jq -r '.manifests[] | select(.platform.architecture == "amd64") | .digest') ARM64_DIGEST=$(docker manifest inspect ${{ env.REGISTRY }}/base-developer-image:arm64-pr-${{github.event.number}} | \ jq -r '.manifests[] | select(.platform.architecture == "arm64") | .digest') + PPC64LE_DIGEST=$(docker manifest inspect ${{ env.REGISTRY }}/base-developer-image:ppc64le-pr-${{github.event.number}} | \ + jq -r '.manifests[] | select(.platform.architecture == "ppc64le") | .digest') echo "AMD64 digest: $AMD64_DIGEST" echo "ARM64 digest: $ARM64_DIGEST" + echo "PPC64LE digest: $PPC64LE_DIGEST" echo "Creating multi-arch manifest..." docker manifest create ${{ env.REGISTRY }}/base-developer-image:pr-${{github.event.number}} \ --amend ${{ env.REGISTRY }}/base-developer-image@$AMD64_DIGEST \ - --amend ${{ env.REGISTRY }}/base-developer-image@$ARM64_DIGEST + --amend ${{ env.REGISTRY }}/base-developer-image@$ARM64_DIGEST \ + --amend ${{ env.REGISTRY }}/base-developer-image@$PPC64LE_DIGEST docker manifest annotate ${{ env.REGISTRY }}/base-developer-image:pr-${{github.event.number}} \ ${{ env.REGISTRY }}/base-developer-image@$AMD64_DIGEST \ @@ -178,6 +204,9 @@ jobs: docker manifest annotate ${{ env.REGISTRY }}/base-developer-image:pr-${{github.event.number}} \ ${{ env.REGISTRY }}/base-developer-image@$ARM64_DIGEST \ --os linux --arch arm64 + docker manifest annotate ${{ env.REGISTRY }}/base-developer-image:pr-${{github.event.number}} \ + ${{ env.REGISTRY }}/base-developer-image@$PPC64LE_DIGEST \ + --os linux --arch ppc64le docker manifest push ${{ env.REGISTRY }}/base-developer-image:pr-${{github.event.number}} @@ -197,7 +226,7 @@ jobs: echo "==========================================" echo "Publishing UDI9 manifest" echo "==========================================" - echo "Verifying both architecture images exist..." + echo "Verifying all architecture images exist..." docker manifest inspect ${{ env.REGISTRY }}/universal-developer-image:amd64-pr-${{github.event.number}} || { echo "ERROR: amd64 UDI image not found" exit 1 @@ -206,21 +235,29 @@ jobs: echo "ERROR: arm64 UDI image not found" exit 1 } - echo "Both images verified, extracting digests..." + docker manifest inspect ${{ env.REGISTRY }}/universal-developer-image:ppc64le-pr-${{github.event.number}} || { + echo "ERROR: ppc64le UDI image not found" + exit 1 + } + echo "All images verified, extracting digests..." # Extract the actual image digest for each architecture from the manifest list AMD64_DIGEST=$(docker manifest inspect ${{ env.REGISTRY }}/universal-developer-image:amd64-pr-${{github.event.number}} | \ jq -r '.manifests[] | select(.platform.architecture == "amd64") | .digest') ARM64_DIGEST=$(docker manifest inspect ${{ env.REGISTRY }}/universal-developer-image:arm64-pr-${{github.event.number}} | \ jq -r '.manifests[] | select(.platform.architecture == "arm64") | .digest') + PPC64LE_DIGEST=$(docker manifest inspect ${{ env.REGISTRY }}/universal-developer-image:ppc64le-pr-${{github.event.number}} | \ + jq -r '.manifests[] | select(.platform.architecture == "ppc64le") | .digest') echo "AMD64 digest: $AMD64_DIGEST" echo "ARM64 digest: $ARM64_DIGEST" + echo "ARM64 digest: $PPC64LE_DIGEST" echo "Creating multi-arch manifest..." docker manifest create ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}} \ --amend ${{ env.REGISTRY }}/universal-developer-image@$AMD64_DIGEST \ - --amend ${{ env.REGISTRY }}/universal-developer-image@$ARM64_DIGEST + --amend ${{ env.REGISTRY }}/universal-developer-image@$ARM64_DIGEST \ + --amend ${{ env.REGISTRY }}/universal-developer-image@$PPC64LE_DIGEST docker manifest annotate ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}} \ ${{ env.REGISTRY }}/universal-developer-image@$AMD64_DIGEST \ @@ -228,6 +265,9 @@ jobs: docker manifest annotate ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}} \ ${{ env.REGISTRY }}/universal-developer-image@$ARM64_DIGEST \ --os linux --arch arm64 + docker manifest annotate ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}} \ + ${{ env.REGISTRY }}/universal-developer-image@$PPC64LE_DIGEST \ + --os linux --arch ppc64le docker manifest push ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}} - name: 'Comment PR' @@ -240,4 +280,4 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, body: `Pull Request images published ✨\n\nBase: [${{ env.REGISTRY }}/base-developer-image:pr-${{github.event.number}}](https://${{ env.REGISTRY }}/base-developer-image:pr-${{github.event.number}})\nUDI: [${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}}](https://${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}})` - }) + }) \ No newline at end of file From 6b7396af0d5f31703e08f62dddba5927a301f6e1 Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Mon, 1 Dec 2025 17:58:18 +0530 Subject: [PATCH 06/10] Refactor architecture-specific installation logic Signed-off-by: Prabhu K --- base/ubi9/Dockerfile | 218 ++++++++++++++++++++++++------------------- 1 file changed, 122 insertions(+), 96 deletions(-) diff --git a/base/ubi9/Dockerfile b/base/ubi9/Dockerfile index bf88a52a..5b4bed7b 100644 --- a/base/ubi9/Dockerfile +++ b/base/ubi9/Dockerfile @@ -65,93 +65,111 @@ RUN \ # Download and install ripgrep depending on the architecture. # See release page for details https://github.com/BurntSushi/ripgrep/releases/tag/13.0.0 -RUN \ - if [ "$TARGETARCH" = "ppc64le" ]; then \ - echo "Skipping ripgrep installation for ppc64le as binary not available"; \ - else \ - TEMP_DIR="$(mktemp -d)" && cd "${TEMP_DIR}" && \ - RG_VERSION="13.0.0" && \ - if [ "$TARGETARCH" = "arm64" ]; then \ - RG_ARCH="arm-unknown-linux-gnueabihf"; \ - else \ - RG_ARCH="x86_64-unknown-linux-musl"; \ - fi && \ - RG_TGZ="ripgrep-${RG_VERSION}-${RG_ARCH}.tar.gz" && \ - RG_TGZ_URL="https://github.com/BurntSushi/ripgrep/releases/download/${RG_VERSION}/${RG_TGZ}" && \ - echo "Downloading ${RG_TGZ_URL}..." && \ - if curl -fsSL "${RG_TGZ_URL}" -o "${RG_TGZ}"; then \ - if file "${RG_TGZ}" | grep -q 'gzip compressed'; then \ - tar -zxv --no-same-owner -f "${RG_TGZ}" && \ - mv "ripgrep-${RG_VERSION}-${RG_ARCH}"/rg /usr/local/bin/ && \ - mv "ripgrep-${RG_VERSION}-${RG_ARCH}"/doc/rg.1 /usr/local/share/man/man1; \ - else \ - echo "Downloaded ripgrep archive invalid — skipping."; \ - fi; \ +RUN set -e; \ + case "$TARGETARCH" in \ + ppc64le) \ + echo "Skipping ripgrep installation for ppc64le as binary not available"; \ + exit 0 ;; \ + arm64) \ + RG_ARCH="arm-unknown-linux-gnueabihf" ;; \ + amd64) \ + RG_ARCH="x86_64-unknown-linux-musl" ;; \ + *) \ + echo "Unsupported architecture for ripgrep: $TARGETARCH"; \ + exit 0 ;; \ + esac; \ + TEMP_DIR="$(mktemp -d)"; \ + cd "${TEMP_DIR}"; \ + RG_VERSION="13.0.0"; \ + RG_TGZ="ripgrep-${RG_VERSION}-${RG_ARCH}.tar.gz"; \ + RG_TGZ_URL="https://github.com/BurntSushi/ripgrep/releases/download/${RG_VERSION}/${RG_TGZ}"; \ + echo "Downloading ${RG_TGZ_URL} ..."; \ + if curl -fsSL "${RG_TGZ_URL}" -o "${RG_TGZ}"; then \ + if file "${RG_TGZ}" | grep -q 'gzip compressed'; then \ + tar -zxf "${RG_TGZ}" --no-same-owner; \ + install -m 0755 "ripgrep-${RG_VERSION}-${RG_ARCH}/rg" /usr/local/bin/rg; \ + mkdir -p /usr/local/share/man/man1; \ + install -m 0644 "ripgrep-${RG_VERSION}-${RG_ARCH}/doc/rg.1" /usr/local/share/man/man1/; \ else \ - echo "ripgrep binary not found for ${TARGETARCH}, skipping installation."; \ - fi && \ - cd - && rm -rf "${TEMP_DIR}"; \ - fi + echo "Downloaded ripgrep archive invalid — skipping."; \ + fi; \ + else \ + echo "ripgrep binary not found for ${TARGETARCH}, skipping installation."; \ + fi; \ + cd - >/dev/null; \ + rm -rf "${TEMP_DIR}" # Download and install bat depending on the architecture. # See release page for details https://github.com/sharkdp/bat/releases/tag/v0.18.3 -RUN \ - if [ "$TARGETARCH" = "ppc64le" ]; then \ - echo "Skipping bat installation for ppc64le as binary not available"; \ - else \ - TEMP_DIR="$(mktemp -d)" && cd "${TEMP_DIR}" && \ - BAT_VERSION="0.18.3" && \ - if [ "$TARGETARCH" = "arm64" ]; then \ - BAT_ARCH="aarch64-unknown-linux-gnu"; \ - else \ - BAT_ARCH="x86_64-unknown-linux-musl"; \ - fi && \ - BAT_TGZ="bat-v${BAT_VERSION}-${BAT_ARCH}.tar.gz" && \ - BAT_TGZ_URL="https://github.com/sharkdp/bat/releases/download/v${BAT_VERSION}/${BAT_TGZ}" && \ - echo "Downloading ${BAT_TGZ_URL}..." && \ - if curl -fsSL "${BAT_TGZ_URL}" -o "${BAT_TGZ}"; then \ - if file "${BAT_TGZ}" | grep -q 'gzip compressed'; then \ - tar -zxv --no-same-owner -f "${BAT_TGZ}" && \ - mv "bat-v${BAT_VERSION}-${BAT_ARCH}"/bat /usr/local/bin/ && \ - mv "bat-v${BAT_VERSION}-${BAT_ARCH}"/bat.1 /usr/local/share/man/man1; \ - else \ - echo "Downloaded bat archive invalid — skipping."; \ - fi; \ +RUN set -e; \ + case "$TARGETARCH" in \ + ppc64le) \ + echo "Skipping bat installation for ppc64le as binary not available"; \ + exit 0 ;; \ + arm64) \ + BAT_ARCH="aarch64-unknown-linux-gnu" ;; \ + amd64) \ + BAT_ARCH="x86_64-unknown-linux-musl" ;; \ + *) \ + echo "Unsupported architecture for bat: $TARGETARCH"; \ + exit 0 ;; \ + esac; \ + TEMP_DIR="$(mktemp -d)"; \ + cd "${TEMP_DIR}"; \ + BAT_VERSION="0.18.3"; \ + BAT_TGZ="bat-v${BAT_VERSION}-${BAT_ARCH}.tar.gz"; \ + BAT_TGZ_URL="https://github.com/sharkdp/bat/releases/download/v${BAT_VERSION}/${BAT_TGZ}"; \ + echo "Downloading ${BAT_TGZ_URL} ..."; \ + if curl -fsSL "${BAT_TGZ_URL}" -o "${BAT_TGZ}"; then \ + if file "${BAT_TGZ}" | grep -q 'gzip compressed'; then \ + tar -zxf "${BAT_TGZ}" --no-same-owner; \ + install -m 0755 "bat-v${BAT_VERSION}-${BAT_ARCH}/bat" /usr/local/bin/bat; \ + mkdir -p /usr/local/share/man/man1; \ + install -m 0644 "bat-v${BAT_VERSION}-${BAT_ARCH}/bat.1" /usr/local/share/man/man1/; \ else \ - echo "bat binary not found for ${TARGETARCH}, skipping installation."; \ - fi && \ - cd - && rm -rf "${TEMP_DIR}"; \ - fi + echo "Downloaded bat archive invalid — skipping."; \ + fi; \ + else \ + echo "bat binary not found for ${TARGETARCH}, skipping installation."; \ + fi; \ + cd - >/dev/null; \ + rm -rf "${TEMP_DIR}" # Download and install fd depending on the architecture. # See release page for details https://github.com/sharkdp/fd/releases/tag/v8.7.0 -RUN \ - if [ "$TARGETARCH" = "ppc64le" ]; then \ - echo "Skipping fd installation for ppc64le as binary not available"; \ - else \ - TEMP_DIR="$(mktemp -d)" && cd "${TEMP_DIR}" && \ - FD_VERSION="8.7.0" && \ - if [ "$TARGETARCH" = "arm64" ]; then \ - FD_ARCH="aarch64-unknown-linux-gnu"; \ - else \ - FD_ARCH="x86_64-unknown-linux-musl"; \ - fi && \ - FD_TGZ="fd-v${FD_VERSION}-${FD_ARCH}.tar.gz" && \ - FD_TGZ_URL="https://github.com/sharkdp/fd/releases/download/v${FD_VERSION}/${FD_TGZ}" && \ - echo "Downloading ${FD_TGZ_URL}..." && \ - if curl -fsSL "${FD_TGZ_URL}" -o "${FD_TGZ}"; then \ - if file "${FD_TGZ}" | grep -q 'gzip compressed'; then \ - tar -xv --no-same-owner -f "${FD_TGZ}" && \ - mv "fd-v${FD_VERSION}-${FD_ARCH}"/fd /usr/local/bin/ && \ - mv "fd-v${FD_VERSION}-${FD_ARCH}"/fd.1 /usr/local/share/man/man1; \ - else \ - echo "Downloaded fd archive invalid — skipping."; \ - fi; \ +RUN set -e; \ + case "$TARGETARCH" in \ + ppc64le) \ + echo "Skipping fd installation for ppc64le as binary not available"; \ + exit 0 ;; \ + arm64) \ + FD_ARCH="aarch64-unknown-linux-gnu" ;; \ + amd64) \ + FD_ARCH="x86_64-unknown-linux-musl" ;; \ + *) \ + echo "Unsupported architecture for fd: $TARGETARCH"; \ + exit 0 ;; \ + esac; \ + TEMP_DIR="$(mktemp -d)"; \ + cd "${TEMP_DIR}"; \ + FD_VERSION="8.7.0"; \ + FD_TGZ="fd-v${FD_VERSION}-${FD_ARCH}.tar.gz"; \ + FD_TGZ_URL="https://github.com/sharkdp/fd/releases/download/v${FD_VERSION}/${FD_TGZ}"; \ + echo "Downloading ${FD_TGZ_URL} ..."; \ + if curl -fsSL "${FD_TGZ_URL}" -o "${FD_TGZ}"; then \ + if file "${FD_TGZ}" | grep -q 'gzip compressed'; then \ + tar -xf "${FD_TGZ}" --no-same-owner; \ + install -m 0755 "fd-v${FD_VERSION}-${FD_ARCH}/fd" /usr/local/bin/fd; \ + mkdir -p /usr/local/share/man/man1; \ + install -m 0644 "fd-v${FD_VERSION}-${FD_ARCH}/fd.1" /usr/local/share/man/man1/; \ else \ - echo "fd binary not found for ${TARGETARCH}, skipping installation."; \ - fi && \ - cd - && rm -rf "${TEMP_DIR}"; \ - fi + echo "Downloaded fd archive invalid — skipping."; \ + fi; \ + else \ + echo "fd binary not found for ${TARGETARCH}, skipping installation."; \ + fi; \ + cd - >/dev/null; \ + rm -rf "${TEMP_DIR}" # Define user directory for binaries ENV PATH="/home/user/.local/bin:$PATH" @@ -177,26 +195,34 @@ RUN mkdir -p /var/lib/shared/overlay-images /var/lib/shared/overlay-layers; \ # See release page for details https://github.com/joyrex2001/kubedock/releases/tag/0.18.2 ENV KUBEDOCK_VERSION=0.18.2 ENV KUBECONFIG=/home/user/.kube/config -RUN \ - if [ "$TARGETARCH" = "ppc64le" ]; then \ - echo "Skipping kubedock installation for ppc64le as binary not available"; \ - else \ - KUBEDOCK_ARCH="linux_${TARGETARCH}" && \ - KUBEDOCK_URL="https://github.com/joyrex2001/kubedock/releases/download/${KUBEDOCK_VERSION}/kubedock_${KUBEDOCK_VERSION}_${KUBEDOCK_ARCH}.tar.gz"; \ - echo "Downloading ${KUBEDOCK_URL}..."; \ - if curl -fsSL "${KUBEDOCK_URL}" -o /tmp/kubedock.tar.gz; then \ - if file /tmp/kubedock.tar.gz | grep -q 'gzip compressed'; then \ - tar -C /usr/local/bin -xz --no-same-owner -f /tmp/kubedock.tar.gz && \ - chmod +x /usr/local/bin/kubedock && \ - echo "Kubedock installed successfully."; \ - else \ - echo "Downloaded kubedock file invalid — skipping extraction."; \ - fi; \ +RUN set -e; \ + case "$TARGETARCH" in \ + ppc64le) \ + echo "Skipping kubedock installation for ppc64le as binary not available"; \ + exit 0 ;; \ + amd64) \ + KUBEDOCK_ARCH="linux_amd64" ;; \ + arm64) \ + KUBEDOCK_ARCH="linux_arm64" ;; \ + *) \ + echo "Unsupported architecture for kubedock: $TARGETARCH"; \ + exit 0 ;; \ + esac; \ + KUBEDOCK_TGZ="kubedock_${KUBEDOCK_VERSION}_${KUBEDOCK_ARCH}.tar.gz"; \ + KUBEDOCK_URL="https://github.com/joyrex2001/kubedock/releases/download/${KUBEDOCK_VERSION}/${KUBEDOCK_TGZ}"; \ + echo "Downloading ${KUBEDOCK_URL} ..."; \ + if curl -fsSL "${KUBEDOCK_URL}" -o /tmp/kubedock.tar.gz; then \ + if file /tmp/kubedock.tar.gz | grep -q 'gzip compressed'; then \ + tar -C /usr/local/bin -xzf /tmp/kubedock.tar.gz --no-same-owner; \ + chmod 0755 /usr/local/bin/kubedock; \ + echo "kubedock installed successfully."; \ else \ - echo "Kubedock binary not found for ${TARGETARCH}, skipping installation."; \ + echo "Downloaded kubedock file invalid — skipping extraction."; \ fi; \ - rm -f /tmp/kubedock.tar.gz; \ - fi + else \ + echo "kubedock binary not found for ${TARGETARCH}, skipping installation."; \ + fi; \ + rm -f /tmp/kubedock.tar.gz COPY --chown=0:0 kubedock_setup.sh /usr/local/bin/kubedock_setup # Configure Podman wrapper From 9093001a430260099e5f748444a38eebe8f8d3bc Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Mon, 1 Dec 2025 18:04:56 +0530 Subject: [PATCH 07/10] Update .github/workflows/ubi9-build.yaml Co-authored-by: David Kwon Signed-off-by: Prabhu K --- .github/workflows/ubi9-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubi9-build.yaml b/.github/workflows/ubi9-build.yaml index c934ffa6..090103b2 100644 --- a/.github/workflows/ubi9-build.yaml +++ b/.github/workflows/ubi9-build.yaml @@ -13,7 +13,7 @@ on: required: true outputs: uniq_tag: - description: "The uniqe tag for universal developer image" + description: "The unique tag for universal developer image" value: ${{ jobs.publish-udi.outputs.uniq_tag }} env: From 01b21924a62e23e38e28e12d6180af0155fb8118 Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Fri, 2 Jan 2026 15:54:40 +0530 Subject: [PATCH 08/10] Added QEMU setup in pr-check workflow Signed-off-by: Prabhu K --- .github/workflows/pr-check.yaml | 15 +++++++++++++++ .github/workflows/ubi9-build.yaml | 4 ---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index 07f74665..3a51f3ba 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -44,8 +44,11 @@ jobs: run: sudo rm -rf /usr/local/lib/android - name: Cleanup docker images run: docker system prune -af +<<<<<<< HEAD - name: Add expiration label to base Dockerfile (UBI9) run: sed -i '/^FROM/a LABEL quay.expires-after=4w' base/ubi9/Dockerfile +======= +>>>>>>> eb8139b (Added QEMU setup in pr-check workflow) - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx @@ -53,6 +56,7 @@ jobs: with: driver: docker-container platforms: linux/amd64,linux/arm64,linux/ppc64le +<<<<<<< HEAD - name: Login to Registry uses: docker/login-action@v3 with: @@ -60,6 +64,9 @@ jobs: username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_PASSWORD }} - name: Build base image (UBI9) +======= + - name: Build base image +>>>>>>> eb8139b (Added QEMU setup in pr-check workflow) run: | echo "==========================================" echo "Building UBI9 base image for ${{env.arch}}" @@ -117,6 +124,14 @@ jobs: uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 +<<<<<<< HEAD +======= + with: + driver: docker-container + platforms: linux/amd64,linux/arm64,linux/ppc64le + - name: Download BDI artifacts + uses: actions/download-artifact@v4 +>>>>>>> eb8139b (Added QEMU setup in pr-check workflow) with: driver: docker-container platforms: linux/amd64,linux/arm64,linux/ppc64le diff --git a/.github/workflows/ubi9-build.yaml b/.github/workflows/ubi9-build.yaml index 090103b2..46b83feb 100644 --- a/.github/workflows/ubi9-build.yaml +++ b/.github/workflows/ubi9-build.yaml @@ -48,10 +48,8 @@ jobs: run: sudo rm -rf /usr/local/lib/android - name: Cleanup docker images run: docker system prune -af - # Setup QEMU for cross-platform builds - name: Set up QEMU uses: docker/setup-qemu-action@v2 - # Setup Docker Buildx with container driver - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: @@ -138,10 +136,8 @@ jobs: run: sudo rm -rf /usr/local/lib/android - name: Cleanup docker images run: docker system prune -af - # Setup QEMU for cross-platform builds - name: Set up QEMU uses: docker/setup-qemu-action@v2 - # Setup Docker Buildx with container driver - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: From 9cd2e4bc0f037b6e7f9ae5ec192e7674be70f2fe Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Sun, 4 Jan 2026 22:34:18 +0530 Subject: [PATCH 09/10] Added a support of ppc64le for developer image Signed-off-by: Prabhu K --- universal/ubi9/Dockerfile | 213 ++++++++++++++++++++++++-------------- 1 file changed, 138 insertions(+), 75 deletions(-) diff --git a/universal/ubi9/Dockerfile b/universal/ubi9/Dockerfile index 04d3db15..2410cffa 100644 --- a/universal/ubi9/Dockerfile +++ b/universal/ubi9/Dockerfile @@ -31,10 +31,13 @@ USER 10001 ENV HOME=/home/tooling # Java -RUN curl -fsSL "https://get.sdkman.io/?rcupdate=false" | bash \ - && bash -c ". /home/tooling/.sdkman/bin/sdkman-init.sh \ - && sed -i "s/sdkman_auto_answer=false/sdkman_auto_answer=true/g" /home/tooling/.sdkman/etc/config \ - && sed -i "s/sdkman_auto_env=false/sdkman_auto_env=true/g" /home/tooling/.sdkman/etc/config \ +RUN if [ "$TARGETARCH" = "ppc64le" ]; then \ + echo "Skipping Java installation: tem Java not available for ppc64le"; \ + else \ + curl -fsSL "https://get.sdkman.io/?rcupdate=false" | bash \ + && bash -c ". /home/tooling/.sdkman/bin/sdkman-init.sh \ + && sed -i 's/sdkman_auto_answer=false/sdkman_auto_answer=true/g' /home/tooling/.sdkman/etc/config \ + && sed -i 's/sdkman_auto_env=false/sdkman_auto_env=true/g' /home/tooling/.sdkman/etc/config \ && sdk install java 8.0.432-tem \ && sdk install java 11.0.25-tem \ && sdk install java 17.0.13-tem \ @@ -45,9 +48,9 @@ RUN curl -fsSL "https://get.sdkman.io/?rcupdate=false" | bash \ && sdk install maven \ && sdk install jbang \ && sdk flush archives \ - && sdk flush temp" \ - && chgrp -R 0 /home/tooling && chmod -R g=u /home/tooling - + && sdk flush temp"; \ + chgrp -R 0 /home/tooling && chmod -R g=u /home/tooling; \ + fi # sdk home java ENV JAVA_HOME_8=/home/tooling/.sdkman/candidates/java/8.0.432-tem ENV JAVA_HOME_11=/home/tooling/.sdkman/candidates/java/11.0.25-tem @@ -84,7 +87,7 @@ RUN mkdir -p /home/tooling/.nvm/ ENV NVM_DIR="/home/tooling/.nvm" ENV NODEJS_20_VERSION=20.18.1 ENV NODEJS_18_VERSION=18.20.5 -ENV NODEJS_DEFAULT_VERSION=${NODEJS_20_VERSION} +ENV NODEJS_DEFAULT_VERSION=${NODEJS_18_VERSION} RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | PROFILE=/dev/null bash RUN echo 'export NVM_DIR="$HOME/.nvm"' >> ${PROFILE_EXT} \ && echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ${PROFILE_EXT} @@ -125,12 +128,29 @@ RUN curl -fLo mill https://raw.githubusercontent.com/lefou/millw/main/millw && \ RUN dnf -y install llvm-toolset gcc gcc-c++ clang clang-libs clang-tools-extra gdb # Go 1.22+ - installed to /usr/bin/go -# gopls 0.21.0+ - installed to /home/tooling/go/bin/gopls and /home/tooling/go/pkg/mod/ -RUN dnf install -y go-toolset && \ - GO111MODULE=on go install -v golang.org/x/tools/gopls@v0.21.0 && \ - chgrp -R 0 /home/tooling && chmod -R g=u /home/tooling -ENV GOBIN="/home/tooling/go/bin/" -ENV PATH="$GOBIN:$PATH" +# gopls 0.16.2+ - installed to /home/tooling/go/bin/gopls and /home/tooling/go/pkg/mod/ +USER 0 + +ENV GOBIN=/home/tooling/go/bin +ENV PATH=$GOBIN:/usr/local/go/bin:$PATH + +ARG TARGETARCH + +RUN mkdir -p $GOBIN \ + && case "$TARGETARCH" in \ + amd64) GO_ARCH="amd64" ;; \ + arm64) GO_ARCH="arm64" ;; \ + ppc64le) GO_ARCH="ppc64le" ;; \ + *) echo "Unsupported architecture: $TARGETARCH" && exit 1 ;; \ + esac \ + && GO_VERSION="1.22.5" \ + && curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz" -o /tmp/go.tar.gz \ + && tar -C /usr/local -xzf /tmp/go.tar.gz \ + && rm -rf /tmp/go.tar.gz \ + && go version \ + && GO111MODULE=on go install golang.org/x/tools/gopls@v0.16.2 \ + && chgrp -R 0 /home/tooling \ + && chmod -R g=u /home/tooling # Python RUN dnf -y install python3.11 python3.11-devel python3.11-setuptools python3.11-pip nss_wrapper @@ -179,11 +199,16 @@ RUN curl --proto '=https' --tlsv1.2 -sSfo rustup https://sh.rustup.rs && \ rustup -y --no-modify-path --profile minimal -c rust-src -c rust-analysis -c rls && \ chgrp -R 0 /home/tooling && chmod -R g=u /home/tooling -# camel-k +# camel-k +ARG TARGETARCH ENV KAMEL_VERSION 2.2.0 -RUN curl -L https://github.com/apache/camel-k/releases/download/v${KAMEL_VERSION}/camel-k-client-${KAMEL_VERSION}-linux-${TARGETARCH}.tar.gz | tar -C /usr/local/bin -xz --no-same-owner \ - && chmod +x /usr/local/bin/kamel - +RUN if [ "$TARGETARCH" != "ppc64le" ]; then \ + curl -sSLf https://github.com/apache/camel-k/releases/download/v${KAMEL_VERSION}/camel-k-client-${KAMEL_VERSION}-linux-${TARGETARCH}.tar.gz \ + | tar -C /usr/local/bin -xz --no-same-owner \ + && chmod +x /usr/local/bin/kamel; \ + else \ + echo "Skipping Camel K install for ppc64le — not supported"; \ + fi # Config directories RUN mkdir -p /home/tooling/.m2 && \ mkdir -p /home/tooling/.gradle && \ @@ -199,59 +224,62 @@ RUN mkdir -p /home/tooling/.m2 && \ # oc client ENV OC_VERSION=4.15 -RUN if [ "$TARGETARCH" = "arm64" ]; then \ - curl -L https://mirror.openshift.com/pub/openshift-v4/arm64/clients/ocp/stable-${OC_VERSION}/openshift-client-linux.tar.gz; \ - else \ - curl -L https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable-${OC_VERSION}/openshift-client-linux.tar.gz; \ - fi | tar -C /usr/local/bin -xz --no-same-owner && \ + +RUN case "$TARGETARCH" in \ + arm64) ARCH_PATH="arm64" ;; \ + amd64) ARCH_PATH="x86_64" ;; \ + ppc64le) ARCH_PATH="ppc64le" ;; \ + *) echo "Unsupported architecture: $TARGETARCH" && exit 1 ;; \ + esac && \ + curl -L "https://mirror.openshift.com/pub/openshift-v4/${ARCH_PATH}/clients/ocp/stable-${OC_VERSION}/openshift-client-linux.tar.gz" \ + | tar -C /usr/local/bin -xz --no-same-owner && \ chmod +x /usr/local/bin/oc # OS Pipelines CLI (tkn) ENV TKN_VERSION=1.14.0 RUN curl -L https://mirror.openshift.com/pub/openshift-v4/clients/pipelines/${TKN_VERSION}/tkn-linux-${TARGETARCH}.tar.gz | tar -C /usr/local/bin -xz --no-same-owner \ && chmod +x /usr/local/bin/tkn /usr/local/bin/opc /usr/local/bin/tkn-pac - + RUN echo 'alias docker=podman' >> ${PROFILE_EXT} # Configure container engine COPY --chown=0:0 containers.conf /etc/containers/containers.conf -ENV K8S_VERSION=1.28 -## kubectl -RUN < /etc/yum.repos.d/kubernetes.repo -[kubernetes] -name=Kubernetes -baseurl=https://pkgs.k8s.io/core:/stable:/v${K8S_VERSION}/rpm/ -enabled=1 -gpgcheck=1 -gpgkey=https://pkgs.k8s.io/core:/stable:/v${K8S_VERSION}/rpm/repodata/repomd.xml.key -EOF2 - -dnf install -y kubectl -curl -sSL -o ~/.kubectl_aliases https://raw.githubusercontent.com/ahmetb/kubectl-alias/master/.kubectl_aliases -echo '[ -f ~/.kubectl_aliases ] && source ~/.kubectl_aliases' >> ${PROFILE_EXT} -EOF +##kubectl +ARG TARGETARCH +ENV KUBECTL_VERSION=1.30.1 +RUN curl -LO "https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/${TARGETARCH}/kubectl" \ + && chmod +x kubectl \ + && mv kubectl /usr/local/bin/kubectl ## shellcheck RUN <&1 | grep OK tar -zxv --no-same-owner -f "${KREW_TGZ}" ./"krew-${KREW_ARCH}" install krew echo 'export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"' >> ${PROFILE_EXT} -export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" +#export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" +export KREW_ROOT="/home/tooling/.krew" +export PATH="$KREW_ROOT/bin:$PATH" + # kubens and kubectx kubectl krew install ns kubectl krew install ctx @@ -323,25 +354,42 @@ rm -rf "${TEMP_DIR}" EOF ## tektoncd-cli -RUN <&1 | grep OK -tar -zxv --no-same-owner -f "${TKN_TGZ}" -mv tkn /usr/local/bin/ -cd - +curl -sSLO "${TKN_CHECKSUMS_URL}" +sha256sum --ignore-missing -c checksums.txt | grep OK + +tar -zx --no-same-owner -f "${TKN_TGZ}" +mv tkn /usr/local/bin/tkn + +cd / rm -rf "${TEMP_DIR}" EOF @@ -366,24 +414,27 @@ rm -rf "${TEMP_DIR}" EOF ## terraform-cli -RUN <&1 | grep OK -unzip ${TF_ZIP} -chmod +x terraform -mv terraform /usr/local/bin -cd - -rm -rf "${TEMP_DIR}" -EOF +ARG TARGETARCH +RUN if [ "$TARGETARCH" != "ppc64le" ]; then \ + set -euf -o pipefail; \ + TEMP_DIR="$(mktemp -d)"; \ + cd "${TEMP_DIR}"; \ + TF_VERSION="1.7.5"; \ + TF_ARCH="linux_${TARGETARCH}"; \ + TF_ZIP="terraform_${TF_VERSION}_${TF_ARCH}.zip"; \ + TF_ZIP_URL="https://releases.hashicorp.com/terraform/${TF_VERSION}/${TF_ZIP}"; \ + TF_CHECKSUMS_URL="https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_SHA256SUMS"; \ + curl -sSLO "${TF_ZIP_URL}"; \ + curl -sSLO "${TF_CHECKSUMS_URL}"; \ + sha256sum --ignore-missing -c "terraform_${TF_VERSION}_SHA256SUMS" 2>&1 | grep OK; \ + unzip ${TF_ZIP}; \ + chmod +x terraform; \ + mv terraform /usr/local/bin; \ + cd -; \ + rm -rf "${TEMP_DIR}"; \ +else \ + echo "Skipping Terraform install for architecture: ${TARGETARCH}"; \ +fi ## skaffold RUN curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-${TARGETARCH} && \ @@ -394,23 +445,35 @@ RUN curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/sk # https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/considerations_in_adopting_rhel_8/index#removed-packages_changes-to-packages RUN <&1 | grep OK + tar -zxv --no-same-owner -f "${E2FSPROGS_TGZ}" cd "e2fsprogs-${E2FSPROGS_VERSION}" + mkdir build cd build + ../configure --prefix=/usr --with-root-prefix="" --enable-elf-shlibs --disable-evms make make install make install-libs + cd - rm -rf "${TEMP_DIR}" EOF @@ -422,7 +485,7 @@ RUN dnf -y install bash-completion \ RUN < /usr/share/bash-completion/completions/oc -tkn completion bash > /usr/share/bash-completion/completions/tkn +tkn completion bash > /usr/share/bash-completion/completions/tkn kubectl completion bash > /usr/share/bash-completion/completions/kubectl cat ${NVM_DIR}/bash_completion > /usr/share/bash-completion/completions/nvm EOF From 3824f27d9f8b57d39dd56260e79603111ddb519a Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Sun, 11 Jan 2026 21:43:16 +0530 Subject: [PATCH 10/10] Updated new changes with rebase Signed-off-by: Prabhu K --- .github/workflows/pr-check.yaml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index 3a51f3ba..07f74665 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -44,11 +44,8 @@ jobs: run: sudo rm -rf /usr/local/lib/android - name: Cleanup docker images run: docker system prune -af -<<<<<<< HEAD - name: Add expiration label to base Dockerfile (UBI9) run: sed -i '/^FROM/a LABEL quay.expires-after=4w' base/ubi9/Dockerfile -======= ->>>>>>> eb8139b (Added QEMU setup in pr-check workflow) - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx @@ -56,7 +53,6 @@ jobs: with: driver: docker-container platforms: linux/amd64,linux/arm64,linux/ppc64le -<<<<<<< HEAD - name: Login to Registry uses: docker/login-action@v3 with: @@ -64,9 +60,6 @@ jobs: username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_PASSWORD }} - name: Build base image (UBI9) -======= - - name: Build base image ->>>>>>> eb8139b (Added QEMU setup in pr-check workflow) run: | echo "==========================================" echo "Building UBI9 base image for ${{env.arch}}" @@ -124,14 +117,6 @@ jobs: uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 -<<<<<<< HEAD -======= - with: - driver: docker-container - platforms: linux/amd64,linux/arm64,linux/ppc64le - - name: Download BDI artifacts - uses: actions/download-artifact@v4 ->>>>>>> eb8139b (Added QEMU setup in pr-check workflow) with: driver: docker-container platforms: linux/amd64,linux/arm64,linux/ppc64le