Add naas-api v1 scaffold and integration plan - #1
Merged
Conversation
Scaffold a Rust workspace exposing the Infinite Noise tRNG over HTTP.
INTEGRATION.md captures the architecture, resolved decisions, measured
throughput, and v1.1 follow-ups.
API listener (8080) serves /api/v1/random/{<n>,stream,hex/<n>,base64/<n>};
ops listener (8081) serves /healthz and Prometheus /metrics. Reader
threads use libftdi via infnoise-rs v0.1.0; an async-channel pool
bridges sync producers to async axum handlers with natural backpressure.
Multi-arch GHCR release on tag push; CI runs fmt + clippy + test +
cargo-deny + amd64 docker build.
Verified end-to-end against real hardware: ~2.4 MB/s sustained per
device, fair-ish concurrency under multi-stream load, no errors emitted
under saturation.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Pin version="0.1.0" on the infnoise-{core,ftdi} git deps so cargo-deny
bans.wildcards stops flagging them.
- Drop cargo-chef (no published image for rust 1.93.1) in favor of a
plain rust:1.93.1-slim-bookworm two-stage build; GHA buildx cache
handles cross-build dep caching.
- Use libftdi1-2 (the actual runtime shared lib package on bookworm)
instead of the libftdi1 transitional shim, which doesn't include
libftdi1.so.2 at runtime.
- Trim unused license allowances from deny.toml (ISC, MPL-2.0, OpenSSL
weren't matching anything).
Verified locally: cargo build, cargo deny check (advisories/bans/
licenses/sources all ok), docker build linux/amd64, and
`docker run --rm naas-api:ci-test --help` all clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
naas-apibinary crate. Routes/api/v1/random/{<n>,stream,hex/<n>,base64/<n>}on :8080;/healthz+ Prometheus/metricson :8081. Anasync-channelpool bridges per-device libftdi readers to async axum handlers, giving natural backpressure under load.-D warnings+ test + cargo-deny + amd64 docker build.INTEGRATION.mdis the single source of truth: architecture, resolved decisions, env-var configuration, measured ~2.4 MB/s-per-device throughput, and v1.1 follow-ups (pull timeout, concurrency cap, per-IP rate limit).Test plan
cargo fmt --all --checkcargo clippy --all-targets --all-features -- -D warningscargo test --all-features --no-runn=0andn>1MiB, hex/base64 round-trip,/healthz,/metricsNAAS_SERIAL_ALLOWLIST(single device on hand)v0.0.1to verify the release workflow publishes multi-arch to GHCR🤖 Generated with Claude Code