✅ Validation Results: - PPO training: 24.2s (1 epoch, 950 samples, dim=225) - Feature extraction: 105μs/bar (9.5x faster than target) - Model checkpoint: 293KB (147KB actor + 146KB critic) - GPU memory: 145MB used (96.4% headroom) - Zero dimension mismatches 📊 Success Criteria (5/5): ✅ Feature dimension = 225 (Wave C 201 + Wave D 24) ✅ Model state_dim = 225 ✅ Training completed without errors ✅ Checkpoint saved successfully ✅ No dimension mismatch errors 📁 Training Data Ready: - ES.FUT: 2.9MB, 180 days - NQ.FUT: 4.4MB, 180 days - 6E.FUT: 2.8MB, 180 days - ZN.FUT: 65KB, 90 days (clean) 🚀 Next: Full production model retraining (4 models, ~10min GPU time) 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Foxhunt Deployment Documentation
This directory contains comprehensive operational documentation for deploying, monitoring, and troubleshooting the Foxhunt HFT trading system.
📚 Documentation Index
1. TLS Certificate Setup
Complete guide for TLS/mTLS certificate management:
- Self-signed certificates for development
- Production certificates (Let's Encrypt, Corporate CA)
- Certificate validation and rotation
- Docker and Kubernetes configuration
- Troubleshooting TLS issues
- Security best practices
When to use: Setting up secure communication between services
2. Docker Troubleshooting
Comprehensive Docker Compose troubleshooting guide:
- Service health check procedures
- Common issues and solutions
- Rebuild and redeploy strategies
- Database and network troubleshooting
- Performance optimization
- Emergency recovery procedures
When to use: Services not starting, unhealthy containers, connection issues
3. Service Dependencies
Service architecture and dependency management:
- Complete service topology diagram
- Startup dependency sequence
- Service requirements matrix
- Failure impact analysis
- Communication patterns
- High availability configuration
When to use: Understanding service relationships, planning deployments
4. Health Check Verification
Health monitoring and verification procedures:
- HTTP and gRPC health endpoints
- Infrastructure health checks
- Prometheus alerting configuration
- Grafana health dashboards
- Automated monitoring scripts
- Troubleshooting failed checks
When to use: Verifying system health, setting up monitoring
5. General Deployment Guide
High-level deployment procedures (existing document):
- Initial deployment steps
- Configuration management
- Production considerations
🛠️ Automation Scripts
Located in /home/jgrusewski/Work/foxhunt/scripts/:
1. comprehensive_health_check.sh
Purpose: Complete system health validation
Usage: ./scripts/comprehensive_health_check.sh
Features:
- Checks all services (infrastructure, core, gateway, monitoring)
- Validates dependency chains
- Reports resource usage
- Color-coded output with summary
2. start_foxhunt.sh
Purpose: Automated system startup
Usage: ./scripts/start_foxhunt.sh
Features:
- Sequential startup (Infrastructure → Core → Gateway → Monitoring)
- Health verification after each layer
- Database migration execution
- Service readiness polling
3. stop_foxhunt.sh
Purpose: Graceful system shutdown
Usage: ./scripts/stop_foxhunt.sh
Features:
- Reverse-order shutdown
- Service stop verification
- Clean shutdown status report
4. check_dependencies.sh
Purpose: Service dependency validation
Usage: ./scripts/check_dependencies.sh
Features:
- 4-layer dependency validation
- Connection pool status
- Port listening verification
- Dependency chain validation
🚀 Quick Start
First Time Setup
-
Start infrastructure:
./scripts/start_foxhunt.sh -
Verify health:
./scripts/comprehensive_health_check.sh -
Check dependencies:
./scripts/check_dependencies.sh
Troubleshooting
-
Service won't start:
- Check logs:
docker-compose logs -f [service-name] - See: Docker Troubleshooting
- Check logs:
-
Health check fails:
- Review failed checks in script output
- See: Health Check Verification
-
TLS errors:
- Verify certificates exist:
ls -la /tmp/foxhunt/certs/ - See: TLS Certificate Setup
- Verify certificates exist:
-
Dependency issues:
- Run:
./scripts/check_dependencies.sh - See: Service Dependencies
- Run:
📊 Monitoring
Health Endpoints
| Service | HTTP Health | gRPC Health | Metrics |
|---|---|---|---|
| API Gateway | http://localhost:8080/health | localhost:50051 | :9091/metrics |
| Trading Service | http://localhost:8081/health | localhost:50052 | :9092/metrics |
| Backtesting | http://localhost:8083/health | localhost:50053 | :9093/metrics |
| ML Training | http://localhost:8095/health | localhost:50054 | :9094/metrics |
Monitoring Stack
- Prometheus: http://localhost:9090
- Grafana: http://localhost:3000 (admin/foxhunt123)
- AlertManager: http://localhost:9093
See Health Check Verification for detailed monitoring setup.
🔒 Security
TLS Configuration
For production deployments:
- Generate certificates (see TLS Setup)
- Configure volume mounts in
docker-compose.yml - Enable TLS in service configurations
- Set up certificate rotation
Secrets Management
All secrets should be stored in HashiCorp Vault:
- Database credentials
- API keys
- TLS certificates
- JWT secrets
See main CLAUDE.md for Vault configuration.
📈 Production Readiness
Pre-Deployment Checklist
- All services healthy (run
comprehensive_health_check.sh) - Dependencies validated (run
check_dependencies.sh) - TLS certificates configured (see TLS Setup)
- Monitoring stack deployed (Prometheus, Grafana)
- Alerting rules configured (see Health Checks)
- Backup procedures tested (see Docker Troubleshooting)
- Database migrations applied (
cargo sqlx migrate run) - Resource limits configured (see Service Dependencies)
- Circuit breakers tested
- Runbooks documented
🆘 Emergency Procedures
System Down
- Check all services:
docker-compose ps - Review logs:
docker-compose logs --tail=100 - Run health check:
./scripts/comprehensive_health_check.sh - Restart services:
./scripts/stop_foxhunt.sh && ./scripts/start_foxhunt.sh
Database Issues
- Check PostgreSQL:
docker exec foxhunt-postgres pg_isready -U foxhunt - Review migrations:
cargo sqlx migrate info - Backup database: See Docker Troubleshooting
- Restore if needed
Network Issues
- Check service connectivity:
./scripts/check_dependencies.sh - Verify Docker network:
docker network inspect foxhunt_foxhunt-network - Test port bindings:
netstat -tulpn | grep -E ":(5005[0-4]|5432|6379)" - See Docker Troubleshooting
📞 Support
Documentation
- Architecture: CLAUDE.md
- Testing: TESTING_PLAN.md
- Wave Reports: Wave summaries (WAVE_*_SUMMARY.md)
Tools Required
dockeranddocker-composegrpc_health_probe(for gRPC health checks)jq(for JSON parsing)curl(for HTTP health checks)netstatorss(for port checking)
Installation
# Install grpc_health_probe
wget https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.4.19/grpc_health_probe-linux-amd64
chmod +x grpc_health_probe-linux-amd64
sudo mv grpc_health_probe-linux-amd64 /usr/local/bin/grpc_health_probe
# Install jq
sudo apt-get install jq # Ubuntu/Debian
sudo yum install jq # RHEL/CentOS
📝 Contributing
When adding new operational documentation:
- Follow existing structure and format
- Include troubleshooting section
- Provide complete examples
- Update this README index
- Test all commands and scripts
- Update relevant automation scripts
🔄 Recent Updates
2025-10-07 (Agent 110):
- Created comprehensive deployment documentation suite
- Added 4 automation scripts (health check, startup, shutdown, dependencies)
- Documented TLS certificate management
- Added Docker troubleshooting guide
- Documented service dependencies and architecture
- Created health check verification procedures
Last Updated: 2025-10-07 Documentation Version: 1.0 Total Lines: ~2,814 lines of documentation and automation