How hpe-cpp2026-vit-vellore/io-workload-pattern-classification-hotspot-detection works
1. What this repository is
- It implements an autonomous storage control plane for IO workload classification, hotspot detection, predictive forecasting, and volume rebalancing.
- The runtime is split into a local/dev track and a production/Kubernetes track, with the same logical pipeline but different infrastructure choices.
2. Primary runtime topology
- The main live loop is: telemetry source → message bus → stream worker → ML inference/control logic → state store/action history → API/dashboard.
- In local mode this uses Redis Streams; in production it swaps to Kafka and can persist windowed state in TimescaleDB.
3. Telemetry ingestion and simulation
- Synthetic telemetry is generated or replayed by src/data/data_generator.py and scripts/telemetry_playback.py.
- Messages are consumed by src/pipeline/stream_worker.py, which is the pipeline’s central ingestion loop.
- The repository includes a C++ parser (src/cpp/telemetry_parser.cpp) with Python fallback, so parsing and clipping happen at a performance boundary before feature extraction.
4. Stream processing boundary
- src/pipeline/telemetry_parser.py, preprocessor.py, data_loader.py, and topology_graph.py form the preprocessing layer.
- This layer handles parsing, scaling, rolling-window features, dataset construction for forecasting, and topology/placement mapping between volumes and nodes.
- The design separates raw telemetry handling from model-ready features, which is important for the architecture diagram.
5. Model subsystem
- Models are grouped into three functional families under src/models/:
- Classifier: LightGBM baseline/tuned and ARF+ADWIN for workload labeling.
- Anomaly detection: statistical detector, Isolation Forest, LSTM autoencoder, ensemble detector, noisy-neighbor detection.
- Forecasting: demand forecaster, N-BEATS, TFT-based latency forecasting.
- Trained artifacts live in models/, and scripts/train_all.py is the offline training/export pipeline that produces them.
6. Inference architecture
- The control plane can run inference in two modes:
- Local monolithic via src/control_plane/inference_hub.py.
- Remote/disaggregated via src/control_plane/remote_inference_client.py, which proxies heavy inference to external serving systems such as Triton/KServe.
- This is a clear architectural boundary: inference can be colocated with control logic or routed to a dedicated serving tier.
7. Control plane core loop
- src/control_plane/decision_engine.py evaluates policy, thresholds, and safety checks.
- rebalancer.py applies migration/QoS actions, actuators.py abstracts the actual execution backend, and monitor.py watches for stalls and rollback conditions.
- capacity_planner.py handles autoscaling and capacity recommendations, while simulator.py supports what-if evaluation before acting.
- The overall control loop is observe → infer → decide → act → monitor/rollback.
8. Safety and closed-loop guardrails
- Safety thresholds are configured in configs/policy.yaml.
- The control plane has explicit rollback logic if target latency rises too much after a move, and a circuit breaker that disables autonomous rebalancing when rollback rates are excessive.
- This makes the actuation path a constrained subsystem rather than a direct “fire-and-forget” automation layer.
9. API layer
- api/main.py hosts a FastAPI service that exposes health, metrics, policy, simulation, forecasting, volume, and rebalance endpoints.
- api/schemas/models.py defines request/response contracts.
- The API is the main external boundary for both the dashboard and automation clients, and it also includes security concerns such as token issuance and auth checks.
10. Dashboard/UI layer
- dashboard/Home.py and the Streamlit pages provide a read-only and operator-facing control surface.
- The pages are split by concern: cluster overview, hotspot analytics, forecasting, and control-plane history/actions.
- The dashboard talks to the API rather than to internal services directly, which keeps the UI boundary clean.
11. State, messaging, and observability
- src/infrastructure/ contains the bus abstraction and concrete transports (redis_bus.py, kafka_bus.py), plus timescale_client.py, security.py, tracing.py, and bus_factory.py.
- Redis is used as both a transport and a lightweight state store in local mode; TimescaleDB is the persistent time-series backend in production.
- Prometheus/Grafana are wired through deployment manifests, and the API exposes /metrics for scraping.
12. Deployment and environment split
- Local orchestration is defined by docker-compose.yml and includes Redis, API, dashboard, stream worker, and telemetry generator.
- Production deployment is modeled in deploy/helm/hpe-control-plane/ with HPA, probes, service monitoring, and environment-driven swapping of bus, DB, and inference mode.
- configs/settings.py is the central 12-factor configuration layer that switches behavior across environments.
13. Offline workflow and validation
- Data generation, feature engineering, and model training are intentionally separate from serving-time code.
- Notebooks under notebooks/ support exploratory analysis and model evaluation, while tests/ cover the control plane, infrastructure, parser, security, and production pipeline paths.
- This separation is useful for the diagram: training/offline artifacts feed the serving pipeline, but do not sit on the critical runtime path.
Main entry points: decision_engine.py Decision engine · main.py API · stream_worker.py Stream worker · preprocessor.py Preprocessor
Components 27
Runtime paths
Local/dev and production runtime variants of the same closed-loop control plane.
- Telemetry source · Generated or replayed telemetry that enters the system.
src/data/data_generator.py - Message bus · Redis Streams in local mode, Kafka in production.
src/infrastructure/redis_bus.py - TimescaleDB · Persistent windowed state and historical storage in production.
src/infrastructure/timescale_client.py - Bus factory · Chooses Redis or Kafka transport based on environment.
src/infrastructure/bus_factory.py - Security/tracing · Auth, token checks, and observability wiring.
src/infrastructure/security.py
Telemetry pipeline
Ingestion, parsing, preprocessing, and stream orchestration.
- Stream worker · Central live loop that consumes telemetry and coordinates processing.
src/pipeline/stream_worker.py - C++ parser · Fast telemetry parsing boundary with Python fallback.
src/cpp/telemetry_parser.cpp - Parser glue · Python-side parsing and normalization boundary.
src/pipeline/telemetry_parser.py - Preprocessor · Scaling, clipping, and rolling-window feature preparation.
src/pipeline/preprocessor.py - Data loader · Builds model-ready datasets, especially for forecasting.
src/pipeline/data_loader.py - Topology map · Maps volumes and nodes for placement and rebalancing logic.
src/pipeline/topology_graph.py
Control plane
Inference, decisioning, actuation, monitoring, and capacity planning.
- Inference hub · Monolithic in-process inference path for control logic.
src/control_plane/inference_hub.py - Remote client · Proxies inference to external serving systems such as Triton or KServe.
src/control_plane/remote_inference_client.py - Decision engine · Evaluates thresholds, policy, and guardrails before action.
src/control_plane/decision_engine.py - Rebalancer · Applies rebalance and QoS-related moves.
src/control_plane/rebalancer.py - Actuators · Abstracts the concrete backend used to perform actions.
src/control_plane/actuators.py - Monitor · Tracks stalls, post-move regressions, and rollback conditions.
src/control_plane/monitor.py - Capacity planner · Produces capacity and autoscaling recommendations.
src/control_plane/capacity_planner.py - Simulator · Supports scenario testing before applying control actions.
src/control_plane/simulator.py
Serving surfaces
External API, dashboard, and deployment/observability boundaries.
- API · External control surface for health, metrics, policy, forecasting, simulation, and rebalance endpoints.
api/main.py - API schemas · Request and response models for the API boundary.
api/schemas/models.py - Dashboard · Operator-facing read-only dashboard that calls the API.
dashboard/Home.py - Settings · Central environment and deployment configuration.
configs/settings.py - Policy · Thresholds and safety limits for autonomous action.
configs/policy.yaml
Offline assets
Synthetic data generation, training, and persisted model artifacts.
- Data generator · Synthetic telemetry generation for development and training.
src/data/data_generator.py - Train all · Offline training and export pipeline for model artifacts.
scripts/train_all.py - Model artifacts · Persisted classifiers, anomaly detectors, and forecasters.
models
Connections 31
- Telemetry source → Message bus: emit telemetry · Generated or replayed data is published onto the runtime bus.
- Bus factory → Message bus: select transport · Environment determines Redis or Kafka transport.
- Message bus → Stream worker: consume · The stream worker is the central consumer loop.
- Stream worker → C++ parser: parse boundary · High-throughput parsing starts at the C++ boundary when available.
- Stream worker → Parser glue: fallback parse · Python parsing path is used when native parsing is unavailable.
- Parser glue → Preprocessor: normalize · Parsed telemetry is turned into model-ready features.
- Preprocessor → Data loader: window features · Prepared features feed dataset construction and forecasting inputs.
- Preprocessor → Topology map: map placement · Volume/node topology is enriched for control decisions.
- Stream worker → Inference hub: local inference · Monolithic inference path for colocated execution.
- Stream worker → Remote client: remote inference · Heavy inference can be routed to external serving systems.
- Inference hub → Decision engine: scores · Inference outputs are consumed by the decision engine.
- Remote client → Decision engine: scores · Remote inference feeds the same decision path.
- Decision engine → Simulator: what-if · Actions can be evaluated in simulation before execution.
- Decision engine → Rebalancer: approve action · Policy and safety checks gate actuation.
- Rebalancer → Actuators: execute · Rebalance intent is handed to backend-specific actuators.
- Actuators → Monitor: observe outcome · Post-action monitoring watches for stalls and regressions.
- Monitor → Decision engine: rollback signal · Rollback or circuit-breaker conditions feed back into decisions.
- Capacity planner → Decision engine: recommend capacity · Autoscaling recommendations inform control policy.
- API → Decision engine: control requests · External callers drive policy, simulation, and rebalance flows through the API.
- API → API schemas: validate contracts · API requests and responses are typed by schemas.
- Dashboard → API: read/control · The dashboard talks to the API rather than internal services.
- Settings → API: configure · Central config shapes runtime behavior and environment switching.
- Policy → Decision engine: safety thresholds · Policy config constrains autonomous rebalancing.
- Settings → Bus factory: env select · Settings drive transport and deployment selection.
- TimescaleDB → Monitor: persist state · Production stores windowed state and historical metrics.
- TimescaleDB → API: serve history · Historical data supports API endpoints and analytics.
- Data generator → Train all: training data · Synthetic data can feed offline training workflows.
- Train all → Model artifacts: export models · Training produces the artifacts used in serving.
- Model artifacts → Inference hub: load models · Local inference consumes trained artifacts.
- Model artifacts → Remote client: serve models · Remote serving can expose the same artifacts externally.
- Security/tracing → API: protect/trace · Security and tracing are cross-cutting concerns at the service boundary.