@@ -10,30 +10,117 @@ The following port mappings are used across the OmniPDF microservices in both de
1010
1111| Service | Description | Port |
1212| ---------------------------| -----------------------------------------------------------| --------|
13+ | ** Frontend Services** | | |
1314| Streamlit Frontend | Web UI for user interaction | 8501 |
14- | Nginx API Gateway | Proxies file uploads to PDF Processor | 8080 |
15- | PDF Processor Service | Main coordinator for processing and routing | 8000 |
16- | Chat Service | Retrieves context chunks and queries LLM | 8000 |
17- | PDF Extraction Service | Extracts tables and images from PDFs | 8000 |
18- | Docling Translate Service | Translates text fields in docling-style JSON | 8000 |
19- | PDF Renderer Service | Overlays translated tables and text onto the original PDF | 8000 |
20- | Embedder Service | Chunks + embeds PDF text and stores in ChromaDB | 8000 |
21- | vLLM LLM Server | LLM backend for chat, translation, captions, summaries | 1234 |
22- | Redis | In-memory session store | 6379 |
23- | ChromaDB | Temporary in-memory vector store | 5100 |
24- | S3-Compatible Store | Object storage (e.g., MinIO S3 API) | 9000 |
25- | MinIO Console | MinIO web-based Admin UI | 9001 |
15+ | Nginx API Gateway | Proxies requests and handles file uploads | 8080 |
16+ | ** Core Processing Services** | | |
17+ | PDF Processor Service | Main orchestrator - coordinates all processing workflows | 8000 |
18+ | PDF Extraction Service | Extracts tables and images from PDFs using docling | 8000 |
19+ | Docling Translation Service | Translates text fields in docling-format JSON | 8000 |
20+ | PDF Renderer Service | Renders translated content onto original PDFs | 8000 |
21+ | Embedder Service | Chunks text and creates embeddings for vector storage | 8000 |
22+ | Chat Service | RAG chat interface using retrieved context chunks | 8000 |
23+ | Image Captioner Service | AI image captioning for extracted images using VLM | 8000 |
24+ | Metadata Service | Document metadata and word cloud generation | 8000 |
25+ | Cleaner | Background cleanup of expired sessions and files | N/A |
26+ | ** AI/ML Services** | | |
27+ | vLLM Text Model | Text-only LLM (Llama 3.1, Qwen2.5) for chat/translation | 8000 |
28+ | vLLM Vision-Language Model | Multimodal VLM (Llava, Qwen2-VL) for image captioning | 8000 |
29+ | ** Data Services** | | |
30+ | Redis | Session storage and caching | 6379 |
31+ | ChromaDB | Vector database for embeddings | 8000 |
32+ | MinIO | S3-compatible object storage for files | 9000 |
33+ | MinIO Console | MinIO web-based Admin UI | 9001 |
34+
35+ ## Architecture
36+
37+ OmniPDF follows a ** microservices architecture** with ** centralized orchestration** :
38+
39+ - ** pdf-processor-service** : Main hub that coordinates all processing workflows
40+ - ** Processing services** : Specialized services for extraction, translation, rendering, embedding, and chat
41+ - ** Data layer** : Redis (sessions), ChromaDB (vectors), MinIO (files)
42+ - ** AI/ML layer** : vLLM text and vision-language models
2643
2744## Deployment Environments
2845
29- OmniPDF supports multiple deployment environments with different orchestration methods :
46+ OmniPDF supports multiple deployment environments with ** Kubernetes + Helm ** :
3047
3148- ** Development** : Docker Compose for local development
32- - ** Pre-staging** : CodeReady Containers (CRC) with local OpenShift registry
33- - ** Staging** : Offline OpenShift Container Platform (OCP) with internal registries
34- - ** Production** : Offline OpenShift Container Platform (OCP) with internal registries
49+ - ** Pre-staging** : CodeReady Containers (CRC) with Helm charts and local OpenShift registry
50+ - ** Staging** : Offline OpenShift Container Platform (OCP) with Helm deployment
51+ - ** Production** : Offline OpenShift Container Platform (OCP) with Helm deployment
3552
36- ** Note** : Staging and production environments are offline/disconnected and cannot access external registries. All container images must be pre-mirrored to internal registries.
53+ ** Container Registry Patterns** :
54+ - ** Development** : Local Docker images
55+ - ** Pre-staging** : ` default-route-openshift-image-registry.apps-crc.testing/omnipdf/SERVICE_NAME `
56+ - ** Staging/Production** : Internal/disconnected registries (images must be pre-mirrored)
57+
58+ ## Quick Start
59+
60+ ### Development (Docker Compose)
61+ ``` bash
62+ # Start all services
63+ docker compose up --build
64+
65+ # Start with GPU support (for LLM services)
66+ docker compose -f docker-compose.gpu.yml up --build
67+ ```
68+
69+ ### Kubernetes/OpenShift (Helm)
70+ ``` bash
71+ # Deploy individual service
72+ helm install chat-service ./helm/chat-service --namespace omnipdf
73+
74+ # Deploy all services
75+ for service in helm/* /; do
76+ service_name=$( basename " $service " )
77+ helm install " $service_name " " $service " --namespace omnipdf
78+ done
79+
80+ # Deploy RBAC (service accounts and permissions)
81+ helm install omnipdf-rbac ./helm/rbac --namespace omnipdf
82+ ```
83+
84+ ## Security Features
85+
86+ OmniPDF implements ** defense-in-depth security** with multiple layers:
87+
88+ ### Service Account & RBAC
89+ - ** Individual service accounts** for each service with per-service secret isolation
90+ - ** RBAC roles** with principle of least privilege:
91+ - ` orchestrator-role ` : pdf-processor (full coordination access)
92+ - ` individual-service-roles ` : Each service accesses only its own secrets
93+ - ` cleaner-role ` : Full data store access for cleanup operations
94+ - ** Complete audit trail** for inter-service communication
95+
96+ ### NetworkPolicy (Zero-Trust)
97+ - ** Network segmentation** between services
98+ - ** Ingress/egress controls** based on service communication matrix
99+ - ** DNS and HTTPS egress** allowed for external services
100+ - ** Pod selector-based** traffic rules
101+
102+ ### HPA (Horizontal Pod Autoscaler)
103+ - ** 6 services** with auto-scaling enabled (nginx, chat-service, pdf-processor, etc.)
104+ - ** CPU/Memory thresholds** : 70% CPU, 80% Memory
105+ - ** High availability** : Minimum 2 replicas for critical services
106+ - ** Resource optimization** : Scale from 2-10 replicas based on load
107+
108+ ## Security Configuration
109+
110+ ``` bash
111+ # Enable NetworkPolicy for production
112+ helm upgrade chat-service ./helm/chat-service \
113+ --set networkPolicy.enabled=true \
114+ --namespace omnipdf
115+
116+ # Check service account permissions
117+ kubectl auth can-i get secrets \
118+ --as=system:serviceaccount:omnipdf:chat-service \
119+ -n omnipdf
120+
121+ # Monitor HPA status
122+ kubectl get hpa -n omnipdf
123+ ```
37124
38125## CRC (OpenShift Local) Setup
39126
@@ -93,6 +180,36 @@ oc describe node crc | grep -A 10 "Allocated resources"
93180crc config view
94181```
95182
183+ ## Documentation
184+
185+ ### Architecture & Design
186+ - [ Service Communication Matrix] ( service-communication-matrix.md ) : Complete ingress/egress patterns for all services
187+ - [ Service Account Matrix] ( service-account-matrix.md ) : RBAC permissions and secret access patterns
188+
189+ ### Security & Operations
190+ - [ Service Account Setup] ( SERVICE-ACCOUNT-SETUP.md ) : RBAC implementation and deployment guide
191+ - [ Secret Management] ( SECRET-MANAGEMENT.md ) : Per-service secret isolation strategy
192+ - [ HPA Configuration] ( HPA-CONFIGURATION.md ) : Auto-scaling configuration and monitoring
193+
194+ ### Development
195+ - [ CLAUDE.md] ( CLAUDE.md ) : Development commands, testing, and architecture details
196+
197+ ## Testing
198+
199+ ``` bash
200+ # Run all service unit tests (206+ tests across 7 services)
201+ ./scripts/test-all-services.sh
202+
203+ # Run tests for individual service
204+ ./scripts/test-single-service.sh chat_service
205+
206+ # Security scanning with Trivy
207+ ./scripts/scan_with_trivy.sh
208+
209+ # Lint all Helm charts
210+ for chart in helm/* /; do helm lint " $chart " ; done
211+ ```
212+
96213## Development Workflow
97214
98215This project uses a ` Makefile ` to simplify common Helm and Kubernetes operations.
0 commit comments