You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEPLOYMENT.md
+297-1Lines changed: 297 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,4 +117,300 @@ After deployment, you'll have:
117
117
- ✅ Professional presentation of your project
118
118
- ✅ Educational value for visitors
119
119
120
-
**Your federated learning demo will be live and working!** 🚀
120
+
**Your federated learning demo will be live and working!** 🚀
121
+
122
+
# FinFedRAG Deployment Guide
123
+
124
+
## Overview
125
+
126
+
This project implements a federated learning framework with RAG capabilities for financial data. The system can be deployed using Docker Compose for local development or Kubernetes for production environments.
127
+
128
+
## Debugging and Monitoring
129
+
130
+
### Enhanced Debugging Features
131
+
132
+
The web application now includes comprehensive debugging capabilities:
133
+
134
+
1.**Debug Information Panel**: Located in the sidebar, shows:
135
+
- Real-time server health status
136
+
- Recent debug messages and logs
137
+
- Connection error details
138
+
- Client simulator status
139
+
140
+
2.**Detailed Error Logging**: All operations are logged with:
141
+
- Connection attempts and failures
142
+
- Server response details
143
+
- Timeout and network error handling
144
+
- Client registration and training status updates
145
+
146
+
3.**Real-time Status Monitoring**:
147
+
- Server health checks
148
+
- Training progress tracking
149
+
- Client connection status
150
+
- Error message history
151
+
152
+
### Using the Debug Features
153
+
154
+
1.**Enable Debug Mode**: Uncheck "Demo Mode" in the sidebar
155
+
2.**View Debug Information**: Expand the "Debug Information" section in the sidebar
156
+
3.**Monitor Logs**: Check the "Recent Logs" section for real-time updates
157
+
4.**Clear Logs**: Use the "Clear Debug Logs" button to reset the log history
158
+
159
+
## Local Development Setup
160
+
161
+
### Prerequisites
162
+
163
+
- Python 3.8+
164
+
- Docker and Docker Compose
165
+
- Required Python packages (see requirements.txt)
166
+
167
+
### Quick Start
168
+
169
+
1.**Clone and Setup**:
170
+
```bash
171
+
git clone <repository-url>
172
+
cd FinFedRAG-Financial-Federated-RAG
173
+
python -m venv venv
174
+
source venv/bin/activate # On Windows: venv\Scripts\activate
175
+
pip install -r requirements.txt
176
+
```
177
+
178
+
2.**Start the Federated Server**:
179
+
```bash
180
+
python src/main.py --mode server
181
+
```
182
+
183
+
3.**Start Multiple Clients** (in separate terminals):
- Check if server is running: `kubectl get pods -n federated-learning`
353
+
- Verify service exists: `kubectl get services -n federated-learning`
354
+
- Check pod logs for startup errors
355
+
356
+
2. **Client Registration Failures**:
357
+
- Ensure server is healthy before starting clients
358
+
- Check network connectivity between pods
359
+
- Verify ConfigMap configurations
360
+
361
+
3. **Training Status Issues**:
362
+
- Monitor server logs for aggregation errors
363
+
- Check client participation in training rounds
364
+
- Verify model update sharing
365
+
366
+
### Debug Commands
367
+
368
+
```bash
369
+
# Check all resources in namespace
370
+
kubectl get all -n federated-learning
371
+
372
+
# View detailed pod information
373
+
kubectl describe pod <pod-name> -n federated-learning
374
+
375
+
# Check service endpoints
376
+
kubectl get endpoints -n federated-learning
377
+
378
+
# View ConfigMap contents
379
+
kubectl get configmap server-config -n federated-learning -o yaml
380
+
```
381
+
382
+
## Production Considerations
383
+
384
+
1. **Resource Limits**: Add resource requests and limits to deployments
385
+
2. **Health Checks**: Implement liveness and readiness probes
386
+
3. **Secrets Management**: Use Kubernetes secrets for sensitive data
387
+
4. **Persistent Storage**: Add persistent volumes for model storage
388
+
5. **Monitoring**: Integrate with Prometheus/Grafana for metrics
389
+
6. **Logging**: Use centralized logging (ELK stack, Fluentd)
390
+
391
+
## Scaling
392
+
393
+
### Horizontal Pod Autoscaling
394
+
```yaml
395
+
apiVersion: autoscaling/v2
396
+
kind: HorizontalPodAutoscaler
397
+
metadata:
398
+
name: fl-client-hpa
399
+
namespace: federated-learning
400
+
spec:
401
+
scaleTargetRef:
402
+
apiVersion: apps/v1
403
+
kind: Deployment
404
+
name: fl-client
405
+
minReplicas: 3
406
+
maxReplicas: 10
407
+
metrics:
408
+
- type: Resource
409
+
resource:
410
+
name: cpu
411
+
target:
412
+
type: Utilization
413
+
averageUtilization: 70
414
+
```
415
+
416
+
This deployment guide provides comprehensive information for both local development and production Kubernetes deployment, with enhanced debugging capabilities for better monitoring and troubleshooting.
0 commit comments