From a0872bbaec7adfcd5adf7319201c1fc298a9e44e Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Tue, 18 Nov 2025 14:26:13 +0530 Subject: [PATCH 1/7] 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 a9540977..e3184054 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 07c6888c88e83695749a62d2a02f2cf18a99b01a Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Tue, 18 Nov 2025 14:33:24 +0530 Subject: [PATCH 2/7] 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 ff3dbf4ecc4e6224cdd79f03acfcf031129b85c1 Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Tue, 18 Nov 2025 18:21:38 +0530 Subject: [PATCH 3/7] 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 aad96eb8756112ba8ad240459bf9ca44394d746e Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Thu, 20 Nov 2025 01:07:14 +0530 Subject: [PATCH 4/7] Refactor GitHub Actions workflow for multi-architecture builds Enhanced for ppc64le arch Signed-off-by: Prabhu K --- ...worksapce-smoke-test-on-minikube-ubi9.yaml | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/empty-worksapce-smoke-test-on-minikube-ubi9.yaml b/.github/workflows/empty-worksapce-smoke-test-on-minikube-ubi9.yaml index 58105d4e..dd5b9aa0 100644 --- a/.github/workflows/empty-worksapce-smoke-test-on-minikube-ubi9.yaml +++ b/.github/workflows/empty-worksapce-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 @@ -54,12 +63,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 ad2833889753b08b4571e0dea9e4f77cc9f36a90 Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Thu, 20 Nov 2025 01:12:19 +0530 Subject: [PATCH 5/7] Refactor PR check workflow for multi-architecture builds Enhanced for ppc64le arch Signed-off-by: Prabhu K --- .github/workflows/pr-check.yaml | 46 +++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index 485225ac..1aa3e233 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -22,18 +22,22 @@ 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: Free runner space run: sudo rm -rf /usr/local/lib/android - name: Cleanup docker images @@ -59,17 +63,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 - name: Free runner space @@ -119,7 +127,8 @@ jobs: run: | docker manifest create ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}} \ --amend ${{ env.REGISTRY }}/universal-developer-image:amd64-pr-${{github.event.number}} \ - --amend ${{ env.REGISTRY }}/universal-developer-image:arm64-pr-${{github.event.number}} + --amend ${{ env.REGISTRY }}/universal-developer-image:arm64-pr-${{github.event.number}} \ + --amend ${{ env.REGISTRY }}/universal-developer-image:ppc64le-pr-${{github.event.number}} docker manifest annotate ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}} \ ${{ env.REGISTRY }}/universal-developer-image:amd64-pr-${{github.event.number}} \ @@ -127,6 +136,9 @@ jobs: docker manifest annotate ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}} \ ${{ env.REGISTRY }}/universal-developer-image:arm64-pr-${{github.event.number}} \ --os linux --arch arm64 + docker manifest annotate ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}} \ + ${{ env.REGISTRY }}/universal-developer-image:ppc64le-pr-${{github.event.number}} \ + --os linux --arch ppc64le docker manifest push ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}} - name: 'Comment PR' From c2ec1c2e2bd9c1da047914c733e874b4ad5a10ee Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Mon, 1 Dec 2025 17:58:18 +0530 Subject: [PATCH 6/7] Refactor architecture-specific installation logic --- base/ubi9/Dockerfile | 218 ++++++++++++++++++++++++------------------- 1 file changed, 122 insertions(+), 96 deletions(-) diff --git a/base/ubi9/Dockerfile b/base/ubi9/Dockerfile index e3184054..6689d1a7 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 04e1d01804d2aa23f0cfc2a4a2acc6659e9bd700 Mon Sep 17 00:00:00 2001 From: Prabhu K Date: Mon, 1 Dec 2025 18:04:56 +0530 Subject: [PATCH 7/7] Update .github/workflows/ubi9-build.yaml Co-authored-by: David Kwon --- .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: