velxio/backend/requirements.txt

22 lines
847 B
Plaintext
Raw Normal View History

chore(oss): drop dead auth/DB dependencies from OSS image After Phase 4 of the OSS / pro split, the OSS code base imports zero auth/DB modules (verified with grep across backend/app/). But the requirements.txt + config.py + .env.example + docs still listed SQLAlchemy, aiosqlite, JWT/bcrypt, OAuth, SECRET_KEY etc. as if they were live. Self-hosters running `pip install -r requirements.txt` were pulling ~30 MB of packages the code never imports. Changes: * backend/requirements.txt — drop sqlalchemy, greenlet, aiosqlite, python-jose, passlib[bcrypt], bcrypt, authlib, email-validator, python-multipart. Keep fastapi, uvicorn, websockets, pydantic, pydantic-settings, httpx, mcp, esptool, wasmtime — everything OSS actually uses. * backend/app/core/config.py — Settings reduced to FRONTEND_URL only. Comment explains the overlay path that adds the rest at Docker build time. * backend/.env.example — same trim: only FRONTEND_URL, with a comment explaining why this file is almost empty. * README.md — "Auth & Project Persistence" section rewritten to describe .vlx export/import. Env-var table reduced to a single row. Stack table updated: no SQLAlchemy, no JWT, persistence = .vlx files. * CLAUDE.md — intro line updated (Auth: None, persistence: .vlx). Key-file-locations rewritten to list the OSS-stateless backend + the new lib/proRoutes / proSession / proSaveAction seams, with an explicit "removed in the split" note pointing to velxio-prod. Stores section drops useAuthStore (overlay-only now). Backend gotchas drop the bcrypt + email-validator + model-import notes. Implemented-features list replaces "Auth + URL persistence + user profile" with portable .vlx export/import. * docs/ESP32_EMULATION.md — two `docker run` examples dropped the `-e SECRET_KEY=...` arg (no longer needed). OSS build verified end-to-end (285 SEO pages prerender, 20 stateless routes, zero sqlalchemy imports). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 03:06:27 +07:00
# Velxio OSS backend — stateless: compile, libraries, simulation,
# iot_gateway, MCP. No auth, no DB, no project persistence; those live in
# the velxio-prod private overlay's pro/backend/requirements.txt and are
# pip-installed on top of this list at Docker build time.
fastapi==0.115.0
uvicorn[standard]==0.32.0
websockets>=12.0
pydantic>=2.11.0
pydantic-settings>=2.6.0
chore(oss): drop dead auth/DB dependencies from OSS image After Phase 4 of the OSS / pro split, the OSS code base imports zero auth/DB modules (verified with grep across backend/app/). But the requirements.txt + config.py + .env.example + docs still listed SQLAlchemy, aiosqlite, JWT/bcrypt, OAuth, SECRET_KEY etc. as if they were live. Self-hosters running `pip install -r requirements.txt` were pulling ~30 MB of packages the code never imports. Changes: * backend/requirements.txt — drop sqlalchemy, greenlet, aiosqlite, python-jose, passlib[bcrypt], bcrypt, authlib, email-validator, python-multipart. Keep fastapi, uvicorn, websockets, pydantic, pydantic-settings, httpx, mcp, esptool, wasmtime — everything OSS actually uses. * backend/app/core/config.py — Settings reduced to FRONTEND_URL only. Comment explains the overlay path that adds the rest at Docker build time. * backend/.env.example — same trim: only FRONTEND_URL, with a comment explaining why this file is almost empty. * README.md — "Auth & Project Persistence" section rewritten to describe .vlx export/import. Env-var table reduced to a single row. Stack table updated: no SQLAlchemy, no JWT, persistence = .vlx files. * CLAUDE.md — intro line updated (Auth: None, persistence: .vlx). Key-file-locations rewritten to list the OSS-stateless backend + the new lib/proRoutes / proSession / proSaveAction seams, with an explicit "removed in the split" note pointing to velxio-prod. Stores section drops useAuthStore (overlay-only now). Backend gotchas drop the bcrypt + email-validator + model-import notes. Implemented-features list replaces "Auth + URL persistence + user profile" with portable .vlx export/import. * docs/ESP32_EMULATION.md — two `docker run` examples dropped the `-e SECRET_KEY=...` arg (no longer needed). OSS build verified end-to-end (285 SEO pages prerender, 20 stateless routes, zero sqlalchemy imports). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 03:06:27 +07:00
# httpx — iot_gateway proxy + MCP
httpx>=0.27.1
mcp>=1.0.0
esptool>=4.7.0
# WASM runtime for Custom Chips on ESP32 (chip's WASM runs in the QEMU worker
# subprocess so I2C events get a synchronous response — see
# docs/wiki/custom-chips-esp32-backend-runtime.md).
wasmtime>=20.0
feat(sim): boot_images module + Pi 3 emulation restored Pi 3 simulation had been broken since at least April 2026 (51 fail-events / 24h per docs/PI3_EMULATION_BROKEN.md). Two distinct defects compounded: 1. qemu_manager.py hard-coded paths for kernel8.img, a device-tree blob (under a DOS 8.3 short name!), and a 5.4 GiB Raspberry Pi OS SD image — none of which shipped in the repo or were pulled at image build. 2. qemu-system-arm + qemu-utils were missing from the Docker image entirely, so even with the boot files in place QEMU couldn't launch. Add both to Dockerfile.standalone (~200 MB). The architecture fix is a new `app.services.boot_images` module: * Manifest-driven (boot_images/manifest.json, versioned in repo, declares SHA256 + size for each file, supports an optional `compressed.{encoding,sha256,size_bytes}` block for assets shipped as .zst). * `BootImageProvider` materialises files lazily, atomically (temp + rename), verifies SHA256 pre- AND post-decompression, caches under /var/cache/velxio/boot-images, serialises concurrent get() calls per image set via asyncio.Lock. * `AssetDownloader` Protocol with two impls: - `LicenseGatedDownloader` — same flow ESP32 / RISC-V QEMU libs use (VELXIO_BINARY_BASE_URL + VELXIO_LICENSE_KEY). - `LocalDirectoryDownloader` — for tests + in-prod use where the licence-module storage is already on the same filesystem (saves the loopback HTTP roundtrip on a 1.4 GiB blob). * `build_downloader_from_env()` picks one — local-dir wins if both sets of env vars are present, so the prod box short-circuits to direct disk reads automatically. * Lifespan hook in qemu_manager.py pre-warms the cache on container boot so first-time user requests don't pay the 30-60 s download + decompress latency. Adding a future board kind (Pi 4 / Pi 5) is now: upload assets via upload-binary.sh, append an entry to manifest.json, register a lifespan pre-warm in the new board's service module. Zero edits to provider.py / downloader.py. Manifest entries for raspberry-pi-3: kernel8.img 9 695 883 bytes (uncompressed) bcm2710-rpi-3-b.dtb 34 687 bytes (uncompressed) raspios-trixie-armhf.img 5 729 419 264 bytes raw / 1 488 002 803 bytes .zst on wire (zstd -19) source: 2026-04-21 build from raspberrypi.com Tests: 21 new unit tests covering manifest parsing, integrity helpers, both downloaders, and the provider's idempotent / concurrent / integrity / decompression / warmup paths. In-process FakeDownloader keeps the suite under 1 s and httpx-free. Docs: new docs/BOOT_IMAGES.md describes the architecture, on-disk layout, named-volume operation, and the procedure for adding a new image set.
2026-05-16 10:41:01 +07:00
# zstd decompression for the boot_images provider — the Raspberry Pi 3
# SD image ships as a .zst on the velxio.dev licence endpoint to save
# ~75% of network transfer.
zstandard>=0.22.0