Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerfiles: Add support for s390x #8095

Merged
merged 1 commit into from
Nov 7, 2023
Merged

Conversation

ajaypvictor
Copy link
Contributor

@ajaypvictor ajaypvictor commented Oct 26, 2023

  • Adding support for linux-s390x in CI
  • Added s390x specific cmake target to disable WASM and LuaJIT

Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • Debug log output from testing the change
  • [N/A] Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • [N/A] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

Backporting

  • [N/A] Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

@ajaypvictor
Copy link
Contributor Author

Example config file change:

[SERVICE]
  Flush                   1
  Log_Level               info
  Daemon                  off
  HTTP_Server             On
  HTTP_Listen             0.0.0.0
  HTTP_Port               8081
  Health_Check            On
  HC_Errors_Count         1
  HC_Retry_Failure_Count  1
  HC_Period               30

[INPUT]
    Name             dummy
    Dummy          {"message": "THIS IS FROM K8S CLUSTER"}
    Tag                dummy.log
[OUTPUT]
    name            logdna
    match           *
    logdna_host     <logdna-endpoint>
    logdna_port     443
    api_key         <logdna-ingestion-key>
    hostname        ${ZONE}
    tags            ${LOGDNA_TAGS}
    tls             on
    tls.verify      on
    net.dns.resolver  LEGACY

Debug log output:

~/fluent-bit/build# bin/fluent-bit -c fluent-bit.conf --verbose
Fluent Bit v2.1.0
* Copyright (C) 2015-2022 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io/

[2023/09/15 11:44:47] [ warn] [env] variable ${ZONE} is used but not set
[2023/09/15 11:44:47] [ warn] [env] variable ${LOGDNA_TAGS} is used but not set
[2023/09/15 11:44:47] [ info] [fluent bit] version=2.1.0, commit=341ddbc44a, pid=330302
[2023/09/15 11:44:47] [ info] [storage] ver=1.4.0, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2023/09/15 11:44:47] [ info] [cmetrics] version=0.6.1
[2023/09/15 11:44:47] [ info] [ctraces ] version=0.3.0
[2023/09/15 11:44:47] [ info] [input:dummy:dummy.0] initializing
[2023/09/15 11:44:47] [ info] [input:dummy:dummy.0] storage_strategy='memory' (memory only)
[2023/09/15 11:44:47] [ info] [output:logdna:logdna.0] configured, hostname=(null)
[2023/09/15 11:44:47] [ info] [http_server] listen iface=0.0.0.0 tcp_port=8081
[2023/09/15 11:44:47] [ info] [sp] stream processor started
[2023/09/15 11:44:50] [ info] [output:logdna:logdna.0] logs.eu-gb.logging.cloud.ibm.com:443, HTTP status=200
{"batchID":"035db71e-3edc-4248-8f03-aeaeda784d70:20056:ld81","status":"ok"}
[2023/09/15 11:44:50] [ info] [output:logdna:logdna.0] logs.eu-gb.logging.cloud.ibm.com:443, HTTP status=200
{"batchID":"566a334c-6e68-4a27-b1c8-3c24dd5638a0:10335:ld81","status":"ok"}
[2023/09/15 11:44:52] [ info] [output:logdna:logdna.0] logs.eu-gb.logging.cloud.ibm.com:443, HTTP status=200
{"batchID":"5df8fc6f-7f07-480e-8014-1c21cc870540:10651:ld81","status":"ok"}
[2023/09/15 11:44:52] [ info] [output:logdna:logdna.0] logs.eu-gb.logging.cloud.ibm.com:443, HTTP status=200
{"batchID":"d0849d90-1040-4c96-945a-25e6563d5429:19011:ld81","status":"ok"}
^C[2023/09/15 11:44:53] [engine] caught signal (SIGINT)
[2023/09/15 11:44:53] [ warn] [engine] service will shutdown in max 5 seconds
[2023/09/15 11:44:53] [ info] [input] pausing dummy.0
[2023/09/15 11:44:54] [ info] [output:logdna:logdna.0] logs.eu-gb.logging.cloud.ibm.com:443, HTTP status=200
{"batchID":"7f99146e-8d5e-4bf6-886b-6d9ebd67cd04:17161:ld81","status":"ok"}
[2023/09/15 11:44:54] [ info] [output:logdna:logdna.0] logs.eu-gb.logging.cloud.ibm.com:443, HTTP status=200
{"batchID":"1e56af55-fd65-4c51-be1e-1e84925d8c9d:12477:ld81","status":"ok"}
[2023/09/15 11:44:54] [ info] [engine] service has stopped (0 pending tasks)
[2023/09/15 11:44:54] [ info] [input] pausing dummy.0

@patrick-stephens
Copy link
Contributor

@ajaypvictor can you confirm that skopeo image supports copying this architecture as well for releases?

- name: Promote container images from staging to Dockerhub
run: |
docker run --rm \
quay.io/skopeo/stable:latest \
copy \
--all \
--retry-times 10 \
--src-no-creds \
--dest-creds "$RELEASE_CREDS" \
"docker://$STAGING_IMAGE_NAME:$TAG" \
"docker://$RELEASE_IMAGE_NAME:$TAG"
env:
RELEASE_IMAGE_NAME: docker.io/${{ github.event.inputs.docker-image || secrets.DOCKERHUB_ORGANIZATION }}
RELEASE_CREDS: ${{ secrets.DOCKERHUB_USERNAME }}:${{ secrets.DOCKERHUB_TOKEN }}
TAG: ${{ matrix.tag }}
shell: bash
- name: Promote container images from staging to GHCR.io
if: ${{ startsWith(github.event.inputs.version, '2.0') || ! startsWith(matrix.tag, 'latest') }}
run: |
docker run --rm \
quay.io/skopeo/stable:latest \
copy \
--all \
--retry-times 10 \
--src-no-creds \
--dest-creds "$RELEASE_CREDS" \
"docker://$STAGING_IMAGE_NAME:$TAG" \
"docker://$RELEASE_IMAGE_NAME:$TAG"
env:
RELEASE_IMAGE_NAME: ghcr.io/${{ github.event.inputs.github-image || github.repository }}
RELEASE_CREDS: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}
TAG: ${{ matrix.tag }}
shell: bash

@ajaypvictor
Copy link
Contributor Author

@ajaypvictor can you confirm that skopeo image supports copying this architecture as well for releases?

- name: Promote container images from staging to Dockerhub
run: |
docker run --rm \
quay.io/skopeo/stable:latest \
copy \
--all \
--retry-times 10 \
--src-no-creds \
--dest-creds "$RELEASE_CREDS" \
"docker://$STAGING_IMAGE_NAME:$TAG" \
"docker://$RELEASE_IMAGE_NAME:$TAG"
env:
RELEASE_IMAGE_NAME: docker.io/${{ github.event.inputs.docker-image || secrets.DOCKERHUB_ORGANIZATION }}
RELEASE_CREDS: ${{ secrets.DOCKERHUB_USERNAME }}:${{ secrets.DOCKERHUB_TOKEN }}
TAG: ${{ matrix.tag }}
shell: bash
- name: Promote container images from staging to GHCR.io
if: ${{ startsWith(github.event.inputs.version, '2.0') || ! startsWith(matrix.tag, 'latest') }}
run: |
docker run --rm \
quay.io/skopeo/stable:latest \
copy \
--all \
--retry-times 10 \
--src-no-creds \
--dest-creds "$RELEASE_CREDS" \
"docker://$STAGING_IMAGE_NAME:$TAG" \
"docker://$RELEASE_IMAGE_NAME:$TAG"
env:
RELEASE_IMAGE_NAME: ghcr.io/${{ github.event.inputs.github-image || github.repository }}
RELEASE_CREDS: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}
TAG: ${{ matrix.tag }}
shell: bash

Thanks @patrick-stephens for the review..

yes, it seems like s390x is supported for the skopeo image as well.

~# docker manifest inspect quay.io/skopeo/stable:latest | grep -i Arch
            "architecture": "ppc64le",
            "architecture": "arm64",
            "architecture": "amd64",
            "architecture": "s390x",

@patrick-stephens
Copy link
Contributor

@ajaypvictor can you confirm that skopeo image supports copying this architecture as well for releases?

- name: Promote container images from staging to Dockerhub
run: |
docker run --rm \
quay.io/skopeo/stable:latest \
copy \
--all \
--retry-times 10 \
--src-no-creds \
--dest-creds "$RELEASE_CREDS" \
"docker://$STAGING_IMAGE_NAME:$TAG" \
"docker://$RELEASE_IMAGE_NAME:$TAG"
env:
RELEASE_IMAGE_NAME: docker.io/${{ github.event.inputs.docker-image || secrets.DOCKERHUB_ORGANIZATION }}
RELEASE_CREDS: ${{ secrets.DOCKERHUB_USERNAME }}:${{ secrets.DOCKERHUB_TOKEN }}
TAG: ${{ matrix.tag }}
shell: bash
- name: Promote container images from staging to GHCR.io
if: ${{ startsWith(github.event.inputs.version, '2.0') || ! startsWith(matrix.tag, 'latest') }}
run: |
docker run --rm \
quay.io/skopeo/stable:latest \
copy \
--all \
--retry-times 10 \
--src-no-creds \
--dest-creds "$RELEASE_CREDS" \
"docker://$STAGING_IMAGE_NAME:$TAG" \
"docker://$RELEASE_IMAGE_NAME:$TAG"
env:
RELEASE_IMAGE_NAME: ghcr.io/${{ github.event.inputs.github-image || github.repository }}
RELEASE_CREDS: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}
TAG: ${{ matrix.tag }}
shell: bash

Thanks @patrick-stephens for the review..

yes, it seems like s390x is supported for the skopeo image as well.

~# docker manifest inspect quay.io/skopeo/stable:latest | grep -i Arch
            "architecture": "ppc64le",
            "architecture": "arm64",
            "architecture": "amd64",
            "architecture": "s390x",

Sorry, I meant that it can copy the s390 architecture images and not that an image for that platform is provided - we only use the amd64 architecture image for skopeo but we use it to copy all architectures so I wanted to confirm it will indeed correctly copy an image of that architecture in the manifest list?

@ajaypvictor
Copy link
Contributor Author

docker run --rm \
quay.io/skopeo/stable:latest \
copy \
--all \
--retry-times 10 \
--src-no-creds \

Sorry for the misunderstanding and thanks for the clarification.
I would expect it to copy the s390x image as similar to other arch images, but I can do some tests if required to ensure the same..

@edsiper edsiper merged commit 3d42367 into fluent:master Nov 7, 2023
38 of 39 checks passed
@ajaypvictor ajaypvictor deleted the enable-s390x branch November 7, 2023 04:53
@patrick-stephens
Copy link
Contributor

@ajaypvictor it looks like we need to tweak things slightly as when building for the 2.1 branch it is failing to create the images: https://github.com/fluent/fluent-bit/actions/runs/6797961238/job/18481194089

 > [linux/s390x builder 2/6] RUN cmake -DFLB_RELEASE=On     -DFLB_JEMALLOC=On     -DFLB_TLS=On     -DFLB_SHARED_LIB=Off     -DFLB_EXAMPLES=Off     -DFLB_HTTP_SERVER=On     -DFLB_IN_EXEC=Off     -DFLB_IN_SYSTEMD=On     -DFLB_OUT_KAFKA=On     -DFLB_OUT_PGSQL=On     -DFLB_NIGHTLY_BUILD="2023-11-08-12_06_54"     -DFLB_LOG_NO_CONTROL_CHARS=On     -DFLB_CHUNK_TRACE="On"     ..:
-- Check target fpu abi: FPU ABI IS Hard
CMake Error at lib/luajit-cmake/LuaJIT.cmake:141 (message):
  Unsupported target architecture: 'SystemZ'
Call Stack (most recent call first):
  lib/luajit-cmake/CMakeLists.txt:8 (include)
 
 
-- Configuring incomplete, errors occurred!

Could you backport any changes to 2.1 as well? Otherwise we'll have to make the choice of targets to build for dependent on which branch (e.g. 2.1 only builds amd64/arm64) and that's messy.

@ajaypvictor
Copy link
Contributor Author

@ajaypvictor it looks like we need to tweak things slightly as when building for the 2.1 branch it is failing to create the images: https://github.com/fluent/fluent-bit/actions/runs/6797961238/job/18481194089

 > [linux/s390x builder 2/6] RUN cmake -DFLB_RELEASE=On     -DFLB_JEMALLOC=On     -DFLB_TLS=On     -DFLB_SHARED_LIB=Off     -DFLB_EXAMPLES=Off     -DFLB_HTTP_SERVER=On     -DFLB_IN_EXEC=Off     -DFLB_IN_SYSTEMD=On     -DFLB_OUT_KAFKA=On     -DFLB_OUT_PGSQL=On     -DFLB_NIGHTLY_BUILD="2023-11-08-12_06_54"     -DFLB_LOG_NO_CONTROL_CHARS=On     -DFLB_CHUNK_TRACE="On"     ..:
-- Check target fpu abi: FPU ABI IS Hard
CMake Error at lib/luajit-cmake/LuaJIT.cmake:141 (message):
  Unsupported target architecture: 'SystemZ'
Call Stack (most recent call first):
  lib/luajit-cmake/CMakeLists.txt:8 (include)
 
 
-- Configuring incomplete, errors occurred!

Could you backport any changes to 2.1 as well? Otherwise we'll have to make the choice of targets to build for dependent on which branch (e.g. 2.1 only builds amd64/arm64) and that's messy.

sure, sorry I missed that part.
raised another PR to 2.1: #8149
Thank you..

@patrick-stephens
Copy link
Contributor

patrick-stephens commented Nov 9, 2023

And one thing flagged on staging tests was the s390x smoke tests failing if you could have a look: https://github.com/fluent/fluent-bit/actions/runs/6804824150/job/18503134209
They are here: https://github.com/fluent/fluent-bit/tree/master/packaging/testing/smoke/container
Run from here:

staging-test-images:
name: Container images staging tests
# Workflow run always triggers on completion regardless of status
# This prevents us from running if build fails.
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
uses: ./.github/workflows/call-test-images.yaml
with:
registry: ghcr.io
username: ${{ github.actor }}
image: ${{ github.repository }}/staging
image-tag: latest
environment: staging
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
cosign_key: ${{ secrets.COSIGN_PUBLIC_KEY }}

Which calls:
call-test-images-container-smoke:

@ajaypvictor
Copy link
Contributor Author

And one thing flagged on staging tests was the s390x smoke tests failing if you could have a look: https://github.com/fluent/fluent-bit/actions/runs/6804824150/job/18503134209 They are here: https://github.com/fluent/fluent-bit/tree/master/packaging/testing/smoke/container

Thanks Pat..
seems like Lua is causing this failure, which is kind of expected due to Lua being not available on s390x:

Error: [2023/11/08 22:35:51] [error] [config] section 'Lua' tried to instance a plugin name that don't exists
Error: [2023/11/08 22:35:51] [error] configuration file contains errors, aborting.

digging in deeper..

@ajaypvictor
Copy link
Contributor Author

@patrick-stephens
tried out few things, got to see the staging tests disablement for s390x via #8149
could you please check the details I have added on the same PR as a comment
Thank you..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants