-
Notifications
You must be signed in to change notification settings - Fork 25
429 lines (418 loc) · 16 KB
/
kind.yml
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
name: Kind
on:
pull_request:
branches:
- main
- release-*
- feature/*
push:
branches:
- main
- release-*
- feature/*
env:
KIND_VERSION: v0.12.0
jobs:
check-changes:
name: Check whether tests need to be run based on diff
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: antrea-io/has-changes@v2
id: check_diff
with:
paths-ignore: docs/* ci/jenkins/* *.md hack/.notableofcontents
outputs:
has_changes: ${{ steps.check_diff.outputs.has_changes }}
build-spark-jobs-image:
name: Build Spark Jobs image to be used for Kind e2e tests
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4
- run: make spark-jobs
- name: Save Spark jobs image to tarball
run: docker save -o spark-jobs.tar antrea/theia-spark-jobs
- name: Upload Spark jobs image for subsequent jobs
uses: actions/upload-artifact@v4
with:
name: spark-jobs
path: spark-jobs.tar
retention-days: 1 # minimum value, in case artifact deletion by 'artifact-cleanup' job fails
build-clickhouse-monitor-image:
name: Build ClickHouse monitor image to be used for Kind e2e tests
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4
- run: make clickhouse-monitor
- name: Save ClickHouse monitor image to tarball
run: docker save -o clickhouse-monitor.tar antrea/theia-clickhouse-monitor
- name: Upload ClickHouse monitor image for subsequent jobs
uses: actions/upload-artifact@v4
with:
name: clickhouse-monitor
path: clickhouse-monitor.tar
retention-days: 1 # minimum value, in case artifact deletion by 'artifact-cleanup' job fails
build-clickhouse-server-image:
name: Build ClickHouse server image to be used for Kind e2e tests
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4
- run: make clickhouse-server
- name: Save ClickHouse server image to tarball
run: docker save -o clickhouse-server.tar antrea/theia-clickhouse-server
- name: Upload ClickHouse server image for subsequent jobs
uses: actions/upload-artifact@v4
with:
name: clickhouse-server
path: clickhouse-server.tar
retention-days: 1 # minimum value, in case artifact deletion by 'artifact-cleanup' job fails
build-theia-manager-image:
name: Build Theia Manager image to be used for Kind e2e tests
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v4
- run: make theia-manager
- name: Save Theia Manager image to tarball
run: docker save -o theia-manager.tar antrea/theia-manager
- name: Upload Theia Manager image for subsequent jobs
uses: actions/upload-artifact@v4
with:
name: theia-manager
path: theia-manager.tar
retention-days: 1 # minimum value, in case artifact deletion by 'artifact-cleanup' job fails
test-e2e-encap:
name: E2e tests on a Kind cluster on Linux
needs:
- build-spark-jobs-image
- build-clickhouse-monitor-image
- build-clickhouse-server-image
- build-theia-manager-image
runs-on: [ubuntu-latest]
steps:
- name: Free disk space
# https://github.com/actions/virtual-environments/issues/709
run: |
sudo apt-get clean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf "/usr/local/lib/android"
docker system prune -a -f --filter "until=1h" || true > /dev/null
df -h
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Download Spark jobs images from previous jobs
uses: actions/download-artifact@v4
with:
name: spark-jobs
- name: Download ClickHouse monitor images from previous jobs
uses: actions/download-artifact@v4
with:
name: clickhouse-monitor
- name: Download ClickHouse server images from previous jobs
uses: actions/download-artifact@v4
with:
name: clickhouse-server
- name: Download Theia Manager images from previous jobs
uses: actions/download-artifact@v4
with:
name: theia-manager
- name: Load Theia image
run: |
docker load -i spark-jobs.tar
docker tag antrea/theia-spark-jobs:latest projects.registry.vmware.com/antrea/theia-spark-jobs:latest
docker load -i clickhouse-monitor.tar
docker tag antrea/theia-clickhouse-monitor:latest projects.registry.vmware.com/antrea/theia-clickhouse-monitor:latest
docker load -i clickhouse-server.tar
docker tag antrea/theia-clickhouse-server:latest projects.registry.vmware.com/antrea/theia-clickhouse-server:latest
docker load -i theia-manager.tar
docker tag antrea/theia-manager:latest projects.registry.vmware.com/antrea/theia-manager:latest
- name: Remove Theia images tar files
run: |
rm -rf clickhouse-server.tar
rm -rf clickhouse-monitor.tar
rm -rf spark-jobs.tar
rm -rf theia-manager.tar
- name: Install Kind
run: |
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
chmod +x ./kind
sudo mv kind /usr/local/bin
- name: Run e2e tests
run: |
mkdir log
ANTREA_LOG_DIR=$PWD/log ./ci/kind/test-e2e-kind.sh --coverage
- name: Tar log files
if: ${{ failure() }}
run: tar -czf log.tar.gz log
- name: Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: .coverage/complete-kind-e2e-coverage.txt
fail_ci_if_error: ${{ github.event_name == 'push' }}
flags: kind-e2e-tests
name: codecov-kind-e2e-test
- name: Upload test log
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: e2e-kind-fa.tar.gz
path: log.tar.gz
retention-days: 30
test-e2e-multicluster:
name: E2e tests on a Kind cluster for multi-cluster feature on Linux
needs:
- build-clickhouse-monitor-image
- build-clickhouse-server-image
runs-on: [ubuntu-latest]
steps:
- name: Free disk space
# https://github.com/actions/virtual-environments/issues/709
run: |
sudo apt-get clean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf "/usr/local/lib/android"
docker system prune -a -f --filter "until=1h" || true > /dev/null
df -h
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Download ClickHouse monitor images from previous jobs
uses: actions/download-artifact@v4
with:
name: clickhouse-monitor
- name: Download ClickHouse server images from previous jobs
uses: actions/download-artifact@v4
with:
name: clickhouse-server
- name: Load Theia image
run: |
docker load -i clickhouse-monitor.tar
docker tag antrea/theia-clickhouse-monitor:latest projects.registry.vmware.com/antrea/theia-clickhouse-monitor:latest
docker load -i clickhouse-server.tar
docker tag antrea/theia-clickhouse-server:latest projects.registry.vmware.com/antrea/theia-clickhouse-server:latest
- name: Remove Theia images tar files
run: |
rm -rf clickhouse-server.tar
rm -rf clickhouse-monitor.tar
- name: Install Kind
run: |
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
chmod +x ./kind
sudo mv kind /usr/local/bin
- name: Run e2e tests for multi-cluster feature
run: |
mkdir log
ANTREA_LOG_DIR=$PWD/log ./ci/kind/test-multi-cluster.sh --coverage
- name: Tar log files
if: ${{ failure() }}
run: tar -czf log.tar.gz log
- name: Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: .coverage/complete-multi-cluster-kind-e2e-coverage.txt
fail_ci_if_error: ${{ github.event_name == 'push' }}
flags: kind-multi-cluster-e2e-tests
name: codecov-multi-cluster-kind-e2e-test
- name: Upload test log
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: e2e-kind-multi-cluster.tar.gz
path: log.tar.gz
retention-days: 30
test-upgrade-from-N-1:
name: Upgrade from Theia version N-1
needs:
- build-spark-jobs-image
- build-clickhouse-monitor-image
- build-clickhouse-server-image
- build-theia-manager-image
runs-on: [ubuntu-latest]
steps:
- name: Free disk space
# https://github.com/actions/virtual-environments/issues/709
run: |
sudo apt-get clean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf "/usr/local/lib/android"
sudo apt-get autoremove
sudo apt-get clean
sudo apt-get autoclean
docker system prune -a -f --filter "until=1h" || true > /dev/null
df -h
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Download Spark jobs images from previous jobs
uses: actions/download-artifact@v4
with:
name: spark-jobs
- name: Download ClickHouse monitor images from previous jobs
uses: actions/download-artifact@v4
with:
name: clickhouse-monitor
- name: Download ClickHouse server images from previous jobs
uses: actions/download-artifact@v4
with:
name: clickhouse-server
- name: Download Theia Manager images from previous jobs
uses: actions/download-artifact@v4
with:
name: theia-manager
- name: Load Theia image
run: |
docker load -i spark-jobs.tar
docker tag antrea/theia-spark-jobs:latest projects.registry.vmware.com/antrea/theia-spark-jobs:latest
docker load -i clickhouse-monitor.tar
docker tag antrea/theia-clickhouse-monitor:latest projects.registry.vmware.com/antrea/theia-clickhouse-monitor:latest
docker load -i clickhouse-server.tar
docker tag antrea/theia-clickhouse-server:latest projects.registry.vmware.com/antrea/theia-clickhouse-server:latest
docker load -i theia-manager.tar
docker tag antrea/theia-manager:latest projects.registry.vmware.com/antrea/theia-manager:latest
- name: Remove Theia images tar files
run: |
rm -rf clickhouse-server.tar
rm -rf clickhouse-monitor.tar
rm -rf spark-jobs.tar
rm -rf theia-manager.tar
- name: Install Kind
run: |
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
chmod +x ./kind
sudo mv kind /usr/local/bin
- name: Run test
run: |
mkdir log
ANTREA_LOG_DIR=$PWD/log ./ci/kind/test-upgrade-theia.sh --from-version-n-minus 1
- name: Tar log files
if: ${{ failure() }}
run: tar -czf log.tar.gz log
- name: Upload test log
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: upgrade-from-theia-version-n-1.tar.gz
path: log.tar.gz
retention-days: 30
test-ClickHouse-migrate-from-N-1:
name: Migrate ClickHouse from Theia version N-1
needs:
- build-clickhouse-monitor-image
- build-clickhouse-server-image
runs-on: [ubuntu-latest]
steps:
- name: Free disk space
# https://github.com/actions/virtual-environments/issues/709
run: |
sudo apt-get clean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf "/usr/local/lib/android"
sudo apt-get autoremove
sudo apt-get autoclean
docker system prune -a -f --filter "until=1h" || true > /dev/null
df -h
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Download ClickHouse monitor images from previous jobs
uses: actions/download-artifact@v4
with:
name: clickhouse-monitor
- name: Download ClickHouse server images from previous jobs
uses: actions/download-artifact@v4
with:
name: clickhouse-server
- name: Load Theia clickhouse images
run: |
docker load -i clickhouse-monitor.tar
docker tag antrea/theia-clickhouse-monitor:latest projects.registry.vmware.com/antrea/theia-clickhouse-monitor:latest
docker load -i clickhouse-server.tar
docker tag antrea/theia-clickhouse-server:latest projects.registry.vmware.com/antrea/theia-clickhouse-server:latest
- name: Remove Theia images tar files
run: |
rm -rf clickhouse-server.tar
rm -rf clickhouse-monitor.tar
- name: Install Kind
run: |
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64
chmod +x ./kind
sudo mv kind /usr/local/bin
- name: Run migrate test
run: |
mkdir log
ANTREA_LOG_DIR=$PWD/log ./ci/kind/test-migrate-clickhouse.sh --from-version-n-minus 1
- name: Tar log files
if: ${{ failure() }}
run: tar -czf log.tar.gz log
- name: Upload test log
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: migrate-clickhouse-from-theia-version-n-1.tar.gz
path: log.tar.gz
retention-days: 30
# Runs after all other jobs in the workflow succeed and deletes Theia Docker images uploaded as temporary
# artifacts. It uses a third-party, MIT-licensed action (geekyeggo/delete-artifact). While Github
# exposes an API for deleting artifacts, they do not support an official delete-artifact action
# yet.
artifact-cleanup:
name: Delete uploaded images
needs:
- build-spark-jobs-image
- build-clickhouse-monitor-image
- build-clickhouse-server-image
- build-theia-manager-image
- test-e2e-encap
- test-e2e-multicluster
- test-upgrade-from-N-1
- test-ClickHouse-migrate-from-N-1
runs-on: [ubuntu-latest]
steps:
- name: Delete spark-jobs
if: ${{ needs.build-spark-jobs-image.result == 'success' }}
uses: geekyeggo/delete-artifact@v4
with:
name: spark-jobs
- name: Delete clickhouse-monitor
if: ${{ needs.build-clickhouse-monitor-image.result == 'success' }}
uses: geekyeggo/delete-artifact@v4
with:
name: clickhouse-monitor
- name: Delete clickhouse-server
if: ${{ needs.build-clickhouse-server-image.result == 'success' }}
uses: geekyeggo/delete-artifact@v4
with:
name: clickhouse-server
- name: Delete theia-manager
if: ${{ needs.build-theia-manager-image.result == 'success' }}
uses: geekyeggo/delete-artifact@v4
with:
name: theia-manager