-
Notifications
You must be signed in to change notification settings - Fork 29
442 lines (438 loc) · 17.5 KB
/
yum.yml
File metadata and controls
442 lines (438 loc) · 17.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
name: Yum based Linux
on:
push:
branches:
- master
- fluent-package-v5
pull_request:
concurrency:
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
define-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
label: ${{ steps.set-matrix.outputs.label }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
# See https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#example-returning-a-json-object
run: |
echo "matrix=$(cat yum.matrix.json | jq --compact-output)" >> $GITHUB_OUTPUT
echo "label=$(cat yum.matrix.json | jq '[.include[].label]' --compact-output)" >> $GITHUB_OUTPUT
working-directory: .github/workflows/
build:
needs: define-matrix
name: Build
timeout-minutes: 120
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: cache rpm
uses: actions/cache@v4
id: cache-rpm
with:
path: |
fluent-package/yum/repositories
fluent-release/yum/repositories
fluent-lts-release/yum/repositories
v7-test/fluent-package/yum/repositories
key: ${{ runner.os }}-cache-${{ matrix.rake-job }}-${{ hashFiles('**/config.rb', '**/Rakefile', '**/Gemfile*', '**/*.spec.in', 'fluent-package/templates/**', 'fluent-package/yum/**/Dockerfile') }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
- name: Install dependencies
if: ${{ ! steps.cache-rpm.outputs.cache-hit }}
run: |
gem install serverspec --no-document
- name: Build rpm with Docker
if: ${{ ! steps.cache-rpm.outputs.cache-hit }}
run: |
rake yum:build YUM_TARGETS=${{ matrix.rake-job }}
- uses: actions/checkout@v4
if: ${{ ! steps.cache-rpm.outputs.cache-hit }}
with:
path: v7-test
- name: Build v7 rpm with Docker
if: ${{ ! steps.cache-rpm.outputs.cache-hit }}
run: |
cd v7-test
git config user.email "fluentd@googlegroups.com"
git config user.name "Fluentd developers"
git am fluent-package/bump-version-v7.patch
rake yum:build YUM_TARGETS=${{ matrix.rake-job }}
- name: Upload fluent-package rpm
uses: actions/upload-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/yum/repositories
- name: Upload fluent-release rpm
uses: actions/upload-artifact@v4
with:
name: packages-release-${{ matrix.rake-job }}
path: fluent-release/yum/repositories
- name: Upload fluent-lts-release rpm
uses: actions/upload-artifact@v4
with:
name: packages-lts-release-${{ matrix.rake-job }}
path: fluent-lts-release/yum/repositories
- name: Upload v7 fluent-package rpm
uses: actions/upload-artifact@v4
with:
name: v7-packages-${{ matrix.rake-job }}
path: v7-test/fluent-package/yum/repositories
check_package_size:
name: Check Package Size
runs-on: ubuntu-latest
needs: [define-matrix, build]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/yum/repositories
- name: Check Package Size
run: |
fluent-package/yum/pkgsize-test.sh ${{ matrix.rake-job }} x86_64
installation_test:
name: Installation Test
runs-on: ubuntu-latest
needs: [define-matrix, build]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/yum/repositories
- name: Installation Test
run: |
mkdir -p .bundle
docker run \
--rm \
--tty \
--env CI=true \
--volume ${PWD}:/fluentd:ro \
--env CENTOS_STREAM=${{ matrix.centos-stream }} \
${{ matrix.test-docker-image }} \
/fluentd/fluent-package/yum/install-test.sh
serverspec_test:
name: Serverspec Test
runs-on: ubuntu-latest
needs: [define-matrix, build]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/yum/repositories
- name: Serverspec Test
run: |
mkdir -p .bundle
docker run \
--rm \
--tty \
--env CI=true \
--volume ${PWD}:/fluentd:ro \
--env CENTOS_STREAM=${{ matrix.centos-stream }} \
${{ matrix.test-docker-image }} \
/fluentd/fluent-package/yum/serverspec-test.sh
confluent_test:
name: Confluent Test
runs-on: ubuntu-latest
needs: [define-matrix, build]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/yum/repositories
- name: Confluent Test
run: |
mkdir -p .bundle
docker run \
--rm \
--tty \
--env CI=true \
--volume ${PWD}:/fluentd:ro \
${{ matrix.test-docker-image }} \
/fluentd/fluent-package/yum/confluent-test.sh
binstubs_test:
name: Binstubs Test
runs-on: ubuntu-latest
needs: [define-matrix, build]
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
path: fluent-package/yum/repositories
- name: Binstubs Test
run: |
mkdir -p .bundle
docker run \
--rm \
--tty \
--env CI=true \
--volume ${PWD}:/fluentd:ro \
--env CENTOS_STREAM=${{ matrix.centos-stream }} \
${{ matrix.test-docker-image }} \
/fluentd/fluent-package/yum/binstubs-test.sh
#
# NOTE: It is hard to keep testing environment for AmazonLinux:2 properly and it is not sustainable enough at this time.
# Thus disable v1test job for a while. (Running AmazonLinux:2 (CGroup v1) on CGroup v2 host with VirtualBox is fragile and not stable enough.)
# If we found a better solution for it, replace with it.
#
# v1test:
# name: Test ${{ matrix.label }} ${{ matrix.test }} (CGroup V1)
# needs: [check_package_size, installation_test, serverspec_test, confluent_test, binstubs_test]
# # Ubuntu 20.04 is not available anymore, so can't use container based
# # approach. Instead, use vagrant on Ubuntu 24.04.
# # (NOTE: nested VM is executable on macos-13, but it is too slow)
# runs-on: ubuntu-24.04
# timeout-minutes: 15
# strategy:
# fail-fast: false
# matrix:
# label:
# - AmazonLinux 2 x86_64
# test:
# - "update-from-v4.sh"
# - "update-from-v5-lts.sh"
# - "downgrade-to-v4.sh"
# - "downgrade-to-v5-lts.sh"
# - "install-newly.sh local"
# - "install-newly.sh v5"
# - "install-newly.sh lts"
# - "update-to-next-version.sh"
# - "update-to-next-version-with-backward-compat-for-v4.sh"
# - "update-to-next-version-service-status.sh enabled active"
# - "update-to-next-version-service-status.sh enabled inactive"
# - "update-to-next-version-service-status.sh disabled active"
# - "update-to-next-version-service-status.sh disabled inactive"
# - "update-to-next-version-with-auto-and-manual.sh"
# - "update-to-next-major-version.sh auto active"
# - "update-to-next-major-version.sh auto inactive"
# - "update-to-next-major-version.sh manual active"
# - "update-to-next-major-version.sh manual inactive"
# - "update-to-next-major-version.sh etc active"
# - "update-to-next-major-version.sh etc inactive"
# - "update-without-data-lost.sh v6 v7"
# - "update-without-data-lost.sh v7 v6"
# include:
# - label: AmazonLinux 2 x86_64
# rake-job: amazonlinux-2
# steps:
# - uses: actions/checkout@v4
# - uses: actions/download-artifact@v4
# with:
# name: packages-${{ matrix.rake-job }}
# - uses: actions/download-artifact@v4
# with:
# name: v7-packages-${{ matrix.rake-job }}
# path: v7-test
# - name: Show host runner information
# run: |
# cat /proc/cpuinfo | grep -E "vmx|svm"
# lsmod | grep kvm
# - name: Set up virtualbox
# run: |
# sudo apt-get update
# sudo apt-get install -y virtualbox
# - name: Set up vagrant
# run: |
# sudo apt-get update
# wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
# echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
# sudo apt-get update && sudo apt install -y vagrant
# vagrant --version
# vagrant status
# - name: Spin up vagrant
# run: |
# vagrant up --provider virtualbox ${{ matrix.rake-job }}
# # Run tests based on AlmaLinux 8 (CGroup v1)
# - name: Run Test ${{ matrix.test }} on ${{ matrix.rake-job }}
# run: |
# BOX_MOUNT_DIR=fluent-package/yum/repositories vagrant ssh ${{ matrix.rake-job }} -- /host/fluent-package/yum/systemd-test/${{ matrix.test }}
v2test:
name: Test ${{ matrix.label }} ${{ matrix.test }} (CGroup V2)
needs: [define-matrix, check_package_size, installation_test, serverspec_test, confluent_test, binstubs_test]
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
label: ${{ fromJSON(needs.define-matrix.outputs.label) }}
test:
- "update-from-v4.sh"
- "update-from-v4.sh via-v5"
- "update-from-v5-lts.sh local"
- "update-from-v5-lts.sh v6"
- "update-from-v5-lts.sh lts"
- "downgrade-to-v4.sh"
- "downgrade-to-v5-lts.sh"
- "install-newly.sh local"
- "install-newly.sh v6"
- "install-newly.sh lts"
- "update-to-next-version.sh"
- "update-to-next-version-with-backward-compat-for-v4.sh"
- "update-to-next-version-service-status.sh enabled active"
- "update-to-next-version-service-status.sh enabled inactive"
- "update-to-next-version-service-status.sh disabled active"
- "update-to-next-version-service-status.sh disabled inactive"
- "update-to-next-version-with-auto-and-manual.sh"
- "update-to-next-major-version.sh auto active"
- "update-to-next-major-version.sh auto inactive"
- "update-to-next-major-version.sh manual active"
- "update-to-next-major-version.sh manual inactive"
- "update-to-next-major-version.sh etc active"
- "update-to-next-major-version.sh etc inactive"
- "update-without-data-lost.sh v6 v7"
- "update-without-data-lost.sh v7 v6"
- "obsolete-plugins.sh"
- "tmpfiles.sh"
include: ${{ fromJSON(needs.define-matrix.outputs.matrix).include }}
exclude:
- label: Amazon Linux 2023 x86_64
test: update-from-v4.sh
- label: Amazon Linux 2023 x86_64
test: update-from-v4.sh via-v5
- label: Amazon Linux 2023 x86_64
test: update-to-next-version-with-backward-compat-for-v4.sh
- label: Amazon Linux 2023 x86_64
test: downgrade-to-v4.sh
- label: AlmaLinux 10 x86_64
test: update-from-v4.sh
- label: AlmaLinux 10 x86_64
test: update-from-v4.sh via-v5
- label: AlmaLinux 10 x86_64
test: update-from-v5-lts.sh local
- label: AlmaLinux 10 x86_64
test: update-from-v5-lts.sh v6
- label: AlmaLinux 10 x86_64
test: update-from-v5-lts.sh lts
- label: AlmaLinux 10 x86_64
test: update-to-next-version-with-backward-compat-for-v4.sh
- label: AlmaLinux 10 x86_64
test: downgrade-to-v4.sh
- label: AlmaLinux 10 x86_64
test: downgrade-to-v5-lts.sh
# rpmrebuild is not supported on EPEL for AlmaLinux 10 yet
- label: AlmaLinux 10 x86_64
test: update-to-next-version.sh
- label: AlmaLinux 10 x86_64
test: update-to-next-version-service-status.sh enabled active
- label: AlmaLinux 10 x86_64
test: update-to-next-version-service-status.sh enabled inactive
- label: AlmaLinux 10 x86_64
test: update-to-next-version-service-status.sh disabled active
- label: AlmaLinux 10 x86_64
test: update-to-next-version-service-status.sh disabled inactive
- label: AlmaLinux 10 x86_64
test: update-to-next-version-with-auto-and-manual.sh
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-${{ matrix.rake-job }}
- uses: actions/download-artifact@v4
with:
name: packages-release-${{ matrix.rake-job }}
- uses: actions/download-artifact@v4
with:
name: v7-packages-${{ matrix.rake-job }}
path: v7-test
- name: Install Incus
run: |
sudo apt-get update
sudo apt-get install -y -V incus
- name: Allow egress network traffic flows for Incus
# https://linuxcontainers.org/incus/docs/main/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-incus-and-docker
run: |
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
- name: Setup Incus
run: |
sudo incus admin init --auto
- name: Run Test ${{ matrix.test }} on ${{ matrix.test-incus-image }}
run: fluent-package/yum/systemd-test/test.sh ${{ matrix.test-incus-image }} ${{ matrix.test }}
fluent-release-test:
name: Test ${{ matrix.label }} ${{ matrix.test }} (CGroup V2)
needs: [define-matrix, v2test]
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
label: ${{ fromJSON(needs.define-matrix.outputs.label) }}
test:
- install-from-r2.sh
include: ${{ fromJSON(needs.define-matrix.outputs.matrix).include }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-release-${{ matrix.rake-job }}
- name: Install Incus
run: |
sudo apt-get update
sudo apt-get install -y -V incus
- name: Allow egress network traffic flows for Incus
# https://linuxcontainers.org/incus/docs/main/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-incus-and-docker
run: |
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
- name: Setup Incus
run: |
sudo incus admin init --auto
- name: Run Test ${{matrix.test}} on ${{ matrix.test-incus-image }}
run: fluent-release/yum/systemd-test/test.sh ${{ matrix.test-incus-image }} ${{ matrix.test }}
fluent-lts-release-test:
name: Test ${{ matrix.label }} ${{ matrix.test }} (CGroup V2)
needs: [define-matrix, v2test]
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
label: ${{ fromJSON(needs.define-matrix.outputs.label) }}
test:
- install-from-r2.sh
include: ${{ fromJSON(needs.define-matrix.outputs.matrix).include }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: packages-lts-release-${{ matrix.rake-job }}
- name: Install Incus
run: |
sudo apt-get update
sudo apt-get install -y -V incus
- name: Allow egress network traffic flows for Incus
# https://linuxcontainers.org/incus/docs/main/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-incus-and-docker
run: |
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
- name: Setup Incus
run: |
sudo incus admin init --auto
- name: Run Test ${{matrix.test}} on ${{ matrix.test-incus-image }}
run: fluent-lts-release/yum/systemd-test/test.sh ${{ matrix.test-incus-image }} ${{ matrix.test }}