interop #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: interop | |
on: | |
workflow_dispatch | |
jobs: | |
config: | |
runs-on: ubuntu-latest | |
outputs: | |
logname: ${{ steps.set-logname.outputs.logname }} | |
starttime: ${{ steps.set-starttime.outputs.starttime }} | |
servers: ${{ steps.set-servers.outputs.servers }} | |
clients: ${{ steps.set-clients.outputs.clients }} | |
images: ${{ steps.set-images.outputs.images }} | |
steps: | |
- name: Set log name | |
id: set-logname | |
run: | | |
LOGNAME=$(date -u +"%Y-%m-%dT%H:%M") | |
echo $LOGNAME | |
echo "logname=$LOGNAME" >> $GITHUB_OUTPUT | |
- name: Save start time | |
id: set-starttime | |
run: | | |
STARTTIME=$(date +%s) | |
echo $STARTTIME | |
echo "starttime=$STARTTIME" >> $GITHUB_OUTPUT | |
- uses: actions/checkout@v4 | |
with: | |
repository: quic-interop/quic-interop-runner | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Determine servers | |
id: set-servers | |
run: | | |
jq '.linuxquic //= {"image": "quay.io/lxin/linuxquic-interop:latest", "url": "https://github.com/lxin/quic", "role": "both"}' implementations.json > temp.json | |
mv -f temp.json implementations.json | |
SERVERS=$(jq -c 'with_entries(select(.value.role == "server" or .value.role == "both")) | keys_unsorted' implementations.json) | |
echo $SERVERS | |
echo "servers=$SERVERS" >> $GITHUB_OUTPUT | |
- name: Determine clients | |
id: set-clients | |
run: | | |
CLIENTS=$(jq -c 'with_entries(select(.value.role == "client" or .value.role == "both")) | keys_unsorted' implementations.json) | |
echo $CLIENTS | |
echo "clients=$CLIENTS" >> $GITHUB_OUTPUT | |
- name: Determine Docker images | |
id: set-images | |
run: | | |
IMAGES=$(jq -c 'keys_unsorted' implementations.json) | |
echo $IMAGES | |
echo "images=$IMAGES" >> $GITHUB_OUTPUT | |
docker-pull-tools: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
image: [ 'quic-network-simulator', 'quic-interop-iperf-endpoint' ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: quic-interop/quic-interop-runner | |
- name: Pull | |
run: | | |
URL="martenseemann/${{ matrix.image }}" | |
docker pull $URL | |
echo "URL=$URL" >> $GITHUB_ENV | |
- name: Docker inspect | |
run: docker image inspect $URL | |
- name: Save Docker image | |
run: | | |
docker save $URL | gzip --best > ${{ matrix.image }}.tar.gz | |
du -sh ${{ matrix.image }}.tar.gz | |
- name: Upload result | |
uses: actions/upload-artifact@v4 | |
with: | |
name: images-${{ matrix.image }} | |
path: ${{ matrix.image }}.tar.gz | |
if-no-files-found: error | |
docker-pull-images: | |
needs: [ config ] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
image: ${{ fromJson(needs.config.outputs.images) }} | |
name: Pull ${{ matrix.image }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: quic-interop/quic-interop-runner | |
- name: Run docker pull | |
run: | | |
jq '.linuxquic //= {"image": "quay.io/lxin/linuxquic-interop:latest", "url": "https://github.com/lxin/quic", "role": "both"}' implementations.json > temp.json | |
mv -f temp.json implementations.json | |
URL=$(jq -r '.["${{ matrix.image }}"].image' implementations.json) | |
echo $URL | |
docker pull $URL | |
echo "URL=$URL" >> $GITHUB_ENV | |
- name: Docker inspect | |
run: docker image inspect $URL | |
- name: Save Docker image | |
run: | | |
docker save $URL | gzip --best > ${{ matrix.image }}.tar.gz | |
du -sh ${{ matrix.image }}.tar.gz | |
- name: Upload result | |
uses: actions/upload-artifact@v4 | |
with: | |
name: image-${{ matrix.image }} | |
path: ${{ matrix.image }}.tar.gz | |
if-no-files-found: error | |
client-tests: | |
uses: ./.github/workflows/interop_tests.yml | |
needs: [ config, docker-pull-tools, docker-pull-images ] | |
name: client group (linuxquic) | |
with: | |
clients: '[ "linuxquic" ]' | |
servers: ${{ needs.config.outputs.servers }} | |
server-tests: | |
uses: ./.github/workflows/interop_tests.yml | |
needs: [ config, docker-pull-tools, docker-pull-images ] | |
name: server group (linuxquic) | |
with: | |
clients: ${{ needs.config.outputs.clients }} | |
servers: '[ "linuxquic" ]' | |
aggregate: | |
needs: [ config, client-tests, server-tests ] | |
runs-on: ubuntu-latest | |
env: | |
LOGNAME: ${{ needs.config.outputs.logname }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: quic-interop/quic-interop-runner | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Download results | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: results-* | |
- name: Aggregate results | |
run: | | |
mv results-*/*.json . | |
python .github/workflows/aggregate.py \ | |
--start-time ${{ needs.config.outputs.starttime }} \ | |
--server ${{ join(fromJson(needs.config.outputs.servers), ',') }} \ | |
--client ${{ join(fromJson(needs.config.outputs.clients), ',') }} \ | |
--log-dir=$LOGNAME \ | |
--output result.json | |
- name: Print result | |
run: jq '.' result.json | |
- name: Upload result to artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: result-aggregated | |
path: result.json | |
- name: Upload logs to interop.seemann.io | |
uses: burnett01/rsync-deployments@796cf0d5e4b535745ce49d7429f77cf39e25ef39 # v7.0.1 | |
if: ${{ github.event_name == 'schedule' }} | |
with: | |
switches: -avzr | |
path: result.json | |
remote_path: ${{ vars.LOG_DIR }}/${{ needs.config.outputs.logname }}/ | |
remote_host: interop.seemann.io | |
remote_user: ${{ secrets.INTEROP_SEEMANN_IO_USER }} | |
remote_key: ${{ secrets.INTEROP_SEEMANN_IO_SSH_KEY }} | |
- name: Point interop.seemann.io to the latest result | |
uses: appleboy/ssh-action@7eaf76671a0d7eec5d98ee897acda4f968735a17 # v1.2.0 | |
if: ${{ github.event_name == 'schedule' }} | |
with: | |
host: interop.seemann.io | |
username: ${{ secrets.INTEROP_SEEMANN_IO_USER }} | |
key: ${{ secrets.INTEROP_SEEMANN_IO_SSH_KEY }} | |
envs: LOGNAME | |
script: | | |
cd ${{ vars.LOG_DIR }} | |
jq '. += [ "${{ needs.config.outputs.logname }}" ]' logs.json | sponge logs.json | |
rm latest || true | |
ln -s $LOGNAME latest |