Wire the complete OCR review and indexing production pipeline: durable OCR result handoff before remote deletion (17a), native-page evidence and quality-gated candidate composition (17b), review images and restart-safe candidate loading (17c), transactional approval and rejection decisions (17d), reviewed-artifact indexing store with exact count verification (17e), and production approve-to-ready wiring with fail-closed OCR_INDEXING_UNAVAILABLE (17f). Activation remains a separately authorized operation; task 7.4 stays pending. |
||
|---|---|---|
| .. | ||
| app | ||
| tests | ||
| Dockerfile | ||
| Dockerfile.dockerignore | ||
| README.md | ||
| requirements.txt | ||
OCR Service Development Environment
Unit 5 uses the repository-local virtual environment ocr-service/.venv. It is intentionally retained between runs and ignored by Git. Do not install these dependencies globally.
Install
From the repository root:
ocr-service/.venv/bin/python -m pip install -r ocr-service/requirements.txt
Activate it with source ocr-service/.venv/bin/activate.
Test
ocr-service/.venv/bin/python -m pytest ocr-service/tests
The container build downloads the pinned PaddleOCR models. Runtime startup loads those baked models before readiness can report healthy. Deploy one replica with a maximum of 3 CPU and 5 GiB RAM; Docker image labels document these platform-enforced limits.
Build from the repository root so the Dockerfile can use the service-scoped paths:
docker build -f ocr-service/Dockerfile -t rag-ocr-service .