Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,8 @@ jobs:
strategy:
fail-fast: false
matrix:
# `rs uring` is a separate feature compile (off the default set), and
# CI_STRICT fails it below the 6.12 kernel floor. The embedding tests for
# io_uring live there; uring.yml also runs it on affected release PRs.
# `rs uring` runs the io_uring tests under CI_STRICT, which fails them below
# the 6.12 kernel floor; uring.yml also runs it on affected release PRs.
# `test drain` stands up two relays and drains one under a live JS
# viewer: diff-independent, since a break can arrive through the relay,
# js/net, or the wire between them.
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ jobs:
- "rs/moq-srt/**"
- "rs/moq-stats/**"
- "rs/moq-tokio/**"
- "rs/moq-uring/**"
- "rs/moq-webrtc/**"
- "rs/qmux/**"
- "Cargo.toml"
Expand Down
5 changes: 2 additions & 3 deletions .oss-scanner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ RUN rustup show active-toolchain || rustup toolchain install \
ARG CRATES="kio hang moq-auth moq-crypto moq-hls moq-json moq-loc moq-msf moq-mux moq-net moq-pattern moq-quic moq-relay moq-rtmp moq-rtsp moq-sock moq-srt moq-stats moq-tokio moq-uring moq-webrtc moq-cli"

# Path specs, because the lockfile also has published copies of some workspace crates.
# io-uring compiles the relay's io_uring QUIC workers (`--runtime-io-uring`), which the default features leave out.
RUN cargo fetch --locked \
&& specs=$(printf -- '-p path+file:///src/rs/%s ' $CRATES) \
&& cargo build --locked $specs --features moq-relay/io-uring --bins \
&& cargo test --locked --no-run $specs --features moq-relay/io-uring
&& cargo build --locked $specs --bins \
&& cargo test --locked --no-run $specs

ENV CARGO_NET_OFFLINE=true
2 changes: 1 addition & 1 deletion .oss-scanner/threat_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Out of scope: `js/` and the other language bindings (`py/`, `swift/`, `kt/`, `go

The image is offline, with every crate fetched and `CARGO_NET_OFFLINE` set. The debug build of the in-scope crates, their test binaries, and the `moq-relay` and `moq` binaries are already built in `/src/target/debug`. Debug builds keep overflow checks on.

- **Tests**: `cargo nextest run -p path+file:///src/rs/moq-net` (or any in-scope crate; the path spec is needed because the lockfile also has published copies of some crates). Use nextest as CI does: some tests install process-global state and fail under plain `cargo test`. Add `--features moq-relay/io-uring` for the relay and `moq-uring` so the io\_uring backend's tests run (they skip on a kernel without io\_uring support). Unit tests use the deterministic clock in `kio::clock` rather than wall time, so they are fast and reproducible.
- **Tests**: `cargo nextest run -p path+file:///src/rs/moq-net` (or any in-scope crate; the path spec is needed because the lockfile also has published copies of some crates). Use nextest as CI does: some tests install process-global state and fail under plain `cargo test`. The io\_uring backend's tests in the relay and `moq-uring` skip on a kernel without io\_uring support. Unit tests use the deterministic clock in `kio::clock` rather than wall time, so they are fast and reproducible.
- **A relay to attack**: `./target/debug/moq-relay demo/relay/localhost.toml` listens on UDP and TCP `[::]:4443` with a self-signed certificate and anonymous access to every path. The binary is built with io\_uring support; pass `--runtime-io-uring` to serve QUIC from the io\_uring workers in `rs/moq-uring` and `rs/moq-relay/src/uring.rs` instead of tokio. For authorization testing, grant a narrow anonymous pattern with `[auth] public_subscribe` / `public_publish`, or run the reference auth server (`moq auth generate`, `moq auth sign`, `moq auth serve`, then `[auth] url`; see `doc/bin/cli.md`) and try to escape a signed token's root and patterns. `doc/bin/relay/` documents the config, auth, cluster, and HTTP endpoints.
- **A client**: `./target/debug/moq --help` publishes, subscribes, fetches, and lists announcements against a relay. `curl http://localhost:4443/announced/` and `curl http://localhost:4443/fetch/<broadcast>/<track>` hit the HTTP endpoints.
- **Fuzz harnesses**: `rs/moq-net/fuzz` and `rs/moq-quic/fuzz` hold cargo-fuzz targets for the wire codecs and the QUIC state machine. cargo-fuzz and a nightly toolchain are not in the image, but the targets show the parser entry points.
Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ kio-macros = { version = "0.1.0", path = "rs/kio/macros" }
libc = "0.2"
libloading = "0.9"
linux-raw-sys = { version = "0.12.1", features = ["ioctl"] }
# DNS-SD advertisement and browsing for LAN peer discovery (moq-tokio's `mdns` feature).
# DNS-SD advertisement and browsing for LAN peer discovery, in moq-tokio's `mdns` module.
# `async` awaits the event channel instead of blocking a thread on it.
mdns-sd = { version = "0.21", features = ["async"] }
moq-archive = { version = "0.0.11", path = "rs/moq-archive" }
Expand Down
4 changes: 2 additions & 2 deletions bench/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def command(*args):
},
"profile": "profiling" if mode == "--profile" else "release",
"features": {
"--runtime": "default + moq-relay/io-uring",
"--profile": "default + moq-relay/io-uring; heap adds moq-relay/jemalloc",
"--runtime": "default",
"--profile": "default; heap adds moq-relay/jemalloc",
"--criterion": "see criterion-command.json",
}.get(mode, "default"),
"mode": mode,
Expand Down
11 changes: 8 additions & 3 deletions bench/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -924,17 +924,22 @@ generate_certificate() {

# The runtime matrix and profiling use identical feature selection and support checks.
build_workers() {
local checkout=$1 target=$2 profile=$3 features=moq-relay/io-uring
local checkout=$1 target=$2 profile=$3
local -a features=()
# A revision from before the relay always compiled io_uring on Linux names it as a feature.
if grep -q '^io-uring = ' "$checkout/rs/moq-relay/Cargo.toml"; then
features+=(moq-relay/io-uring)
fi
if [[ ${4:-} == heap ]]; then
features+=,moq-relay/jemalloc
features+=(moq-relay/jemalloc)
fi
printf 'Building worker runtimes: %s (%s)\n' "$checkout" "$profile"
(
# Read just this revision's configuration, even in a nested scratch worktree.
cd /
CARGO_TARGET_DIR=$target cargo --config "$checkout/.cargo/config.toml" build \
--manifest-path "$checkout/Cargo.toml" --locked --profile "$profile" \
-p moq-relay -p moq-bench --features "$features"
-p moq-relay -p moq-bench --features "${features[*]}"
)
}

Expand Down
2 changes: 1 addition & 1 deletion doc/bin/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Playback is behind the `play` feature, since it pulls in windowing and
audio-device dependencies:

```bash
cargo install moq-cli --no-default-features --features "quic,websocket,play,openh264"
cargo install moq-cli --no-default-features --features play,openh264
```

`moq play` skips disabled renditions. If none are enabled, it waits for a later catalog. Disabling the current rendition stops it and selects an enabled replacement.
Expand Down
6 changes: 3 additions & 3 deletions doc/bin/relay/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,17 @@ io_uring = false # Drive them with io_uring instead of tokio
```

Packets are steered by connection ID, so a client that migrates stays with its
worker. `workers` needs the `quic` feature. Every worker and the TLS stream
worker. Every worker and the TLS stream
listener serve one shared identity, generated or file-backed, so a certificate
rotation reaches them together and `/certificate.sha256` stays accurate.

Pinning is off by default because every relay pins its workers to the same
first cores, so two relays on one host, or one limited to fewer CPUs than the
host has, would crowd onto them. Turn it on for a host the relay has to itself.

`io_uring` additionally needs Linux 6.12+ and the `io-uring` cargo feature; it
`io_uring` additionally needs Linux 6.12+; it
shares the same reloadable TLS identity and serves every configured version
like the shared runtime. A setting the build or host cannot deliver refuses to
like the shared runtime. A setting the host cannot deliver refuses to
start rather than being ignored. Linux 6.14 up to the 7.3 fix (backported to
stable kernels) charges io\_uring rings to `RLIMIT_MEMLOCK`: if io\_uring workers
fail to start naming it, raise it (`LimitMEMLOCK=` under systemd).
Expand Down
4 changes: 2 additions & 2 deletions doc/lib/rs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ missing required CPU feature before starting transport cryptography.
| --- | --- |
| [moq-net](/lib/rs/moq-net) | The pub/sub layer: sessions, origins, broadcasts, tracks, groups, frames. Transport-agnostic. |
| [moq-pattern](https://docs.rs/moq-pattern) | Path patterns such as `room/**`. Re-exported by moq-net and moq-auth. |
| [moq-tokio](https://docs.rs/moq-tokio) | Connects and listens over QUIC, WebTransport, WebSocket, TCP, or Unix sockets, from config or CLI flags, and runs MoQ over a qmux session established elsewhere (`qmux` feature). With default features off, `driver` builds a Tokio QUIC stack, with rind cryptography, without MoQ. |
| [qmux](https://docs.rs/qmux) | QUIC streams, datagrams, and flow control over TCP, TLS, WebSocket, and Unix sockets, on moq-quic's state machine. |
| [moq-tokio](https://docs.rs/moq-tokio) | Connects and listens over QUIC, WebTransport, WebSocket, TCP, or Unix sockets (Unix only), from config or CLI flags, and runs MoQ over a qmux session established elsewhere. Its `quic::driver` is a Tokio QUIC stack, with rind cryptography, for applications without MoQ. |
| [qmux](https://docs.rs/qmux) | QUIC streams, datagrams, and flow control over TCP, TLS, WebSocket, and Unix sockets (Unix only), on moq-quic's state machine. |
| [moq-sock](https://docs.rs/moq-sock) | Socket binding and CPU pinning for thread-per-core listeners. |
| [moq-uring](https://docs.rs/moq-uring) | Experimental Linux io\_uring server for moq-lite. |
| [hang](/lib/rs/hang) | The media layer: catalog, containers, ordered frame delivery. |
Expand Down
Loading