Skip to content

Commit bbcf38e

Browse files
merge: reconcile build1102 server with reviewed parent CI repairs
2 parents 1985280 + 68cd049 commit bbcf38e

7 files changed

Lines changed: 359 additions & 98 deletions

File tree

‎.github/workflows/bench-regression.yml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ on:
4242
- 'v2/Cargo.toml'
4343
- 'v2/Cargo.lock'
4444
- '.github/workflows/bench-regression.yml'
45+
- 'scripts/ci-install-ubuntu-deps.sh'
4546
pull_request:
4647
paths:
4748
- 'v2/crates/**/benches/**'
@@ -50,6 +51,7 @@ on:
5051
- 'v2/Cargo.toml'
5152
- 'v2/Cargo.lock'
5253
- '.github/workflows/bench-regression.yml'
54+
- 'scripts/ci-install-ubuntu-deps.sh'
5355
workflow_dispatch:
5456

5557
permissions:
@@ -68,7 +70,7 @@ jobs:
6870
# ── HARD GATE: every bench must still compile + link ─────────────────────
6971
bench-compile:
7072
name: bench compile-verify (--no-run)
71-
runs-on: ubuntu-latest
73+
runs-on: ubuntu-24.04
7274
steps:
7375
- name: Checkout (recursive — wifi-densepose-rufield path-deps vendor/rufield)
7476
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
@@ -84,8 +86,7 @@ jobs:
8486
# the whole graph, so these are required here too.
8587
- name: Install Tauri / GTK / serial system dev libraries
8688
run: |
87-
sudo apt-get update
88-
sudo apt-get install -y --no-install-recommends \
89+
bash scripts/ci-install-ubuntu-deps.sh \
8990
libglib2.0-dev \
9091
libgtk-3-dev \
9192
libsoup-3.0-dev \

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
# Rust Workspace Tests
8080
rust-tests:
8181
name: Rust Workspace Tests
82-
runs-on: ubuntu-latest
82+
runs-on: ubuntu-24.04
8383
steps:
8484
- name: Checkout code
8585
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
@@ -96,8 +96,7 @@ jobs:
9696
# standard Tauri-on-Ubuntu set.
9797
- name: Install Tauri / GTK / serial system dev libraries
9898
run: |
99-
sudo apt-get update
100-
sudo apt-get install -y --no-install-recommends \
99+
bash scripts/ci-install-ubuntu-deps.sh \
101100
libglib2.0-dev \
102101
libgtk-3-dev \
103102
libsoup-3.0-dev \

‎.github/workflows/firmware-qemu.yml‎

Lines changed: 30 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -22,50 +22,32 @@ on:
2222
- 'scripts/swarm_presets/**'
2323
- '.github/workflows/firmware-qemu.yml'
2424

25+
defaults:
26+
run:
27+
shell: bash
28+
2529
env:
2630
IDF_VERSION: "v5.4"
27-
QEMU_REPO: "https://github.com/espressif/qemu.git"
28-
QEMU_BRANCH: "esp-develop"
2931

3032
jobs:
3133
build-qemu:
3234
name: Build Espressif QEMU
33-
# QEMU's bundled dtc fails with GCC 15 on Ubuntu 26.04. Keep the
34-
# Ubuntu 24.04 / GCC 13 build environment until that dependency is updated.
3535
runs-on: ubuntu-24.04
36+
# This SDK image installs Espressif's checksum-verified QEMU package and
37+
# its runtime libraries. Match the image used by both consumers below.
38+
# Avoid APT DNS and an unpinned floating QEMU source build on cold caches.
39+
container:
40+
image: espressif/idf:v5.4@sha256:f1e9f69dc052b9afc7801ca884e0ef40c17e014bb05ce73d9c09d29290bd17fb
3641
steps:
37-
- name: Cache QEMU build
38-
id: cache-qemu
39-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
40-
with:
41-
path: /opt/qemu-esp32
42-
# Scope native binaries to the build image; bump v1 when refreshing
43-
# the floating upstream branch. Do not restore an unqualified cache.
44-
key: qemu-esp32s3-ubuntu-24.04-${{ env.QEMU_BRANCH }}-v1
45-
46-
- name: Install QEMU build dependencies
47-
if: steps.cache-qemu.outputs.cache-hit != 'true'
48-
run: |
49-
sudo apt-get update
50-
sudo apt-get install -y \
51-
git build-essential ninja-build pkg-config \
52-
libglib2.0-dev libpixman-1-dev libslirp-dev \
53-
libgcrypt20-dev \
54-
python3 python3-venv
55-
56-
- name: Clone and build Espressif QEMU
57-
if: steps.cache-qemu.outputs.cache-hit != 'true'
42+
- name: Prepare SDK-provided Espressif QEMU
5843
run: |
59-
git clone --depth 1 -b "$QEMU_BRANCH" "$QEMU_REPO" /tmp/qemu-esp
60-
cd /tmp/qemu-esp
61-
mkdir build && cd build
62-
../configure \
63-
--target-list=xtensa-softmmu \
64-
--prefix=/opt/qemu-esp32 \
65-
--enable-slirp \
66-
--disable-werror
67-
ninja -j$(nproc)
68-
ninja install
44+
. "$IDF_PATH/export.sh"
45+
QEMU_BIN="$(command -v qemu-system-xtensa)"
46+
QEMU_ROOT="$(dirname "$(dirname "$QEMU_BIN")")"
47+
"$QEMU_BIN" --version
48+
"$QEMU_BIN" -machine help | grep -E '^esp32s3[[:space:]]'
49+
mkdir -p /opt/qemu-esp32
50+
cp -a "$QEMU_ROOT/." /opt/qemu-esp32/
6951
7052
- name: Verify QEMU binary
7153
run: |
@@ -85,7 +67,7 @@ jobs:
8567
needs: build-qemu
8668
runs-on: ubuntu-latest
8769
container:
88-
image: espressif/idf:v5.4
70+
image: espressif/idf:v5.4@sha256:f1e9f69dc052b9afc7801ca884e0ef40c17e014bb05ce73d9c09d29290bd17fb
8971

9072
strategy:
9173
fail-fast: false
@@ -214,32 +196,35 @@ jobs:
214196

215197
fuzz-test:
216198
name: Fuzz Testing (ADR-061 Layer 6)
217-
runs-on: ubuntu-latest
199+
runs-on: ubuntu-24.04
200+
env:
201+
CC: clang-18
218202
steps:
219203
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
220204
with:
221205
submodules: recursive
222206

223-
- name: Install clang
207+
- name: Verify hosted Clang
208+
# Ubuntu 24.04 hosted runners already contain Clang 18 and libFuzzer.
209+
# Do not fetch the redundant distro meta-package before testing.
224210
run: |
225-
sudo apt-get update
226-
sudo apt-get install -y clang
211+
"$CC" --version
227212
228213
- name: Build fuzz targets
229214
working-directory: firmware/esp32-csi-node/test
230-
run: make all CC=clang
215+
run: make all CC="$CC"
231216

232217
- name: Run serialize fuzzer (60s)
233218
working-directory: firmware/esp32-csi-node/test
234-
run: make run_serialize FUZZ_DURATION=60 || echo "FUZZER_CRASH=serialize" >> "$GITHUB_ENV"
219+
run: make run_serialize CC="$CC" FUZZ_DURATION=60 || echo "FUZZER_CRASH=serialize" >> "$GITHUB_ENV"
235220

236221
- name: Run edge enqueue fuzzer (60s)
237222
working-directory: firmware/esp32-csi-node/test
238-
run: make run_edge FUZZ_DURATION=60 || echo "FUZZER_CRASH=edge" >> "$GITHUB_ENV"
223+
run: make run_edge CC="$CC" FUZZ_DURATION=60 || echo "FUZZER_CRASH=edge" >> "$GITHUB_ENV"
239224

240225
- name: Run NVS config fuzzer (60s)
241226
working-directory: firmware/esp32-csi-node/test
242-
run: make run_nvs FUZZ_DURATION=60 || echo "FUZZER_CRASH=nvs" >> "$GITHUB_ENV"
227+
run: make run_nvs CC="$CC" FUZZ_DURATION=60 || echo "FUZZER_CRASH=nvs" >> "$GITHUB_ENV"
243228

244229
- name: Check for crashes
245230
working-directory: firmware/esp32-csi-node/test
@@ -320,7 +305,7 @@ jobs:
320305
needs: [build-qemu]
321306
runs-on: ubuntu-latest
322307
container:
323-
image: espressif/idf:v5.4
308+
image: espressif/idf:v5.4@sha256:f1e9f69dc052b9afc7801ca884e0ef40c17e014bb05ce73d9c09d29290bd17fb
324309

325310
steps:
326311
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262

‎.github/workflows/mqtt-integration.yml‎

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,8 @@ jobs:
3333
runs-on: ubuntu-latest
3434
timeout-minutes: 20
3535

36-
# NB: we don't use a `services:` mosquitto container here because the
37-
# eclipse-mosquitto:2.x image rejects anonymous connections by default
38-
# and GH Actions `services` doesn't easily support mounting a custom
39-
# config file. We start mosquitto manually in a step below with an
40-
# inline `allow_anonymous true` config.
36+
# Explicit vendor broker config; publish only the CI loopback port.
37+
# No APT package install or production MQTT security policy is involved.
4138

4239
env:
4340
RUVIEW_RUN_INTEGRATION: "1"
@@ -50,29 +47,26 @@ jobs:
5047
with:
5148
submodules: recursive
5249

53-
- name: Install mosquitto + clients and start with allow_anonymous
50+
- name: Start pinned Mosquitto broker with CI-only anonymous listener
5451
run: |
55-
sudo apt-get update -qq
56-
sudo apt-get install -y mosquitto mosquitto-clients
57-
sudo systemctl stop mosquitto || true
58-
# Inline config: anon listener on 11883 only — no TLS, no auth,
59-
# OK for CI because we test the wire shape, not security.
60-
# Production deployments enable mTLS per ADR-115 §3.9.
61-
cat > /tmp/mosquitto-ci.conf <<'EOF'
62-
listener 11883
52+
cat > "$RUNNER_TEMP/mosquitto-ci.conf" <<'CONFIG'
53+
listener 1883
6354
allow_anonymous true
6455
persistence false
6556
log_dest stdout
66-
EOF
67-
mosquitto -c /tmp/mosquitto-ci.conf -d
57+
CONFIG
58+
docker run --detach --user mosquitto --name ruview-mqtt-ci \
59+
--publish 127.0.0.1:11883:1883 \
60+
--mount "type=bind,source=$RUNNER_TEMP/mosquitto-ci.conf,target=/mosquitto/config/mosquitto.conf,readonly" \
61+
eclipse-mosquitto:2.0.18@sha256:d12c8f80dfc65b768bb9acecc7ef182b976f71fb681640b66358e5e0cf94e9e9
6862
for i in {1..20}; do
69-
if mosquitto_pub -h 127.0.0.1 -p 11883 -t healthcheck -m ok -q 0 2>/dev/null; then
70-
echo "mosquitto reachable on 11883"; exit 0
63+
if docker exec ruview-mqtt-ci mosquitto_pub -h 127.0.0.1 -p 1883 -t healthcheck -m ok -q 0 \
64+
&& python3 -c 'import socket; socket.create_connection(("127.0.0.1", 11883), timeout=3).close()'; then
65+
exit 0
7166
fi
72-
sleep 2
67+
sleep 1
7368
done
74-
echo "mosquitto never became reachable" >&2
75-
tail -50 /var/log/mosquitto/*.log 2>/dev/null || true
69+
docker logs ruview-mqtt-ci
7670
exit 1
7771
7872
- name: Install Rust toolchain
@@ -90,16 +84,15 @@ jobs:
9084
python -m pip install --quiet pyyaml
9185
python scripts/validate-ha-blueprints.py
9286
93-
- name: Verify unit tests still pass under --features mqtt
87+
- name: Verify MQTT-feature unit tests
9488
working-directory: v2
95-
# `cargo test` accepts a single TESTNAME filter, so we run the
96-
# whole --lib suite here. That gives us the full 410-test green
97-
# bar under --features mqtt (which is more reassuring than
98-
# filtering anyway).
89+
# Keep this broker workflow focused on the feature it changes. The full
90+
# library/workspace and temporal Release suites run in ci.yml; repeating
91+
# long learner training here exhausted this job before broker tests ran.
9992
run: >-
100-
cargo test -p wifi-densepose-sensing-server
93+
cargo test --locked -p wifi-densepose-sensing-server
10194
--features mqtt --no-default-features
102-
--lib
95+
--lib mqtt::
10396
--no-fail-fast
10497
10598
- name: Run integration tests against mosquitto
@@ -114,5 +107,8 @@ jobs:
114107
- name: Dump broker logs on failure
115108
if: failure()
116109
run: |
117-
docker ps -a
118-
docker logs $(docker ps -aqf "ancestor=eclipse-mosquitto:2.0.18") || true
110+
docker logs ruview-mqtt-ci || true
111+
112+
- name: Stop the owned CI broker
113+
if: always()
114+
run: docker rm --force ruview-mqtt-ci

‎scripts/ci-install-ubuntu-deps.sh‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
# Ephemeral Ubuntu 24.04 CI dependency installation. Keep Ubuntu signature/TLS
3+
# verification, but bypass the hosted image's failing mirror+file indirection.
4+
set -euo pipefail
5+
6+
if (( $# == 0 )); then
7+
echo 'Pass one or more package names.' >&2
8+
exit 2
9+
fi
10+
for package in "$@"; do
11+
if [[ ! "$package" =~ ^[a-z0-9][a-z0-9+.-]*(:amd64)?$ ]]; then
12+
echo 'Invalid package argument; APT options are not accepted.' >&2
13+
exit 2
14+
fi
15+
done
16+
if [[ $(uname -s) != Linux ]] || [[ ! -r /etc/os-release ]]; then
17+
echo 'This helper requires an Ubuntu 24.04 amd64 CI runner.' >&2
18+
exit 2
19+
fi
20+
os_id=$(. /etc/os-release; printf '%s' "$ID")
21+
os_version=$(. /etc/os-release; printf '%s' "$VERSION_ID")
22+
if [[ "$os_id" != ubuntu || "$os_version" != 24.04 || $(dpkg --print-architecture) != amd64 ]]; then
23+
echo 'This helper requires an Ubuntu 24.04 amd64 CI runner.' >&2
24+
exit 2
25+
fi
26+
keyring=/usr/share/keyrings/ubuntu-archive-keyring.gpg
27+
[[ -r "$keyring" ]] || { echo 'Ubuntu archive keyring is unavailable.' >&2; exit 1; }
28+
# Fail quickly on actual repository DNS loss, rather than spending hours trying
29+
# each package through broken mirror fallbacks.
30+
for host in archive.ubuntu.com security.ubuntu.com; do
31+
timeout 20 getent ahostsv4 "$host" >/dev/null
32+
done
33+
apt_dir=$(mktemp -d -t ruview-ci-apt.XXXXXX)
34+
source_list="$apt_dir/ubuntu.list"
35+
parts_dir="$apt_dir/empty"
36+
trap 'rm -f -- "$source_list"; rmdir -- "$parts_dir" "$apt_dir"' EXIT
37+
mkdir "$parts_dir"
38+
chmod 755 "$apt_dir" "$parts_dir"
39+
cat > "$source_list" <<SOURCES
40+
deb [signed-by=$keyring] https://archive.ubuntu.com/ubuntu noble main restricted universe multiverse
41+
deb [signed-by=$keyring] https://archive.ubuntu.com/ubuntu noble-updates main restricted universe multiverse
42+
deb [signed-by=$keyring] https://archive.ubuntu.com/ubuntu noble-backports main restricted universe multiverse
43+
deb [signed-by=$keyring] https://security.ubuntu.com/ubuntu noble-security main restricted universe multiverse
44+
SOURCES
45+
chmod 644 "$source_list"
46+
apt_command=(env DEBIAN_FRONTEND=noninteractive apt-get)
47+
if (( EUID != 0 )); then apt_command=(sudo "${apt_command[@]}"); fi
48+
apt_options=(-o "Dir::Etc::sourcelist=$source_list" -o "Dir::Etc::sourceparts=$parts_dir"
49+
-o APT::Get::List-Cleanup=0 -o APT::Update::Error-Mode=any
50+
-o Acquire::Retries=2 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20)
51+
"${apt_command[@]}" "${apt_options[@]}" update
52+
"${apt_command[@]}" "${apt_options[@]}" install -y --no-install-recommends "$@"

0 commit comments

Comments
 (0)