forked from ovn-kubernetes/ovn-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
684 lines (606 loc) · 26.8 KB
/
test.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
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
name: ovn-ci
on:
merge_group:
pull_request:
branches: [ master ]
schedule:
- cron: '0 */12 * * *'
permissions:
contents: read
concurrency:
group: ovn-ci-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
GO_VERSION: "1.19.6"
K8S_VERSION: v1.24.0
KIND_CLUSTER_NAME: ovn
KIND_INSTALL_INGRESS: true
KIND_ALLOW_SYSTEM_WRITES: true
# This skips tests tagged as Serial
# Current Serial tests are not relevant for OVN
PARALLEL: true
# This must be a directory
CI_IMAGE_CACHE: tmp/image_cache/
CI_IMAGE_MASTER_TAR: image-master.tar
CI_IMAGE_PR_TAR: image-pr.tar
CI_DIST_IMAGES_OUTPUT: dist/images/_output/
jobs:
# separate job for parallelism
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Verify
uses: golangci/golangci-lint-action@v3
with:
version: v1.52
working-directory: go-controller
args: --modules-download-mode=vendor --timeout=15m0s --verbose
skip-go-installation: true
build-master:
name: Build-master
runs-on: ubuntu-latest
steps:
# Create a cache for the built master image
- name: Restore master image cache
id: image_cache_master
uses: actions/cache@v3
with:
path: |
${{ env.CI_IMAGE_CACHE }}
key: ${{ github.run_id }}-image-cache-master
# if CI_IMAGE_MASTER_TAR isn't in cache, try pulling it and saving to the cache rather
# than building, resort back to building if the cache isn't populated and
# pulling the image fails.
- name: Check if master image build is needed
id: is_master_image_build_needed
continue-on-error: false
run: |
set -x
if [ -f ${CI_IMAGE_CACHE}${CI_IMAGE_MASTER_TAR}.gz ]; then
cp ${CI_IMAGE_CACHE}/${CI_IMAGE_MASTER_TAR}.gz ${CI_IMAGE_MASTER_TAR}.gz
gunzip ${CI_IMAGE_MASTER_TAR}.gz
echo "::set-output name=MASTER_IMAGE_RESTORED_FROM_CACHE::true"
exit 0
fi
if docker pull ghcr.io/ovn-org/ovn-kubernetes/ovn-kube-f:master; then
docker tag ghcr.io/ovn-org/ovn-kubernetes/ovn-kube-f:master ovn-daemonset-f:dev
echo "::set-output name=MASTER_IMAGE_RESTORED_FROM_GHCR::true"
exit 0
fi
# only run the following steps if the master image was not found in the cache
- name: Set up Go
if: steps.is_master_image_build_needed.outputs.MASTER_IMAGE_RESTORED != 'true' && success()
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory - from master branch
if: steps.is_master_image_build_needed.outputs.MASTER_IMAGE_RESTORED_FROM_GHCR != 'true' && steps.is_master_image_build_needed.outputs.MASTER_IMAGE_RESTORED_FROM_CACHE != 'true' && success()
uses: actions/checkout@v3
with:
ref: master
- name: Build - from master branch
if: steps.is_master_image_build_needed.outputs.MASTER_IMAGE_RESTORED_FROM_GHCR != 'true' && steps.is_master_image_build_needed.outputs.MASTER_IMAGE_RESTORED_FROM_CACHE != 'true' && success()
run: |
set -x
pushd go-controller
make
make windows
popd
- name: Build docker image - from master branch
if: steps.is_master_image_build_needed.outputs.MASTER_IMAGE_RESTORED_FROM_GHCR != 'true' && steps.is_master_image_build_needed.outputs.MASTER_IMAGE_RESTORED_FROM_CACHE != 'true' && success()
run: |
pushd dist/images
sudo cp -f ../../go-controller/_output/go/bin/ovn* .
sudo cp -f ../../go-controller/_output/go/bin/hybrid-overlay-node .
echo "ref: $(git rev-parse --symbolic-full-name HEAD) commit: $(git rev-parse HEAD)" > git_info
docker build -t ovn-daemonset-f:dev -f Dockerfile.fedora .
popd
- name: Cache master image
if: steps.is_master_image_build_needed.outputs.MASTER_IMAGE_RESTORED_FROM_CACHE != 'true' && success()
continue-on-error: false
run: |
set -x
if [ -f ${CI_IMAGE_CACHE}${CI_IMAGE_MASTER_TAR} ]; then
rm -f ${CI_IMAGE_CACHE}${CI_IMAGE_MASTER_TAR}
fi
if [ -f ${CI_IMAGE_CACHE}${CI_IMAGE_MASTER_TAR}.gz ]; then
rm -f ${CI_IMAGE_CACHE}${CI_IMAGE_MASTER_TAR}.gz
fi
docker save ovn-daemonset-f:dev -o ${CI_IMAGE_MASTER_TAR}
mkdir -p ${CI_IMAGE_CACHE}
cp ${CI_IMAGE_MASTER_TAR} ${CI_IMAGE_CACHE}${CI_IMAGE_MASTER_TAR}
gzip ${CI_IMAGE_CACHE}${CI_IMAGE_MASTER_TAR}
# run the following always if none of the steps before failed
- uses: actions/upload-artifact@v3
with:
name: test-image-master
path: ${{ env.CI_IMAGE_MASTER_TAR }}
build-pr:
name: Build-PR
runs-on: ubuntu-latest
steps:
# Create a cache for the build PR image
- name: Restore PR image cache
id: image_cache_pr
uses: actions/cache@v3
with:
path: |
${{ env.CI_IMAGE_CACHE }}
key: ${{ github.run_id }}-image-cache-pr
- name: Check if PR image build is needed
id: is_pr_image_build_needed
continue-on-error: true
run: |
set -x
if [ -f ${CI_IMAGE_CACHE}/${CI_IMAGE_PR_TAR}.gz ]; then
mkdir -p ${CI_DIST_IMAGES_OUTPUT}
cp ${CI_IMAGE_CACHE}/${CI_IMAGE_PR_TAR}.gz ${CI_DIST_IMAGES_OUTPUT}/${CI_IMAGE_PR_TAR}.gz
gunzip ${CI_DIST_IMAGES_OUTPUT}/${CI_IMAGE_PR_TAR}.gz
echo "::set-output name=PR_IMAGE_RESTORED::true"
fi
# only run the following steps if the PR image was not found in the cache
- name: Set up Go
if: steps.is_pr_image_build_needed.outputs.PR_IMAGE_RESTORED != 'true' && success()
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory - from current pr branch
if: steps.is_pr_image_build_needed.outputs.PR_IMAGE_RESTORED != 'true' && success()
uses: actions/checkout@v3
- name: Build and Test - from current pr branch
if: steps.is_pr_image_build_needed.outputs.PR_IMAGE_RESTORED != 'true' && success()
run: |
set -x
pushd go-controller
# exit early if there are gofmt issues
make gofmt
make
make windows
COVERALLS=1 CONTAINER_RUNNABLE=1 make check
popd
- name: Build docker image - from current pr branch
if: steps.is_pr_image_build_needed.outputs.PR_IMAGE_RESTORED != 'true' && success()
run: |
pushd dist/images
sudo cp -f ../../go-controller/_output/go/bin/ovn* .
sudo cp -f ../../go-controller/_output/go/bin/hybrid-overlay-node .
echo "ref: $(git rev-parse --symbolic-full-name HEAD) commit: $(git rev-parse HEAD)" > git_info
docker build -t ovn-daemonset-f:pr -f Dockerfile.fedora .
mkdir _output
docker save ovn-daemonset-f:pr > _output/${CI_IMAGE_PR_TAR}
popd
- name: Submit code coverage to Coveralls
if: steps.is_pr_image_build_needed.outputs.PR_IMAGE_RESTORED != 'true' && success()
continue-on-error: true
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: off
run: |
set -x
go get github.com/mattn/goveralls
go get github.com/modocache/gover
PATH=$PATH:$(go env GOPATH)/bin
mkdir -p $(go env GOPATH)/src/github.com/ovn-org
ln -sf $(pwd) $(go env GOPATH)/src/github.com/ovn-org/ovn-kubernetes
gover
goveralls -coverprofile=gover.coverprofile -service=github
- name: Cache PR image
if: steps.is_pr_image_build_needed.outputs.PR_IMAGE_RESTORED != 'true' && success()
continue-on-error: true
run: |
set -x
if [ -f ${CI_IMAGE_CACHE}/${CI_IMAGE_PR_TAR} ]; then
rm -f ${CI_IMAGE_CACHE}/${CI_IMAGE_PR_TAR}
fi
if [ -f ${CI_IMAGE_CACHE}/${CI_IMAGE_PR_TAR}.gz ]; then
rm -f ${CI_IMAGE_CACHE}/${CI_IMAGE_PR_TAR}.gz
fi
mkdir -p ${CI_IMAGE_CACHE}/
cp ${CI_DIST_IMAGES_OUTPUT}/${CI_IMAGE_PR_TAR} ${CI_IMAGE_CACHE}/${CI_IMAGE_PR_TAR}
gzip ${CI_IMAGE_CACHE}/${CI_IMAGE_PR_TAR}
# run the following if none of the previous steps failed
- uses: actions/upload-artifact@v3
with:
name: test-image-pr
path: ${{ env.CI_DIST_IMAGES_OUTPUT }}/${{ env.CI_IMAGE_PR_TAR }}
ovn-upgrade-e2e:
name: Upgrade OVN from Master to PR branch based image
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
timeout-minutes: 120
needs:
- build-master
- build-pr
strategy:
fail-fast: false
matrix:
gateway-mode: [local, shared]
env:
JOB_NAME: "Upgrade-Tests-${{ matrix.gateway-mode }}"
OVN_HA: "false"
KIND_IPV4_SUPPORT: "true"
KIND_IPV6_SUPPORT: "false"
OVN_HYBRID_OVERLAY_ENABLE: "false"
OVN_GATEWAY_MODE: "${{ matrix.gateway-mode }}"
OVN_MULTICAST_ENABLE: "false"
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Set up environment
run: |
export GOPATH=$(go env GOPATH)
echo "GOPATH=$GOPATH" >> $GITHUB_ENV
echo "$GOPATH/bin" >> $GITHUB_PATH
- name: Free up disk space
run: |
sudo eatmydata apt-get purge --auto-remove -y \
azure-cli aspnetcore-* dotnet-* ghc-* firefox \
google-chrome-stable \
llvm-* microsoft-edge-stable mono-* \
msbuild mysql-server-core-* php-* php7* \
powershell temurin-* zulu-*
- name: Download test-image-master
uses: actions/download-artifact@v3
with:
name: test-image-master
- name: Disable ufw
# For IPv6 and Dualstack, ufw (Uncomplicated Firewall) should be disabled.
# Not needed for KIND deployments, so just disable all the time.
run: |
sudo ufw disable
- name: Load docker image
run: |
docker load --input ${CI_IMAGE_MASTER_TAR} && rm -rf ${CI_IMAGE_MASTER_TAR}
- name: Check out code into the Go module directory - from Master branch
if: steps.last_run_status.outputs.STATUS != 'completed' && success()
uses: actions/checkout@v3
with:
ref: master
- name: kind setup
run: |
export OVN_IMAGE="ovn-daemonset-f:dev"
make -C test install-kind
- name: Export kind logs
if: always()
run: |
mkdir -p /tmp/kind/logs
kind export logs --name ${KIND_CLUSTER_NAME} --loglevel=debug /tmp/kind/logs
set -x
docker ps -a
docker exec ovn-control-plane crictl images
docker exec ovn-worker crictl images
docker exec ovn-worker2 crictl images
- name: Upload kind logs
if: always()
uses: actions/upload-artifact@v3
with:
name: kind-logs-${{ env.JOB_NAME }}-${{ github.run_id }}
path: /tmp/kind/logs
- name: Download test-image-pr
uses: actions/download-artifact@v3
with:
name: test-image-pr
- name: Load docker image
run: |
docker load --input ${CI_IMAGE_PR_TAR} && rm -rf ${CI_IMAGE_PR_TAR}
- name: Check out code into the Go module directory - from PR branch
uses: actions/checkout@v3
- name: ovn upgrade
run: |
export OVN_IMAGE="ovn-daemonset-f:pr"
make -C test upgrade-ovn
- name: Run E2E shard-conformance
run: |
make -C test shard-conformance
- name: Export kind logs
if: always()
run: |
mkdir -p /tmp/kind/logs-kind-pr-branch
kind export logs --name ${KIND_CLUSTER_NAME} --loglevel=debug /tmp/kind/logs-kind-pr-branch
- name: Upload kind logs
if: always()
uses: actions/upload-artifact@v3
with:
name: kind-logs-${{ env.JOB_NAME }}-${{ github.run_id }}-after-upgrade
path: /tmp/kind/logs-kind-pr-branch
e2e:
name: e2e
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
# 30 mins for kind, 180 mins for control-plane tests, 10 minutes for all other steps
timeout-minutes: 220
strategy:
fail-fast: false
matrix:
# Valid options are:
# target: ["shard-conformance", "control-plane", "multi-homing", "multi-node-zones", "node-ip-migration", "compact-mode"]
# shard-conformance: hybrid-overlay = multicast-enable = emptylb-enable = false
# control-plane: hybrid-overlay = multicast-enable = emptylb-enable = true
# ha: ["HA", "noHA"]
# gateway-mode: ["local", "shared"]
# ipfamily: ["ipv4", "ipv6", "dualstack"]
# disable-snat-multiple-gws: ["noSnatGW", "snatGW"]
# second-bridge: ["2br", "1br"]
# ic: ["ic-disabled", "ic-single-node-zones", "ic-multi-node-zones"]
# num-workers : "<integer value>"
# num-nodes-per-zone : "<integer value>"
include:
- {"target": "shard-conformance", "ha": "HA", "gateway-mode": "local", "ipfamily": "ipv6", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-disabled"}
- {"target": "shard-conformance", "ha": "HA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-disabled"}
- {"target": "shard-conformance", "ha": "noHA", "gateway-mode": "local", "ipfamily": "dualstack", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
- {"target": "shard-conformance", "ha": "noHA", "gateway-mode": "shared", "ipfamily": "ipv6", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
- {"target": "shard-conformance", "ha": "noHA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
- {"target": "control-plane", "ha": "HA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "noSnatGW", "second-bridge": "1br", "ic": "ic-disabled"}
- {"target": "control-plane", "ha": "HA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-disabled"}
- {"target": "control-plane", "ha": "noHA", "gateway-mode": "local", "ipfamily": "ipv4", "disable-snat-multiple-gws": "noSnatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
- {"target": "control-plane", "ha": "noHA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "noSnatGW", "second-bridge": "2br", "ic": "ic-single-node-zones"}
- {"target": "multi-homing", "ha": "noHA", "gateway-mode": "local", "ipfamily": "ipv4", "disable-snat-multiple-gws": "SnatGW", "second-bridge": "1br", "ic": "ic-disabled"}
- {"target": "node-ip-migration", "ha": "noHA", "gateway-mode": "shared", "ipfamily": "ipv6", "disable-snat-multiple-gws": "SnatGW", "second-bridge": "1br", "ic": "ic-disabled"}
- {"target": "node-ip-migration", "ha": "noHA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "SnatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
- {"target": "compact-mode", "ha": "noHA", "gateway-mode": "local", "ipfamily": "ipv4", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-disabled"}
- {"target": "multi-homing", "ha": "noHA", "gateway-mode": "local", "ipfamily": "dualstack", "disable-snat-multiple-gws": "SnatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
- {"target": "multi-node-zones", "ha": "noHA", "gateway-mode": "local", "ipfamily": "ipv4", "disable-snat-multiple-gws": "SnatGW", "second-bridge": "1br", "ic": "ic-multi-node-zones", "num-workers": "3", "num-nodes-per-zone": "2"}
- {"target": "external-gateway", "ha": "noHA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "noSnatGW", "second-bridge": "2br", "ic": "ic-single-node-zones"}
- {"target": "external-gateway", "ha": "noHA", "gateway-mode": "local", "ipfamily": "ipv4", "disable-snat-multiple-gws": "noSnatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
- {"target": "kv-live-migration", "ha": "noHA", "gateway-mode": "local", "ipfamily": "ipv4", "disable-snat-multiple-gws": "SnatGW", "second-bridge": "1br", "ic": "ic-disabled"}
- {"target": "kv-live-migration", "ha": "noHA", "gateway-mode": "shared", "ipfamily": "dualstack", "disable-snat-multiple-gws": "SnatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
needs: [ build-pr ]
env:
JOB_NAME: "${{ matrix.target }}-${{ matrix.ha }}-${{ matrix.gateway-mode }}-${{ matrix.ipfamily }}-${{ matrix.disable-snat-multiple-gws }}-${{ matrix.second-bridge }}"
OVN_HYBRID_OVERLAY_ENABLE: "${{ matrix.target == 'control-plane' }}"
OVN_MULTICAST_ENABLE: "${{ matrix.target == 'control-plane' }}"
OVN_EMPTY_LB_EVENTS: "${{ matrix.target == 'control-plane' }}"
OVN_HA: "${{ matrix.ha == 'HA' }}"
OVN_DISABLE_SNAT_MULTIPLE_GWS: "${{ matrix.disable-snat-multiple-gws == 'noSnatGW' }}"
KIND_INSTALL_METALLB: "${{ matrix.target == 'control-plane' }}"
OVN_GATEWAY_MODE: "${{ matrix.gateway-mode }}"
OVN_SECOND_BRIDGE: "${{ matrix.second-bridge == '2br' }}"
KIND_IPV4_SUPPORT: "${{ matrix.ipfamily == 'IPv4' || matrix.ipfamily == 'dualstack' }}"
KIND_IPV6_SUPPORT: "${{ matrix.ipfamily == 'IPv6' || matrix.ipfamily == 'dualstack' }}"
ENABLE_MULTI_NET: "${{ matrix.target == 'multi-homing' }}"
KIND_INSTALL_KUBEVIRT: "${{ matrix.target == 'kv-live-migration' }}"
OVN_COMPACT_MODE: "${{ matrix.target == 'compact-mode' }}"
OVN_DUMMY_GATEWAY_BRIDGE: "${{ matrix.target == 'compact-mode' }}"
OVN_ENABLE_INTERCONNECT: "${{ matrix.ic == 'ic-single-node-zones' || matrix.ic == 'ic-multi-node-zones'}}"
KIND_NUM_WORKER: "${{ matrix.num-workers }}"
KIND_NUM_NODES_PER_ZONE: "${{ matrix.num-nodes-per-zone }}"
steps:
- name: Free up disk space
run: |
sudo eatmydata apt-get purge --auto-remove -y \
azure-cli aspnetcore-* dotnet-* ghc-* firefox \
google-chrome-stable \
llvm-* microsoft-edge-stable mono-* \
msbuild mysql-server-core-* php-* php7* \
powershell temurin-* zulu-*
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up environment
run: |
export GOPATH=$(go env GOPATH)
echo "GOPATH=$GOPATH" >> $GITHUB_ENV
echo "$GOPATH/bin" >> $GITHUB_PATH
if [ $OVN_SECOND_BRIDGE == "true" ]; then
echo OVN_TEST_EX_GW_NETWORK=kindexgw >> $GITHUB_ENV
echo OVN_ENABLE_EX_GW_NETWORK_BRIDGE=true >> $GITHUB_ENV
fi
- name: Disable ufw
# For IPv6 and Dualstack, ufw (Uncomplicated Firewall) should be disabled.
# Not needed for KIND deployments, so just disable all the time.
run: |
sudo ufw disable
- name: Download test-image-pr
uses: actions/download-artifact@v3
with:
name: test-image-pr
- name: Load docker image
run: |
docker load --input ${CI_IMAGE_PR_TAR} && rm -rf ${CI_IMAGE_PR_TAR}
- name: kind setup
timeout-minutes: 30
run: |
export OVN_IMAGE="ovn-daemonset-f:pr"
make -C test install-kind
- name: Run Tests
# e2e tests take ~60 minutes normally, 120 should be more than enough
# set 3 hours for control-plane tests as these might take a while
timeout-minutes: ${{ matrix.target == 'control-plane' && 180 || matrix.target == 'external-gateway' && 180 || 120 }}
run: |
if [ "${{ matrix.target }}" == "multi-homing" ]; then
make -C test control-plane WHAT="Multi Homing"
elif [ "${{ matrix.target }}" == "node-ip-migration" ]; then
make -C test control-plane WHAT="Node IP address migration"
elif [ "${{ matrix.target }}" == "compact-mode" ]; then
SINGLE_NODE_CLUSTER="true" make -C test shard-network
elif [ "${{ matrix.target }}" == "multi-node-zones" ]; then
make -C test control-plane WHAT="Multi node zones interconnect"
elif [ "${{ matrix.target }}" == "external-gateway" ]; then
make -C test control-plane WHAT="External Gateway"
elif [ "${{ matrix.target }}" == "kv-live-migration" ]; then
make -C test control-plane WHAT="Kubevirt Virtual Machines"
else
make -C test ${{ matrix.target }}
make -C test conformance
fi
- name: Export kind logs
if: always()
run: |
mkdir -p /tmp/kind/logs
kind export logs --name ${KIND_CLUSTER_NAME} --loglevel=debug /tmp/kind/logs
- name: Upload kind logs
if: always()
uses: actions/upload-artifact@v3
with:
name: kind-logs-${{ env.JOB_NAME }}-${{ github.run_id }}
path: /tmp/kind/logs
e2e-dual-conversion:
name: e2e-dual-conversion
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- {"ha": "HA", "interconnect": "interconnect-disabled"}
- {"ha": "noHA", "interconnect": "interconnect-single-node-zones", "num-zones": "3", "num-nodes-per-zone": "1"}
# - {"ha": "noHA", "interconnect": "interconnect-multi-node-zones", "num-zones": "2", "num-nodes-per-zone": "2"}
needs: [ build-pr ]
env:
JOB_NAME: "DualStack-conversion-shared-${{ matrix.ha }}-${{ matrix.interconnect }}"
OVN_HA: "${{ matrix.ha == 'HA' }}"
KIND_IPV4_SUPPORT: "true"
KIND_IPV6_SUPPORT: "false"
OVN_HYBRID_OVERLAY_ENABLE: "false"
OVN_GATEWAY_MODE: "shared"
OVN_MULTICAST_ENABLE: "false"
DUALSTACK_CONVERSION: "true"
OVN_ENABLE_INTERCONNECT: "${{ matrix.interconnect == 'interconnect-single-node-zones' || matrix.interconnect == 'interconnect-multi-node-zones'}}"
KIND_NUM_ZONES: "${{ matrix.num-zones }}"
KIND_NUM_NODES_PER_ZONE: "${{ matrix.num-nodes-per-zone }}"
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up environment
run: |
export GOPATH=$(go env GOPATH)
echo "GOPATH=$GOPATH" >> $GITHUB_ENV
echo "$GOPATH/bin" >> $GITHUB_PATH
- name: Disable ufw
# For IPv6 and Dualstack, ufw (Uncomplicated Firewall) should be disabled.
# Not needed for KIND deployments, so just disable all the time.
run: |
sudo ufw disable
- name: Download test-image-pr
uses: actions/download-artifact@v3
with:
name: test-image-pr
- name: Load docker image
run: |
docker load --input ${CI_IMAGE_PR_TAR} && rm -rf ${CI_IMAGE_PR_TAR}
- name: kind IPv4 setup
run: |
export OVN_IMAGE="ovn-daemonset-f:pr"
make -C test install-kind
- name: Convert IPv4 cluster to Dual Stack
run: |
./contrib/kind-dual-stack-conversion.sh
- name: Run Dual-Stack Tests
run: |
make -C test shard-test WHAT="Networking Granular Checks\|DualStack"
- name: Run Dual-Stack Control-Plane Tests
run: |
make -C test control-plane WHAT="DualStack"
- name: Export kind logs
if: always()
run: |
mkdir -p /tmp/kind/logs
kind export logs --name ${KIND_CLUSTER_NAME} --loglevel=debug /tmp/kind/logs
- name: Upload kind logs
if: always()
uses: actions/upload-artifact@v3
with:
name: kind-logs-${{ env.JOB_NAME }}-${{ github.run_id }}
path: /tmp/kind/logs
- name: Export ovn dbs
if: ${{ failure() }}
run: |
mkdir -p /tmp/kind/ovndbs
for node in ovn-control-plane ovn-worker ovn-worker2
do for db in ovnnb_db.db ovnsb_db.db
do docker cp ${node}:/var/lib/openvswitch/${db} /tmp/kind/ovndbs/${node}_${db} ||:
done
done
- name: Upload ovn dbs
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: kind-ovndbs-${{ env.JOB_NAME }}-${{ github.run_id }}
path: /tmp/kind/ovndbs
e2e-periodic:
name: e2e-periodic
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
target: ["shard-conformance"]
ha: ["HA"]
gateway-mode: ["local"]
ipfamily: ["ipv4", "ipv6", "dualstack"]
needs: [ build-pr ]
env:
JOB_NAME: "${{ matrix.target }}-${{ matrix.ha }}-${{ matrix.gateway-mode }}-${{ matrix.ipfamily }}"
OVN_HA: "${{ matrix.ha == 'HA' }}"
KIND_IPV4_SUPPORT: "${{ matrix.ipfamily == 'IPv4' || matrix.ipfamily == 'dualstack' }}"
KIND_IPV6_SUPPORT: "${{ matrix.ipfamily == 'IPv6' || matrix.ipfamily == 'dualstack' }}"
OVN_HYBRID_OVERLAY_ENABLE: "${{ matrix.target == 'control-plane' }}"
OVN_GATEWAY_MODE: "${{ matrix.gateway-mode }}"
steps:
- name: Free up disk space
run: sudo eatmydata apt-get remove --auto-remove -y aspnetcore-* dotnet-* libmono-* mono-* msbuild php-* php7* ghc-* zulu-*
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up environment
run: |
export GOPATH=$(go env GOPATH)
echo "GOPATH=$GOPATH" >> $GITHUB_ENV
echo "$GOPATH/bin" >> $GITHUB_PATH
- name: Disable ufw
# For IPv6 and Dualstack, ufw (Uncomplicated Firewall) should be disabled.
# Not needed for KIND deployments, so just disable all the time.
run: |
sudo ufw disable
- uses: actions/download-artifact@v3
with:
name: test-image-pr
- name: Load docker image
run: |
docker load --input ${CI_IMAGE_PR_TAR} && rm -rf ${CI_IMAGE_PR_TAR}
- name: kind setup
run: |
export OVN_IMAGE="ovn-daemonset-f:pr"
make -C test install-kind
- name: Run Tests
run: |
make -C test ${{ matrix.target }}
- name: Export logs
if: always()
run: |
mkdir -p /tmp/kind/logs
kind export logs --name ${KIND_CLUSTER_NAME} --loglevel=debug /tmp/kind/logs
- name: Upload logs
if: always()
uses: actions/upload-artifact@v3
with:
name: kind-logs-${{ env.JOB_NAME }}-${{ github.run_id }}
path: /tmp/kind/logs