# Deployment Status Report

**Date**: 2026-04-02
**Project**: Azaion.Detections

## Component Readiness

| Component | Status | Notes |
|-----------|--------|-------|
| Detections Service (CPU) | Implemented & Tested | Dockerfile exists, 67/67 tests pass |
| Detections Service (GPU) | Implemented & Tested | Dockerfile.gpu exists, e2e tests pass |
| E2E Test Suite | Implemented | docker-compose.test.yml exists |
| Mock Services (Loader, Annotations) | Implemented | docker-compose.mocks.yml exists |
| AZ-178: `POST /detect/video` endpoint | Implemented & Tested | True streaming pipeline; 67/67 tests pass incl. real-video integration test |
| AZ-180: Jetson Orin Nano (aarch64 / JetPack 6.x) | Implemented & Tested | Dockerfile.jetson, requirements-jetson.txt, docker-compose.jetson.yml; 30/33 tests pass (3 skipped: require physical Jetson hardware); INT8 + FP16 fallback via calibration cache |

## External Dependencies

| Dependency | Type | Required | Notes |
|------------|------|----------|-------|
| Loader Service | REST API | Yes | Model download/upload |
| Annotations Service | REST API | Yes | Result persistence, auth refresh |
| classes.json | Config file | Yes | Mounted into container |
| ONNX model (azaion.onnx) | AI model | Yes | Served by Loader |

## Infrastructure Prerequisites

| Prerequisite | Status | Action Required |
|-------------|--------|-----------------|
| Container registry | Needed | User must provide registry URL |
| Docker runtime | Available | Both CPU and GPU Dockerfiles exist |
| NVIDIA runtime | Needed for GPU | `nvidia-docker` required for Dockerfile.gpu |
| Reverse proxy / TLS | Needed | No TLS at application level; requires external termination |
| DNS / Service discovery | Needed | Services communicate by hostname |
| Persistent storage | Not needed | Service is stateless |

## Environment Variables

| Variable | Default | Required | Purpose |
|----------|---------|----------|---------|
| LOADER_URL | http://loader:8080 | Yes | Loader service endpoint |
| ANNOTATIONS_URL | http://annotations:8080 | Yes | Annotations service endpoint |
| CLASSES_JSON_PATH | classes.json | Yes | Detection class definitions |
| LOG_DIR | Logs | No | Log output directory |
| VIDEOS_DIR | ./data/videos | No | Upload video storage |
| IMAGES_DIR | ./data/images | No | Upload image storage |

## Deployment Blockers

| Blocker | Severity | Mitigation |
|---------|----------|------------|
| Security findings (FAIL verdict) | High | Fix Critical/High CVEs before production (see `_docs/05_security/security_report.md`) |
| Containers run as root | Medium | Add non-root USER directive to Dockerfiles |
| No CI/CD pipeline | Medium | Define and implement pipeline |
| Jetson blackbox tests require physical hardware | Low | AC-2, AC-5, AC-6 (GET /health on-device, POST /detect/image on-device, compose up on-device) cannot run in standard CI; validate on Jetson Orin Nano before first production Jetson deployment |

## Recommendation

The application is functionally ready for deployment with AZ-178 (true streaming video detection) and AZ-180 (Jetson Orin Nano + INT8 quantization). Security findings from the audit should be addressed before production deployment — at minimum, pin dependencies to fix CVE-2025-43859 and CVE-2026-28356.

**AZ-178 notes**: `POST /detect/video` uses raw binary body (not multipart). No new env variables are required — existing `VIDEOS_DIR` is used for `StreamingBuffer` temp files. Peak RAM for large video uploads is now bounded by model batch size (~50 MB), not file size.

**AZ-180 notes**: Jetson deployment uses `docker-compose.jetson.yml` — do **not** use the standard CPU/GPU scripts on a Jetson device. The `NVIDIA_VISIBLE_DEVICES=all` env var and `runtime: nvidia` in compose are required. INT8 precision is activated automatically when `azaion.int8_calib.cache` is accessible on the Loader service; the service falls back to FP16 if the cache is absent. Engine files are named per compute capability (e.g. `azaion.cc_8.7_sm_16.int8.engine`) and are not portable between architectures.
