Skip to content

Commit

Permalink
dockerfiles: adding s390x support (fluent#8095)
Browse files Browse the repository at this point in the history
Signed-off-by: Ajay <[email protected]>
  • Loading branch information
ajaypvictor authored Nov 7, 2023
1 parent 14bba1f commit 3d42367
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/call-build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64, linux/arm64, linux/arm/v7
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/s390x
target: production
# Must be disabled to provide legacy format images from the registry
provenance: false
Expand All @@ -147,7 +147,7 @@ jobs:
context: .
tags: ${{ steps.debug-meta.outputs.tags }}
labels: ${{ steps.debug-meta.outputs.labels }}
platforms: linux/amd64, linux/arm64, linux/arm/v7
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/s390x
# Must be disabled to provide legacy format images from the registry
provenance: false
target: debug
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/call-test-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
strategy:
fail-fast: false
matrix:
arch: [ linux/amd64, linux/arm64, linux/arm/v7 ]
arch: [ linux/amd64, linux/arm64, linux/arm/v7, linux/s390x ]
include:
# Rather than extract the specific central arch we just provide it
- arch: linux/amd64
Expand All @@ -85,6 +85,8 @@ jobs:
expected: arm64
- arch: linux/arm/v7
expected: arm
- arch: linux/s390x
expected: s390x
steps:
- name: Log in to the Container registry
uses: docker/login-action@v3
Expand Down Expand Up @@ -128,7 +130,7 @@ jobs:
strategy:
fail-fast: false # verify all
matrix:
arch: [ linux/amd64, linux/arm64, linux/arm/v7 ]
arch: [ linux/amd64, linux/arm64, linux/arm/v7, linux/s390x ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,11 @@ if (FLB_SYSTEM_MACOS)
include(cmake/macos-setup.cmake)
endif()

# Build for SystemZ - s390x arch
if (FLB_SYSTEM_LINUX)
include(cmake/s390x.cmake)
endif ()

# Extract Git commit information for debug output.
# 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.
# For a better solution see https://jonathanhamberg.com/post/cmake-embedding-git-hash/ but this is simple and easy.
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ tags [here](https://docs.fluentbit.io/manual/installation/docker).

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

#### Running on s390x

Fluent Bit is supported on Linux on IBM Z(s390x), but the WASM and LUA filter plugins are not.

### Plugins: Inputs, Filters and Outputs

[Fluent Bit](http://fluentbit.io) is based in a pluggable architecture where different plugins plays a major role in the data pipeline:
Expand Down
8 changes: 8 additions & 0 deletions cmake/s390x.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(SystemZ|s390x)")
message(STATUS "Forcing characters to be signed, as on x86_64.")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsigned-char")
message(STATUS "Cannot build WAMR on this platform, so WASM support is disabled.")
set(FLB_WASM OFF)
message(STATUS "This platform does not support LuaJIT, so it's disabled.")
set(FLB_LUAJIT OFF)
endif ()
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# docker buildx rm builder
# docker buildx create --name builder --use
# docker buildx inspect --bootstrap
# 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/
# 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/

# Set this to the current release version: it gets done so as part of the release.
ARG RELEASE_VERSION=2.2.0
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ docker buildx inspect --bootstrap
```
4. Build Fluent Bit from the **root of the Git repo (not from this directory)**:
```
docker buildx build --platform "linux/amd64,linux/arm64,linux/arm/v7" --target=production -f dockerfiles/Dockerfile .
docker buildx build --platform "linux/amd64,linux/arm64,linux/arm/v7,linux/s390x" --target=production -f dockerfiles/Dockerfile .
```

## Build and test
Expand Down

0 comments on commit 3d42367

Please sign in to comment.