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:

  1. Download and unzip project.
  2. Run the init.sh file in a console.
  3. Test installation 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.9.zip

								Archive: fluentbit-install-demo-v1.9.zip
								creating: fluentbit-install-demo-v1.9/
								extracting: fluentbit-install-demo-v1.9/.gitignore
								inflating: fluentbit-install-demo-v1.9/README.md
								creating: fluentbit-install-demo-v1.9/docs/
								creating: fluentbit-install-demo-v1.9/docs/demo-images/
								inflating: fluentbit-install-demo-v1.9/docs/demo-images/workshop.png
								inflating: fluentbit-install-demo-v1.9/init.bat
								inflating: fluentbit-install-demo-v1.9/init.sh
								creating: fluentbit-install-demo-v1.9/installs/
								inflating: fluentbit-install-demo-v1.9/installs/README
								inflating: fluentbit-install-demo-v1.9/installs/fluent-bit-4.0.3.zip
								creating: fluentbit-install-demo-v1.9/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 replaced 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:
							
								[INFO]    #######################################################################
								[INFO]    ##                                                                   ##
								[INFO]    ##  Setting up the Fluent Bit Easy Install demo                      ##
								[INFO]    ##                                                                   ##
								[INFO]    ##      #####  #     #   # ##### #   # #####   ####  ##### #####     ##
								[INFO]    ##      #      #     #   # #     ##  #   #     #   #   #     #       ##
								[INFO]    ##      ####   #     #   # ###   # # #   #     ####    #     #       ##
								[INFO]    ##      #      #     #   # #     #  ##   #     #   #   #     #       ##
								[INFO]    ##      #      ##### ##### ##### #   #   #     ####  #####   #       ##
								[INFO]    ##                                                                   ##
								[INFO]    ##                       #####  ###   #### #   #                     ##
								[INFO]    ##                       #     #   # #      # #                      ##
								[INFO]    ##                       ###   #####  ###    #                       ##
								[INFO]    ##                       #     #   #     #   #                       ##
								[INFO]    ##                       ##### #   # ####    #                       ##
								[INFO]    ##                                                                   ##
								[INFO]    ##               ##### #   #  #### #####  ###  #     #               ##
								[INFO]    ##                 #   ##  # #       #   #   # #     #               ##
								[INFO]    ##                 #   # # #  ###    #   ##### #     #               ##
								[INFO]    ##                 #   #  ##     #   #   #   # #     #               ##
								[INFO]    ##               ##### #   # ####    #   #   # ##### #####           ##
								[INFO]    ##                                                                   ##
								[INFO]    ##  brought to you by Eric D. Schabell                               ##
								[INFO]    ##                                                                   ##
								[INFO]    ##  git@gitlab.com:o11y-workshops/fluentbit-install-demo.git         ##
								[INFO]    ##                                                                   ##
								[INFO]    #######################################################################
							
						

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:
							
								...
								[INFO]    Checking the build mode arguments...

								[WARN]    ========================================================================
								[WARN]    =                                                                      =
								[WARN]    =  To use this installation script you have to provide one argument    =
								[WARN]    =  indicating how you want to install Fluent Bit. You have the option  =
								[WARN]    =  to install a container image or build it from source:               =
								[WARN]    =                                                                      =
								[WARN]    =    $ ./init.sh {podman|source}                                       =
								[WARN]    =                                                                      =
								[WARN]    =  Both methods are validated by the install scripts.                  =
								[WARN]    =                                                                      =
								[WARN]    ========================================================================

								$ ./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):
							
								...
								[INFO]    Checking the build mode arguments...
								[INFO]    Installing from source...
								[INFO]    Installing Fluent Bit version 4.0.3 from the source project...
								[WARN]    removing existing installation directory...
								[INFO]    Checking for bison version needed to build:
								[INFO]    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:
							
								...
								[INFO]    Unpacking Fluent Bit project into target directory...
								[INFO]    Fluent Bit project unpacked successfully into target directory!
								[INFO]    Moving to the Fluent Bit project build directory...
								[INFO]    Building Fluent Bit (phase 1):

								[BUILDING_CODE_STARTS_HERE]
								...
  							
						

Source - Building phase completes

When the build completes successfully, the next step is to copy the build binaries to our target execution directory:
							
								...
								[INFO]    Fluent Bit built successfully!
								[INFO]    Copying to ./target/fluent-bit-4.0.3/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:
							
								[INFO]    =========================================================
								[INFO]    =                                                       =
								[INFO]    =  Install complete, get ready to rock Fluent Bit!      =
								[INFO]    =                                                       =
								[INFO]    =  The binary build is available to run at:             =
								[INFO]    =                                                       =
								[INFO]    =  $ cd target/fluent-bit-4.0.3/bin/fluent-bit          =
								[INFO]    =  $ bin/fluent-bit --version                           =
								[INFO]    =                                                       =
								[INFO]    =   Fluent Bit v4.0.3                                   =
								[INFO]    =                                                       =
								[INFO]    =  To get started building your first observability     =
								[INFO]    =  observability pipelines with real hands on           =
								[INFO]    =  examples, see below.                                 =
								[INFO]    =                                                       =
								[INFO]    =  Getting started workshop available online:           =
								[INFO]    =  https://o11y-workshops.gitlab.io/workshop-fluentbit  =
								[INFO]    =                                                       =
								[INFO]    =========================================================
  							
						

Lab completed - Results

							
								[INFO]    =========================================================
								[INFO]    =                                                       =
								[INFO]    =  Install complete, get ready to rock Fluent Bit!      =
								[INFO]    =                                                       =
								[INFO]    =  The binary build is available to run at:             =
								[INFO]    =                                                       =
								[INFO]    =  $ cd target/fluent-bit-4.0.3/bin/fluent-bit          =
								[INFO]    =  $ bin/fluent-bit --version                           =
								[INFO]    =                                                       =
								[INFO]    =   Fluent Bit v4.0.3                                   =
								[INFO]    =                                                       =
								[INFO]    =  To get started building your first observability     =
								[INFO]    =  observability pipelines with real hands on           =
								[INFO]    =  examples, see below.                                 =
								[INFO]    =                                                       =
								[INFO]    =  Getting started workshop available online:           =
								[INFO]    =  https://o11y-workshops.gitlab.io/workshop-fluentbit  =
								[INFO]    =                                                       =
								[INFO]    =========================================================
  							
						
Next up, exploring first pipelines...
references

Contact - are there any questions?

Eric D. Schabell
Director Evangelism
Contact: @ericschabell {@fosstodon.org) or https://www.schabell.org

Up next in workshop...

Lab 3 - Exploring first pipelines