Skip to content

Commit 4895b64

Browse files
ci: documentation (#7530)
* workflows: add release process Signed-off-by: Patrick Stephens <pat@calyptia.com> * packaging: update build info Signed-off-by: Patrick Stephens <pat@calyptia.com> * packaging: update scripts and remove unnecessary stuff Signed-off-by: Patrick Stephens <pat@calyptia.com> * workflows: add info for all CI Signed-off-by: Patrick Stephens <pat@calyptia.com> --------- Signed-off-by: Patrick Stephens <pat@calyptia.com>
1 parent e22bdcb commit 4895b64

24 files changed

+225
-695
lines changed

.github/workflows/README.md

+156-8
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
| Label name | Description |
2222
| :----------|-------------|
2323
| docs-required| default tag used to request documentation, has to be removed before merge |
24-
| ok-package-test | run all package tests |
24+
| ok-package-test | Build for all possible targets |
2525
| ok-to-test | run all integration tests |
2626
| ok-to-merge | run mergebot and merge (rebase) current PR |
2727
| ci/integration-docker-ok | integration test is able to build docker image |
@@ -66,14 +66,162 @@ For some reason this is not automatically done via permission inheritance or sim
6666

6767
Each major version (e.g. 1.8 & 1.9) supports different targets to build for, e.g. 1.9 includes a CentOS 8 target and 1.8 has some other legacy targets.
6868

69-
This is all handled by the [build matrix generation composite action](../actions/generate-package-build-matrix/action.yaml) so make sure to update appropriately.
70-
The build matrix is then fed into the reusable job that builds packages which will then fire for the appropriate targets.
69+
This is all handled by the [build matrix generation composite action](../actions/generate-package-build-matrix/action.yaml).
70+
This uses a [JSON file](../../packaging/build-config.json) to specify the targets so ensure this is updated.
71+
The build matrix is then fed into the [reusable job](./call-build-linux-packages.yaml) that builds packages which will then fire for the appropriate targets.
72+
The reusable job is used for all package builds including unstable/nightly and the PR `ok-package-test` triggered ones.
7173

7274
## Releases
7375

74-
Currently the process is as follows:
76+
The process at a high level is as follows:
7577

76-
1. Tag the source with whatever tag you like on master.
77-
2. The [`Deploy to staging`](./staging-build.yaml) workflow will then kick in to build everything and upload it either to the S3 staging bucket (packages) or ghcr.io (containers).
78-
3. Once this completes, the [`Test staging`](./staging-test.yaml) workflow will then run to carry out smoke tests on these packages and containers.
79-
4. The [`Release from staging`](./staging-release.yaml) workflow can then be manually initiated to promote staging to release.
78+
1. Tag created with `v` prefix.
79+
2. [Deploy to staging](https://github.com/fluent/fluent-bit/actions/workflows/staging-build.yaml) workflow runs.
80+
3. [Test staging](https://github.com/fluent/fluent-bit/actions/workflows/staging-test.yaml) workflow runs.
81+
4. Manually initiate [release from staging](https://github.com/fluent/fluent-bit/actions/workflows/staging-release.yaml) workflow.
82+
5. A PR is auto-created to increment the minor version now for Fluent Bit using the [`update_version.sh`](../../update_version.sh) script.
83+
6. Create PRs for doc updates - Windows & container versions. (WIP to automate).
84+
85+
Breaking the steps down.
86+
87+
### Deploy to staging and test
88+
89+
This should run automatically when a tag is created matching the `v*` regex.
90+
It currently copes with 1.8+ builds although automation is only exercised for 1.9+ releases.
91+
92+
Once this is completed successfully the staging tests should also run automatically.
93+
94+
![Workflows for staging and test example](./resources/auto-build-test-workflow.png "Example of workflows for build and test")
95+
96+
If both complete successfully then we are good to go.
97+
98+
Occasional failures are seen with package builds not downloading dependencies (CentOS 7 in particular seems bad for this).
99+
A re-run of failed jobs should resolve this.
100+
101+
The workflow builds all Linux, macOS and Windows targets to a staging S3 bucket plus the container images to ghcr.io.
102+
103+
### Release from staging workflow
104+
105+
This is a manually initiated workflow, the intention is multiple staging builds can happen but we only release one.
106+
Note that currently we do not support parallel staging builds of different versions, e.g. master and 1.9 branches.
107+
**We can only release the previous staging build and there is a check to confirm version.**
108+
109+
Ensure AppVeyor build for the tag has completed successfully as well.
110+
111+
To trigger: <https://github.com/fluent/fluent-bit/actions/workflows/staging-release.yaml>
112+
113+
All this job does is copy the various artefacts from staging locations to release ones, it does not rebuild them.
114+
115+
![Workflow for release example](./resources/release-from-staging-workflow-incorrect-version.png "Example of workflow for release")
116+
117+
With this example you can see we used the wrong `version` as it requires it without the `v` prefix (it is used for container tag, etc.) and so it fails.
118+
119+
![Workflow for release failure example](./resources/release-version-failure.png "Example of failing workflow for release")
120+
121+
Make sure to provide without the `v` prefix.
122+
123+
![Workflow for release example](./resources/release-from-staging-workflow.png "Example of successful workflow for release")
124+
125+
Once this workflow is initiated you then also need to have it approved by the designated "release team" otherwise it will not progress.
126+
127+
![Release approval example](./resources/release-approval.png "Release approval example")
128+
129+
They will be notified for approval by Github.
130+
Unfortunately it has to be approved for each job in the sequence rather than a global approval for the whole workflow although that can be useful to check between jobs.
131+
132+
![Release approval per-job required](./resources/release-approval-per-job.png "Release approval per-job required")
133+
134+
This is quite useful to delay the final smoke test of packages until after the manual steps are done as it will then verify them all for you.
135+
136+
#### Packages server sync
137+
138+
The workflow above ensures all release artefacts are pushed to the appropriate container registry and S3 bucket for official releases.
139+
The packages server then periodically syncs from this bucket to pull down and serve the new packages so there may be a delay (up to 1 hour) before it serves the new versions.
140+
The syncs happen hourly.
141+
See <https://github.com/fluent/fluent-bit-infra/blob/main/terraform/provision/package-server-provision.sh.tftpl> for details of the dedicated packages server.
142+
143+
The main reason for a separate server is to accurately track download statistics.
144+
Container images are handled by ghcr.io and Docker Hub, not this server.
145+
146+
#### Transient container publishing failures
147+
148+
The parallel publishing of multiple container tags for the same image seems to fail occasionally with network errors, particularly more for ghcr.io than DockerHub.
149+
This can be resolved by just re-running the failed jobs.
150+
151+
#### Windows builds from AppVeyor
152+
153+
This is automated, however confirm that the actual build is successful for the tag: <https://ci.appveyor.com/project/fluent/fluent-bit-2e87g/history>
154+
If not then ask a maintainer to retrigger.
155+
156+
It can take a while to find the one for the specific tag...
157+
158+
#### ARM builds
159+
160+
All builds are carried out in containers and intended to be run on a valid Ubuntu host to match a standard Github Actions runner.
161+
This can take some time for ARM as we have to emulate the architecture via QEMU.
162+
163+
<https://github.com/fluent/fluent-bit/pull/7527> introduces support to run ARM builds on a dedicated <actuated.dev> ephemeral VM runner.
164+
A self-hosted ARM runner is set up and provisioned for this per the [documentation](https://docs.actuated.dev/provision-server/).
165+
For forks, this should all be skipped and run on a normal Ubuntu Github hosted runner but be aware this may take some time.
166+
167+
### Manual release
168+
169+
As long as it is built to staging we can manually publish packages as well via the script here: <https://github.com/fluent/fluent-bit/blob/master/packaging/update-repos.sh>
170+
171+
Containers can be promoted manually too, ensure to include all architectures and signatures.
172+
173+
### Create PRs
174+
175+
Once releases are published we need to provide PRs for the following documentation updates:
176+
177+
1. Windows checksums: <https://docs.fluentbit.io/manual/installation/windows#installation-packages>
178+
2. Container versions: <https://docs.fluentbit.io/manual/installation/docker#tags-and-versions>
179+
180+
<https://github.com/fluent/fluent-bit-docs> is the repo for updates to docs.
181+
182+
Take the checksums from the release process above, the AppVeyor stage provides them all and we attempt to auto-create the PR with it.
183+
184+
## Unstable/nightly builds
185+
186+
These happen every 24 hours and [reuse the same workflow](./cron-unstable-build.yaml) as the staging build so are identical except they skip the upload to S3 step.
187+
This means all targets are built nightly for `master` and `2.0` branches including container images and Linux, macOS and Windows packages.
188+
189+
The container images are available here (the tag refers to the branch):
190+
191+
* [ghcr.io/fluent/fluent-bit/unstable:2.0](ghcr.io/fluent/fluent-bit/unstable:2.0)
192+
* [ghcr.io/fluent/fluent-bit/unstable:master](ghcr.io/fluent/fluent-bit/unstable:master)
193+
* [ghcr.io/fluent/fluent-bit/unstable:windows-2019-2.0](ghcr.io/fluent/fluent-bit/unstable:windows-2019-2.0)
194+
* [ghcr.io/fluent/fluent-bit/unstable:windows-2019-master](ghcr.io/fluent/fluent-bit/unstable:windows-2019-master)
195+
196+
The Linux, macOS and Windows packages are available to download from the specific workflow run.
197+
198+
## Integration tests
199+
200+
On every commit to `master` we rebuild the [packages](./build-master-packages.yaml) and [container images](./master-integration-test.yaml).
201+
The container images are then used to [run the integration tests](./master-integration-test.yaml) from the <https://github.com/fluent/fluent-bit-ci> repository.
202+
The container images are available as:
203+
204+
* [ghcr.io/fluent/fluent-bit/master:x86_64](ghcr.io/fluent/fluent-bit/master:x86_64)
205+
206+
## PR checks
207+
208+
Various workflows are run for PRs automatically:
209+
210+
* [Unit tests](./unit-tests.yaml)
211+
* [Compile checks on CentOS 7 compilers](./pr-compile-check.yaml)
212+
* [Linting](./pr-lint.yaml)
213+
* [Windows builds](./pr-windows-build.yaml)
214+
* [Fuzzing](./pr-fuzz.yaml)
215+
* [Container image builds](./pr-image-tests.yaml)
216+
* [Install script checks](./pr-install-script.yaml)
217+
218+
We try to guard these to only trigger when relevant files are changed to reduce any delays or resources used.
219+
**All should be able to be triggered manually for explicit branches as well.**
220+
221+
The following workflows can be triggered manually for specific PRs too:
222+
223+
* [Integration tests](./pr-integration-test.yaml): Build a container image and run the integration tests as per commits to `master`.
224+
* [Performance tests](./pr-perf-test.yaml): WIP to trigger a performance test on a dedicated VM and collect the results as a PR comment.
225+
* [Full package build](./pr-package-tests.yaml): builds all Linux, macOs and Windows packages as well as container images.
226+
227+
To trigger these, apply the relevant label.

.github/workflows/remove-release.yaml

-64
This file was deleted.
Loading
Loading
Loading
Loading
Loading
Loading

packaging/README.md

+52-40
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,64 @@
11
# Fluent Bit Packaging
22

3-
This directory contains Docker files used to build [Fluent Bit](http://fluentbit.io) Linux packages for different distros, the following table describe the supported targets:
4-
5-
| Distro | Version / Code Name | Arch | Target Option |
6-
|--------------|---------------------------|---------|-------------------------|
7-
| AmazonLinux | 2 | x86_64 | amazonlinux/2 |
8-
| AmazonLinux | 2 | arm64v8 | amazonlinux/2.arm64v8 |
9-
| CentOS | 8 | x86_64 | centos/8 |
10-
| CentOS | 8 | arm64v8 | centos/8.arm64v8 |
11-
| CentOS | 7 | x86_64 | centos/7 |
12-
| CentOS | 7 | arm64v8 | centos/7.arm64v8 |
13-
| Debian | 12 | x86_64 | debian/bookworm |
14-
| Debian | 12 | arm64v8 | debian/bookworm.arm64v8 |
15-
| Debian | 11 | x86_64 | debian/bullseye |
16-
| Debian | 11 | arm64v8 | debian/bullseye.arm64v8 |
17-
| Debian | 10 | x86_64 | debian/buster |
18-
| Debian | 10 | arm64v8 | debian/buster.arm64v8 |
19-
| Ubuntu | 22.04 / Jammy Jellyfish | x86_64 | ubuntu/22.04 |
20-
| Ubuntu | 22.04 / Jammy Jellyfish | arm64v8 | ubuntu/22.04.arm64v8 |
21-
| Ubuntu | 20.04 / Focal Fossa | x86_64 | ubuntu/20.04 |
22-
| Ubuntu | 20.04 / Focal Fossa | arm64v8 | ubuntu/20.04.arm64v8 |
23-
| Ubuntu | 18.04 / Bionic Beaver | x86_64 | ubuntu/18.04 |
24-
| Ubuntu | 18.04 / Bionic Beaver | arm64v8 | ubuntu/18.04.arm64v8 |
25-
| Ubuntu | 16.04 / Xenial Xerus | x86_64 | ubuntu/16.04 |
26-
| Raspbian | 11 / Bullseye | arm32v7 | raspbian/bullseye |
27-
| Raspbian | 10 / Buster | arm32v7 | raspbian/buster |
28-
29-
## Usage
3+
This directory contains files to support building and releasing Fluent Bit.
4+
5+
For PRs, add the `ok-package-test` label to trigger an automated build of all supported Linux, macOS, Windows and container image targets to verify a PR correctly builds for all supported platforms.
6+
This can take some time to complete so is only triggered via the label on-demand.
7+
8+
## Linux
9+
10+
The [`distros`](./distros/) directory contains OCI container definitions used to build [Fluent Bit](http://fluentbit.io) Linux packages for different distros, the following table describe the supported targets:
11+
12+
| Distro | Version / Code Name | Arch | Target Option |
13+
|---------------|---------------------------|---------|--------------------------|
14+
| AmazonLinux | 2 | x86_64 | amazonlinux/2 |
15+
| AmazonLinux | 2 | arm64v8 | amazonlinux/2.arm64v8 |
16+
| AmazonLinux | 2023 | x86_64 | amazonlinux/2023 |
17+
| AmazonLinux | 2023 | arm64v8 | amazonlinux/2023.arm64v8 |
18+
| CentOS Stream | 9 | x86_64 | centos/9 |
19+
| CentOS Stream | 9 | arm64v8 | centos/9.arm64v8 |
20+
| CentOS | 8 | x86_64 | centos/8 |
21+
| CentOS | 8 | arm64v8 | centos/8.arm64v8 |
22+
| CentOS | 7 | x86_64 | centos/7 |
23+
| CentOS | 7 | arm64v8 | centos/7.arm64v8 |
24+
| Debian | 12 | x86_64 | debian/bookworm |
25+
| Debian | 12 | arm64v8 | debian/bookworm.arm64v8 |
26+
| Debian | 11 | x86_64 | debian/bullseye |
27+
| Debian | 11 | arm64v8 | debian/bullseye.arm64v8 |
28+
| Debian | 10 | x86_64 | debian/buster |
29+
| Debian | 10 | arm64v8 | debian/buster.arm64v8 |
30+
| Ubuntu | 22.04 / Jammy Jellyfish | x86_64 | ubuntu/22.04 |
31+
| Ubuntu | 22.04 / Jammy Jellyfish | arm64v8 | ubuntu/22.04.arm64v8 |
32+
| Ubuntu | 20.04 / Focal Fossa | x86_64 | ubuntu/20.04 |
33+
| Ubuntu | 20.04 / Focal Fossa | arm64v8 | ubuntu/20.04.arm64v8 |
34+
| Ubuntu | 18.04 / Bionic Beaver | x86_64 | ubuntu/18.04 |
35+
| Ubuntu | 18.04 / Bionic Beaver | arm64v8 | ubuntu/18.04.arm64v8 |
36+
| Ubuntu | 16.04 / Xenial Xerus | x86_64 | ubuntu/16.04 |
37+
| Raspbian | 11 / Bullseye | arm32v7 | raspbian/bullseye |
38+
| Raspbian | 10 / Buster | arm32v7 | raspbian/buster |
39+
40+
These container images are intended to be built from the root of this repo to build the locally checked out/updated version of the source easily for any target.
41+
42+
### Usage
3043

3144
The _build.sh_ script can be used to build packages for a specific target, the command understand the following format:
3245

33-
```
34-
$ ./build.sh -v VERSION -d DISTRO [-b BRANCH_NAME] [-t TARBALL]
46+
```shell
47+
./build.sh -d DISTRO
3548
```
3649

37-
Details about the script parameters:
50+
Replace `DISTRO` with the `Target option` column above.
3851

39-
| Name | Description | Example |
40-
|-------------|----------------------------------|------------------------|
41-
| VERSION | Github Tag or version number | 1.3.x |
42-
| TARGET | Target platform for the packages | ubuntu/18.04 |
52+
All Linux builds happen in a container so can be run on any supported platform with QEMU installed and a container runtime.
4353

44-
Optionally the script supports the option __-b__ to specify a custom branch, this is useful to package and test _master_ or specific branches.
54+
## Windows
4555

46-
### Build examples
56+
Windows builds are carried out by the [dedicated workflow](../.github/workflows/call-build-windows.yaml) in CI.
57+
This builds using the standard CMake process on a dedicated Windows runner within Github actions.
58+
The steps involved and additional requirements can all be found there.
4759

48-
#### Package version 1.3.1 for Ubuntu 18.04:
60+
## macOS
4961

50-
```
51-
$ ./build.sh -v 1.3.1 -d ubuntu/18.04
52-
```
62+
Windows builds are carried out by the [dedicated workflow](../.github/workflows/call-build-macos.yaml) in CI.
63+
This builds using the standard CMake process on a dedicated macOS runner within Github actions.
64+
The steps involved and additional requirements can all be found there.

packaging/appveyor-download.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
# Used during the release process to automatically pull the tagged build from AppVeyor
23
set -eux
34

45
TAG=${TAG:?}

packaging/build.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
# Build a specific Linux target using the local source code via a container image
23
set -eux
34

45
# Never rely on PWD so we can invoke from anywhere

0 commit comments

Comments
 (0)