feat: Add s390x architecture support for Docker image builds (PoC)#1184
Draft
Lan Yao (lyao-77) wants to merge 1 commit intomasterfrom
Draft
feat: Add s390x architecture support for Docker image builds (PoC)#1184Lan Yao (lyao-77) wants to merge 1 commit intomasterfrom
Lan Yao (lyao-77) wants to merge 1 commit intomasterfrom
Conversation
This PR implements s390x (IBM Z) architecture support for building Confluent Platform base Docker images in Semaphore CI, enabling multi-architecture support alongside existing AMD64 and ARM64 builds. ## Changes ### CI Configuration (.semaphore/semaphore.yml) - Added S390X_ARCH variable definition (.s390x) - Created "Build & Test S390X" block for s390x builds - Uses QEMU emulation on AMD64 hosts with docker buildx - Configured 2-hour execution time limit for s390x builds - Separated Maven artifact compilation from Docker image building ### Architecture-Specific Dockerfiles Created s390x-specific Dockerfiles with Go cross-compilation: - base-java/Dockerfile.ubi9.s390x - base-java-micro/Dockerfile.ubi9.s390x - base-lite/Dockerfile.ubi9.s390x Uses tonistiigi/xx:1.5.0 toolkit for cross-compilation to avoid Go compiler segmentation faults under QEMU emulation. ### Build Strategy - **AMD/ARM**: Use Maven Spotify plugin (existing approach) - **s390x**: Use manual docker buildx with cross-compilation - Maven builds artifacts with -Ddocker.skip-build=true - Extract version properties from Maven - Build images using docker buildx with --platform linux/s390x - Use s390x-specific Dockerfiles for Go cross-compilation ### Key Technical Solutions 1. **Go Cross-Compilation**: Implemented cross-compilation for cp-docker-utils binaries (ub, package_dedupe) using BuildKit's cross-platform features to avoid QEMU segfaults when running Go compiler under emulation. 2. **confluent-docker-utils Handling**: Skipped on s390x in base/Dockerfile.ubi9 due to Rust compilation complexity under QEMU. Added conditional check for s390x architecture. 3. **Build Dependency Management**: Push cp-base-new immediately after building so jmxterm can pull it from ECR registry. 4. **Package Structure**: Manually create package directories and copy built JARs since Maven's skip-build doesn't create the expected structure. ### POM Updates Modified pom.xml files to skip Docker builds for s390x: - base/pom.xml - base-java/pom.xml - base-java-micro/pom.xml - base-lite/pom.xml - jmxterm/pom.xml ## Images Built All five base images successfully build for s390x: - confluentinc/cp-base-new - confluentinc/cp-base-java - confluentinc/cp-base-java-micro - confluentinc/cp-base-lite - confluentinc/cp-jmxterm ## Scope This is a PoC limited to PR builds (semaphore.yml). Release builds (cp_dockerfile_build.yml) are not modified and remain unchanged. ## Testing Verified s390x architecture with docker inspect and successful pipeline execution (pipeline ID: 1a902c5a-b7dd-422c-80f4-c88c4b57508f). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements s390x (IBM Z) architecture support for building Confluent Platform base Docker images in Semaphore CI, enabling multi-architecture support alongside existing AMD64 and ARM64 builds.
Changes
CI Configuration (.semaphore/semaphore.yml)
Architecture-Specific Dockerfiles
Created s390x-specific Dockerfiles with Go cross-compilation:
Uses tonistiigi/xx:1.5.0 toolkit for cross-compilation to avoid Go compiler segmentation faults under QEMU emulation.
Build Strategy
Key Technical Solutions
Go Cross-Compilation: Implemented cross-compilation for cp-docker-utils binaries (ub, package_dedupe) using BuildKit's cross-platform features to avoid QEMU segfaults when running Go compiler under emulation.
confluent-docker-utils Handling: Skipped on s390x in base/Dockerfile.ubi9 due to Rust compilation complexity under QEMU. Added conditional check for s390x architecture.
Build Dependency Management: Push cp-base-new immediately after building so jmxterm can pull it from ECR registry.
Package Structure: Manually create package directories and copy built JARs since Maven's skip-build doesn't create the expected structure.
POM Updates
Modified pom.xml files to skip Docker builds for s390x:
Images Built
All five base images successfully build for s390x:
Scope
This is a PoC limited to PR builds (semaphore.yml). Release builds (cp_dockerfile_build.yml) are not modified and remain unchanged.
Testing
Verified s390x architecture with docker inspect and successful pipeline execution (pipeline ID: 1a902c5a-b7dd-422c-80f4-c88c4b57508f).
Change Description
Testing