22
22
arm64-runner-ec2-ami : ami-04dd2037804df8ff9
23
23
arm64-runner-group : cilium-pwru-runners
24
24
arm64-runner-label : cilium-pwru-runners-arm64-${{ github.run_id }}
25
- arm64-runner-count : 7
25
+ arm64-runner-count : 1 # TODO(7)
26
26
27
27
jobs :
28
28
@@ -47,24 +47,26 @@ jobs:
47
47
- name : Generate and build
48
48
run : |
49
49
make release
50
- tar xfv release/pwru-linux-amd64.tar.gz
51
50
52
51
- name : Store executable
53
52
uses : actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
54
53
with :
55
54
name : pwru
56
- path : pwru
55
+ path : release/ pwru-linux-*.tar.gz
57
56
58
57
- name : Build test-app
58
+ shell : bash
59
59
run : |
60
60
cd test-app
61
- go build .
61
+ for arch in amd64 arm64; do
62
+ GOARCH=${arch} go build -o test-app-${arch} .
63
+ done
62
64
63
65
- name : Store test-app
64
66
uses : actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
65
67
with :
66
68
name : test-app
67
- path : test-app/test-app
69
+ path : test-app/test-app-*
68
70
69
71
arm64-runner-provision :
70
72
needs : [build]
@@ -105,59 +107,39 @@ jobs:
105
107
strategy :
106
108
fail-fast : false
107
109
matrix :
108
- os : ['ubuntu-latest', 'cilium-pwru-runners-arm64-${{ github.run_id }}']
109
- kernel : [ '5.4-20241218.004849', '5.10-20241218.004849', '5.15-20241218.004849', '6.1-20241218.004849', '6.6-20241218.004849', '6.12-20241218.004849', 'bpf-next-20250105.013256' ]
110
+ os :
111
+ # - 'ubuntu-latest'
112
+ - ' cilium-pwru-runners-arm64-${{ github.run_id }}'
113
+ kernel :
114
+ # - '5.4-20241218.004849'
115
+ # - '5.10-20241218.004849'
116
+ # - '5.15-20241218.004849'
117
+ # - '6.1-20241218.004849'
118
+ - ' 6.6-20241218.004849'
119
+ # - '6.12-20241218.004849'
120
+ # - 'bpf-next-20250105.013256'
121
+ # TODO check obsolete kernels
110
122
timeout-minutes : 60
111
123
runs-on : ${{ matrix.os }}
112
124
steps :
113
125
- uses : actions/checkout@09d2acae674a48949e3602304ab46fd20ae0c42f
114
126
115
- - name : Set up job variables
116
- id : vars
117
- run : |
118
- if [[ "${{ matrix.os }}" == "cilium-pwru-runners-arm64-${{ github.run_id }}" ]]
119
- then
120
- # this is racy but it should be fine
121
- ssh_port=$(python3 -c 'import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()')
122
- echo metal_arm64=true >> $GITHUB_OUTPUT
123
- echo lvh_install_deps=false >> $GITHUB_OUTPUT
124
- echo lvh_kernel="/home/runners/vmlinuz-${{ matrix.kernel }}" >> $GITHUB_OUTPUT
125
- echo ssh_port=$ssh_port >> $GITHUB_OUTPUT
126
- echo shared_folder="/home/runners" >> $GITHUB_OUTPUT
127
- else
128
- echo metal_arm64=false >> $GITHUB_OUTPUT
129
- echo lvh_install_deps=true >> $GITHUB_OUTPUT
130
- echo lvh_kernel="" >> $GITHUB_OUTPUT
131
- echo ssh_port=2222 >> $GITHUB_OUTPUT
132
- echo shared_folder="" >> $GITHUB_OUTPUT
133
- fi
134
-
135
- - name : Install GO
136
- if : steps.vars.outputs.metal_arm64 == 'true'
137
- uses : actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
138
- with :
139
- go-version : ' 1.23.2'
140
-
141
- - name : Install LVH CLI
142
- if : steps.vars.outputs.metal_arm64 == 'true'
143
- run : |
144
- go install github.com/cilium/little-vm-helper/cmd/lvh@latest
145
- # Move it into /bin folder, so that LVH action can detect it further
146
- sudo mv $(which lvh) /bin/lvh
147
-
148
127
- name : Retrieve stored pwru executable
149
128
uses : actions/download-artifact@448e3f862ab3ef47aa50ff917776823c9946035b
150
129
with :
151
130
name : pwru
152
- path : pwru
153
131
154
132
- name : Retrieve stored test-app executable
155
133
uses : actions/download-artifact@448e3f862ab3ef47aa50ff917776823c9946035b
156
134
with :
157
135
name : test-app
158
- path : test-app
159
136
160
- - name : Derive kernel version
137
+ - name : Install stored executables
138
+ shell : bash
139
+ run : |
140
+ tar xfv pwru-linux-${{ steps.vars.outputs.arch }}.tar.gz
141
+
142
+ - name : Derive kernel version, arch
161
143
id : kernel
162
144
run : |
163
145
if [[ "${{ matrix.kernel }}" == bpf-next* ]]; then
@@ -174,32 +156,35 @@ jobs:
174
156
175
157
echo "vsn=${major}${minor}" >> "$GITHUB_OUTPUT"
176
158
177
- - name : Download the kernel
178
- if : steps.vars.outputs.metal_arm64 == 'true'
179
- run : |
180
- if [ ! -e "${{ steps.vars.outputs.shared_folder }}/vmlinuz-${{ matrix.kernel }}" ]; then
181
- lvh kernel pull ${{ matrix.kernel }}
182
- mkdir -p ${{ steps.vars.outputs.shared_folder }}
183
- mv ${{ matrix.kernel }}/boot/vmlinuz* ${{ steps.vars.outputs.shared_folder }}/vmlinuz-${{ matrix.kernel }}
184
- rm -rf ${{ matrix.kernel }}
159
+ if [[ "${{ matrix.os }}" == "cilium-pwru-runners-arm64-${{ github.run_id }}" ]]
160
+ then
161
+ echo arch=arm64 >> $GITHUB_OUTPUT
162
+ echo kernel-version=${{ matrix.kernel}} >> $GITHUB_OUTPUT
163
+ else
164
+ echo arch=amd64 >> $GITHUB_OUTPUT
165
+ echo kernel-version="" >> $GITHUB_OUTPUT # for amd64 we can use kernel from lvh image
185
166
fi
186
167
187
168
- name : Provision LVH VMs
188
- uses : cilium/little-vm-helper@e87948476ca97050b1f149ab2aec379d0de19b84 # v0.0.23
169
+ uses : cilium/little-vm-helper@12677b10f89edec8f94ae8e1872aa680bbb83ce7
189
170
with :
190
- install-dependencies : ${{ steps.vars.outputs.lvh_install_deps }}
191
- images-folder-parent : ${{ steps.vars.outputs.shared_folder }}
192
- ssh-port : ${{ steps.vars.outputs.ssh_port }}
171
+ lvh-version : ' v0.0.23'
193
172
mem : 4G
194
173
cpu : 2
195
174
test-name : pwru-test
196
175
image-version : ${{ matrix.kernel }}
197
- kernel : ' ${{ steps.vars.outputs.lvh_kernel }}'
176
+ kernel-version : ${{ steps.kernel.outputs.kernel-version }}
177
+ arch : ${{ steps.kernel.outputs.arch }}
198
178
host-mount : ./
199
179
cmd : |
200
- chmod +x /host/pwru/pwru
201
- chmod +x /host/test-app/test-app
202
-
180
+ mkdir /host/pwru-tmp
181
+ chmod +x /host/pwru
182
+ mv /host/pwru /host/pwru-tmp/
183
+ mv /host/pwru-tmp /host/pwru
184
+
185
+ chmod +x /host/test-app-${{ steps.vars.outputs.arch }}
186
+ mv /host/test-app-${{ steps.vars.outputs.arch }} /host/test-app/test-app
187
+
203
188
# wait for network to be available
204
189
while true;
205
190
do
@@ -213,7 +198,6 @@ jobs:
213
198
- name : Test basic IPv4
214
199
uses : ./.github/actions/pwru-test
215
200
with :
216
- ssh-port : ${{ steps.vars.outputs.ssh_port }}
217
201
test-name : ${{ matrix.kernel }}-basic-ipv4
218
202
pwru-pcap-filter : ' dst host 1.0.0.1 and port 8080'
219
203
setup : |
@@ -225,7 +209,6 @@ jobs:
225
209
- name : Test basic IPv6
226
210
uses : ./.github/actions/pwru-test
227
211
with :
228
- ssh-port : ${{ steps.vars.outputs.ssh_port }}
229
212
test-name : ${{ matrix.kernel }}-basic-ipv6
230
213
pwru-pcap-filter : ' dst host 2606:4700:4700::1001 and port 8080'
231
214
setup : |
@@ -237,7 +220,6 @@ jobs:
237
220
- name : Test advanced IPv4
238
221
uses : ./.github/actions/pwru-test
239
222
with :
240
- ssh-port : ${{ steps.vars.outputs.ssh_port }}
241
223
test-name : ${{ matrix.kernel }}-advanced-ipv4
242
224
pwru-pcap-filter : ' tcp[tcpflags] = tcp-syn'
243
225
setup : |
@@ -249,7 +231,6 @@ jobs:
249
231
- name : Test advanced IPv6
250
232
uses : ./.github/actions/pwru-test
251
233
with :
252
- ssh-port : ${{ steps.vars.outputs.ssh_port }}
253
234
test-name : ${{ matrix.kernel }}-advanced-ipv6
254
235
pwru-pcap-filter : ' ip6[53] & 0x3f = 0x2'
255
236
setup : |
@@ -261,7 +242,6 @@ jobs:
261
242
- name : Test pcap filter using stack
262
243
uses : ./.github/actions/pwru-test
263
244
with :
264
- ssh-port : ${{ steps.vars.outputs.ssh_port }}
265
245
test-name : ${{ matrix.kernel }}-pcap-filter-stack
266
246
pwru-pcap-filter : ' (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
267
247
gen-traffic : curl -vvv -sS --fail --connect-timeout "1" -o /dev/null http://1.1.1.1 || true; sleep 5
@@ -270,7 +250,6 @@ jobs:
270
250
- name : Test --filter-track-skb
271
251
uses : ./.github/actions/pwru-test
272
252
with :
273
- ssh-port : ${{ steps.vars.outputs.ssh_port }}
274
253
test-name : ${{ matrix.kernel }}-filter-track-skb
275
254
pwru-flags : --filter-track-skb
276
255
pwru-pcap-filter : dst host 10.10.20.99
@@ -283,7 +262,6 @@ jobs:
283
262
- name : Test ARP filter
284
263
uses : ./.github/actions/pwru-test
285
264
with :
286
- ssh-port : ${{ steps.vars.outputs.ssh_port }}
287
265
test-name : ${{ matrix.kernel }}-filter-arp
288
266
pwru-pcap-filter : ' arp and arp[7] = 1 and arp[24]= 169 and arp[25] = 254 and arp[26] = 0 and arp[27] = 1'
289
267
setup : |
@@ -303,7 +281,6 @@ jobs:
303
281
- name : Test --filter-ifname
304
282
uses : ./.github/actions/pwru-test
305
283
with :
306
- ssh-port : ${{ steps.vars.outputs.ssh_port }}
307
284
test-name : ${{ matrix.kernel }}-filter-ifname
308
285
pwru-flags : --filter-ifname lo
309
286
pwru-pcap-filter : icmp
@@ -315,7 +292,6 @@ jobs:
315
292
if : ${{ steps.kernel.outputs.vsn >= 518 }}
316
293
uses : ./.github/actions/pwru-test
317
294
with :
318
- ssh-port : ${{ steps.vars.outputs.ssh_port }}
319
295
test-name : ${{ matrix.kernel }}-kprobe-multi-basic
320
296
pwru-flags : --backend=kprobe-multi
321
297
pwru-pcap-filter : ' dst host 1.0.0.1 and port 8080'
@@ -329,7 +305,6 @@ jobs:
329
305
if : ${{ steps.kernel.outputs.vsn >= 606 }}
330
306
uses : ./.github/actions/pwru-test
331
307
with :
332
- ssh-port : ${{ steps.vars.outputs.ssh_port }}
333
308
test-name : ${{ matrix.kernel }}-filter-trace-tc-xdp
334
309
pwru-flags : --filter-trace-tc --filter-trace-xdp
335
310
pwru-pcap-filter : ' dst host 1.0.0.1 and port 8080'
@@ -348,14 +323,26 @@ jobs:
348
323
if : ${{ !success() }}
349
324
uses : cilium/little-vm-helper@e87948476ca97050b1f149ab2aec379d0de19b84 # v0.0.23
350
325
with :
351
- ssh-port : ${{ steps.vars.outputs.ssh_port }}
352
326
provision : ' false'
353
327
cmd : |
354
328
for i in /tmp/pwru-*.status /tmp/pwru-*.ready /tmp/pwru-*.log; do
355
329
echo "--- \$i ---"
356
330
cat \$i || true
357
331
done
358
332
333
+ - name : Tmate deps
334
+ if : ${{ failure() }}
335
+ run : |
336
+ sudo apt update
337
+ sudo apt-get install -y tmate
338
+
339
+ - name : Setup tmate session
340
+ if : ${{ failure() }}
341
+ uses : mxschmitt/action-tmate@v3
342
+ timeout-minutes : 20
343
+ with :
344
+ install-dependencies : false
345
+
359
346
arm64-runner-destroy :
360
347
needs : [arm64-runner-provision, test]
361
348
if : always() && needs.arm64-runner-provision.result != 'skipped'
0 commit comments