Lab 2 - Installing Fluent Bit from source code
Lab Goal
To install using the source code and run Fluent Bit on your local machine.
Source - Locally installing Fluent Bit
Installing on your local machine can be done in just a few steps with our
Fluent Bit Easy Install project.
This contains the source code from a released version of Fluent Bit, see
readme for the exact version, and uses a simple automated installation script.
This automated installation project is used to install Fluent Bit.
On the next slide you will download and install Fluent Bit using the Easy Install project.
Source - Using the easy install project
The Fluent Bit Easy Install project takes just 3 steps to a running server:
- Download and unzip project.
- Run the
init.sh
file in a console.
- Test install by running a version check (
fluent-bit --version
).
Let's walk through these steps one by one in the next slides...
Source - Downloading and unzip project
The first step is to
download the project.
Unzipping (use your file manager or console) should look something like this:
$ unzip fluentbit-install-demo-v1.4.zip
Archive: fluentbit-install-demo-v1.4.zip
creating: fluentbit-install-demo-v1.4/
extracting: fluentbit-install-demo-v1.4/.gitignore
inflating: fluentbit-install-demo-v1.4/README.md
creating: fluentbit-install-demo-v1.4/docs/
creating: fluentbit-install-demo-v1.4/docs/demo-images/
inflating: fluentbit-install-demo-v1.4/docs/demo-images/workshop.png
inflating: fluentbit-install-demo-v1.4/init.bat
inflating: fluentbit-install-demo-v1.4/init.sh
creating: fluentbit-install-demo-v1.4/installs/
inflating: fluentbit-install-demo-v1.4/installs/README
inflating: fluentbit-install-demo-v1.4/installs/fluent-bit-3.1.4.zip
creating: fluentbit-install-demo-v1.4/support/
...
Source - Getting started with install script
In our example here we will run the console-based installation script (note the VERSION text
below is to be replace with the version of the project you have downloaded):
$ cd fluentbit-install-demo-{VERSION}
$ ./init.sh
Source - Enjoy the welcome ascii art!
First, you are presented with welcome art and details about this project:
#######################################################################
## ##
## Setting up the Fluent Bit Easy Install demo ##
## ##
## ##### # # # ##### # # ##### #### ##### ##### ##
## # # # # # ## # # # # # # ##
## #### # # # ### # # # # #### # # ##
## # # # # # # ## # # # # # ##
## # ##### ##### ##### # # # #### ##### # ##
## ##
## ##### ### #### # # ##
## # # # # # # ##
## ### ##### ### # ##
## # # # # # ##
## ##### # # #### # ##
## ##
## ##### # # #### ##### ### # # ##
## # ## # # # # # # # ##
## # # # # ### # ##### # # ##
## # # ## # # # # # # ##
## ##### # # #### # # # ##### ##### ##
## ##
## brought to you by Eric D. Schabell ##
## ##
## git@gitlab.com:o11y-workshops/fluentbit-install-demo.git ##
## ##
#######################################################################
Intermezzo - Whoops... that's not right?
Note that there are many fail safe checks in this script and you found the first one! Read the
help messages in the console output and fix it by running it with the right argument:
...
Checking the build mode arguments...
To use this installation script you have to provide one argument
indicating how you want to install Fluent Bit. You have the
option to install a container image or build it from source:
$ ./init.sh {podman|source}
Both methods are validated by the install scripts.
$ ./init.sh source
Source - Checking build dependencies
This time, as you scroll down the output, you'll see validation for dependencies needed to
build Fluent Bit. Should any fail, you will be pointed to installation help. Here all
checks are passing (noting your versions reported might be different, as long as they pass):
...
Checking the build mode arguments...
Installing from source...
Installing Fluent Bit version 3.1.4 from the source project...
- removing existing installation directory...
Checking for bison version needed to build:
Bison major version is good...
...
Source - Unpacking and building project
As you scroll further down the output, you see Fluent Bit is installed into the
target
directory. We then run phase 1 of building the project:
...
Unpacking Fluent Bit project into target directory...
Fluent Bit project unpacked successfully into target directory!
Moving to the Fluent Bit project build directory...
Building Fluent Bit (phase 1):
[BUILDING_CODE_STARTS_HERE]
...
Source - Building phase 1 completes
Eventually (cut out of the log here due to length of the build), the build phase 1 should
complete and you'll see the message below as it continues on to phase 2 of the build:
...
-- Configuring done (37.7s)
-- Generating done (1.5s)
-- Build files have been written to:
/Users/erics/demo-projects/workshops/fluentbit-install-demo/target/fluent-bit-3.1.4/build
Phase 1 build successful, building continuing with phase 2:
[BUILDING_CODE_CONTINUES_HERE]
...
Source - Building phase 2 completes
When phase 2 completes successfully the next step is to copy the build binaries to our target
execution directory:
...
Fluent Bit built successfully!
Copying to ./target/fluent-bit-3.1.4/bin for use.
...
Source - Installing Fluent Bit completes
Finally, Fluent Bit is ready to use. Here you see the end report with the final instructions on
where to find the executable and how to test it by checking its version:
=============================================================
= =
= Install complete, get ready to rock Fluent Bit! =
= =
= The binary build is available to run at: =
= =
= $ cd target/fluent-bit-3.1.4/bin/fluent-bit =
= $ bin/fluent-bit --version =
= =
= Fluent Bit v3.1.4 =
= =
= Getting started workshop available online: =
= https://o11y-workshops.gitlab.io/workshop-fluentbit =
= =
=============================================================
Lab completed - Results
=============================================================
= =
= Install complete, get ready to rock Fluent Bit! =
= =
= The binary build is available to run at: =
= =
= $ cd target/fluent-bit-3.1.4/bin/fluent-bit =
= $ bin/fluent-bit --version =
= =
= Fluent Bit v3.1.4 =
= =
= Getting started workshop available online: =
= https://o11y-workshops.gitlab.io/workshop-fluentbit =
= =
=============================================================
Next up, exploring first pipelines...
Contact - are there any questions?