-
Notifications
You must be signed in to change notification settings - Fork 243
222 lines (194 loc) · 7.23 KB
/
ovn-fake-multinode-tests.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
name: System tests using ovn-fake-multinode
on:
schedule:
# Run everyday at midnight
- cron: '0 0 * * *'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: Build ovn-fake-multinode image
runs-on: ubuntu-22.04
strategy:
matrix:
cfg:
- { branch: "${{ github.ref_name }}" }
- { branch: "branch-22.03" }
env:
RUNC_CMD: podman
OS_IMAGE: "fedora:37"
# https://github.com/actions/runner-images/issues/6282
XDG_RUNTIME_DIR: ''
steps:
- name: Check out ovn-fake-multi-node
uses: actions/checkout@v4
with:
repository: 'ovn-org/ovn-fake-multinode'
path: 'ovn-fake-multinode'
ref: 'v0.1'
# Check out ovn and ovs separately inside ovn-fake-multinode/ovn and ovn-fake-multinode/ovs
# ovn-fake-multinode builds and installs ovs from ovn-fake-multinode/ovs
# and it builds and installs ovn from ovn-fake-multinode/ovn. It uses the ovs submodule for ovn compilation.
- name: Check out ovs main
uses: actions/checkout@v4
with:
path: 'ovn-fake-multinode/ovs'
repository: 'openvswitch/ovs'
ref: 'main'
- name: Check out ovn ${{ matrix.cfg.branch }}
uses: actions/checkout@v4
with:
path: 'ovn-fake-multinode/ovn'
submodules: recursive
ref: ${{ matrix.cfg.branch }}
- name: Install dependencies
run: |
sudo apt update || true
sudo apt-get install -y podman
- name: Build ovn-fake-multi-node ${{ matrix.cfg.branch }} image
run: |
set -x
sudo -E ./ovn_cluster.sh build
mkdir -p /tmp/_output
sudo podman tag ovn/ovn-multi-node:latest ovn/ovn-multi-node:${{ matrix.cfg.branch }}
sudo podman save ovn/ovn-multi-node:${{ matrix.cfg.branch }} > /tmp/_output/ovn_${{ matrix.cfg.branch }}_image.tar
working-directory: ovn-fake-multinode
- uses: actions/upload-artifact@v4
with:
name: test-${{ matrix.cfg.branch }}-image
path: /tmp/_output/ovn_${{ matrix.cfg.branch }}_image.tar
multinode-tests:
runs-on: ubuntu-22.04
timeout-minutes: 15
needs: [build]
strategy:
fail-fast: false
matrix:
cfg:
- { branch: "${{ github.ref_name }}", testsuiteflags: ""}
- { branch: "branch-22.03", testsuiteflags: "-k 'basic test'" }
name: multinode tests ${{ join(matrix.cfg.*, ' ') }}
env:
RUNC_CMD: podman
OS_IMAGE: "fedora:37"
CENTRAL_IMAGE: "ovn/ovn-multi-node:${{ matrix.cfg.branch }}"
CHASSIS_IMAGE: "ovn/ovn-multi-node:${{ github.ref_name }}"
RELAY_IMAGE: "ovn/ovn-multi-node:${{ github.ref_name }}"
GW_IMAGE: "ovn/ovn-multi-node:${{ github.ref_name }}"
# Disable SSL for now. Revisit this if required.
ENABLE_SSL: no
CC: gcc
OPTS: "--disable-ssl"
dependencies: |
automake libtool gcc bc libjemalloc2 libjemalloc-dev \
libssl-dev llvm-dev libelf-dev libnuma-dev libpcap-dev \
selinux-policy-dev ncat python3-scapy isc-dhcp-server \
podman openvswitch-switch libunbound-dev libunwind-dev
# https://github.com/actions/runner-images/issues/6282
XDG_RUNTIME_DIR: ''
steps:
- name: Check out ovn
uses: actions/checkout@v4
- name: install required dependencies
run: |
sudo apt update || true
sudo apt install -y ${{ env.dependencies }}
- name: Free up disk space
run: |
. .ci/linux-util.sh
free_up_disk_space_ubuntu
- uses: actions/download-artifact@v4
with:
name: test-${{ github.ref_name }}-image
- uses: actions/download-artifact@v4
with:
name: test-branch-22.03-image
- name: Load podman image
run: |
sudo podman load --input ovn_${{ github.ref_name }}_image.tar
sudo podman load --input ovn_branch-22.03_image.tar
- name: Check out ovn-fake-multi-node
uses: actions/checkout@v4
with:
repository: 'ovn-org/ovn-fake-multinode'
path: 'ovn-fake-multinode'
ref: 'v0.1'
- name: Start openvswitch
run: |
sudo systemctl start openvswitch-switch
sudo ovs-vsctl show
# XXX This should be removed when native crun >=1.9.1
- name: update crun script
run: |
crun --version
sudo curl -L "https://github.com/containers/crun/releases/download/1.14.1/crun-1.14.1-linux-amd64" -o /usr/bin/crun
sudo chmod +x /usr/bin/crun
echo "New crun version: "$(crun --version)
- name: Start basic cluster
run: |
sudo -E ./ovn_cluster.sh start
sudo podman exec -it ovn-central ovn-nbctl show
sudo podman exec -it ovn-central ovn-appctl -t ovn-northd version
sudo podman exec -it ovn-chassis-1 ovn-appctl -t ovn-controller version
working-directory: ovn-fake-multinode
- name: Run basic test script
run: |
sudo ./.ci/test_basic.sh
working-directory: ovn-fake-multinode
- name: update PATH
run: |
echo "$HOME/bin" >> $GITHUB_PATH
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: set up python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Check out ovn
uses: actions/checkout@v4
with:
path: 'ovn'
submodules: recursive
- name: Build OVN (for running fake-multinode system tests)
run: |
pip3 install --disable-pip-version-check --user wheel
pip3 install --disable-pip-version-check --user \
-r utilities/containers/py-requirements.txt
USE_SPARSE=no ./.ci/linux-build.sh
working-directory: ovn
- name: Run fake-multinode system tests
run: |
if ! sudo make check-multinode TESTSUITEFLAGS="${{ matrix.cfg.testsuiteflags }}"; then
sudo podman exec -it ovn-central ovn-nbctl show || :
sudo podman exec -it ovn-central ovn-sbctl show || :
sudo podman exec -it ovn-chassis-1 ovs-vsctl show || :
sudo podman exec -it ovn-chassis-1 ip netns || :
sudo podman exec -it ovn-chassis-1 cat /var/log/ovn/ovn-controller.log || :
sudo cat tests/multinode-testsuite.log || :
exit 1
fi
working-directory: ovn
- name: copy logs on failure
if: failure() || cancelled()
run: |
# upload-artifact throws exceptions if it tries to upload socket
# files and we could have some socket files in testsuite.dir.
# Also, upload-artifact doesn't work well enough with wildcards.
# So, we're just archiving everything here to avoid any issues.
mkdir logs
cp ovn/config.log ./logs/
# multinode tests are run as root, need to adjust permissions.
sudo chmod -R +r ovn/tests/multinode-testsuite.* || true
cp -r ovn/tests/multinode-testsuite.* ./logs/ || true
tar -czvf logs.tgz logs/
- name: upload logs on failure
if: failure() || cancelled()
uses: actions/upload-artifact@v4
with:
name: logs-linux-${{ join(matrix.cfg.*, '-') }}
path: logs.tgz
- name: Stop cluster
run: |
sudo -E ./ovn_cluster.sh stop
working-directory: ovn-fake-multinode