Distributed camera telemetry ingestion with Ray Core, Pandera QA validation, statistical drift detection, and automated incident orchestration.
| Phase | Status | Description |
|---|---|---|
| 1 | Complete | Ray DataStreamer actor simulating 3 concurrent camera feeds |
| 2 | Complete | Distributed QAValidationWorker cluster with schema checks and quarantine routing |
| 3 | Complete | Stateful DriftAnalyzer with KS tests and embedding distance metrics |
| 4 | Complete | PipelineOrchestrator circuit breaker, alerting, and retraining triggers |
See PHASE_REPORT.md for the full engineering log.
- Initializes a local Ray cluster
- Streams mock batches from
camera_1,camera_2, andcamera_3 - Routes every batch through
QAValidationWorkeractors before downstream processing - Sends QA-validated rows to
DriftAnalyzerfor sliding-window statistical drift checks - Feeds QA and drift metrics into
PipelineOrchestratorfor circuit breaker evaluation - Quarantines schema failures to
data/quarantine/ - Writes incident alerts to
alerts/and queues simulated retraining webhook POSTs on trip
sentinel-ray/
├── config.py # Paths, stream sizes, QA, drift, and orchestration thresholds
├── ingestion_engine.py # Ray DataStreamer actor
├── qa_validator.py # Pandera schema, QAValidationWorker, quarantine logic
├── drift_detector.py # Golden baseline, DriftAnalyzer, KS + embedding drift
├── orchestrator.py # PipelineOrchestrator, circuit breaker, alerting, retraining
├── main.py # Entry point (stream → QA → drift → orchestration)
├── Dockerfile # Production container image (non-root)
├── docker-compose.yml # Local deployment with volume mounts and resource limits
├── PHASE_REPORT.md # Phase-by-phase engineering log
├── requirements.txt
├── tests/
│ ├── conftest.py
│ ├── test_qa_validator.py
│ ├── test_drift_detector.py
│ └── test_orchestrator.py
└── README.md
cd sentinel-ray
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python3 main.py
pytest tests/ -vBuild and run the full pipeline in a container:
mkdir -p data/quarantine alerts logs
docker compose up --buildThis will:
- Build the SentinelRay image from
Dockerfile(Python 3.12, non-rootsentineluser) - Mount host directories for quarantine data, alerts, and logs
- Limit the container to 2 CPUs and 2 GB RAM
- Expose port
8265for the Ray dashboard
Inspect outputs on the host after a run:
data/quarantine/ # QA-failed rows
alerts/ # Incident JSON payloads + retraining trigger records
logs/ # Application logs (when configured to file)
docker compose build
docker compose run --rm sentinel-ray pytest tests/ -vOr against a running container:
docker compose exec sentinel-ray pytest tests/ -vflowchart LR
Main[main.py] --> Stream[DataStreamer]
Stream --> QA[QAValidationWorker Pool]
QA --> Valid[Valid Rows]
QA --> Quarantine[data/quarantine/]
Valid --> Drift[DriftAnalyzer]
QA --> Orchestrator[PipelineOrchestrator]
Drift --> Orchestrator
Orchestrator --> Alerts[alerts/]
Orchestrator --> Retrain[Retraining Webhook]
Valid --> Log[Telemetry Logging]
| Setting | Default | Description |
|---|---|---|
QA_QUARANTINE_RATE_THRESHOLD |
0.15 |
Rolling quarantine rate that trips the breaker |
ORCHESTRATOR_QA_WINDOW_BATCHES |
5 |
Batch window for quarantine rate calculation |
DRIFT_MIN_FEATURES_FOR_INCIDENT |
2 |
Drifted features required to trip breaker |
RETRAINING_WEBHOOK_URL |
http://localhost:8080/api/v1/retrain |
Simulated retraining endpoint |
ALERTS_DIR |
alerts/ |
Incident alert JSON output directory |
From batch round 6 onward, camera_2 exceeds the 15% quarantine threshold. The orchestrator:
- Trips the circuit breaker once for
camera_2 - Writes a structured Slack/PagerDuty-style JSON alert to
alerts/ - Queues an asynchronous retraining pipeline POST (saved locally if the webhook is unreachable)
Final pipeline output includes explicit incident and webhook summaries.