Skip to content

v0.5.0: FastAPI Migration & Docs System

Choose a tag to compare

@zjykzj zjykzj released this 22 Aug 07:50
· 39 commits to main since this release

Changed

  • Web framework migrated from Flask to FastAPI (breaking): ASGI serving via gunicorn + uvicorn.workers.UvicornWorker (one-line change in gunicorn.conf.py β€” process management, logrotate and graceful shutdown unchanged); Pydantic request models with validation failures folded into the 200 + code=1 envelope (FastAPI's 422 never leaks); request_id moved from flask.g to a ContextVar + pure-ASGI middleware; endpoints are sync def (threadpool execution for CPU-bound inference)
  • Python floor raised to 3.12 (Dockerfile python:3.12-slim; latest fastapi/uvicorn)
  • RabbitMQ >= 4.3 compatibility: control_queue_durable=True (pidbox reply queue no longer transient) + --without-gossip in start_celery.sh and compose (gossip's transient queue has no durability knob and its features are unused)

Added

  • OpenAPI docs: GET /docs (Swagger UI) + GET /openapi.json, version read from VERSION
  • Request-body guard: Content-Length 20MB ceiling in app.py middleware (200 + code=1 envelope, matches the image download limit)
  • Docs: stack.md Β§1.4 documents the gunicorn-vs-uvicorn decision (differences + when to choose each)
  • Docs: deployment.md β€” canary rollout (nginx traffic split, web grayscale + worker full rollout) and long-term test/prod coexistence (two fully isolated stacks)
  • Docs: fastapi-migration.md (Flask β†’ FastAPI comparison and migration impact); docs index reorganized into engineering / tech-stack / standards categories; concepts.md gains a Pydantic primer
  • Docs: add-engine.md (mounting a new inference engine β€” BasePredictor walkthrough, TensorRT/Triton notes, verification checklist) and forking-contract.md (template usage, editable vs stable areas, upstream merge policy)
  • Docs: READMEs gain an About section stating the template-not-framework positioning
  • Docs: READMEs restructured β€” Features table dropped (OpenAPI pointer moved into Quick Start), Documentation grouped by category, Acknowledgments condensed to one line per category
  • Docs: architecture.md Β§1 names the architecture style β€” unidirectional layering + dependency inversion at the engine boundary (composition root / shared kernel / clean-architecture mapping)
  • Deploy: deploy/nginx-canary.conf β€” canary traffic split reference (weight ramp + X-Canary: 1 header pin, proxy headers, 20MB body match, long-inference read timeout); deploy/README.md marks deploy/ as the reference-artifact area; deployment.md gains Β§0 (environments / canary / traffic split primer) and Β§2.3 snippet corrected (weights only split within one upstream group) and points to the file

See CHANGELOG.md for the full change history.