This guide covers different deployment options for the Virtual Memory Manager system.
- Docker and Docker Compose installed
- Git for cloning the repository
- At least 4GB RAM and 2 CPU cores recommended
git clone https://github.com/AdityaPandey-DEV/Virtual-Memory-Manager.git
cd Virtual-Memory-ManagerCopy the environment template and configure:
# Linux/macOS
cp env.example .env
# Windows
copy env.example .envEdit .env file with your configuration:
# Backend Configuration
BACKEND_PORT=8080
BACKEND_HOST=0.0.0.0
# AI Predictor Configuration
PREDICTOR_PORT=5000
PREDICTOR_HOST=0.0.0.0
# Frontend Configuration
FRONTEND_PORT=3000
FRONTEND_HOST=localhost
# VMM Configuration
VMM_TOTAL_FRAMES=256
VMM_PAGE_SIZE=4096
VMM_TOTAL_PAGES=1024
VMM_REPLACEMENT_POLICY=CLOCK
VMM_ENABLE_AI=trueLinux/macOS:
./deploy.sh deployWindows:
deploy.bat deployManual:
docker-compose up --build -dAccess Points:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8080
- AI Predictor: http://localhost:5000
Linux/macOS:
./deploy.sh deploy-prodWindows:
deploy.bat deploy-prodManual:
docker-compose -f docker-compose.prod.yml up --build -dAccess Points:
- Frontend: http://localhost:80
- Backend API: http://localhost:80/api/
- AI Predictor: http://localhost:80/ai/
cd predictor
pip install -r requirements.txt
python -m uvicorn predictor.service:app --host 0.0.0.0 --port 5000cd backend
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
cd bin/Release
./vmm_simulator.exe # Windows
# or
./vmm_simulator # Linux/macOScd frontend
npm install
npm run devLinux/macOS:
./deploy.sh stopWindows:
deploy.bat stopManual:
docker-compose downAll services:
./deploy.sh logs
# or
docker-compose logs -fSpecific service:
./deploy.sh logs backend
# or
docker-compose logs -f backend./deploy.sh health
# or
curl http://localhost:8080/metrics
curl http://localhost:5000/health
curl http://localhost:3000./deploy.sh cleanup
# or
docker-compose down --volumes --remove-orphans
docker image prune -fFor production deployment, configure these environment variables:
# Production settings
NODE_ENV=production
DEBUG=false
LOG_LEVEL=WARNING
# Security
SECRET_KEY=your-secret-key-here
JWT_SECRET=your-jwt-secret-here
# Database (if using persistent storage)
DATABASE_URL=postgresql://user:password@localhost:5432/vmm
REDIS_URL=redis://localhost:6379
# SSL/TLS
SSL_CERT_PATH=/etc/ssl/certs/vmm.crt
SSL_KEY_PATH=/etc/ssl/private/vmm.key- Generate SSL certificates:
mkdir -p nginx/ssl
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
-keyout nginx/ssl/key.pem \
-out nginx/ssl/cert.pem-
Update nginx configuration:
- Uncomment the HTTPS server block in
nginx/nginx.conf - Update certificate paths
- Uncomment the HTTPS server block in
-
Deploy with SSL:
docker-compose -f docker-compose.prod.yml up --build -dThe production setup includes Nginx as a reverse proxy with:
- Load balancing across multiple backend instances
- SSL termination for HTTPS
- Rate limiting for API protection
- CORS headers for cross-origin requests
- Gzip compression for better performance
- Static file caching for frontend assets
To scale individual services:
# Scale backend to 3 instances
docker-compose -f docker-compose.prod.yml up --scale backend=3 -d
# Scale AI predictor to 2 instances
docker-compose -f docker-compose.prod.yml up --scale predictor=2 -dLogs are stored in the logs/ directory:
logs/backend.log- Backend application logslogs/predictor.log- AI predictor logslogs/nginx/access.log- Nginx access logslogs/nginx/error.log- Nginx error logs
The system includes health checks for all services:
- Backend:
GET /metricsendpoint - AI Predictor:
GET /healthendpoint - Frontend: HTTP response check
- Nginx:
GET /healthendpoint
Monitor system performance using:
- Docker stats:
docker stats - Resource usage: Check CPU and memory usage
- API response times: Monitor
/metricsendpoint - Error rates: Check logs for error patterns
-
Port conflicts:
- Check if ports 3000, 5000, 8080 are available
- Update port configuration in
.envfile
-
Docker build failures:
- Ensure Docker has enough memory (4GB+)
- Check Docker daemon is running
- Clear Docker cache:
docker system prune -a
-
Service connectivity:
- Verify all services are running:
docker-compose ps - Check service logs:
docker-compose logs [service] - Test individual endpoints with curl
- Verify all services are running:
-
Permission issues (Linux/macOS):
- Make scripts executable:
chmod +x deploy.sh - Check Docker permissions:
sudo usermod -aG docker $USER
- Make scripts executable:
Enable debug logging:
# Set debug environment
export DEBUG=true
export LOG_LEVEL=DEBUG
# Deploy with debug
./deploy.sh deployComplete system reset:
# Stop and remove everything
docker-compose down --volumes --remove-orphans
docker system prune -a
# Remove all images
docker rmi $(docker images -q)
# Start fresh
./deploy.sh deploy- Change default passwords in environment variables
- Use HTTPS in production
- Configure firewall to restrict access
- Regular security updates for base images
- Monitor logs for suspicious activity
- Use secrets management for sensitive data
- Services communicate through Docker network
- External access only through Nginx reverse proxy
- Rate limiting prevents abuse
- CORS headers control cross-origin requests
# Backup volumes
docker run --rm -v vmm_predictor_data:/data -v vmm_backend_data:/data2 \
-v $(pwd)/backup:/backup alpine \
tar czf /backup/vmm-backup-$(date +%Y%m%d).tar.gz /data /data2# Restore from backup
docker run --rm -v vmm_predictor_data:/data -v vmm_backend_data:/data2 \
-v $(pwd)/backup:/backup alpine \
tar xzf /backup/vmm-backup-YYYYMMDD.tar.gz -C /For issues and questions:
- Check the logs:
./deploy.sh logs - Run health checks:
./deploy.sh health - Review this documentation
- Create an issue on GitHub