- Add docker-compose.yml following trading web pattern - Update web Dockerfile to use multi-stage build with metadata - Add build metadata (commit SHA, branch, timestamp, author, message) - Rewrite deploy.sh to use docker compose with build metadata - Add hotcopy deployment script for quick updates - Add comprehensive backend API with deployment orchestration - Add health checks, service management, and monitoring endpoints - Add CI/CD workflow configuration - Add deployment documentation and guides Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
4.8 KiB
4.8 KiB
DevOps Dashboard Deployment Guide
Current Status
The DevOps dashboard has been significantly enhanced with production-ready features, but deployment requires resolving workspace dependencies.
Dependency Issues
The dashboard currently depends on workspace packages from learning_ai_common_plat:
@bytelyst/config- Configuration management@bytelyst/auth- Authentication utilities@bytelyst/cosmos- Cosmos DB client@bytelyst/errors- Error handling@bytelyst/react-auth- React auth context@bytelyst/telemetry-client- Telemetry
Deployment Options
Option 1: Deploy with Common Platform (Recommended)
Prerequisites:
- Ensure
learning_ai_common_platpackages are built and available - Configure npm registry to point to local package registry
- Use the provided install scripts
Steps:
cd /opt/bytelyst/bytelyst-devops-tools/dashboard
# Install dependencies with common platform
pnpm install:common-plat
# Build both backend and web
pnpm build
# Deploy with Docker Compose
docker-compose up -d
Option 2: Deploy Standalone (Simplified)
Prerequisites:
- Remove workspace dependencies
- Implement simplified auth/config/cosmos layers
- Set up environment variables
Environment Variables Required:
PORT=4004
PLATFORM_SERVICE_URL=http://localhost:4003
COSMOS_ENDPOINT=https://your-cosmos-account.documents.azure.com:443/
COSMOS_KEY=your-cosmos-primary-key
COSMOS_DATABASE=bytelyst-platform
JWT_SECRET=your-jwt-signing-secret
CSRF_SECRET=your-csrf-secret-change-in-production
Steps:
cd /opt/bytelyst/bytelyst-devops-tools/dashboard/backend
npm install
npm run build
npm start
# In another terminal:
cd /opt/bytelyst/bytelyst-devops-tools/dashboard/web
npm install
npm run build
npm start
Option 3: Deploy to Production Server
Prerequisites:
- Production server with Node.js 22+
- Azure Cosmos DB account
- Platform service instance
- Docker installed
Steps:
# Build Docker images
docker-compose build
# Tag and push to registry
docker tag devops-backend:latest your-registry/devops-backend:latest
docker tag devops-web:latest your-registry/devops-web:latest
docker push your-registry/devops-backend:latest
docker push your-registry/devops-web:latest
# On production server:
docker pull your-registry/devops-backend:latest
docker pull your-registry/devops-web:latest
docker-compose -f docker-compose.prod.yml up -d
Features Implemented
The dashboard includes these production-ready features:
Backend (Port 4004)
- ✅ CI/CD pipeline with Gitea Actions
- ✅ E2E tests with Playwright
- ✅ Telemetry integration
- ✅ Error boundary
- ✅ CSRF protection with token refresh
- ✅ Service CRUD operations
- ✅ Real-time log streaming (SSE)
- ✅ Audit logging
- ✅ Structured logging
- ✅ Database migrations
- ✅ Backup/restore functionality
- ✅ Performance monitoring (APM)
- ✅ System metrics (CPU, memory, disk)
- ✅ Docker cleanup endpoints
- ✅ OpenAPI/Swagger documentation at
/docs
Frontend (Port 3000)
- ✅ Service management UI
- ✅ Deployment monitoring
- ✅ Health dashboard
- ✅ Metrics/charts page
- ✅ System management page
- ✅ Real-time log viewer
- ✅ Accessibility features (ARIA, keyboard nav)
- ✅ PWA manifest
- ✅ Responsive design
Services Configured
The dashboard can deploy:
- Investment Trading (
learning_ai_invt_trdg) - Agentic Notes (
learning_ai_notes) - AI Clock (
learning_ai_clock) - Platform Services (
learning_ai_common_plat) - can be added
Next Steps for Production Deployment
- Resolve Workspace Dependencies: Ensure common platform packages are accessible
- Configure Environment Variables: Set production values for Cosmos, JWT, etc.
- Set Up Infrastructure: Azure Cosmos DB, platform service instance
- Configure CI/CD: Update Gitea Actions with production registry
- Test Deployments: Verify all deployment scripts work in production
- Set Up Monitoring: Configure logging, metrics, and alerting
Access
- Dashboard: http://localhost:3000 (or production URL)
- API: http://localhost:4004 (or production URL)
- API Docs: http://localhost:4004/docs
- System Management: Navigate to System page in dashboard
Troubleshooting
Workspace dependency errors:
# Use the install scripts provided
pnpm install:common-plat # For local development
pnpm install:gitea # For Gitea environment
Docker build failures:
- Ensure Dockerfiles reference correct lock files
- Check that all dependencies are in registry
- Verify context paths in docker-compose.yml
Port conflicts:
- Backend uses port 4004
- Web uses port 3000
- Ensure these ports are available
The dashboard is feature-complete and ready for production deployment once the dependency infrastructure is resolved.