forked from antrea-io/antrea
-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·432 lines (420 loc) · 14.5 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
430
431
432
name: Kind
on:
pull_request:
branches:
- master
- release-*
- ipv6
push:
branches:
- master
- release-*
- ipv6
env:
KIND_VERSION: v0.9.0
jobs:
check-changes:
name: Check whether tests need to be run based on diff
runs-on: [ubuntu-18.04]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: vmware-tanzu/antrea/ci/gh-actions/has-changes@master
id: check_diff
with:
args: docs/* ci/jenkins/* *.md
outputs:
has_changes: ${{ steps.check_diff.outputs.has_changes }}
build-antrea-coverage-image:
name: Build Antrea image to be used for Kind e2e tests
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
runs-on: [ubuntu-18.04]
steps:
- uses: actions/checkout@v2
- run: make build-ubuntu-coverage
- name: Save Antrea image to tarball
run: docker save -o antrea-ubuntu.tar antrea/antrea-ubuntu-coverage:latest
- name: Upload Antrea image for subsequent jobs
uses: actions/upload-artifact@v2
with:
name: antrea-ubuntu-cov
path: antrea-ubuntu.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-antrea-coverage-image
runs-on: [ubuntu-18.04]
steps:
- name: Free disk space
# https://github.com/actions/virtual-environments/issues/709
run: |
sudo apt-get clean
df -h
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: 1.15
- name: Download Antrea image from previous job
uses: actions/download-artifact@v1
with:
name: antrea-ubuntu-cov
- name: Load Antrea image
run: docker load -i antrea-ubuntu-cov/antrea-ubuntu.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
mkdir test-e2e-encap-coverage
ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-encap-coverage ./ci/kind/test-e2e-kind.sh --encap-mode encap --coverage
- name: Tar coverage files
run: tar -czf test-e2e-encap-coverage.tar.gz test-e2e-encap-coverage
- name: Upload coverage for test-e2e-encap-coverage
uses: actions/upload-artifact@v2
with:
name: test-e2e-encap-coverage
path: test-e2e-encap-coverage.tar.gz
retention-days: 30
- name: Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: '*antrea*'
flags: kind-e2e-tests
name: codecov-test-e2e-encap
directory: test-e2e-encap-coverage
- name: Tar log files
if: ${{ failure() }}
run: tar -czf log.tar.gz log
- name: Upload test log
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: e2e-kind-encap.tar.gz
path: log.tar.gz
retention-days: 30
test-e2e-encap-no-proxy:
name: E2e tests on a Kind cluster on Linux with AntreaProxy disabled
needs: build-antrea-coverage-image
runs-on: [ubuntu-18.04]
steps:
- name: Free disk space
# https://github.com/actions/virtual-environments/issues/709
run: |
sudo apt-get clean
df -h
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: 1.15
- name: Download Antrea image from previous job
uses: actions/download-artifact@v1
with:
name: antrea-ubuntu-cov
- name: Load Antrea image
run: docker load -i antrea-ubuntu-cov/antrea-ubuntu.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
mkdir test-e2e-encap-no-proxy-coverage
ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-encap-no-proxy-coverage ./ci/kind/test-e2e-kind.sh --encap-mode encap --no-proxy --coverage
- name: Tar coverage files
run: tar -czf test-e2e-encap-no-proxy-coverage.tar.gz test-e2e-encap-no-proxy-coverage
- name: Upload coverage for test-e2e-encap-no-proxy-coverage
uses: actions/upload-artifact@v2
with:
name: test-e2e-encap-no-proxy-coverage
path: test-e2e-encap-no-proxy-coverage.tar.gz
retention-days: 30
- name: Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: '*antrea*'
flags: kind-e2e-tests
name: codecov-test-e2e-encap-no-proxy
directory: test-e2e-encap-no-proxy-coverage
- name: Tar log files
if: ${{ failure() }}
run: tar -czf log.tar.gz log
- name: Upload test log
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: e2e-kind-encap-no-proxy.tar.gz
path: log.tar.gz
retention-days: 30
test-e2e-noencap:
name: E2e tests on a Kind cluster on Linux (noEncap)
needs: build-antrea-coverage-image
runs-on: [ubuntu-18.04]
steps:
- name: Free disk space
# https://github.com/actions/virtual-environments/issues/709
run: |
sudo apt-get clean
df -h
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: 1.15
- name: Download Antrea image from previous job
uses: actions/download-artifact@v1
with:
name: antrea-ubuntu-cov
- name: Load Antrea image
run: docker load -i antrea-ubuntu-cov/antrea-ubuntu.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
mkdir test-e2e-noencap-coverage
ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-noencap-coverage ./ci/kind/test-e2e-kind.sh --encap-mode noEncap --coverage
- name: Tar coverage files
run: tar -czf test-e2e-noencap-coverage.tar.gz test-e2e-noencap-coverage
- name: Upload coverage for test-e2e-noencap-coverage
uses: actions/upload-artifact@v2
with:
name: test-e2e-noencap-coverage
path: test-e2e-noencap-coverage.tar.gz
retention-days: 30
- name: Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: '*antrea*'
flags: kind-e2e-tests
name: codecov-test-e2e-noencap
directory: test-e2e-noencap-coverage
- name: Tar log files
if: ${{ failure() }}
run: tar -czf log.tar.gz log
- name: Upload test log
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: e2e-kind-noencap.tar.gz
path: log.tar.gz
retention-days: 30
test-e2e-hybrid:
name: E2e tests on a Kind cluster on Linux (hybrid)
needs: build-antrea-coverage-image
runs-on: [ubuntu-18.04]
steps:
- name: Free disk space
# https://github.com/actions/virtual-environments/issues/709
run: |
sudo apt-get clean
df -h
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: 1.15
- name: Download Antrea image from previous job
uses: actions/download-artifact@v1
with:
name: antrea-ubuntu-cov
- name: Load Antrea image
run: docker load -i antrea-ubuntu-cov/antrea-ubuntu.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
mkdir test-e2e-hybrid-coverage
ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-hybrid-coverage ./ci/kind/test-e2e-kind.sh --encap-mode hybrid --coverage
- name: Tar coverage files
run: tar -czf test-e2e-hybrid-coverage.tar.gz test-e2e-hybrid-coverage
- name: Upload coverage for test-e2e-hybrid-coverage
uses: actions/upload-artifact@v2
with:
name: test-e2e-hybrid-coverage
path: test-e2e-hybrid-coverage.tar.gz
retention-days: 30
- name: Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: '*antrea*'
flags: kind-e2e-tests
name: codecov-test-e2e-hybrid
directory: test-e2e-hybrid-coverage
- name: Tar log files
if: ${{ failure() }}
run: tar -czf log.tar.gz log
- name: Upload test log
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: e2e-kind-hybrid.tar.gz
path: log.tar.gz
retention-days: 30
test-e2e-encap-np:
name: E2e tests on a Kind cluster on Linux with Antrea NetworkPolicies enabled
needs: build-antrea-coverage-image
runs-on: [ubuntu-18.04]
steps:
- name: Free disk space
# https://github.com/actions/virtual-environments/issues/709
run: |
sudo apt-get clean
df -h
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: 1.15
- name: Download Antrea image from previous job
uses: actions/download-artifact@v1
with:
name: antrea-ubuntu-cov
- name: Load Antrea image
run: docker load -i antrea-ubuntu-cov/antrea-ubuntu.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
mkdir test-e2e-encap-np-coverage
ANTREA_LOG_DIR=$PWD/log ANTREA_COV_DIR=$PWD/test-e2e-encap-np-coverage ./ci/kind/test-e2e-kind.sh --encap-mode encap --np --coverage
- name: Tar coverage files
run: tar -czf test-e2e-encap-np-coverage.tar.gz test-e2e-encap-np-coverage
- name: Upload coverage for test-e2e-encap-np-coverage
uses: actions/upload-artifact@v2
with:
name: test-e2e-encap-np-coverage
path: test-e2e-encap-np-coverage.tar.gz
retention-days: 30
- name: Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: '*antrea*'
flags: kind-e2e-tests
name: codecov-test-e2e-np-encap
directory: test-e2e-encap-np-coverage
- name: Tar log files
if: ${{ failure() }}
run: tar -czf log.tar.gz log
- name: Upload test log
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: e2e-kind-hybrid.tar.gz
path: log.tar.gz
retention-days: 30
build-antrea-image:
name: Build Antrea image to be used for Kind netpol tests
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }}
runs-on: [ubuntu-18.04]
steps:
- uses: actions/checkout@v2
- run: make
- name: Save Antrea image to tarball
run: docker save -o antrea-ubuntu.tar antrea/antrea-ubuntu:latest
- name: Upload Antrea image for subsequent jobs
uses: actions/upload-artifact@v2
with:
name: antrea-ubuntu
path: antrea-ubuntu.tar
retention-days: 1 # minimum value, in case artifact deletion by 'artifact-cleanup' job fails
test-netpol-tmp:
name: Run experimental network policy tests (netpol) on Kind cluster
needs: build-antrea-image
runs-on: [ubuntu-18.04]
steps:
- name: Free disk space
# https://github.com/actions/virtual-environments/issues/709
run: |
sudo apt-get clean
df -h
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: 1.15
- name: Download Antrea image from previous job
uses: actions/download-artifact@v1
with:
name: antrea-ubuntu
- name: Load Antrea image
run: docker load -i antrea-ubuntu/antrea-ubuntu.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: Build netpol Docker image
working-directory: hack/netpol
run: make
- name: Run netpol tests
working-directory: hack/netpol
run: ./test-kind.sh
validate-prometheus-metrics-doc:
name: Validate metrics in Prometheus document match running deployment's
needs: build-antrea-image
runs-on: [ubuntu-18.04]
steps:
- name: Free disk space
# https://github.com/actions/virtual-environments/issues/709
run: |
sudo apt-get clean
df -h
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: 1.15
- name: Download Antrea image from previous job
uses: actions/download-artifact@v1
with:
name: antrea-ubuntu
- name: Load Antrea image
run: docker load -i antrea-ubuntu/antrea-ubuntu.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: Validate document
run: |
./ci/kind/validate-metrics-doc.sh
# Runs after all other jobs in the workflow and deletes Antrea 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-antrea-coverage-image, build-antrea-image, test-e2e-encap, test-e2e-encap-no-proxy, test-e2e-noencap, test-e2e-hybrid, test-e2e-encap-np, test-netpol-tmp, validate-prometheus-metrics-doc]
if: ${{ always() }}
runs-on: [ubuntu-18.04]
steps:
- name: Delete antrea-ubuntu-cov
if: ${{ needs.build-antrea-coverage-image.result == 'success' }}
uses: geekyeggo/delete-artifact@v1
with:
name: antrea-ubuntu-cov
- name: Delete antrea-ubuntu
if: ${{ needs.build-antrea-image.result == 'success' }}
uses: geekyeggo/delete-artifact@v1
with:
name: antrea-ubuntu
failOnError: false