fluent / fluent-package-builder

td-agent (Fluentd) Building and Packaging System
Apache License 2.0
21 stars 23 forks source link
amazonlinux2 centos debian fluentd package td-agent ubuntu windows

fluent-package-builder

About fluent-package-builder

fluent-package-builder (formerly known as td-agent-builder, it was renamed at Aug, 2021) is a new build system for td-agent which aims to replace the traditional build system omnibus-td-agent since it has several problems due to Omnibus's limitations.

NOTE: Discussed why re-branding is required Rebranding td-agent-builder

Changes from Treasure Agent 4

Changes from Treasure Agent 3

See also this issue for omnibus problems.

Prerequisites

For building .rpm & .deb packages

For building Windows package (.msi)

After installed above software, you need to enable additional features from powershell (as admin).

dism.exe /online /enable-feature /featurename:Microsoft-Hyper-V /all /norestart
dism.exe /online /enable-feature /featurename:Containers /all /norestart

Then restart Windows.

For building macOS package (.dmg)

How to build .rpm package

% rake yum:build

By default, yum repositories for following platforms will be built under fluent-package/yum/repositories/ directory:

You can choose target platforms by YUM_TARGETS environment variable like this:

% rake yum:build YUM_TARGETS="centos-7,rockylinux-8,almalinux-9"

You can find other supported platforms under fluent-package/yum directory.

Note for AArch64 platforms

You can also build packages for AArch64 platforms like this:

% rake yum:build YUM_TARGETS="amazonlinux-2023-aarch64"

But if you use older GNU/Linux platforms (e.g. Ubuntu 18.04 or before) as your host OS, you need to copy qemu-aarch64-static into the base directory of the target:

% export TARGET_BASE="centos-8"
% sudo apt install qemu-user-static
% cd /path/to/fluent-package-builder
% cp /usr/bin/qemu-aarch64-static fluent-package/yum/${TARGET_BASE}
% rake yum:build YUM_TARGETS="${TARGET_BASE}-aarch64"

Note for ppc64le platform

You can also build packages for ppc64le platform like this:

% rake yum:build YUM_TARGETS="centos-8-ppc64le"

But if you use older GNU/Linux platforms (e.g. Ubuntu 18.04 or before) as your host OS, you need to copy qemu-ppc64le-static into the base directory of the target:

% export TARGET_BASE="centos-8"
% sudo apt install qemu-user-static
% cd /path/to/fluent-package-builder
% cp /usr/bin/qemu-ppc64le-static fluent-package/yum/${TARGET_BASE}
% rake yum:build YUM_TARGETS="${TARGET_BASE}-ppc64le"

How to build .deb package

% rake apt:build

By default, apt repositories for following platforms will be built under fluent-package/apt/repositories/ directory:

You can choose target platforms by APT_TARGETS environment variable like this:

% rake apt:build APT_TARGETS="debian-bookworm,ubuntu-jammy"

You can find other supported platforms under fluent-package/apt directory.

Note for AArch64 platforms

You can also built packages for AArch64 platforms like this:

% rake apt:build APT_TARGETS="ubuntu-jammy-arm64"

But if you use older GNU/Linux platforms (e.g. Ubuntu 18.04 or before) as your host OS, you need to copy qemu-aarch64-static into the base directory of the target:

% export TARGET_BASE="ubuntu-bionic"
% sudo apt install qemu-user-static
% cd /path/to/fluent-package-builder
% cp /usr/bin/qemu-aarch64-static fluent-package/apt/${TARGET_BASE}
% rake apt:build APT_TARGETS="${TARGET_BASE}-arm64"

How to build .msi package

% rake msi:build

A fluent-package-${version}-x64.msi package will be built under fluent-package/msi directory.

Note for Windows package

You can use with MSYS2 for C extension gem building.

MSI included Ruby can detect MSYS2 environment. So, you can install C extension included gem with MSYS2.

e.g.)

Prepare C extension gem building environment:

cmd> ridk install 2
...
cmd> ridk install 3

Install gem via ridk exec fluent-gem install:

cmd> ridk exec fluent-gem install winevt_c

How to build .dmg package

% sudo mkdir /opt/fluent
% sudo chown $(whoami) /opt/fluent
% rake dmg:selfbuild

A fluent-package-${version}.dmg package will be built under fluent-package/dmg directory.

Note for macOS package

GitHub Actions' built package is ready to run on macOS 10.15 (Catalina).

Be sure to permit to be authorized for for assistive access. In System Preferences > Security & Privacy > Privacy > Accessibility, you should permit Terminal.app there.

NOTE: Since authorization is at the application level on Terminal.app, it allows any script run from Terminal.app to perform GUI scripting.

How to bump up the package version

Note for bump up the package version

It assumes that Gemfile works with Bundler's multiplatform feature, so bundler must be 2.2.0 or later.