Skip to content

Commit 4187b7d

Browse files
committed
ci: introduce reusable workflow for interop tests
This reusable workflow groups interop tests by client, improving organization. More importantly, it works around the 256-job limit in the GitHub Actions' matrix strategy, allowing additional images to be included in implementations.json. This approach requires minimal changes to interop.yml, primarily moving the tests section into interop-tests.yml. The workflow now matrices over all clients, passing a single client and all servers to interop-tests.yml per run. The approach is inspired by: https://github.com/lxin/github-action-matrix-extended and suggested by Lars Eggert in quic-interop#402 Suggested-by: Lars Eggert <[email protected]> Signed-off-by: Xin Long <[email protected]>
1 parent 40efcda commit 4187b7d

File tree

2 files changed

+104
-81
lines changed

2 files changed

+104
-81
lines changed

.github/workflows/interop.yml

Lines changed: 5 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -101,92 +101,16 @@ jobs:
101101
path: ${{ matrix.image }}.tar.gz
102102
if-no-files-found: error
103103
tests:
104+
uses: ./.github/workflows/interop_tests.yml
104105
needs: [ config, docker-pull-tools, docker-pull-images ]
105-
runs-on: ubuntu-latest
106-
continue-on-error: true
107-
timeout-minutes: 45
108106
strategy:
109107
fail-fast: false
110108
matrix:
111-
server: ${{ fromJson(needs.config.outputs.servers) }}
112109
client: ${{ fromJson(needs.config.outputs.clients) }}
113-
name: (${{ matrix.server }} - ${{ matrix.client }})
114-
steps:
115-
- uses: actions/checkout@v4
116-
- uses: actions/setup-python@v5
117-
with:
118-
python-version: 3.8
119-
- name: Enable IPv6 support
120-
run: sudo modprobe ip6table_filter
121-
- run: docker image ls
122-
- name: Download quic-network-simulator image
123-
uses: actions/download-artifact@v4
124-
with:
125-
name: images-quic-network-simulator
126-
- name: Download quic-interop-iperf-endpoint image
127-
uses: actions/download-artifact@v4
128-
with:
129-
name: images-quic-interop-iperf-endpoint
130-
- name: Download ${{ matrix.server }} Docker image
131-
uses: actions/download-artifact@v4
132-
with:
133-
name: image-${{ matrix.server }}
134-
- name: Download ${{ matrix.client }} Docker image
135-
if: ${{ matrix.server != matrix.client }}
136-
uses: actions/download-artifact@v4
137-
with:
138-
name: image-${{ matrix.client }}
139-
- name: Load docker images
140-
run: |
141-
docker load --input quic-network-simulator.tar.gz
142-
docker load --input quic-interop-iperf-endpoint.tar.gz
143-
docker load --input ${{ matrix.server }}.tar.gz
144-
docker load --input ${{ matrix.client }}.tar.gz
145-
- run: docker image ls
146-
- name: Install Wireshark
147-
run: |
148-
sudo add-apt-repository ppa:wireshark-dev/nightly
149-
sudo apt-get update
150-
sudo apt-get install -y --no-install-recommends tshark
151-
- name: Install Python packages
152-
run: |
153-
pip install -U pip
154-
pip install -r requirements.txt
155-
- name: Run tests
156-
env:
157-
CRON: "true"
158-
run: |
159-
(python run.py --client ${{ matrix.client }} --server ${{ matrix.server }} --log-dir logs --json ${{ matrix.server }}_${{ matrix.client }}_results.json -t onlyTests || true) | tee output.txt
160-
mkdir -p logs/${{ matrix.server }}_${{ matrix.client }}
161-
mv output.txt logs/${{ matrix.server }}_${{ matrix.client }}/
162-
- name: Run measurements
163-
env:
164-
CRON: "true"
165-
run: |
166-
python run.py --client ${{ matrix.client }} --server ${{ matrix.server }} --log-dir logs_measurement --json ${{ matrix.server }}_${{ matrix.client }}_measurements.json -t onlyMeasurements || true
167-
if [ ! -d "logs_measurement" ]; then exit 0; fi
168-
find logs_measurement -depth -name "sim" -type d -exec rm -r "{}" \;
169-
find logs_measurement -depth -name "client" -type d -exec rm -r "{}" \;
170-
find logs_measurement -depth -name "server" -type d -exec rm -r "{}" \;
171-
mv logs_measurement/${{ matrix.server }}_${{ matrix.client }}/* logs/${{ matrix.server }}_${{ matrix.client }}/
172-
- name: Upload logs to interop.seemann.io
173-
uses: burnett01/rsync-deployments@796cf0d5e4b535745ce49d7429f77cf39e25ef39 # v7.0.1
174-
if: ${{ github.event_name == 'schedule' }}
175-
with:
176-
switches: -avzr --relative
177-
path: logs/./${{ matrix.server }}_${{ matrix.client }}/
178-
remote_path: ${{ vars.LOG_DIR }}/${{ needs.config.outputs.logname }}
179-
remote_host: interop.seemann.io
180-
remote_user: ${{ secrets.INTEROP_SEEMANN_IO_USER }}
181-
remote_key: ${{ secrets.INTEROP_SEEMANN_IO_SSH_KEY }}
182-
- name: Upload result
183-
uses: actions/upload-artifact@v4
184-
with:
185-
name: results-${{ matrix.server }}-${{ matrix.client }}
186-
if-no-files-found: error
187-
path: |
188-
${{ matrix.server }}_${{ matrix.client }}_results.json
189-
${{ matrix.server }}_${{ matrix.client }}_measurements.json
110+
name: Client Group (${{ matrix.client }})
111+
with:
112+
client: ${{ matrix.client }}
113+
servers: ${{ needs.config.outputs.servers }}
190114
aggregate:
191115
needs: [ config, tests ]
192116
runs-on: ubuntu-latest

.github/workflows/interop_tests.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: interop tests
2+
on:
3+
workflow_call:
4+
inputs:
5+
client:
6+
description: "client"
7+
required: true
8+
type: string
9+
servers:
10+
description: "servers"
11+
required: true
12+
type: string
13+
14+
jobs:
15+
tests:
16+
runs-on: ubuntu-latest
17+
continue-on-error: true
18+
timeout-minutes: 45
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
server: ${{ fromJson(inputs.servers) }}
23+
name: (${{ inputs.client }} - ${{ matrix.server }})
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-python@v5
27+
with:
28+
python-version: 3.8
29+
- name: Enable IPv6 support
30+
run: sudo modprobe ip6table_filter
31+
- run: docker image ls
32+
- name: Download quic-network-simulator image
33+
uses: actions/download-artifact@v4
34+
with:
35+
name: images-quic-network-simulator
36+
- name: Download quic-interop-iperf-endpoint image
37+
uses: actions/download-artifact@v4
38+
with:
39+
name: images-quic-interop-iperf-endpoint
40+
- name: Download ${{ matrix.server }} Docker image
41+
uses: actions/download-artifact@v4
42+
with:
43+
name: image-${{ matrix.server }}
44+
- name: Download ${{ inputs.client }} Docker image
45+
if: ${{ matrix.server != inputs.client }}
46+
uses: actions/download-artifact@v4
47+
with:
48+
name: image-${{ inputs.client }}
49+
- name: Load docker images
50+
run: |
51+
docker load --input quic-network-simulator.tar.gz
52+
docker load --input quic-interop-iperf-endpoint.tar.gz
53+
docker load --input ${{ matrix.server }}.tar.gz
54+
docker load --input ${{ inputs.client }}.tar.gz
55+
- run: docker image ls
56+
- name: Install Wireshark
57+
run: |
58+
sudo add-apt-repository ppa:wireshark-dev/nightly
59+
sudo apt-get update
60+
sudo apt-get install -y --no-install-recommends tshark
61+
- name: Install Python packages
62+
run: |
63+
pip install -U pip
64+
pip install -r requirements.txt
65+
- name: Run tests
66+
env:
67+
CRON: "true"
68+
run: |
69+
(python run.py --client ${{ inputs.client }} --server ${{ matrix.server }} --log-dir logs --json ${{ matrix.server }}_${{ inputs.client }}_results.json -t onlyTests || true) | tee output.txt
70+
mkdir -p logs/${{ matrix.server }}_${{ inputs.client }}
71+
mv output.txt logs/${{ matrix.server }}_${{ inputs.client }}/
72+
- name: Run measurements
73+
env:
74+
CRON: "true"
75+
run: |
76+
python run.py --client ${{ inputs.client }} --server ${{ matrix.server }} --log-dir logs_measurement --json ${{ matrix.server }}_${{ inputs.client }}_measurements.json -t onlyMeasurements || true
77+
if [ ! -d "logs_measurement" ]; then exit 0; fi
78+
find logs_measurement -depth -name "sim" -type d -exec rm -r "{}" \;
79+
find logs_measurement -depth -name "client" -type d -exec rm -r "{}" \;
80+
find logs_measurement -depth -name "server" -type d -exec rm -r "{}" \;
81+
mv logs_measurement/${{ matrix.server }}_${{ inputs.client }}/* logs/${{ matrix.server }}_${{ inputs.client }}/
82+
- name: Upload logs to interop.seemann.io
83+
uses: burnett01/rsync-deployments@796cf0d5e4b535745ce49d7429f77cf39e25ef39 # v7.0.1
84+
if: ${{ github.event_name == 'schedule' }}
85+
with:
86+
switches: -avzr --relative
87+
path: logs/./${{ matrix.server }}_${{ inputs.client }}/
88+
remote_path: ${{ vars.LOG_DIR }}/${{ needs.config.outputs.logname }}
89+
remote_host: interop.seemann.io
90+
remote_user: ${{ secrets.INTEROP_SEEMANN_IO_USER }}
91+
remote_key: ${{ secrets.INTEROP_SEEMANN_IO_SSH_KEY }}
92+
- name: Upload result
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: results-${{ matrix.server }}-${{ inputs.client }}
96+
if-no-files-found: error
97+
path: |
98+
${{ matrix.server }}_${{ inputs.client }}_results.json
99+
${{ matrix.server }}_${{ inputs.client }}_measurements.json

0 commit comments

Comments
 (0)