Skip to content

Commit 8d9602f

Browse files
Merge branch 'master' of github.com:tanmaya-panda1/fluent-bit into feature/added-buffering-to-azure-blob
2 parents d1d6edc + 46ba2aa commit 8d9602f

File tree

2,454 files changed

+447960
-114291
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,454 files changed

+447960
-114291
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ jobs:
7676
config:
7777
- name: "Apple Silicon macOS runner"
7878
runner: macos-14
79+
cmake_version: "3.31.6"
7980
- name: "Intel macOS runner"
8081
runner: macos-14-large
82+
cmake_version: "3.31.6"
8183

8284
steps:
8385
- name: Checkout repository
@@ -90,6 +92,11 @@ jobs:
9092
brew update
9193
brew install bison flex libyaml openssl pkgconfig || true
9294
95+
- name: Install cmake
96+
uses: jwlawson/actions-setup-cmake@v2
97+
with:
98+
cmake-version: "${{ matrix.config.cmake_version }}"
99+
93100
- name: Build Fluent Bit packages
94101
run: |
95102
export LIBRARY_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib:$LIBRARY_PATH

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,19 @@ jobs:
8585
openssl_dir: C:\vcpkg\packages\openssl_x86-windows-static
8686
cmake_additional_opt: ""
8787
vcpkg_triplet: x86-windows-static
88+
cmake_version: "3.31.6"
8889
- name: "Windows 64bit"
8990
arch: x64
9091
openssl_dir: C:\vcpkg\packages\openssl_x64-windows-static
9192
cmake_additional_opt: ""
9293
vcpkg_triplet: x64-windows-static
94+
cmake_version: "3.31.6"
9395
- name: "Windows 64bit (Arm64)"
9496
arch: amd64_arm64
9597
openssl_dir: C:\vcpkg\packages\openssl_arm64-windows-static
9698
cmake_additional_opt: "-DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_SYSTEM_PROCESSOR=ARM64"
9799
vcpkg_triplet: arm64-windows-static
100+
cmake_version: "3.31.6"
98101
permissions:
99102
contents: read
100103
# Default environment variables can be overridden below. To prevent library pollution - without this other random libraries may be found on the path leading to failures.
@@ -113,6 +116,7 @@ jobs:
113116
Copy-Item -Path C:\WinFlexBison/win_bison.exe C:\WinFlexBison/bison.exe
114117
Copy-Item -Path C:\WinFlexBison/win_flex.exe C:\WinFlexBison/flex.exe
115118
echo "C:\WinFlexBison" | Out-File -FilePath $env:GITHUB_PATH -Append
119+
choco install cmake --version "${{ matrix.config.cmake_version }}" --force
116120
env:
117121
WINFLEXBISON: https://github.com/lexxmark/winflexbison/releases/download/v2.5.22/win_flex_bison-2.5.22.zip
118122
shell: pwsh

.github/workflows/call-windows-unit-tests.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ jobs:
3939
openssl_dir: C:\vcpkg\packages\openssl_x86-windows-static
4040
cmake_additional_opt: ""
4141
vcpkg_triplet: x86-windows-static
42+
cmake_version: "3.31.6"
4243
- name: "Windows 64bit"
4344
arch: x64
4445
openssl_dir: C:\vcpkg\packages\openssl_x64-windows-static
4546
cmake_additional_opt: ""
4647
vcpkg_triplet: x64-windows-static
48+
cmake_version: "3.31.6"
4749
permissions:
4850
contents: read
4951
# Default environment variables can be overridden below. To prevent library pollution - without this other random libraries may be found on the path leading to failures.
@@ -62,6 +64,7 @@ jobs:
6264
Copy-Item -Path C:\WinFlexBison/win_bison.exe C:\WinFlexBison/bison.exe
6365
Copy-Item -Path C:\WinFlexBison/win_flex.exe C:\WinFlexBison/flex.exe
6466
echo "C:\WinFlexBison" | Out-File -FilePath $env:GITHUB_PATH -Append
67+
choco install cmake --version "${{ matrix.config.cmake_version }}" --force
6568
env:
6669
WINFLEXBISON: https://github.com/lexxmark/winflexbison/releases/download/v2.5.22/win_flex_bison-2.5.22.zip
6770
shell: pwsh

.github/workflows/pr-compile-check.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ jobs:
3333

3434
# Sanity check for compilation using system libraries
3535
pr-compile-system-libs:
36-
runs-on: ubuntu-20.04
36+
runs-on: ubuntu-22.04
3737
timeout-minutes: 60
3838
strategy:
3939
fail-fast: false
4040
matrix:
4141
flb_option:
4242
- "-DFLB_PREFER_SYSTEM_LIBS=On"
43+
cmake_version:
44+
- "3.31.6"
4345
compiler:
4446
- gcc:
4547
cc: gcc
@@ -51,24 +53,29 @@ jobs:
5153
- name: Setup environment
5254
run: |
5355
sudo apt-get update
54-
sudo apt-get install -y curl gcc-7 g++-7 clang-6.0 libsystemd-dev gcovr libyaml-dev libluajit-5.1-dev \
56+
sudo apt-get install -y curl gcc-9 g++-9 clang-12 libsystemd-dev gcovr libyaml-dev libluajit-5.1-dev \
5557
libnghttp2-dev libjemalloc-dev
56-
sudo ln -s /usr/bin/llvm-symbolizer-6.0 /usr/bin/llvm-symbolizer || true
58+
sudo ln -s /usr/bin/llvm-symbolizer-12 /usr/bin/llvm-symbolizer || true
5759
mkdir -p /tmp/libbacktrace/build && \
5860
curl -L https://github.com/ianlancetaylor/libbacktrace/archive/8602fda.tar.gz | \
5961
tar --strip-components=1 -xzC /tmp/libbacktrace/ && \
6062
pushd /tmp/libbacktrace/build && ../configure && make && sudo make install && popd
6163
64+
- name: Install cmake
65+
uses: jwlawson/actions-setup-cmake@v2
66+
with:
67+
cmake-version: "${{ matrix.cmake_version }}"
68+
6269
- name: Checkout Fluent Bit code
6370
uses: actions/checkout@v4
6471

6572
- name: ${{ matrix.compiler.cc }} & ${{ matrix.compiler.cxx }} - ${{ matrix.flb_option }}
6673
run: |
6774
export nparallel=$(( $(getconf _NPROCESSORS_ONLN) > 8 ? 8 : $(getconf _NPROCESSORS_ONLN) ))
6875
echo "CC = $CC, CXX = $CXX, FLB_OPT = $FLB_OPT"
69-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90
70-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90
71-
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 90
76+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90
77+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 90
78+
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 90
7279
cmake $GLOBAL_OPTS $FLB_OPT ../
7380
make -j $nparallel
7481
working-directory: build

.github/workflows/unit-tests.yaml

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ on:
3535

3636
jobs:
3737
run-ubuntu-unit-tests:
38-
runs-on: ubuntu-20.04
38+
runs-on: ubuntu-22.04
3939
timeout-minutes: 60
4040
strategy:
4141
fail-fast: false
@@ -51,6 +51,8 @@ jobs:
5151
- "-DFLB_SANITIZE_THREAD=On"
5252
- "-DFLB_SIMD=On"
5353
- "-DFLB_SIMD=Off"
54+
cmake_version:
55+
- "3.31.6"
5456
compiler:
5557
- gcc:
5658
cc: gcc
@@ -69,8 +71,13 @@ jobs:
6971
- name: Setup environment
7072
run: |
7173
sudo apt-get update
72-
sudo apt-get install -y gcc-7 g++-7 clang-6.0 libsystemd-dev gcovr libyaml-dev libbpf-dev linux-tools-common
73-
sudo ln -s /usr/bin/llvm-symbolizer-6.0 /usr/bin/llvm-symbolizer || true
74+
sudo apt-get install -y gcc-9 g++-9 clang-12 libsystemd-dev gcovr libyaml-dev libbpf-dev linux-tools-common
75+
sudo ln -s /usr/bin/llvm-symbolizer-12 /usr/bin/llvm-symbolizer || true
76+
77+
- name: Install cmake
78+
uses: jwlawson/actions-setup-cmake@v2
79+
with:
80+
cmake-version: "${{ matrix.cmake_version }}"
7481

7582
- uses: actions/checkout@v4
7683

@@ -82,9 +89,9 @@ jobs:
8289
- name: ${{ matrix.compiler.cc }} & ${{ matrix.compiler.cxx }} - ${{ matrix.flb_option }}
8390
run: |
8491
echo "CC = $CC, CXX = $CXX, FLB_OPT = $FLB_OPT"
85-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 90
86-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90
87-
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 90
92+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90
93+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 90
94+
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 90
8895
sudo usermod -a -G systemd-journal $(id -un)
8996
sudo -E su -p $(id -un) -c "PATH=$PATH ci/scripts/run-unit-tests.sh"
9097
env:
@@ -106,9 +113,16 @@ jobs:
106113
- "-DFLB_JEMALLOC=Off"
107114
- "-DFLB_SANITIZE_MEMORY=On"
108115
- "-DFLB_SANITIZE_THREAD=On"
116+
cmake_version:
117+
- "3.31.6"
109118
permissions:
110119
contents: read
111120
steps:
121+
- name: Install cmake
122+
uses: jwlawson/actions-setup-cmake@v2
123+
with:
124+
cmake-version: "${{ matrix.cmake_version }}"
125+
112126
- uses: actions/checkout@v4
113127
- uses: actions/checkout@v4
114128
with:
@@ -144,15 +158,29 @@ jobs:
144158
unit_test_option: "-DFLB_TESTS_INTERNAL=On"
145159
compiler_cc: gcc
146160
compiler_cxx: g++
161+
cmake_version: "3.31.6"
162+
cmake_home: "/opt/cmake"
163+
147164
steps:
148165
- name: Checkout Fluent Bit code
149166
uses: actions/checkout@v4
150167

151168
- name: Setup environment
152169
run: |
153170
sudo apt-get update
154-
sudo apt-get install -y gcc-9 g++-9 clang-12 cmake flex bison libsystemd-dev gcovr libyaml-dev libbpf-dev linux-tools-common
171+
sudo apt-get install -y gcc-9 g++-9 clang-12 flex bison libsystemd-dev gcovr libyaml-dev libbpf-dev linux-tools-common curl tar gzip
155172
sudo ln -s /usr/bin/llvm-symbolizer-12 /usr/bin/llvm-symbolizer || true
173+
sudo mkdir -p "${CMAKE_HOME}"
174+
cmake_url="https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-$(uname -m).tar.gz"
175+
cmake_dist="$(mktemp --suffix ".tar.gz")"
176+
echo "Downloading CMake ${CMAKE_VERSION}: ${cmake_url} -> ${cmake_dist}"
177+
curl -jksSL -o "${cmake_dist}" "${cmake_url}"
178+
echo "Extracting CMake ${CMAKE_VERSION}: ${cmake_dist} -> ${CMAKE_HOME}"
179+
sudo tar -xzf "${cmake_dist}" -C "${CMAKE_HOME}" --strip-components 1
180+
rm "${cmake_dist}"
181+
env:
182+
CMAKE_HOME: ${{ matrix.config.cmake_home }}
183+
CMAKE_VERSION: ${{ matrix.config.cmake_version }}
156184

157185
- name: Build and test with arm runners
158186
run: |
@@ -169,6 +197,10 @@ jobs:
169197
170198
echo "CC = ${{ matrix.config.compiler_cc }}, CXX = ${{ matrix.config.compiler_cxx }}, FLB_OPT = $FLB_OPT"
171199
200+
if [[ -n "${CMAKE_HOME}" ]]; then
201+
export PATH="${CMAKE_HOME}/bin:${PATH}"
202+
fi
203+
172204
cmake ${FLB_OPT} ../
173205
make -j $nparallel
174206
ctest -j $nparallel --build-run-dir . --output-on-failure
@@ -177,12 +209,13 @@ jobs:
177209
CC: ${{ matrix.config.compiler_cc }}
178210
CXX: ${{ matrix.config.compiler_cxx }}
179211
CALYPTIA_FLEET_TOKEN: ${{ secrets.CALYPTIA_FLEET_TOKEN }}
212+
CMAKE_HOME: ${{ matrix.config.cmake_home }}
180213

181214
run-qemu-ubuntu-unit-tests:
182215
# We chain this after Linux one as there are CPU time costs for QEMU emulation
183216
needs:
184217
- run-ubuntu-unit-tests
185-
runs-on: ubuntu-20.04
218+
runs-on: ubuntu-22.04
186219
timeout-minutes: 60
187220
strategy:
188221
fail-fast: false
@@ -206,7 +239,8 @@ jobs:
206239
--volume "/etc/machine-id:/etc/machine-id"
207240
install: |
208241
apt-get update
209-
apt-get install -y gcc-12 g++-12 libyaml-dev cmake flex bison libssl-dev libbpf-dev linux-tools-common
242+
apt-get install -y gcc-12 g++-12 libyaml-dev flex bison libssl-dev libbpf-dev linux-tools-common
243+
apt-get satisfy -y cmake "cmake (<< 4.0)"
210244
211245
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 90
212246
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 90

CMakeLists.txt

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ option(FLB_WASM "Build with WASM runtime support" Yes)
174174
option(FLB_WAMRC "Build with WASM AOT compiler executable" No)
175175
option(FLB_WASM_STACK_PROTECT "Build with WASM runtime with strong stack protector flags" No)
176176
option(FLB_ENFORCE_ALIGNMENT "Enable limited platform specific aligned memory access" No)
177+
option(FLB_KAFKA "Enable Kafka support" Yes)
177178
option(FLB_ZIG "Enable zig integration" Yes)
178179

179180
# Native Metrics Support (cmetrics)
@@ -1084,16 +1085,19 @@ if(FLB_BACKTRACE)
10841085
FLB_DEFINITION(FLB_HAVE_LIBBACKTRACE)
10851086
endif()
10861087

1087-
if(FLB_IN_KAFKA OR FLB_OUT_KAFKA)
1088-
if(FLB_PREFER_SYSTEM_LIB_KAFKA)
1089-
find_package(PkgConfig)
1090-
pkg_check_modules(KAFKA rdkafka>=2.3.0)
1091-
endif()
1092-
if(KAFKA_FOUND)
1093-
include_directories(${KAFKA_INCLUDE_DIRS})
1094-
link_directories(${KAFKA_LIBRARY_DIRS})
1095-
else()
1096-
include(cmake/kafka.cmake)
1088+
# Kafka support (library in general)
1089+
if(FLB_KAFKA)
1090+
if(FLB_IN_KAFKA OR FLB_OUT_KAFKA)
1091+
if(FLB_PREFER_SYSTEM_LIB_KAFKA)
1092+
find_package(PkgConfig)
1093+
pkg_check_modules(KAFKA rdkafka>=2.3.0)
1094+
endif()
1095+
if(KAFKA_FOUND)
1096+
include_directories(${KAFKA_INCLUDE_DIRS})
1097+
link_directories(${KAFKA_LIBRARY_DIRS})
1098+
else()
1099+
include(cmake/kafka.cmake)
1100+
endif()
10971101
endif()
10981102
endif()
10991103

cmake/libraries.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set(FLB_PATH_LIB_CPROFILES "lib/cprofiles")
88
set(FLB_PATH_LIB_CO "lib/flb_libco")
99
set(FLB_PATH_LIB_RBTREE "lib/rbtree")
1010
set(FLB_PATH_LIB_MSGPACK "lib/msgpack-c")
11-
set(FLB_PATH_LIB_NGHTTP2 "lib/nghttp2")
11+
set(FLB_PATH_LIB_NGHTTP2 "lib/nghttp2-1.65.0")
1212
set(FLB_PATH_LIB_AVRO "lib/avro")
1313
set(FLB_PATH_LIB_CHUNKIO "lib/chunkio")
1414
set(FLB_PATH_LIB_LUAJIT "lib/luajit-04dca791")
@@ -22,7 +22,7 @@ set(FLB_PATH_LIB_MINIZ "lib/miniz")
2222
set(FLB_PATH_LIB_TUTF8E "lib/tutf8e")
2323
set(FLB_PATH_LIB_CARES "lib/c-ares-1.34.4")
2424
set(FLB_PATH_LIB_SNAPPY "lib/snappy-fef67ac")
25-
set(FLB_PATH_LIB_RDKAFKA "lib/librdkafka-2.4.0")
25+
set(FLB_PATH_LIB_RDKAFKA "lib/librdkafka-2.8.0")
2626
set(FLB_PATH_LIB_RING_BUFFER "lib/lwrb")
2727
set(FLB_PATH_LIB_WASM_MICRO_RUNTIME "lib/wasm-micro-runtime-WAMR-1.3.3")
2828
set(FLB_PATH_LIB_ZSTD "lib/zstd-1.5.7")

cmake/nghttp2.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
FLB_OPTION(ENABLE_LIB_ONLY ON)
33
FLB_OPTION(ENABLE_STATIC_LIB ON)
44
FLB_OPTION(ENABLE_SHARED_LIB OFF)
5+
FLB_OPTION(BUILD_SHARED_LIBS OFF)
6+
FLB_OPTION(BUILD_STATIC_LIBS ON)
57
FLB_DEFINITION(NGHTTP2_STATICLIB)
68

79
add_subdirectory(${FLB_PATH_LIB_NGHTTP2} EXCLUDE_FROM_ALL)

dockerfiles/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ RUN echo "deb http://deb.debian.org/debian bookworm-backports main" >> /etc/apt/
4141
build-essential \
4242
curl \
4343
ca-certificates \
44-
cmake \
4544
git \
4645
make \
4746
tar \
@@ -56,6 +55,7 @@ RUN echo "deb http://deb.debian.org/debian bookworm-backports main" >> /etc/apt/
5655
flex \
5756
bison \
5857
libyaml-dev \
58+
&& apt-get satisfy -y cmake "cmake (<< 4.0)" \
5959
&& apt-get clean \
6060
&& rm -rf /var/lib/apt/lists/*
6161

@@ -254,8 +254,9 @@ RUN echo "deb http://deb.debian.org/debian bookworm-backports main" >> /etc/apt/
254254
net-tools mtr netcat-openbsd bridge-utils iperf ngrep \
255255
openssl \
256256
htop atop strace iotop sysstat ncdu logrotate hdparm pciutils psmisc tree pv \
257-
cmake make tar flex bison \
257+
make tar flex bison \
258258
libssl-dev libsasl2-dev libsystemd-dev/bookworm-backports zlib1g-dev libpq-dev libyaml-dev postgresql-server-dev-all \
259+
&& apt-get satisfy -y cmake "cmake (<< 4.0)" \
259260
&& apt-get clean \
260261
&& rm -rf /var/lib/apt/lists/*
261262

dockerfiles/Dockerfile.centos7

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,32 @@ FROM centos:7
77
RUN sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo && \
88
sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo && \
99
yum -y update && \
10-
yum install -y rpm-build curl ca-certificates gcc gcc-c++ cmake make bash \
10+
yum install -y rpm-build curl ca-certificates gcc gcc-c++ make bash \
1111
wget unzip systemd-devel wget flex bison \
12-
cyrus-sasl-lib cyrus-sasl-devel openssl openss-libs openssl-devel libcurl-devel \
13-
postgresql-libs postgresql-devel postgresql-server postgresql libyaml-devel && \
14-
yum install -y epel-release && \
15-
yum install -y cmake3
12+
cyrus-sasl-lib cyrus-sasl-devel openssl openssl-libs openssl-devel libcurl-devel \
13+
postgresql-libs postgresql-devel postgresql-server postgresql libyaml-devel \
14+
tar gzip
15+
16+
ENV CMAKE_HOME="/opt/cmake"
17+
18+
ARG CMAKE_VERSION="3.31.6"
19+
ARG CMAKE_URL="https://github.com/Kitware/CMake/releases/download"
20+
21+
RUN mkdir -p "${CMAKE_HOME}" && \
22+
cmake_download_url="${CMAKE_URL}/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-$(uname -m).tar.gz" && \
23+
echo "Downloading CMake ${CMAKE_VERSION}: ${cmake_download_url} -> ${CMAKE_HOME}" && \
24+
curl -jksSL "${cmake_download_url}" | tar -xzf - -C "${CMAKE_HOME}" --strip-components 1
25+
26+
ENV PATH="${CMAKE_HOME}/bin:${PATH}"
1627

1728
COPY . /src/
1829
WORKDIR /src/build
1930

20-
RUN cmake3 -DCMAKE_INSTALL_PREFIX=/opt/fluent-bit/ -DCMAKE_INSTALL_SYSCONFDIR=/etc/ \
31+
RUN cmake -DCMAKE_INSTALL_PREFIX=/opt/fluent-bit/ -DCMAKE_INSTALL_SYSCONFDIR=/etc/ \
2132
-DFLB_RELEASE=On -DFLB_TRACE=On \
2233
-DFLB_TESTS_INTERNAL=On -DFLB_TESTS_RUNTIME=On \
2334
-DFLB_SQLDB=On -DFLB_HTTP_SERVER=On \
24-
-DFLB_OUT_KAFKA=On \
35+
-DFLB_KAFKA=off \
2536
-DFLB_JEMALLOC=On \
2637
-DFLB_CHUNK_TRACE=On \
2738
-DFLB_OUT_PGSQL=On \

0 commit comments

Comments
 (0)