PresBot Server Deployment
Automated CI/CD deployment using GitHub Actions on self-hosted runners.
Deployment Overview
| Environment | Branch | Auto-Deploy |
|---|---|---|
| Production | working_v4 | ✅ On push |
| UAT | release/uat | ✅ On push |
Server Locations
Host: Blackwell Server (NVIDIA GPU Workstation)
| Environment | Path | GPU |
|---|---|---|
| Production | /home/dash_ra/dmsb-dash-labs/presbot-server-prod | GPU 0 |
| UAT | /home/dash_ra/dmsb-dash-labs/presbot-server-uat | GPU 1 |
Environment Configuration
Production
| Setting | Value |
|---|---|
| Server Port | 6969 |
| Flower Port | 5555 |
| Redis DB | 0 |
| Celery Workers | 20 |
| Docker Subnet | 172.26.0.0/16 |
| MinIO Bucket | presbotclone |
UAT
| Setting | Value |
|---|---|
| Server Port | 6968 |
| Flower Port | 5556 |
| Redis DB | 1 |
| Celery Workers | 3 |
| Docker Subnet | 172.25.0.0/16 |
| MinIO Bucket | presbotclone-uat |
Deployment Pipeline
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Push to │────▶│ Setup │────▶│ Test │
│ Branch │ │ (Detect │ │ (Linting) │
│ │ │ Env) │ │ │
└─────────────┘ └─────────────┘ └──────┬──────┘
│
┌─────────────┐ ┌──────▼──────┐
│ Rollback │◀────│ Deploy │
│ (On Fail) │ │ (Build & │
│ │ │ Start) │
└─────────────┘ └─────────────┘
Pipeline Steps
- Setup - Detect environment from branch
- Test - Run linting and syntax checks (optional)
- Deploy
- Pull latest code
- Create
.envfile - Build Docker images
- Start services
- Health checks
- Smoke tests
- Rollback - Auto-revert on failure
GitHub Secrets Required
| Secret | Description |
|---|---|
GH_PAT | GitHub Personal Access Token (repo access) |
MONGO_URI_PROD | MongoDB connection string (production) |
MONGO_URI_UAT | MongoDB connection string (UAT) |
MINIO_ENDPOINT | MinIO storage endpoint |
MINIO_ACCESS_KEY | MinIO access key |
MINIO_SECRET_KEY | MinIO secret key |
JWT_SECRET | JWT authentication secret |
FLASK_SECRET_KEY | Flask session secret |
FLOWER_PASSWORD | Flower UI password |
TEAMS_WEBHOOK_URL | Microsoft Teams notifications |
Deploy Commands
Automatic Deployment
# Deploy to UAT
git push origin release/uat
# Deploy to Production
git push origin working_v4
Manual Deployment (Workflow Dispatch)
- Go to Actions → Deploy PresBot Server
- Click Run workflow
- Select environment:
productionoruat - Optionally skip tests
Manual Server Commands
# SSH into Blackwell server
ssh dash_ra@blackwell
# Navigate to environment
cd /home/dash_ra/dmsb-dash-labs/presbot-server-prod # or -uat
# View running services
docker-compose ps
# View logs
docker-compose logs -f api
docker-compose logs -f celery-worker
# Restart services
docker-compose restart
# Scale workers
docker-compose up -d --scale celery-worker=5
# Rebuild and restart
docker-compose up -d --build
Health Checks
API Health
# Production
curl http://localhost:6969/health
# UAT
curl http://localhost:6968/health
Flower Dashboard
| Environment | URL |
|---|---|
| Production | http://blackwell:5555 |
| UAT | http://blackwell:5556 |
Credentials: admin / <FLOWER_PASSWORD>
Rollback
Automatic Rollback
Triggered automatically when deployment fails:
- Stops failed containers
- Reverts to previous commit (
HEAD~1) - Restarts services
Manual Rollback
cd /home/dash_ra/dmsb-dash-labs/presbot-server-prod
# Stop services
docker-compose down
# Revert to previous commit
git reset --hard HEAD~1
# Restart
docker-compose up -d
Troubleshooting
Common Issues
| Issue | Solution |
|---|---|
| API not starting | Check logs: docker-compose logs api |
| GPU OOM | Reduce workers: --scale celery-worker=2 |
| Git auth failed | Verify GH_PAT secret is valid |
| Redis connection | Check Redis health: docker-compose exec redis redis-cli ping |
View Container Logs
# All services
docker-compose logs -f
# Specific service
docker-compose logs -f api
docker-compose logs -f celery-worker
docker-compose logs -f whisper-service
# Last 100 lines
docker-compose logs --tail=100 api
Check Resource Usage
docker stats --no-stream
Notifications
Deployment status is sent to Microsoft Teams:
| Status | Color |
|---|---|
| 🚀 Starting | Blue |
| ✅ Success | Green |
| ❌ Failure | Red |