Skip to content

Commit

Permalink
build: add support for FLB_STATIC_CONF in build.sh - WIP
Browse files Browse the repository at this point in the history
This it to verify compilation.

It's not trivial to use this flag otherwise because a user needs to put their config in the Docker images 🤔

Signed-off-by: Bryce Gibson <[email protected]>
  • Loading branch information
bglimepoint committed Jun 5, 2024
1 parent 03ef710 commit 76d84ce
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-compile-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
run: ./build.sh
env:
FLB_DISTRO: ubuntu/20.04
FLB_ARG: --build-arg=FLB_STATIC_CONF=yes
FLB_ARG: --build-arg=FLB_STATIC_CONF=/tmp
5 changes: 4 additions & 1 deletion dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ COPY . ./
# We split the builder setup out so people can target it or use as a base image without doing a full build.
FROM builder-base as builder
WORKDIR /src/fluent-bit/build/

ARG FLB_STATIC_CONF

RUN cmake -DFLB_RELEASE=On \
-DFLB_JEMALLOC=On \
-DFLB_TLS=On \
Expand All @@ -76,7 +79,7 @@ RUN cmake -DFLB_RELEASE=On \
-DFLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \
-DFLB_LOG_NO_CONTROL_CHARS=On \
-DFLB_CHUNK_TRACE="$FLB_CHUNK_TRACE" \
${FLB_STATIC_CONF:+-DFLB_STATIC_CONF=/tmp} \
${FLB_STATIC_CONF:+-DFLB_STATIC_CONF=}"${FLB_STATIC_CONF:-}" \
..

RUN make -j "$(getconf _NPROCESSORS_ONLN)"
Expand Down
2 changes: 2 additions & 0 deletions packaging/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ FLB_DISTRO=${FLB_DISTRO:-}
FLB_OUT_DIR=${FLB_OUT_DIR:-}
FLB_NIGHTLY_BUILD=${FLB_NIGHTLY_BUILD:-}
FLB_JEMALLOC=${FLB_JEMALLOC:-On}
FLB_STATIC_CONF=${FLB_STATIC_CONF:-}
DOCKER=${FLB_DOCKER_CLI:-docker}

# Use this to pass special arguments to docker build
Expand Down Expand Up @@ -90,6 +91,7 @@ if ! ${DOCKER} build \
--build-arg FLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \
--build-arg FLB_JEMALLOC="$FLB_JEMALLOC" \
--build-arg FLB_TD="$FLB_TD" \
--build-arg FLB_STATIC_CONF="$FLB_STATIC_CONF" \
$FLB_ARG \
-t "$MAIN_IMAGE" \
-f "$IMAGE_CONTEXT_DIR/Dockerfile" \
Expand Down
2 changes: 2 additions & 0 deletions packaging/distros/amazonlinux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ ARG FLB_OUT_KAFKA=On
ARG FLB_OUT_PGSQL=On
ARG FLB_JEMALLOC=On
ARG FLB_CHUNK_TRACE=On
ARG FLB_STATIC_CONF

RUN cmake3 -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
-DCMAKE_INSTALL_SYSCONFDIR="$CMAKE_INSTALL_SYSCONFDIR" \
Expand All @@ -97,6 +98,7 @@ RUN cmake3 -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
-DFLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \
-DFLB_JEMALLOC="${FLB_JEMALLOC}" \
-DFLB_CHUNK_TRACE="${FLB_CHUNK_TRACE}" \
${FLB_STATIC_CONF:+-DFLB_STATIC_CONF=}"${FLB_STATIC_CONF:-}" \
../

VOLUME [ "/output" ]
Expand Down
2 changes: 2 additions & 0 deletions packaging/distros/centos/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ ARG FLB_HTTP_SERVER=On
ARG FLB_OUT_KAFKA=On
ARG FLB_JEMALLOC=On
ARG FLB_CHUNK_TRACE=On
ARG FLB_STATIC_CONF

# cmake3 exists in every image - cmake references the older cmake2 in centos 7
RUN cmake3 -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
Expand All @@ -175,6 +176,7 @@ RUN cmake3 -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
-DFLB_JEMALLOC_OPTIONS="$FLB_JEMALLOC_OPTIONS" \
-DFLB_JEMALLOC="${FLB_JEMALLOC}" \
-DFLB_CHUNK_TRACE="${FLB_CHUNK_TRACE}" \
${FLB_STATIC_CONF:+-DFLB_STATIC_CONF=}"${FLB_STATIC_CONF:-}" \
../

VOLUME [ "/output" ]
Expand Down
2 changes: 2 additions & 0 deletions packaging/distros/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ ARG FLB_OUT_KAFKA=On
ARG FLB_OUT_PGSQL=On
ARG FLB_JEMALLOC=On
ARG FLB_CHUNK_TRACE=On
ARG FLB_STATIC_CONF

ENV CFLAGS=$CFLAGS
RUN cmake -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
Expand All @@ -130,6 +131,7 @@ RUN cmake -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
-DFLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \
-DFLB_JEMALLOC="${FLB_JEMALLOC}" \
-DFLB_CHUNK_TRACE="${FLB_CHUNK_TRACE}" \
${FLB_STATIC_CONF:+-DFLB_STATIC_CONF=}"${FLB_STATIC_CONF:-}" \
../

VOLUME [ "/output" ]
Expand Down
2 changes: 2 additions & 0 deletions packaging/distros/raspbian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ ARG FLB_OUT_KAFKA=On
ARG FLB_OUT_PGSQL=On
ARG FLB_JEMALLOC=On
ARG FLB_CHUNK_TRACE=On
ARG FLB_STATIC_CONF

ENV CFLAGS=$CFLAGS
RUN cmake -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
Expand All @@ -71,6 +72,7 @@ RUN cmake -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
-DFLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \
-DFLB_JEMALLOC="${FLB_JEMALLOC}" \
-DFLB_CHUNK_TRACE="${FLB_CHUNK_TRACE}" \
${FLB_STATIC_CONF:+-DFLB_STATIC_CONF=}"${FLB_STATIC_CONF:-}" \
../

VOLUME [ "/output" ]
Expand Down
2 changes: 2 additions & 0 deletions packaging/distros/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ ARG FLB_OUT_KAFKA=On
ARG FLB_OUT_PGSQL=On
ARG FLB_JEMALLOC=On
ARG FLB_CHUNK_TRACE=On
ARG FLB_STATIC_CONF

ENV CFLAGS=$CFLAGS
RUN cmake -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
Expand All @@ -185,6 +186,7 @@ RUN cmake -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
-DFLB_NIGHTLY_BUILD="$FLB_NIGHTLY_BUILD" \
-DFLB_JEMALLOC="${FLB_JEMALLOC}" \
-DFLB_CHUNK_TRACE="${FLB_CHUNK_TRACE}" \
${FLB_STATIC_CONF:+-DFLB_STATIC_CONF=}"${FLB_STATIC_CONF:-}" \
../

VOLUME [ "/output" ]
Expand Down

0 comments on commit 76d84ce

Please sign in to comment.