Skip to content

Comments

feat: Add s390x architecture support for Docker image builds (PoC)#1184

Draft
Lan Yao (lyao-77) wants to merge 1 commit intomasterfrom
test_s390x_build
Draft

feat: Add s390x architecture support for Docker image builds (PoC)#1184
Lan Yao (lyao-77) wants to merge 1 commit intomasterfrom
test_s390x_build

Conversation

@lyao-77
Copy link
Member

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:

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

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant