How fluent/fluent-package-builder works
1. What this repository is
- fluent-package-builder is a packaging factory, not an application runtime.
- Its job is to produce installable artifacts for Fluentd-based products across Linux, Windows, and macOS, plus the repository metadata packages that let users install those artifacts from apt/yum.
2. Top-level control plane
- The root Rakefile is the main entry point.
- Ruby/Bundler code in lib/ defines the shared build tasks and helpers, while platform-specific subtrees provide inputs and packaging recipes.
- The root also contains CI, versioning, changelog, and release automation metadata.
3. Core build abstractions
- lib/package-task.rb and the family-specific builders in lib/apt/ and lib/yum/ are the central orchestration layer.
- These tasks read version/config data from fluent-package/config.rb and package dependency state from the Gemfiles/lockfiles.
- Their output is a set of distro-specific package build jobs, not a single monolithic build.
4. Product families / output boundaries
- fluent-package/ is the main product: the actual Fluent package installed under /opt/fluent.
- fluent-apt-source/ and fluent-lts-apt-source/ are helper Debian packages that install apt repo configuration and signing keys.
- fluent-release/ and fluent-lts-release/ are yum repo packages for the RPM ecosystem, again focused on repo setup and trust material rather than the application payload.
- This separation is important: application artifacts and repository-bootstrap artifacts are built and versioned independently.
5. Main Linux packaging pipeline
- fluent-package/apt/ and fluent-package/yum/ hold distro-specific container build roots.
- Each target directory contains a Dockerfile, base-image wiring, and sometimes qemu-dummy-static/from markers for cross-architecture builds.
- The build flow is: Ruby/Rake task chooses a target matrix, Docker builds the package in an isolated OS environment, and the resulting .deb or .rpm is published into repository layout directories.
6. Template-driven package contents
- fluent-package/templates/ contains the filesystem payload and service integration templates that become part of the package.
- These templates define config files, systemd units, tmpfiles rules, logrotate integration, shell wrappers, and macOS plist content.
- This is where the package’s install-time behavior is shaped: paths, service names, defaults, and command shims.
7. OS integration and service model
- The Linux package installs into standard system locations via templates under etc/, usr/, and service-management hooks.
- systemd integration is a first-class boundary: service units, tmpfiles, needrestart, and logrotate are all explicitly packaged.
- For macOS, the build produces a .dmg with .plist/package resources.
- For Windows, the msi/ subtree defines the installer layout, UI assets, post-install scripts, and WiX source.
8. Cross-platform packaging implementations
- fluent-package/msi/ is the Windows installer pipeline, driven by batch/PowerShell assets and a WiX source file.
- fluent-package/dmg/ is the macOS installer pipeline, with packaged resources and postinstall logic.
- These are separate from the Linux package builders, but they share versioning and some artifact content decisions through the Ruby build system.
9. Release repository mechanics
- fluent-package/manage-fluent-repositories.sh, convert-artifacts-layout.sh, and similar scripts indicate a second-stage artifact layout transformation.
- Repository packages and generated artifacts are arranged for consumption by apt/yum clients, with signing keys checked in under the relevant release/source subtrees.
- The repo therefore has both “build a package” and “package the package repository” concerns.
10. Testing and validation
- serverspec/ contains install/runtime verification for Linux, Windows, and Kafka/confluent-related scenarios.
- The apt/ and yum/ subtrees include install tests, systemd upgrade/downgrade tests, package-size checks, and service-specific validation scripts.
- Tests are containerized and target real package behavior after installation, which is critical because the architecture is packaging-centric rather than application-centric.
11. Architecture matrix and cross-build support
- GitHub Actions workflows in .github/workflows/ run matrix builds for apt/yum, macOS, Windows, bundle auditing, and release maintenance.
- AArch64 and ppc64le support is handled via target-specific directories and qemu-static injection when the host cannot natively execute the target architecture.
- This means build topology is intentionally multi-architecture and matrix-driven.
12. Data flow summary
- Source inputs: Ruby config, Gem dependencies, distro templates, signing keys, and package metadata.
- Build engine: Rake + Ruby helpers.
- Build isolation: Docker containers for Linux, Windows container tooling for MSI, local macOS tooling for DMG.
- Outputs: installable packages, repository bootstrap packages, and published repository layouts under family-specific output trees.
- Verification: Serverspec and install/systemd tests run against the generated artifacts before release.
13. How to draw the diagram
- Put Rake/Bundler/lib/ at the center as the orchestrator.
- Branch to four artifact families: Linux package build, repo-bootstrap packages, Windows MSI, and macOS DMG.
- Show Dockerized distro-specific build roots behind Linux packaging.
- Show signing/repository packages as a separate boundary from the main Fluent package payload.
- Show tests and GitHub Actions as surrounding validation/automation layers, not part of the runtime product.
Main entry points: package-task.rb Package tasks · fluent-package Fluent package · convert-artifacts-layout.sh Repo layout · workflows GitHub Actions
Components 20
Build orchestration
Shared Ruby/Rake build engine and configuration.
- Rakefile · Top-level build entry point.
Rakefile - Package tasks · Shared packaging task layer and helpers.
lib/package-task.rb - APT builder · Debian and Ubuntu package build logic.
lib/apt - YUM builder · RPM package build logic.
lib/yum - Config · Shared package version and build configuration.
fluent-package/config.rb - Gem deps · Bundler and Gem dependency inputs for reproducible builds.
fluent-package/Gemfile
Linux packaging
Deb and RPM package build roots plus distro-specific pipelines.
- Fluent package · Main Fluent package payload and distro packaging root.
fluent-package - APT roots · Containerized Debian and Ubuntu build environments.
fluent-package/apt - YUM roots · Containerized RPM build environments.
fluent-package/yum - Templates · Filesystem payload, service units, wrappers, and defaults.
fluent-package/templates - Repo layout · Artifact rearrangement for repository consumption.
fluent-package/convert-artifacts-layout.sh
Repo bootstrap
Packages that configure apt/yum repositories and trust.
- APT source pkg · Deb package that installs repo config and signing keys.
fluent-apt-source - LTS source pkg · LTS variant of the apt repository bootstrap package.
fluent-lts-apt-source - YUM release pkg · RPM repository package for the current release line.
fluent-release - LTS release pkg · RPM repository package for the LTS release line.
fluent-lts-release
Native installers
Windows MSI and macOS DMG packaging pipelines.
- Windows MSI · WiX-based Windows installer pipeline.
fluent-package/msi - macOS DMG · macOS disk image and package resources.
fluent-package/dmg
Validation
Install and service behavior checks for generated artifacts.
- Serverspec · Cross-platform install and runtime verification.
serverspec - Package tests · Distro-specific install, systemd, size, and upgrade tests.
fluent-package/apt
Automation
CI workflows and release maintenance.
- GitHub Actions · Matrix CI for apt, yum, macOS, Windows, and maintenance.
.github/workflows
Connections 20
- Rakefile → Package tasks: drives · Top-level build entry point delegates to shared packaging tasks.
- Package tasks → APT builder: orchestrates · Creates Debian and Ubuntu package build jobs.
- Package tasks → YUM builder: orchestrates · Creates RPM package build jobs.
- Package tasks → Config: reads · Uses shared version and package configuration.
- Package tasks → Gem deps: resolves · Uses bundled dependency state for reproducible builds.
- APT builder → Fluent package: builds · Builds the main Debian and Ubuntu package artifacts.
- YUM builder → Fluent package: builds · Builds the main RPM package artifacts.
- Fluent package → Templates: packages · Embeds filesystem payload and service integration templates.
- Fluent package → APT roots: uses · Distro build roots supply Debian and Ubuntu container environments.
- Fluent package → YUM roots: uses · Distro build roots supply RPM container environments.
- Fluent package → Repo layout: reformats · Transforms outputs into repository-friendly layouts.
- APT source pkg → Repo layout: publishes · Produces repository-facing apt bootstrap artifacts.
- LTS source pkg → Repo layout: publishes · Produces LTS repository-facing apt bootstrap artifacts.
- YUM release pkg → Repo layout: publishes · Produces repository-facing yum layout and metadata.
- LTS release pkg → Repo layout: publishes · Produces LTS repository-facing yum layout and metadata.
- Windows MSI → Package tasks: shares config · Windows installer shares versioning and build decisions.
- macOS DMG → Package tasks: shares config · macOS packaging shares versioning and build decisions.
- Serverspec → Package tests: verifies · Install and runtime checks exercise generated packages.
- GitHub Actions → Package tasks: runs · CI executes the packaging matrix and maintenance jobs.
- GitHub Actions → Serverspec: runs · CI runs validation suites against built artifacts.