Skip to content

Commit 3d42367

Browse files
authored
dockerfiles: adding s390x support (#8095)
Signed-off-by: Ajay <[email protected]>
1 parent 14bba1f commit 3d42367

File tree

7 files changed

+25
-6
lines changed

7 files changed

+25
-6
lines changed

.github/workflows/call-build-images.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
context: .
121121
tags: ${{ steps.meta.outputs.tags }}
122122
labels: ${{ steps.meta.outputs.labels }}
123-
platforms: linux/amd64, linux/arm64, linux/arm/v7
123+
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/s390x
124124
target: production
125125
# Must be disabled to provide legacy format images from the registry
126126
provenance: false
@@ -147,7 +147,7 @@ jobs:
147147
context: .
148148
tags: ${{ steps.debug-meta.outputs.tags }}
149149
labels: ${{ steps.debug-meta.outputs.labels }}
150-
platforms: linux/amd64, linux/arm64, linux/arm/v7
150+
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/s390x
151151
# Must be disabled to provide legacy format images from the registry
152152
provenance: false
153153
target: debug

.github/workflows/call-test-images.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
strategy:
7777
fail-fast: false
7878
matrix:
79-
arch: [ linux/amd64, linux/arm64, linux/arm/v7 ]
79+
arch: [ linux/amd64, linux/arm64, linux/arm/v7, linux/s390x ]
8080
include:
8181
# Rather than extract the specific central arch we just provide it
8282
- arch: linux/amd64
@@ -85,6 +85,8 @@ jobs:
8585
expected: arm64
8686
- arch: linux/arm/v7
8787
expected: arm
88+
- arch: linux/s390x
89+
expected: s390x
8890
steps:
8991
- name: Log in to the Container registry
9092
uses: docker/login-action@v3
@@ -128,7 +130,7 @@ jobs:
128130
strategy:
129131
fail-fast: false # verify all
130132
matrix:
131-
arch: [ linux/amd64, linux/arm64, linux/arm/v7 ]
133+
arch: [ linux/amd64, linux/arm64, linux/arm/v7, linux/s390x ]
132134
steps:
133135
- name: Checkout repository
134136
uses: actions/checkout@v4

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,11 @@ if (FLB_SYSTEM_MACOS)
395395
include(cmake/macos-setup.cmake)
396396
endif()
397397

398+
# Build for SystemZ - s390x arch
399+
if (FLB_SYSTEM_LINUX)
400+
include(cmake/s390x.cmake)
401+
endif ()
402+
398403
# Extract Git commit information for debug output.
399404
# Note that this is only set when cmake is run, the intent here is to use in CI for verification of releases so is acceptable.
400405
# For a better solution see https://jonathanhamberg.com/post/cmake-embedding-git-hash/ but this is simple and easy.

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ tags [here](https://docs.fluentbit.io/manual/installation/docker).
101101

102102
Fluent Bit is fully supported on Windows environments, get started with [these instructions](https://docs.fluentbit.io/manual/installation/windows).
103103

104+
#### Running on s390x
105+
106+
Fluent Bit is supported on Linux on IBM Z(s390x), but the WASM and LUA filter plugins are not.
107+
104108
### Plugins: Inputs, Filters and Outputs
105109

106110
[Fluent Bit](http://fluentbit.io) is based in a pluggable architecture where different plugins plays a major role in the data pipeline:

cmake/s390x.cmake

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(SystemZ|s390x)")
2+
message(STATUS "Forcing characters to be signed, as on x86_64.")
3+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsigned-char")
4+
message(STATUS "Cannot build WAMR on this platform, so WASM support is disabled.")
5+
set(FLB_WASM OFF)
6+
message(STATUS "This platform does not support LuaJIT, so it's disabled.")
7+
set(FLB_LUAJIT OFF)
8+
endif ()

dockerfiles/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# docker buildx rm builder
99
# docker buildx create --name builder --use
1010
# docker buildx inspect --bootstrap
11-
# docker buildx build --platform "linux/amd64,linux/arm64,linux/arm/v7" -f ./dockerfiles/Dockerfile.multiarch --build-arg FLB_TARBALL=https://github.com/fluent/fluent-bit/archive/v1.8.11.tar.gz ./dockerfiles/
11+
# docker buildx build --platform "linux/amd64,linux/arm64,linux/arm/v7,linux/s390x" -f ./dockerfiles/Dockerfile.multiarch --build-arg FLB_TARBALL=https://github.com/fluent/fluent-bit/archive/v1.8.11.tar.gz ./dockerfiles/
1212

1313
# Set this to the current release version: it gets done so as part of the release.
1414
ARG RELEASE_VERSION=2.2.0

dockerfiles/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ docker buildx inspect --bootstrap
4040
```
4141
4. Build Fluent Bit from the **root of the Git repo (not from this directory)**:
4242
```
43-
docker buildx build --platform "linux/amd64,linux/arm64,linux/arm/v7" --target=production -f dockerfiles/Dockerfile .
43+
docker buildx build --platform "linux/amd64,linux/arm64,linux/arm/v7,linux/s390x" --target=production -f dockerfiles/Dockerfile .
4444
```
4545

4646
## Build and test

0 commit comments

Comments
 (0)