This is an automated email from the ASF dual-hosted git repository.

espino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry-devops-release.git


The following commit(s) were added to refs/heads/main by this push:
     new 9638c9e  Container - Multi arch support for Rocky 8 & 9 (#8)
9638c9e is described below

commit 9638c9e3c983e4d9ae7327517c3f88b0f8335614
Author: Ed Espino <[email protected]>
AuthorDate: Mon Dec 9 18:43:57 2024 -0800

    Container - Multi arch support for Rocky 8 & 9 (#8)
---
 .github/workflows/docker-cbdb-build-containers.yml | 194 ++++++++++-----------
 .github/workflows/docker-cbdb-test-containers.yml  | 104 +++++------
 images/docker/cbdb/build/rocky8/Dockerfile         |  21 ++-
 .../cbdb/build/rocky8/configs/init_system.sh       |  29 ++-
 images/docker/cbdb/build/rocky9/Dockerfile         |  22 ++-
 .../cbdb/build/rocky9/configs/init_system.sh       |  29 ++-
 .../docker/cbdb/test/rocky8/configs/init_system.sh |  29 ++-
 .../docker/cbdb/test/rocky9/configs/init_system.sh |  29 ++-
 8 files changed, 287 insertions(+), 170 deletions(-)

diff --git a/.github/workflows/docker-cbdb-build-containers.yml 
b/.github/workflows/docker-cbdb-build-containers.yml
index 0960a68..2a9e77b 100644
--- a/.github/workflows/docker-cbdb-build-containers.yml
+++ b/.github/workflows/docker-cbdb-build-containers.yml
@@ -17,26 +17,41 @@
 # permissions and limitations under the License.
 #
 # --------------------------------------------------------------------
+# GitHub Actions Workflow for Apache Cloudberry Build Environments
+# --------------------------------------------------------------------
+# Purpose:
+# Builds, tests, and publishes multi-architecture Docker images for
+# Apache Cloudberry DB build environments. Images are built for both
+# Rocky Linux 8 and 9, tested with TestInfra, and pushed to DockerHub.
 #
-# Purpose: Builds, tests and pushes Docker images for Apache Cloudberry DB 
build environments
-# Images are built for Rocky Linux 8 and 9, tested with TestInfra, and pushed 
to DockerHub
+# Multi-Architecture Support:
+# - Builds images for both AMD64 and ARM64 architectures
+# - Creates and pushes multi-arch manifests
+# - Uses QEMU for cross-platform builds
+# - Automated testing for all architectures
 #
-# Images are tagged with:
-# - cbdb-build-rocky8-latest
-# - cbdb-build-rocky8-{YYYYMMDD}-{git-short-sha}
-# - cbdb-build-rocky9-latest
-# - cbdb-build-rocky9-{YYYYMMDD}-{git-short-sha}
+# Image Tags:
+# - Latest: cbdb-build-{platform}-latest
+# - Versioned: cbdb-build-{platform}-{YYYYMMDD}-{git-short-sha}
 #
 # Features:
 # - Matrix build for multiple platforms
-# - Caching strategy for efficient builds
+# - Parallel architecture builds
+# - Build caching strategy
 # - Path filtering to only build changed platforms
 # - Comprehensive build summary and metadata
 # - Container testing with TestInfra
+# - Multi-arch manifest creation
+#
+# Requirements:
+# - DockerHub credentials in GitHub secrets
+#   - DOCKERHUB_USER
+#   - DOCKERHUB_TOKEN
+# --------------------------------------------------------------------
 
 name: docker-cbdb-build-containers
 
-# Trigger on pushes to docker-images branch when relevant paths change
+# Trigger workflow on pushes to main when relevant paths change
 # Also allows manual triggering via GitHub UI
 on:
   push:
@@ -54,19 +69,23 @@ concurrency:
 
 jobs:
   build-and-push:
-    timeout-minutes: 60  # Prevent hanging builds
+    # Set timeout to prevent hanging builds
+    timeout-minutes: 60
     runs-on: ubuntu-latest
+
+    # Matrix strategy to build for both Rocky Linux 8 and 9
     strategy:
       matrix:
-        # Build for both Rocky Linux 8 and 9
         platform: ['rocky8', 'rocky9']
 
     steps:
-      # Checkout repository code
+      # Checkout repository code with full history
       - name: Checkout code
         uses: actions/checkout@v4
 
       # Generate version information for image tags
+      # - BUILD_DATE: Current date in YYYYMMDD format
+      # - SHA_SHORT: Short form of the git commit SHA
       - name: Set version
         id: version
         run: |
@@ -74,6 +93,7 @@ jobs:
           echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
 
       # Determine if the current platform's files have changed
+      # This prevents unnecessary builds if only one platform was modified
       - name: Determine if platform changed
         id: platform-filter
         uses: dorny/paths-filter@v3
@@ -84,12 +104,14 @@ jobs:
             rocky9:
               - 'images/docker/cbdb/build/rocky9/**'
 
-      # Skip if no changes for current platform
-      - name: Skip if not relevant
-        if: ${{ steps.platform-filter.outputs[matrix.platform] != 'true' }}
-        run: echo "Skipping because the changes do not affect this platform"
+      # Set up QEMU for multi-architecture support
+      # This allows building ARM64 images on AMD64 infrastructure and vice 
versa
+      - name: Set up QEMU
+        if: ${{ steps.platform-filter.outputs[matrix.platform] == 'true' }}
+        uses: docker/setup-qemu-action@v3
 
       # Login to DockerHub for pushing images
+      # Requires DOCKERHUB_USER and DOCKERHUB_TOKEN secrets to be set
       - name: Login to Docker Hub
         if: ${{ steps.platform-filter.outputs[matrix.platform] == 'true' }}
         uses: docker/login-action@v3
@@ -98,121 +120,89 @@ jobs:
           password: ${{ secrets.DOCKERHUB_TOKEN }}
 
       # Setup Docker Buildx for efficient builds
+      # Enable debug mode for better troubleshooting
       - name: Set up Docker Buildx
         if: ${{ steps.platform-filter.outputs[matrix.platform] == 'true' }}
         uses: docker/setup-buildx-action@v3
         with:
           buildkitd-flags: --debug
 
-      # Build the Docker image locally for testing
-      - name: Build Docker image for incubator-cloudberry:cbdb-build-${{ 
matrix.platform }}-latest
-        if: ${{ steps.platform-filter.outputs[matrix.platform] == 'true' }}
-        uses: docker/build-push-action@v6
-        with:
-          context: ./images/docker/cbdb/build/${{ matrix.platform }}
-          push: false  # Don't push yet, we'll test first
-          load: true   # Load into local Docker daemon for testing
-          # Use caching for faster builds
-          cache-from: |
-            type=registry,ref=apache/incubator-cloudberry:cbdb-build-${{ 
matrix.platform }}-latest
-            type=gha,scope=docker-cbdb-build-${{ matrix.platform }}
-          cache-to: type=gha,mode=max,scope=docker-cbdb-build-${{ 
matrix.platform }}
-          tags: |
-            incubator-cloudberry:cbdb-build-${{ matrix.platform }}-latest
-          # Add metadata labels for better image tracking
-          labels: |
-            org.opencontainers.image.source=${{ github.server_url }}/${{ 
github.repository }}
-            org.opencontainers.image.revision=${{ github.sha }}
-            org.opencontainers.image.created=${{ 
steps.version.outputs.BUILD_DATE }}
-            org.opencontainers.image.version=${{ 
steps.version.outputs.BUILD_DATE }}-${{ steps.version.outputs.SHA_SHORT }}
-
-      # Show available Docker images
-      - name: List Docker images
-        if: ${{ steps.platform-filter.outputs[matrix.platform] == 'true' }}
-        run: docker images
-
-      # Run TestInfra tests against the built image
-      - name: Run Testinfra Tests
+      # Build and test images for each architecture
+      # This ensures both AMD64 and ARM64 variants work correctly
+      - name: Build and test images
         if: ${{ steps.platform-filter.outputs[matrix.platform] == 'true' }}
-        id: test
         run: |
-          docker run -d \
-                     -h cdw \
-                     --name cbdb-build-${{ matrix.platform }}-test \
-                     incubator-cloudberry:cbdb-build-${{ matrix.platform 
}}-latest \
-                     bash \
-                     -c "sleep 30"
-          docker exec cbdb-build-${{ matrix.platform }}-test pytest \
-                     --cache-clear \
-                     --disable-warnings \
-                     -p no:warnings \
-                     /tests/testinfra/test_cloudberry_db_env.py
-
-      # Save test results as artifacts
-      - name: Save test results
-        if: always() && steps.platform-filter.outputs[matrix.platform] == 
'true'
-        uses: actions/upload-artifact@v3
-        with:
-          name: test-results-${{ matrix.platform }}
-          path: |
-            test-results/
-          retention-days: 7
-
-      # Cleanup test container
-      - name: Remove Test Container
-        if: always() && steps.platform-filter.outputs[matrix.platform] == 
'true'
-        run: docker rm -f cbdb-build-${{ matrix.platform }}-test
-
-      # Push the image to DockerHub if tests passed
-      - name: Retag and Push Docker image to DockerHub
-        if: steps.test.outcome == 'success' && 
steps.platform-filter.outputs[matrix.platform] == 'true'
+          # Build for each platform
+          for arch in amd64 arm64; do
+            # Build the image for testing
+            docker buildx build \
+              --platform linux/$arch \
+              --load \
+              -t apache/incubator-cloudberry:cbdb-build-${{ matrix.platform 
}}-$arch-test \
+              ./images/docker/cbdb/build/${{ matrix.platform }}
+
+            # Run tests in a container
+            docker run -d \
+              -h cdw \
+              --name cbdb-build-${{ matrix.platform }}-$arch-test \
+              apache/incubator-cloudberry:cbdb-build-${{ matrix.platform 
}}-$arch-test \
+              bash -c "sleep 30"
+
+            # Execute TestInfra tests
+            docker exec cbdb-build-${{ matrix.platform }}-$arch-test pytest \
+              --cache-clear \
+              --disable-warnings \
+              -p no:warnings \
+              /tests/testinfra/test_cloudberry_db_env.py
+
+            # Cleanup test container
+            docker rm -f cbdb-build-${{ matrix.platform }}-$arch-test
+          done
+
+      # Build and push multi-architecture images
+      # This creates a manifest list that supports both architectures
+      - name: Build and Push Multi-arch Docker images
+        if: ${{ steps.platform-filter.outputs[matrix.platform] == 'true' }}
         uses: docker/build-push-action@v6
         with:
           context: ./images/docker/cbdb/build/${{ matrix.platform }}
           push: true
-          cache-from: |
-            type=registry,ref=apache/incubator-cloudberry:cbdb-build-${{ 
matrix.platform }}-latest
-            type=gha,scope=docker-cbdb-build-${{ matrix.platform }}
+          platforms: linux/amd64,linux/arm64
+          # Tag with both latest and version-specific tags
           tags: |
             apache/incubator-cloudberry:cbdb-build-${{ matrix.platform 
}}-latest
             apache/incubator-cloudberry:cbdb-build-${{ matrix.platform }}-${{ 
steps.version.outputs.BUILD_DATE }}-${{ steps.version.outputs.SHA_SHORT }}
+          # Add standard Open Container Initiative (OCI) labels
           labels: |
             org.opencontainers.image.source=${{ github.server_url }}/${{ 
github.repository }}
             org.opencontainers.image.revision=${{ github.sha }}
             org.opencontainers.image.created=${{ 
steps.version.outputs.BUILD_DATE }}
             org.opencontainers.image.version=${{ 
steps.version.outputs.BUILD_DATE }}-${{ steps.version.outputs.SHA_SHORT }}
 
-      # Generate build summary
+      # Generate a detailed build summary in GitHub Actions UI
+      # This provides quick access to build information and image usage 
instructions
       - name: Build Summary
         if: always()
         run: |
           echo "### Build Summary for ${{ matrix.platform }} 🚀" >> 
$GITHUB_STEP_SUMMARY
           echo "" >> $GITHUB_STEP_SUMMARY
-
           echo "#### 🔍 Build Information" >> $GITHUB_STEP_SUMMARY
           echo "- **Build Status**: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY
           echo "- **Platform**: ${{ matrix.platform }}" >> $GITHUB_STEP_SUMMARY
+          echo "- **Architectures**: amd64, arm64" >> $GITHUB_STEP_SUMMARY
           echo "- **Commit SHA**: [\`${{ github.sha }}\`](${{ 
github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})" >> 
$GITHUB_STEP_SUMMARY
-          echo "- **Trigger**: ${{ github.event_name }}" >> 
$GITHUB_STEP_SUMMARY
-          echo "- **Branch**: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
           echo "- **Build Date**: ${{ steps.version.outputs.BUILD_DATE }}" >> 
$GITHUB_STEP_SUMMARY
-          echo "- **Version Tag**: \`${{ steps.version.outputs.BUILD_DATE 
}}-${{ steps.version.outputs.SHA_SHORT }}\`" >> $GITHUB_STEP_SUMMARY
           echo "" >> $GITHUB_STEP_SUMMARY
-
-          if [[ "${{ steps.test.outcome }}" == "success" && "${{ 
steps.platform-filter.outputs[matrix.platform] }}" == "true" ]]; then
-            echo "#### 🐳 Docker Image" >> $GITHUB_STEP_SUMMARY
-            echo "- **Repository**: 
[\`apache/incubator-cloudberry:cbdb-build-${{ matrix.platform }}-${{ 
steps.version.outputs.BUILD_DATE }}-${{ steps.version.outputs.SHA_SHORT 
}}\`](https://hub.docker.com/r/apache/incubator-cloudberry:cbdb-build-${{ 
matrix.platform }}-${{ steps.version.outputs.BUILD_DATE }}-${{ 
steps.version.outputs.SHA_SHORT }})" >> $GITHUB_STEP_SUMMARY
-            echo "- **Tags Pushed**:" >> $GITHUB_STEP_SUMMARY
-            echo "  - \`latest\`" >> $GITHUB_STEP_SUMMARY
-            echo "  - \`${{ steps.version.outputs.BUILD_DATE }}-${{ 
steps.version.outputs.SHA_SHORT }}\`" >> $GITHUB_STEP_SUMMARY
-            echo "" >> $GITHUB_STEP_SUMMARY
-
-            echo "#### 📋 Quick Reference" >> $GITHUB_STEP_SUMMARY
-            echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
-            echo "# Pull the image" >> $GITHUB_STEP_SUMMARY
-            echo "docker pull apache/incubator-cloudberry:cbdb-build-${{ 
matrix.platform }}-${{ steps.version.outputs.BUILD_DATE }}-${{ 
steps.version.outputs.SHA_SHORT }}" >> $GITHUB_STEP_SUMMARY
-            echo "" >> $GITHUB_STEP_SUMMARY
-            echo "# View image details" >> $GITHUB_STEP_SUMMARY
-            echo "docker inspect apache/incubator-cloudberry:cbdb-build-${{ 
matrix.platform }}-${{ steps.version.outputs.BUILD_DATE }}-${{ 
steps.version.outputs.SHA_SHORT }}" >> $GITHUB_STEP_SUMMARY
-            echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
-          fi
+          echo "#### 🐳 Docker Images" >> $GITHUB_STEP_SUMMARY
+          echo "- Latest tag: \`apache/incubator-cloudberry:cbdb-build-${{ 
matrix.platform }}-latest\`" >> $GITHUB_STEP_SUMMARY
+          echo "- Version tag: \`apache/incubator-cloudberry:cbdb-build-${{ 
matrix.platform }}-${{ steps.version.outputs.BUILD_DATE }}-${{ 
steps.version.outputs.SHA_SHORT }}\`" >> $GITHUB_STEP_SUMMARY
+          echo "" >> $GITHUB_STEP_SUMMARY
+          echo "#### 📋 Quick Reference" >> $GITHUB_STEP_SUMMARY
+          echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
+          echo "# Pull the image (automatically selects correct architecture)" 
>> $GITHUB_STEP_SUMMARY
+          echo "docker pull apache/incubator-cloudberry:cbdb-build-${{ 
matrix.platform }}-latest" >> $GITHUB_STEP_SUMMARY
+          echo "" >> $GITHUB_STEP_SUMMARY
+          echo "# Pull specific architecture if needed" >> $GITHUB_STEP_SUMMARY
+          echo "docker pull --platform linux/amd64 
apache/incubator-cloudberry:cbdb-build-${{ matrix.platform }}-latest" >> 
$GITHUB_STEP_SUMMARY
+          echo "docker pull --platform linux/arm64 
apache/incubator-cloudberry:cbdb-build-${{ matrix.platform }}-latest" >> 
$GITHUB_STEP_SUMMARY
+          echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
diff --git a/.github/workflows/docker-cbdb-test-containers.yml 
b/.github/workflows/docker-cbdb-test-containers.yml
index 0bbf940..5b2ab15 100644
--- a/.github/workflows/docker-cbdb-test-containers.yml
+++ b/.github/workflows/docker-cbdb-test-containers.yml
@@ -18,8 +18,9 @@
 #
 # --------------------------------------------------------------------
 #
-# Purpose: Builds, tests and pushes Docker images for Apache Cloudberry DB 
test environments
-# Images are built for Rocky Linux 8 and 9, tested with TestInfra, and pushed 
to DockerHub
+# Purpose: Builds, tests and pushes multi-architecture Docker images for
+# Apache Cloudberry DB test environments. Images are built for both AMD64
+# and ARM64 architectures on Rocky Linux 8 and 9.
 #
 # Images are tagged with:
 # - cbdb-test-rocky8-latest
@@ -28,10 +29,14 @@
 # - cbdb-test-rocky9-{YYYYMMDD}-{git-short-sha}
 #
 # Features:
+# - Multi-architecture support (AMD64 and ARM64)
 # - Matrix build for multiple platforms
-# - Caching strategy for efficient builds
+# - QEMU emulation for cross-platform builds
+# - Buildx for efficient multi-arch builds
 # - Path filtering to only build changed platforms
 # - Comprehensive build summary and metadata
+#
+# --------------------------------------------------------------------
 
 name: docker-cbdb-test-containers
 
@@ -88,6 +93,12 @@ jobs:
         if: ${{ steps.platform-filter.outputs[matrix.platform] != 'true' }}
         run: echo "Skipping because the changes do not affect this platform"
 
+      # Set up QEMU for multi-architecture support
+      # This allows building ARM64 images on AMD64 infrastructure and vice 
versa
+      - name: Set up QEMU
+        if: ${{ steps.platform-filter.outputs[matrix.platform] == 'true' }}
+        uses: docker/setup-qemu-action@v3
+
       # Login to DockerHub for pushing images
       - name: Login to Docker Hub
         if: ${{ steps.platform-filter.outputs[matrix.platform] == 'true' }}
@@ -96,85 +107,76 @@ jobs:
           username: ${{ secrets.DOCKERHUB_USER }}
           password: ${{ secrets.DOCKERHUB_TOKEN }}
 
-      # Setup Docker Buildx for efficient builds
+      # Setup Docker Buildx for efficient multi-architecture builds
       - name: Set up Docker Buildx
         if: ${{ steps.platform-filter.outputs[matrix.platform] == 'true' }}
         uses: docker/setup-buildx-action@v3
         with:
           buildkitd-flags: --debug
 
-      # Build the Docker image locally for testing
-      - name: Build Docker image for incubator-cloudberry:cbdb-test-${{ 
matrix.platform }}-latest
+      # Build and test images for each architecture
+      # This ensures both AMD64 and ARM64 variants work correctly
+      - name: Build and test images
+        if: ${{ steps.platform-filter.outputs[matrix.platform] == 'true' }}
+        run: |
+          # Build for each platform
+          for arch in amd64 arm64; do
+            echo "Building for $arch architecture..."
+            docker buildx build \
+              --platform linux/$arch \
+              --load \
+              -t apache/incubator-cloudberry:cbdb-test-${{ matrix.platform 
}}-$arch-test \
+              ./images/docker/cbdb/test/${{ matrix.platform }}
+          done
+
+      # Build and push multi-architecture images
+      # Creates a manifest list that supports both architectures
+      - name: Build and Push Multi-arch Docker images
         if: ${{ steps.platform-filter.outputs[matrix.platform] == 'true' }}
-        uses: docker/build-push-action@v6
-        with:
-          context: ./images/docker/cbdb/test/${{ matrix.platform }}
-          push: false  # Don't push yet, we'll test first
-          load: true   # Load into local Docker daemon for testing
-          # Use caching for faster builds
-          cache-from: |
-            type=registry,ref=apache/incubator-cloudberry:cbdb-test-${{ 
matrix.platform }}-latest
-            type=gha,scope=docker-cbdb-test-${{ matrix.platform }}
-          cache-to: type=gha,mode=max,scope=docker-cbdb-test-${{ 
matrix.platform }}
-          tags: |
-            incubator-cloudberry:cbdb-test-${{ matrix.platform }}-latest
-          # Add metadata labels for better image tracking
-          labels: |
-            org.opencontainers.image.source=${{ github.server_url }}/${{ 
github.repository }}
-            org.opencontainers.image.revision=${{ github.sha }}
-            org.opencontainers.image.created=${{ 
steps.version.outputs.BUILD_DATE }}
-            org.opencontainers.image.version=${{ 
steps.version.outputs.BUILD_DATE }}-${{ steps.version.outputs.SHA_SHORT }}
-
-      # Push the image to DockerHub if tests passed
-      - name: Retag and Push Docker image to DockerHub
-        if: steps.platform-filter.outputs[matrix.platform] == 'true'
         uses: docker/build-push-action@v6
         with:
           context: ./images/docker/cbdb/test/${{ matrix.platform }}
           push: true
+          platforms: linux/amd64,linux/arm64
+          # Use caching for faster builds
           cache-from: |
             type=registry,ref=apache/incubator-cloudberry:cbdb-test-${{ 
matrix.platform }}-latest
             type=gha,scope=docker-cbdb-test-${{ matrix.platform }}
+          # Tag with both latest and version-specific tags
           tags: |
             apache/incubator-cloudberry:cbdb-test-${{ matrix.platform }}-latest
             apache/incubator-cloudberry:cbdb-test-${{ matrix.platform }}-${{ 
steps.version.outputs.BUILD_DATE }}-${{ steps.version.outputs.SHA_SHORT }}
+          # Add metadata labels for better image tracking
           labels: |
             org.opencontainers.image.source=${{ github.server_url }}/${{ 
github.repository }}
             org.opencontainers.image.revision=${{ github.sha }}
             org.opencontainers.image.created=${{ 
steps.version.outputs.BUILD_DATE }}
             org.opencontainers.image.version=${{ 
steps.version.outputs.BUILD_DATE }}-${{ steps.version.outputs.SHA_SHORT }}
 
-      # Generate build summary
+      # Generate a detailed build summary in GitHub Actions UI
+      # This provides quick access to build information and image usage 
instructions
       - name: Build Summary
         if: always()
         run: |
           echo "### Build Summary for ${{ matrix.platform }} 🚀" >> 
$GITHUB_STEP_SUMMARY
           echo "" >> $GITHUB_STEP_SUMMARY
-
           echo "#### 🔍 Build Information" >> $GITHUB_STEP_SUMMARY
           echo "- **Build Status**: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY
           echo "- **Platform**: ${{ matrix.platform }}" >> $GITHUB_STEP_SUMMARY
+          echo "- **Architectures**: AMD64, ARM64" >> $GITHUB_STEP_SUMMARY
           echo "- **Commit SHA**: [\`${{ github.sha }}\`](${{ 
github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})" >> 
$GITHUB_STEP_SUMMARY
-          echo "- **Trigger**: ${{ github.event_name }}" >> 
$GITHUB_STEP_SUMMARY
-          echo "- **Branch**: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
           echo "- **Build Date**: ${{ steps.version.outputs.BUILD_DATE }}" >> 
$GITHUB_STEP_SUMMARY
-          echo "- **Version Tag**: \`${{ steps.version.outputs.BUILD_DATE 
}}-${{ steps.version.outputs.SHA_SHORT }}\`" >> $GITHUB_STEP_SUMMARY
           echo "" >> $GITHUB_STEP_SUMMARY
-
-          if [[ "${{ steps.platform-filter.outputs[matrix.platform] }}" == 
"true" ]]; then
-            echo "#### 🐳 Docker Image" >> $GITHUB_STEP_SUMMARY
-            echo "- **Repository**: 
[\`apache/incubator-cloudberry:cbdb-test-${{ matrix.platform }}-${{ 
steps.version.outputs.BUILD_DATE }}-${{ steps.version.outputs.SHA_SHORT 
}}\`](https://hub.docker.com/r/apache/incubator-cloudberry:cbdb-test-${{ 
matrix.platform }}-${{ steps.version.outputs.BUILD_DATE }}-${{ 
steps.version.outputs.SHA_SHORT }})" >> $GITHUB_STEP_SUMMARY
-            echo "- **Tags Pushed**:" >> $GITHUB_STEP_SUMMARY
-            echo "  - \`latest\`" >> $GITHUB_STEP_SUMMARY
-            echo "  - \`${{ steps.version.outputs.BUILD_DATE }}-${{ 
steps.version.outputs.SHA_SHORT }}\`" >> $GITHUB_STEP_SUMMARY
-            echo "" >> $GITHUB_STEP_SUMMARY
-
-            echo "#### 📋 Quick Reference" >> $GITHUB_STEP_SUMMARY
-            echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
-            echo "# Pull the image" >> $GITHUB_STEP_SUMMARY
-            echo "docker pull apache/incubator-cloudberry:cbdb-test-${{ 
matrix.platform }}-${{ steps.version.outputs.BUILD_DATE }}-${{ 
steps.version.outputs.SHA_SHORT }}" >> $GITHUB_STEP_SUMMARY
-            echo "" >> $GITHUB_STEP_SUMMARY
-            echo "# View image details" >> $GITHUB_STEP_SUMMARY
-            echo "docker inspect apache/incubator-cloudberry:cbdb-test-${{ 
matrix.platform }}-${{ steps.version.outputs.BUILD_DATE }}-${{ 
steps.version.outputs.SHA_SHORT }}" >> $GITHUB_STEP_SUMMARY
-            echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
-          fi
+          echo "#### 🐳 Docker Images" >> $GITHUB_STEP_SUMMARY
+          echo "- Latest tag: \`apache/incubator-cloudberry:cbdb-test-${{ 
matrix.platform }}-latest\`" >> $GITHUB_STEP_SUMMARY
+          echo "- Version tag: \`apache/incubator-cloudberry:cbdb-test-${{ 
matrix.platform }}-${{ steps.version.outputs.BUILD_DATE }}-${{ 
steps.version.outputs.SHA_SHORT }}\`" >> $GITHUB_STEP_SUMMARY
+          echo "" >> $GITHUB_STEP_SUMMARY
+          echo "#### 📋 Quick Reference" >> $GITHUB_STEP_SUMMARY
+          echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
+          echo "# Pull the image (automatically selects correct architecture)" 
>> $GITHUB_STEP_SUMMARY
+          echo "docker pull apache/incubator-cloudberry:cbdb-test-${{ 
matrix.platform }}-latest" >> $GITHUB_STEP_SUMMARY
+          echo "" >> $GITHUB_STEP_SUMMARY
+          echo "# Pull specific architecture if needed" >> $GITHUB_STEP_SUMMARY
+          echo "docker pull --platform linux/amd64 
apache/incubator-cloudberry:cbdb-test-${{ matrix.platform }}-latest" >> 
$GITHUB_STEP_SUMMARY
+          echo "docker pull --platform linux/arm64 
apache/incubator-cloudberry:cbdb-test-${{ matrix.platform }}-latest" >> 
$GITHUB_STEP_SUMMARY
+          echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
diff --git a/images/docker/cbdb/build/rocky8/Dockerfile 
b/images/docker/cbdb/build/rocky8/Dockerfile
index d38bc2f..38638a2 100644
--- a/images/docker/cbdb/build/rocky8/Dockerfile
+++ b/images/docker/cbdb/build/rocky8/Dockerfile
@@ -140,15 +140,24 @@ RUN dnf makecache && \
     make -j$(nproc) && \
     make install -C ~/xerces-c-${XERCES_LATEST_RELEASE} && \
     rm -rf ~/xerces-c* && \
-    cd && GO_VERSION="go1.23.2" && \
-    
GO_SHA256="542d3c1705f1c6a1c5a80d5dc62e2e45171af291e755d591c5e6531ef63b454e" && 
\
-    GO_URL="https://go.dev/dl/${GO_VERSION}.linux-amd64.tar.gz"; && \
+    cd && GO_VERSION="go1.23.4" && \
+    ARCH=$(uname -m) && \
+    if [ "${ARCH}" = "aarch64" ]; then \
+        GO_ARCH="arm64" && \
+        
GO_SHA256="16e5017863a7f6071363782b1b8042eb12c6ca4f4cd71528b2123f0a1275b13e"; \
+    elif [ "${ARCH}" = "x86_64" ]; then \
+        GO_ARCH="amd64" && \
+        
GO_SHA256="6924efde5de86fe277676e929dc9917d466efa02fb934197bc2eba35d5680971"; \
+    else \
+        echo "Unsupported architecture: ${ARCH}" && exit 1; \
+    fi && \
+    GO_URL="https://go.dev/dl/${GO_VERSION}.linux-${GO_ARCH}.tar.gz"; && \
     wget -nv "${GO_URL}" && \
-    echo "${GO_SHA256}  ${GO_VERSION}.linux-amd64.tar.gz" | sha256sum -c - && \
-    tar xf "${GO_VERSION}.linux-amd64.tar.gz" && \
+    echo "${GO_SHA256}  ${GO_VERSION}.linux-${GO_ARCH}.tar.gz" | sha256sum -c 
- && \
+    tar xf "${GO_VERSION}.linux-${GO_ARCH}.tar.gz" && \
     mv go "/usr/local/${GO_VERSION}" && \
     ln -s "/usr/local/${GO_VERSION}" /usr/local/go && \
-    rm -f "${GO_VERSION}.linux-amd64.tar.gz" && \
+    rm -f "${GO_VERSION}.linux-${GO_ARCH}.tar.gz" && \
     echo 'export PATH=$PATH:/usr/local/go/bin' | tee -a /etc/profile.d/go.sh > 
/dev/null
 
 # --------------------------------------------------------------------
diff --git a/images/docker/cbdb/build/rocky8/configs/init_system.sh 
b/images/docker/cbdb/build/rocky8/configs/init_system.sh
index 40a0985..cc2d599 100755
--- a/images/docker/cbdb/build/rocky8/configs/init_system.sh
+++ b/images/docker/cbdb/build/rocky8/configs/init_system.sh
@@ -143,6 +143,33 @@ EOF
 # --------------------------------------------------------------------
 source /etc/os-release
 
+# First, create the CPU info detection function
+get_cpu_info() {
+   ARCH=$(uname -m)
+   if [ "$ARCH" = "x86_64" ]; then
+       lscpu | grep 'Model name:' | awk '{print substr($0, index($0,$3))}'
+   elif [ "$ARCH" = "aarch64" ]; then
+       VENDOR=$(lscpu | grep 'Vendor ID:' | awk '{print $3}')
+       if [ "$VENDOR" = "Apple" ] || [ "$VENDOR" = "0x61" ]; then
+           echo "Apple Silicon ($ARCH)"
+       else
+           if [ -f /proc/cpuinfo ]; then
+               IMPL=$(grep "CPU implementer" /proc/cpuinfo | head -1 | awk 
'{print $3}')
+               PART=$(grep "CPU part" /proc/cpuinfo | head -1 | awk '{print 
$3}')
+               if [ ! -z "$IMPL" ] && [ ! -z "$PART" ]; then
+                   echo "ARM $ARCH (Implementer: $IMPL, Part: $PART)"
+               else
+                   echo "ARM $ARCH"
+               fi
+           else
+               echo "ARM $ARCH"
+           fi
+       fi
+   else
+       echo "Unknown architecture: $ARCH"
+   fi
+}
+
 cat <<-EOF
 Welcome to the Apache Cloudberry Build Environment!
 
@@ -150,7 +177,7 @@ Container OS ........ : $NAME $VERSION
 User ................ : $(whoami)
 Container hostname .. : $(hostname)
 IP Address .......... : $(hostname -I | awk '{print $1}')
-CPU Info ............ : $(lscpu | grep 'Model name:' | awk '{print substr($0, 
index($0,$3))}')
+CPU Info ............ : $(get_cpu_info)
 CPU(s) .............. : $(nproc)
 Memory .............. : $(free -h | grep Mem: | awk '{print $2}') total
 ======================================================================
diff --git a/images/docker/cbdb/build/rocky9/Dockerfile 
b/images/docker/cbdb/build/rocky9/Dockerfile
index 7422649..c56927a 100644
--- a/images/docker/cbdb/build/rocky9/Dockerfile
+++ b/images/docker/cbdb/build/rocky9/Dockerfile
@@ -144,16 +144,24 @@ RUN dnf makecache && \
     make -j$(nproc) && \
     make install -C ~/xerces-c-${XERCES_LATEST_RELEASE} && \
     rm -rf ~/xerces-c* && \
-    cd && GO_VERSION="go1.23.2" && \
-    GO_VERSION="go1.23.2" && \
-    
GO_SHA256="542d3c1705f1c6a1c5a80d5dc62e2e45171af291e755d591c5e6531ef63b454e" && 
\
-    GO_URL="https://go.dev/dl/${GO_VERSION}.linux-amd64.tar.gz"; && \
+    cd && GO_VERSION="go1.23.4" && \
+    ARCH=$(uname -m) && \
+    if [ "${ARCH}" = "aarch64" ]; then \
+        GO_ARCH="arm64" && \
+        
GO_SHA256="16e5017863a7f6071363782b1b8042eb12c6ca4f4cd71528b2123f0a1275b13e"; \
+    elif [ "${ARCH}" = "x86_64" ]; then \
+        GO_ARCH="amd64" && \
+        
GO_SHA256="6924efde5de86fe277676e929dc9917d466efa02fb934197bc2eba35d5680971"; \
+    else \
+        echo "Unsupported architecture: ${ARCH}" && exit 1; \
+    fi && \
+    GO_URL="https://go.dev/dl/${GO_VERSION}.linux-${GO_ARCH}.tar.gz"; && \
     wget -nv "${GO_URL}" && \
-    echo "${GO_SHA256}  ${GO_VERSION}.linux-amd64.tar.gz" | sha256sum -c - && \
-    tar xf "${GO_VERSION}.linux-amd64.tar.gz" && \
+    echo "${GO_SHA256}  ${GO_VERSION}.linux-${GO_ARCH}.tar.gz" | sha256sum -c 
- && \
+    tar xf "${GO_VERSION}.linux-${GO_ARCH}.tar.gz" && \
     mv go "/usr/local/${GO_VERSION}" && \
     ln -s "/usr/local/${GO_VERSION}" /usr/local/go && \
-    rm -f "${GO_VERSION}.linux-amd64.tar.gz" && \
+    rm -f "${GO_VERSION}.linux-${GO_ARCH}.tar.gz" && \
     echo 'export PATH=$PATH:/usr/local/go/bin' | tee -a /etc/profile.d/go.sh > 
/dev/null
 
 # --------------------------------------------------------------------
diff --git a/images/docker/cbdb/build/rocky9/configs/init_system.sh 
b/images/docker/cbdb/build/rocky9/configs/init_system.sh
index e1dc08f..d8c4a00 100755
--- a/images/docker/cbdb/build/rocky9/configs/init_system.sh
+++ b/images/docker/cbdb/build/rocky9/configs/init_system.sh
@@ -142,6 +142,33 @@ EOF
 # --------------------------------------------------------------------
 source /etc/os-release
 
+# First, create the CPU info detection function
+get_cpu_info() {
+   ARCH=$(uname -m)
+   if [ "$ARCH" = "x86_64" ]; then
+       lscpu | grep 'Model name:' | awk '{print substr($0, index($0,$3))}'
+   elif [ "$ARCH" = "aarch64" ]; then
+       VENDOR=$(lscpu | grep 'Vendor ID:' | awk '{print $3}')
+       if [ "$VENDOR" = "Apple" ] || [ "$VENDOR" = "0x61" ]; then
+           echo "Apple Silicon ($ARCH)"
+       else
+           if [ -f /proc/cpuinfo ]; then
+               IMPL=$(grep "CPU implementer" /proc/cpuinfo | head -1 | awk 
'{print $3}')
+               PART=$(grep "CPU part" /proc/cpuinfo | head -1 | awk '{print 
$3}')
+               if [ ! -z "$IMPL" ] && [ ! -z "$PART" ]; then
+                   echo "ARM $ARCH (Implementer: $IMPL, Part: $PART)"
+               else
+                   echo "ARM $ARCH"
+               fi
+           else
+               echo "ARM $ARCH"
+           fi
+       fi
+   else
+       echo "Unknown architecture: $ARCH"
+   fi
+}
+
 cat <<-EOF
 Welcome to the Apache Cloudberry Build Environment!
 
@@ -149,7 +176,7 @@ Container OS ........ : $NAME $VERSION
 User ................ : $(whoami)
 Container hostname .. : $(hostname)
 IP Address .......... : $(hostname -I | awk '{print $1}')
-CPU Info ............ : $(lscpu | grep 'Model name:' | awk '{print substr($0, 
index($0,$3))}')
+CPU Info ............ : $(get_cpu_info)
 CPU(s) .............. : $(nproc)
 Memory .............. : $(free -h | grep Mem: | awk '{print $2}') total
 ======================================================================
diff --git a/images/docker/cbdb/test/rocky8/configs/init_system.sh 
b/images/docker/cbdb/test/rocky8/configs/init_system.sh
index 864f7d2..3ea7e34 100755
--- a/images/docker/cbdb/test/rocky8/configs/init_system.sh
+++ b/images/docker/cbdb/test/rocky8/configs/init_system.sh
@@ -163,6 +163,33 @@ EOF
 # --------------------------------------------------------------------
 source /etc/os-release
 
+# First, create the CPU info detection function
+get_cpu_info() {
+   ARCH=$(uname -m)
+   if [ "$ARCH" = "x86_64" ]; then
+       lscpu | grep 'Model name:' | awk '{print substr($0, index($0,$3))}'
+   elif [ "$ARCH" = "aarch64" ]; then
+       VENDOR=$(lscpu | grep 'Vendor ID:' | awk '{print $3}')
+       if [ "$VENDOR" = "Apple" ] || [ "$VENDOR" = "0x61" ]; then
+           echo "Apple Silicon ($ARCH)"
+       else
+           if [ -f /proc/cpuinfo ]; then
+               IMPL=$(grep "CPU implementer" /proc/cpuinfo | head -1 | awk 
'{print $3}')
+               PART=$(grep "CPU part" /proc/cpuinfo | head -1 | awk '{print 
$3}')
+               if [ ! -z "$IMPL" ] && [ ! -z "$PART" ]; then
+                   echo "ARM $ARCH (Implementer: $IMPL, Part: $PART)"
+               else
+                   echo "ARM $ARCH"
+               fi
+           else
+               echo "ARM $ARCH"
+           fi
+       fi
+   else
+       echo "Unknown architecture: $ARCH"
+   fi
+}
+
 # Check if Apache Cloudberry is installed and display its version
 if rpm -q apache-cloudberry-db-incubating > /dev/null 2>&1; then
     CBDB_VERSION=$(/usr/local/cbdb/bin/postgres --gp-version)
@@ -178,7 +205,7 @@ Container OS ........ : $NAME $VERSION
 User ................ : $(whoami)
 Container hostname .. : $(hostname)
 IP Address .......... : $(hostname -I | awk '{print $1}')
-CPU Info ............ : $(lscpu | grep 'Model name:' | awk '{print substr($0, 
index($0,$3))}')
+CPU Info ............ : $(get_cpu_info)
 CPU(s) .............. : $(nproc)
 Memory .............. : $(free -h | grep Mem: | awk '{print $2}') total
 ======================================================================
diff --git a/images/docker/cbdb/test/rocky9/configs/init_system.sh 
b/images/docker/cbdb/test/rocky9/configs/init_system.sh
index 864f7d2..3ea7e34 100755
--- a/images/docker/cbdb/test/rocky9/configs/init_system.sh
+++ b/images/docker/cbdb/test/rocky9/configs/init_system.sh
@@ -163,6 +163,33 @@ EOF
 # --------------------------------------------------------------------
 source /etc/os-release
 
+# First, create the CPU info detection function
+get_cpu_info() {
+   ARCH=$(uname -m)
+   if [ "$ARCH" = "x86_64" ]; then
+       lscpu | grep 'Model name:' | awk '{print substr($0, index($0,$3))}'
+   elif [ "$ARCH" = "aarch64" ]; then
+       VENDOR=$(lscpu | grep 'Vendor ID:' | awk '{print $3}')
+       if [ "$VENDOR" = "Apple" ] || [ "$VENDOR" = "0x61" ]; then
+           echo "Apple Silicon ($ARCH)"
+       else
+           if [ -f /proc/cpuinfo ]; then
+               IMPL=$(grep "CPU implementer" /proc/cpuinfo | head -1 | awk 
'{print $3}')
+               PART=$(grep "CPU part" /proc/cpuinfo | head -1 | awk '{print 
$3}')
+               if [ ! -z "$IMPL" ] && [ ! -z "$PART" ]; then
+                   echo "ARM $ARCH (Implementer: $IMPL, Part: $PART)"
+               else
+                   echo "ARM $ARCH"
+               fi
+           else
+               echo "ARM $ARCH"
+           fi
+       fi
+   else
+       echo "Unknown architecture: $ARCH"
+   fi
+}
+
 # Check if Apache Cloudberry is installed and display its version
 if rpm -q apache-cloudberry-db-incubating > /dev/null 2>&1; then
     CBDB_VERSION=$(/usr/local/cbdb/bin/postgres --gp-version)
@@ -178,7 +205,7 @@ Container OS ........ : $NAME $VERSION
 User ................ : $(whoami)
 Container hostname .. : $(hostname)
 IP Address .......... : $(hostname -I | awk '{print $1}')
-CPU Info ............ : $(lscpu | grep 'Model name:' | awk '{print substr($0, 
index($0,$3))}')
+CPU Info ............ : $(get_cpu_info)
 CPU(s) .............. : $(nproc)
 Memory .............. : $(free -h | grep Mem: | awk '{print $2}') total
 ======================================================================


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to