Skip to content

Add naas-api v1 scaffold and integration plan - #1

Merged
michaelpeterswa merged 2 commits into
mainfrom
feat/v1-scaffold
May 9, 2026
Merged

Add naas-api v1 scaffold and integration plan#1
michaelpeterswa merged 2 commits into
mainfrom
feat/v1-scaffold

Conversation

@michaelpeterswa

Copy link
Copy Markdown
Member

Summary

  • Workspace + naas-api binary crate. Routes /api/v1/random/{<n>,stream,hex/<n>,base64/<n>} on :8080; /healthz + Prometheus /metrics on :8081. An async-channel pool bridges per-device libftdi readers to async axum handlers, giving natural backpressure under load.
  • Multi-arch (amd64, arm64) GHCR release on tag push; CI runs fmt + clippy -D warnings + test + cargo-deny + amd64 docker build.
  • INTEGRATION.md is 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 --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-features --no-run
  • End-to-end on a real Infinite Noise TRNG: all four random endpoints, 400 on n=0 and n>1MiB, hex/base64 round-trip, /healthz, /metrics
  • Load test: 32×1MiB parallel + 8 concurrent streams + 200 sequential 32-byte requests — sustained ~2.4 MB/s, no 5xx, fair-ish concurrency
  • CI green on first push
  • Multi-device with NAAS_SERIAL_ALLOWLIST (single device on hand)
  • Tag a v0.0.1 to verify the release workflow publishes multi-arch to GHCR

🤖 Generated with Claude Code

michaelpeterswa and others added 2 commits May 9, 2026 14:56
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>
@michaelpeterswa
michaelpeterswa merged commit 5696be0 into main May 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant