diff --git a/.github/workflows/repository-hygiene.yml b/.github/workflows/repository-hygiene.yml index 389117cb6..96ac9a2eb 100644 --- a/.github/workflows/repository-hygiene.yml +++ b/.github/workflows/repository-hygiene.yml @@ -13,6 +13,12 @@ on: required: false default: false type: boolean + channel_network_lab: + description: Run one isolated Rust kernel-NAT control (never publishes) + required: false + default: none + type: choice + options: [none, ordinary, prepared, recovery, media, browser-relay] app_checks: description: Build and verify App and Server candidates required: false @@ -27,11 +33,69 @@ permissions: contents: read concurrency: - group: ci-${{ github.ref }} + group: ci-${{ github.ref }}${{ github.event_name == 'workflow_dispatch' && inputs.channel_network_lab != 'none' && inputs.channel_network_lab != '' && '-network-lab' || '' }} cancel-in-progress: false queue: max jobs: + channel-network: + if: github.event_name == 'workflow_dispatch' && inputs.channel_network_lab != 'none' && inputs.channel_network_lab != '' + runs-on: ubuntu-24.04 + timeout-minutes: 40 + defaults: + run: + shell: bash --noprofile --norc -e -o pipefail {0} + env: + CARGO_BUILD_JOBS: '2' + CARGO_INCREMENTAL: '0' + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + - uses: actions/setup-node@v6 + with: + node-version-file: .node-version + cache: npm + - run: npm ci + - name: Install laboratory tools + run: | + sudo apt-get update + sudo apt-get install -y iproute2 nftables conntrack tcpdump + npm install --prefix "$RUNNER_TEMP/channel-network-tools" --no-save --package-lock=false agent-browser@0.36.0 + rustup toolchain install 1.91.0 --profile minimal --target wasm32-unknown-unknown + cargo +1.91.0 install wasm-bindgen-cli --version 0.2.129 --locked + echo "CARGO_TARGET_DIR=$RUNNER_TEMP/channel-network-target" >> "$GITHUB_ENV" + echo "AGENT_BROWSER_BIN=$RUNNER_TEMP/channel-network-tools/node_modules/agent-browser/bin/agent-browser-linux-x64" >> "$GITHUB_ENV" + mkdir -p "$RUNNER_TEMP/channel-network" + - name: Build the matching Native process and Browser adapter + run: | + cargo +1.91.0 build --locked --manifest-path prototype/channel-server/Cargo.toml --example network_lab -j2 2>&1 | tee "$RUNNER_TEMP/channel-network/native-build.log" + node prototype/channel-browser/build.mjs 2>&1 | tee "$RUNNER_TEMP/channel-network/wasm-build.log" + - name: Run the selected kernel-NAT control + env: + CHANNEL_NETWORK_CASE: ${{ inputs.channel_network_lab }} + SOURCE_HEAD: ${{ github.sha }} + CHROMIUM_BIN: /usr/bin/google-chrome + run: | + { + echo "$SOURCE_HEAD" + rustc +1.91.0 --version + node --version + "$AGENT_BROWSER_BIN" --version + "$CHROMIUM_BIN" --version + sha256sum "$CARGO_TARGET_DIR/debug/examples/network_lab" prototype/channel-browser/pkg/piik_channel_browser_bg.wasm + } | tee "$RUNNER_TEMP/channel-network/identity.log" + sudo --preserve-env=PATH,CARGO_TARGET_DIR,AGENT_BROWSER_BIN,CHROMIUM_BIN,SOURCE_HEAD "$(command -v node)" --import tsx scripts/network-lab.ts \ + --case "$CHANNEL_NETWORK_CASE" --output "$RUNNER_TEMP/channel-network/$CHANNEL_NETWORK_CASE" 2>&1 | tee "$RUNNER_TEMP/channel-network/run.log" + - name: Save kernel-NAT evidence + if: always() + uses: actions/upload-artifact@v7 + with: + name: channel-network-${{ inputs.channel_network_lab }}-${{ github.sha }} + path: ${{ runner.temp }}/channel-network/ + if-no-files-found: warn + retention-days: 7 + channel-native: if: github.event_name == 'workflow_dispatch' && inputs.channel_native == true runs-on: xcode-27 @@ -82,7 +146,10 @@ jobs: run: node scripts/release-notes.mjs --pull-request validate: - if: github.event_name != 'pull_request' && !(github.event_name == 'workflow_dispatch' && inputs.channel_native == true) + if: >- + github.event_name != 'pull_request' && + !(github.event_name == 'workflow_dispatch' && + (inputs.channel_native == true || (inputs.channel_network_lab != 'none' && inputs.channel_network_lab != ''))) runs-on: ubuntu-latest outputs: version: ${{ steps.release.outputs.version }} diff --git a/docs/research/network-lab.md b/docs/research/network-lab.md index 8a71d159d..04fb20cc9 100644 --- a/docs/research/network-lab.md +++ b/docs/research/network-lab.md @@ -1,6 +1,9 @@ # Controlled Network Laboratory -The Go/Pion process runners and results below are retained 2.x evidence. The [current Rust source map](../standards/engineering.md#module-map) owns the private 3.x implementation. Generic network-model and namespace helpers remain reusable; the retired process runners are not current validation entrypoints. +This document covers the shared laboratory method and current Rust process +controls. The Go/Pion runner instructions and older results are retained 2.x +evidence. The [current Rust source map](../standards/engineering.md#module-map) +owns the private 3.x implementation; retired runners are not current entrypoints. This document owns the laboratory's method and evidence limits. Product routing remains in [routing and transport](../standards/routing-transport.md); pending @@ -134,13 +137,32 @@ node --import tsx scripts/network-lab.ts --case ordinary --output build/network- ``` `ordinary` covers the real Native room's history, file and Browser media path; -`prepared` covers the prepared Native DataChannel; `recovery` covers established +`prepared` covers the prepared Native DataChannel; `recovery` covers its established UDP loss and remapping; `media` covers decoded media through a prepared Native -transit probe. Each run requires a new output directory. The runner follows +transit probe. `browser-relay` checks decoded picture and source sound after a +50-second UDP outage around a Browser relay, retaining the healthy source. +Each run requires a new output directory. The runner follows `CARGO_TARGET_DIR`, or accepts `--executable` for the matching example binary. Use root in the isolated host, the repository's Node/Rust toolchains, the normal `agent-browser` and Chromium setup, and `iproute2`, `nftables`, `conntrack` and -`tcpdump`. +`tcpdump`. `AGENT_BROWSER_BIN` and `CHROMIUM_BIN` select their installed executables. + +The existing CI workflow can run one of those controls on a temporary Ubuntu +24.04 runner: + +```sh +gh workflow run repository-hygiene.yml --ref feat/channel-prototype -f channel_network_lab=browser-relay +``` + +`channel_network_lab` defaults to `none`; choosing one case enables the dedicated +LAB job and skips normal validation, packaging and publication. LAB dispatches +share one serial queue per ref, separate from ordinary CI. It builds the same +Native example and Browser WASM, then uses the existing namespace, calibration +and cleanup owners. These five controls use NAT and UDP filtering, not seeded +netem delay/loss, so system `iproute2` is sufficient. Build identity, tool versions, +logs, bounded packet captures and the existing result are retained for seven days, +including failed runs. Passing a DataChannel control does not establish decoded +media recovery; this job does not establish physical capture or Internet success rates. At `26857f21`, the maintained `ordinary` and `media` controls passed with their actual room/transport owners and clean teardown. Exact source closures and @@ -151,10 +173,11 @@ Go runners below require their matching snapshot. ## Running The Process Layer -Use an isolated Linux machine or VM with Node/Go from the repository toolchain, +The remainder of this section describes the archived 2.x runner and its CI inputs. +It used an isolated Linux machine or VM with Node/Go from the repository toolchain, Google Chrome, current `iproute2` with netem `seed` support, `nftables`, -`conntrack` and `tcpdump`. CI builds a pinned iproute2 6.17 traffic-control binary locally because -the runner's distribution package lacks that option. Namespace administration +`conntrack` and `tcpdump`. Its CI built a pinned iproute2 6.17 traffic-control binary locally because +the runner's distribution package lacked that option. Namespace administration requires root. Windows/macOS can run the model/unit layer; they need a Linux VM for this process layer. Root on a production host is not an equivalent setup. @@ -178,9 +201,9 @@ Each fault phase replaces its owned qdisc completely: netem's in-place change retains some omitted attributes, including a previous rate limit. Restoration therefore checks the resulting rules and independent UDP reachability as well as the resumed media. Recovery has its own picture/audio/feedback observation window. -The manual CI workflow's `network_lab` input runs this same entry point and never -publishes. Reports and bounded synthetic-traffic captures are under ignored -`build/network-lab/results/`; CI retains them for seven days. +That archived workflow's `network_lab` input ran the matching Go entry point and +never published. Reports and bounded synthetic-traffic captures were retained under +ignored `build/network-lab/results/`, with CI artifacts available for seven days. The `quality-peer`, `quality-sfu-uplink` and `quality-sfu-downlink` cases use the same moving 720p Browser source. They establish 45 seconds of baseline, constrain