Skip to content

Commit 17004ca

Browse files
patrick-stephensedsiper
authored andcommitted
packaging: completely remove td-agent-bit builds
Signed-off-by: Patrick Stephens <pat@calyptia.com>
1 parent d6dc1e9 commit 17004ca

32 files changed

+228
-960
lines changed

.github/workflows/build-branch-containers.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build containers for a specific branch
1+
name: Build containers for a specific branch of 1.9+
22
on:
33
workflow_dispatch:
44
inputs:
@@ -8,7 +8,7 @@ on:
88
default: master
99
jobs:
1010
build-branch-containers:
11-
uses: fluent/fluent-bit/.github/workflows/call-build-images.yaml@master
11+
uses: ./.github/workflows/call-build-images.yaml
1212
with:
1313
version: ${{ github.event.inputs.version }}
1414
ref: ${{ github.event.inputs.version }}

.github/workflows/build-master-packages.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- id: set-matrix
2626
run: |
2727
matrix=$((
28-
echo '{ "distro" : [ "debian/bullseye", "ubuntu/16.04", "ubuntu/18.04", "ubuntu/20.04" ]}'
28+
echo '{ "distro" : [ "debian/bullseye", "ubuntu/20.04", "ubuntu/22.04", "centos/7" ]}'
2929
) | jq -c .)
3030
if [ -n "${{ github.event.inputs.target || '' }}" ]; then
3131
echo "Overriding matrix to build: ${{ github.event.inputs.target }}"
@@ -42,7 +42,7 @@ jobs:
4242

4343
master-build-packages:
4444
needs: master-build-generate-matrix
45-
uses: fluent/fluent-bit/.github/workflows/call-build-linux-packages.yaml@master
45+
uses: ./.github/workflows/call-build-linux-packages.yaml
4646
with:
4747
version: master
4848
ref: master

.github/workflows/call-build-images.yaml

+11-167
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ on:
3232
description: Optionally add metadata to build to indicate an unstable build, set to the contents you want to add.
3333
type: string
3434
required: false
35-
default: ''
35+
default: ""
3636
secrets:
3737
token:
3838
description: The Github token or similar to authenticate with for the registry.
@@ -47,7 +47,6 @@ jobs:
4747
call-build-images-meta:
4848
name: Extract any supporting metadata
4949
outputs:
50-
build-type: ${{ steps.determine-build-type.outputs.BUILD_TYPE }}
5150
major-version: ${{ steps.determine-major-version.outputs.replaced }}
5251
runs-on: ubuntu-latest
5352
environment: ${{ inputs.environment }}
@@ -59,171 +58,20 @@ jobs:
5958
with:
6059
ref: ${{ inputs.ref }}
6160

62-
# Determine if this is a 1.8 type of build which is different
63-
- name: Determine build type
64-
id: determine-build-type
65-
run: |
66-
BUILD_TYPE="1.8"
67-
if [[ -f "dockerfiles/Dockerfile" ]]; then
68-
BUILD_TYPE="modern"
69-
fi
70-
echo "Detected type: $BUILD_TYPE"
71-
echo ::set-output name=BUILD_TYPE::$BUILD_TYPE
72-
shell: bash
73-
74-
# For main branch/releases we want to also tag with the major version.
61+
# For main branch/releases we want to tag with the major version.
7562
# E.g. if we build version 1.9.2 we want to tag with 1.9.2 and 1.9.
7663
- name: Determine major version tag
7764
id: determine-major-version
7865
uses: frabert/replace-string-action@v2.2
7966
with:
8067
pattern: '^(\d+\.\d+).*$'
8168
string: ${{ inputs.version }}
82-
replace-with: '$1'
83-
flags: 'g'
84-
85-
# For 1.8 builds it is a little more complex so we have this build matrix to handle it.
86-
# This creates separate images for each architecture.
87-
# The later step then creates a multi-arch manifest for all of these.
88-
call-build-legacy-images-matrix:
89-
if: needs.call-build-images-meta.outputs.build-type == '1.8'
90-
name: Build single arch legacy images
91-
runs-on: ubuntu-latest
92-
environment: ${{ inputs.environment }}
93-
needs:
94-
- call-build-images-meta
95-
strategy:
96-
fail-fast: false
97-
matrix:
98-
arch: [ amd64, arm64, arm/v7 ]
99-
include:
100-
- arch: amd64
101-
suffix: x86_64
102-
- arch: arm/v7
103-
suffix: arm32v7
104-
- arch: arm64
105-
suffix: arm64v8
106-
permissions:
107-
contents: read
108-
packages: write
109-
steps:
110-
- name: Checkout the docker build repo for legacy builds
111-
uses: actions/checkout@v3
112-
with:
113-
repository: fluent/fluent-bit-docker-image
114-
ref: '1.8' # Fixed to this branch
115-
116-
- name: Set up QEMU
117-
uses: docker/setup-qemu-action@v2
118-
119-
- name: Set up Docker Buildx
120-
uses: docker/setup-buildx-action@v2
121-
122-
- name: Log in to the Container registry
123-
uses: docker/login-action@v2
124-
with:
125-
registry: ${{ inputs.registry }}
126-
username: ${{ inputs.username }}
127-
password: ${{ secrets.token }}
128-
129-
- id: debug-meta
130-
uses: docker/metadata-action@v4
131-
with:
132-
images: ${{ inputs.registry }}/${{ inputs.image }}
133-
tags: |
134-
raw,${{ inputs.version }}-debug
135-
raw,${{ needs.call-build-images-meta.outputs.major-version }}-debug
136-
137-
- name: Build the legacy x86_64 debug image
138-
if: matrix.arch == 'amd64'
139-
uses: docker/build-push-action@v3
140-
with:
141-
file: ./Dockerfile.x86_64.debug
142-
context: .
143-
tags: ${{ steps.debug-meta.outputs.tags }}
144-
labels: ${{ steps.debug-meta.outputs.labels }}
145-
platforms: linux/amd64
146-
push: true
147-
load: false
148-
build-args: |
149-
FLB_TARBALL=https://github.com/fluent/fluent-bit/tarball/${{ inputs.ref }}
150-
151-
- name: Extract metadata from Github
152-
id: meta
153-
uses: docker/metadata-action@v4
154-
with:
155-
images: ${{ inputs.registry }}/${{ inputs.image }}
156-
tags: |
157-
raw,${{ matrix.suffix }}-${{ inputs.version }}
158-
159-
- name: Build the legacy ${{ matrix.arch }} image
160-
uses: docker/build-push-action@v3
161-
with:
162-
file: ./Dockerfile.${{ matrix.suffix }}
163-
context: .
164-
tags: ${{ steps.meta.outputs.tags }}
165-
labels: ${{ steps.meta.outputs.labels }}
166-
platforms: linux/${{ matrix.arch }}
167-
push: true
168-
load: false
169-
build-args: |
170-
FLB_TARBALL=https://github.com/fluent/fluent-bit/tarball/${{ inputs.ref }}
171-
172-
# Create a multi-arch manifest for the separate 1.8 images.
173-
call-build-legacy-image-manifests:
174-
if: needs.call-build-images-meta.outputs.build-type == '1.8'
175-
name: Deploy multi-arch container image manifests
176-
permissions:
177-
contents: read
178-
packages: write
179-
runs-on: ubuntu-latest
180-
environment: ${{ inputs.environment }}
181-
needs:
182-
- call-build-images-meta
183-
- call-build-legacy-images-matrix
184-
steps:
185-
- name: Set up Docker Buildx
186-
uses: docker/setup-buildx-action@v2
187-
188-
- name: Log in to the Container registry
189-
uses: docker/login-action@v2
190-
with:
191-
registry: ${{ inputs.registry }}
192-
username: ${{ inputs.username }}
193-
password: ${{ secrets.token }}
194-
195-
- name: Pull all the images
196-
# Use platform to trigger warnings on invalid image metadata
197-
run: |
198-
docker pull --platform=linux/amd64 ${{ inputs.registry }}/${{ inputs.image }}:x86_64-${{ inputs.version }}
199-
docker pull --platform=linux/arm64 ${{ inputs.registry }}/${{ inputs.image }}:arm64v8-${{ inputs.version }}
200-
docker pull --platform=linux/arm/v7 ${{ inputs.registry }}/${{ inputs.image }}:arm32v7-${{ inputs.version }}
201-
202-
- name: Create manifests for images
203-
# Latest is 1.9, not 1.8 now
204-
run: |
205-
docker manifest create ${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.version }} \
206-
--amend ${{ inputs.registry }}/${{ inputs.image }}:x86_64-${{ inputs.version }} \
207-
--amend ${{ inputs.registry }}/${{ inputs.image }}:arm64v8-${{ inputs.version }} \
208-
--amend ${{ inputs.registry }}/${{ inputs.image }}:arm32v7-${{ inputs.version }}
209-
docker manifest push --purge ${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.version }}
210-
env:
211-
DOCKER_CLI_EXPERIMENTAL: enabled
212-
shell: bash
213-
214-
- name: Create major version manifest
215-
if: needs.call-build-images-meta.outputs.major-version != inputs.version
216-
run: |
217-
docker manifest push --purge ${{ inputs.registry }}/${{ inputs.image }}:${{ needs.call-build-images-meta.outputs.major-version }}
218-
env:
219-
DOCKER_CLI_EXPERIMENTAL: enabled
220-
shell: bash
69+
replace-with: "$1"
70+
flags: "g"
22171

22272
# This is the intended approach to multi-arch image and all the other checks scanning,
22373
# signing, etc only trigger from this.
224-
# 1.8 images are legacy and were not scanned or signed previously so this keeps it simple.
22574
call-build-images:
226-
if: needs.call-build-images-meta.outputs.build-type != '1.8'
22775
needs:
22876
- call-build-images-meta
22977
name: Multiarch container images to GHCR
@@ -304,7 +152,6 @@ jobs:
304152
needs:
305153
- call-build-images-meta
306154
- call-build-images
307-
if: needs.call-build-images-meta.outputs.build-type != '1.8'
308155
runs-on: ubuntu-latest
309156
environment: ${{ inputs.environment }}
310157
permissions:
@@ -332,7 +179,6 @@ jobs:
332179
if-no-files-found: error
333180

334181
call-build-images-scan:
335-
if: needs.call-build-images-meta.outputs.build-type != '1.8'
336182
needs:
337183
- call-build-images-meta
338184
- call-build-images
@@ -353,22 +199,21 @@ jobs:
353199
- name: Trivy - multi-arch
354200
uses: aquasecurity/trivy-action@master
355201
with:
356-
image-ref: '${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.version }}'
357-
format: 'table'
358-
exit-code: '1'
202+
image-ref: "${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.version }}"
203+
format: "table"
204+
exit-code: "1"
359205
ignore-unfixed: true
360-
vuln-type: 'os,library'
361-
severity: 'CRITICAL,HIGH'
206+
vuln-type: "os,library"
207+
severity: "CRITICAL,HIGH"
362208

363209
- name: Dockle - multi-arch
364210
uses: hands-lab/dockle-action@v1
365211
with:
366-
image: '${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.version }}'
367-
exit-code: '1'
212+
image: "${{ inputs.registry }}/${{ inputs.image }}:${{ inputs.version }}"
213+
exit-code: "1"
368214
exit-level: WARN
369215

370216
call-build-images-sign:
371-
if: needs.call-build-images-meta.outputs.build-type != '1.8'
372217
needs:
373218
- call-build-images-meta
374219
- call-build-images
@@ -428,7 +273,6 @@ jobs:
428273

429274
# This takes a long time...
430275
call-build-windows-container:
431-
if: needs.call-build-images-meta.outputs.build-type != '1.8'
432276
name: Windows container image
433277
runs-on: windows-2019
434278
environment: ${{ inputs.environment }}

0 commit comments

Comments
 (0)