Skip to content

v3.0.5 — Stability & Production Readiness Patch

Latest

Choose a tag to compare

@DevSpecOps DevSpecOps released this 02 Jul 20:15

🚀 Release Notes — v3.0.5

Stability & Production Readiness Patch

This release addresses all issues identified during an external code review. The focus was on reliability, configurability, observability, and CI stability.


🔧 Bug Fixes & Critical Improvements

1. Consumer Reliability & Data Integrity

  • Added group_id (orders_consumer_group) to prevent duplicate message reads on consumer restarts.
  • Replaced blocking for message in consumer loop with a poll()-based loop that respects shutdown signals (SIGINT/SIGTERM). Containers now stop cleanly even when the topic is idle.
  • Graceful shutdown is now fully reliable.

2. Environment Variables & Configuration

  • CLICKHOUSE_HOST is now respected by all services:
    fastapi_app.py, streamlit_app.py, model_stub.py, and linear_regression.py. No more hard‑coded hostnames.
  • API_URL is now configurable in streamlit_app.py (default: http://api:8000).

3. Kafka Dual‑Listener Setup

  • Containers use kafka:9092.
  • Host (CI, load tests, local runs) use localhost:29092.
  • Both ports are exposed, enabling external tools to reach Kafka without DNS resolution issues.

4. API Startup & Lifespan

  • Removed the 30‑second blocking sleep on startup.
  • Migrated from deprecated @app.on_event to the modern lifespan context manager.
  • Model training now starts in the background after a short initial delay without blocking the API.

5. Dependencies (Updated to Stable Versions)

Package Old New
kafka-python 2.0.2 2.2.20
numpy 1.23.5 1.26.4
scikit-learn 1.2.2 1.4.2
pandas (unpinned) 2.2.0
docker (dev) 6.1.3 7.1.0

All versions are now pinned and tested against Python 3.10.

6. CI/CD Pipeline

  • CI now builds images before starting services (docker compose up -d --build).
  • Fixed CI command from docker-compose to docker compose for GitHub Actions compatibility.
  • Re-added testcontainers to dev dependencies to unblock test imports (will be removed properly in v4.0.0).
  • Removed fragile schema-drift test that caused false positives.

7. Grafana Dashboard

  • Fixed pie chart to display all three channels (online_web, online_app, offline_store).
  • Value options changed from Calculate to All values so nothing is hidden.
  • Provisioning now uses a fixed UID (clickhouse), making dashboards portable across environments.

📦 What’s Demo‑Only (Not a Bug)

Regression Model (Target Leakage)

The linear regression model currently uses amount as both a feature and the target.
This is intentional for the demo — it keeps the inference endpoint simple and predictable.
We will replace it with a proper feature‑based regression (using user stats, weekday, order count, etc.) in v4.0.0.


🛠️ How to Upgrade

git pull origin main
docker compose down -v
docker compose up -d --build

Wait ~1 minute for services to initialise, then open:

Service URL
API Docs http://localhost:8000/docs
Dashboard http://localhost:8501
Grafana http://localhost:3001 (admin / admin)

✅ What to Expect

  • All services start without errors.
  • /health returns model_ready: true.
  • /predict/13?amount=200 returns a category and an amount.
  • Grafana shows Total Revenue, A/B Test, Revenue by Channel (all three slices), Top Categories, Promo vs No Promo, and Weekend vs Weekday.
  • All tests pass in CI and locally (pytest tests/ -v).

🔮 Roadmap to v4.0.0

The next major release will focus on:

  • Kubernetes (minikube) + Helm charts
  • Dead Letter Queue (DLQ) for Kafka
  • MLflow for experiment tracking and model registry
  • Data drift monitoring with Evidently AI
  • Proper regression model (no target leakage)

🙏 Credits

Thanks to the external reviewer who provided the detailed bug report — it helped us harden the system significantly.


📎 Links


Released on: 2026-07-02
Status: Stable · Production‑ready · Fully documented