Closes the long-standing SSE TODO. The previous attempt with
`fastify-sse-v2 ^4` was incompatible with Fastify 5 and was never wired
in; the README/DEPLOYMENT.md kept advertising "real-time log streaming"
that didn't exist. The web client never used EventSource — `web/src/
lib/api.ts` already polls `/deployments/:id/logs` via the normal
`apiRequest` helper.
Resolution: remove the claim, not ship the feature.
- drop `fastify-sse-v2` dep from `backend/package.json` + lockfile
- delete the commented-out plugin import + register in `server.ts`,
replace with a NOTE explaining the JSON-polling decision and how
to add a stream later (`reply.raw`)
- remove the `TODO: Re-enable SSE` comment in `deployments/routes.ts`;
the endpoint already returns JSON, document that explicitly
- rewrite the README "Deployment Log Streaming" section as
"Deployment Logs" (JSON-polled, no SSE); fix the endpoint table
- flip the DEPLOYMENT.md bullet from "Real-time log streaming (SSE)"
to "Deployment log retrieval (JSON polling — no SSE)"
- mark REVIEW_ACTIONS #4 RESOLVED with the reasoning
- tick the roadmap checkbox
If a real-time stream is wanted later, ship it explicitly via
`reply.raw` and update README/DEPLOYMENT.md/the route comment in the
same change. Don't reintroduce a half-disabled plugin.
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
173 lines
4.8 KiB
Markdown
173 lines
4.8 KiB
Markdown
# 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:**
|
|
1. Ensure `learning_ai_common_plat` packages are built and available
|
|
2. Configure npm registry to point to local package registry
|
|
3. Use the provided install scripts
|
|
|
|
**Steps:**
|
|
```bash
|
|
cd /opt/bytelyst/learning_ai_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:**
|
|
1. Remove workspace dependencies
|
|
2. Implement simplified auth/config/cosmos layers
|
|
3. Set up environment variables
|
|
|
|
**Environment Variables Required:**
|
|
```env
|
|
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:**
|
|
```bash
|
|
cd /opt/bytelyst/learning_ai_devops_tools/dashboard/backend
|
|
npm install
|
|
npm run build
|
|
npm start
|
|
|
|
# In another terminal:
|
|
cd /opt/bytelyst/learning_ai_devops_tools/dashboard/web
|
|
npm install
|
|
npm run build
|
|
npm start
|
|
```
|
|
|
|
### Option 3: Deploy to Production Server
|
|
|
|
**Prerequisites:**
|
|
1. Production server with Node.js 22+
|
|
2. Azure Cosmos DB account
|
|
3. Platform service instance
|
|
4. Docker installed
|
|
|
|
**Steps:**
|
|
```bash
|
|
# 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
|
|
- ✅ Deployment log retrieval (JSON polling — no SSE; see backend README)
|
|
- ✅ 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:
|
|
1. **Investment Trading** (`learning_ai_invt_trdg`)
|
|
2. **Agentic Notes** (`learning_ai_notes`)
|
|
3. **AI Clock** (`learning_ai_clock`)
|
|
4. **Platform Services** (`learning_ai_common_plat`) - can be added
|
|
|
|
## Next Steps for Production Deployment
|
|
|
|
1. **Resolve Workspace Dependencies**: Ensure common platform packages are accessible
|
|
2. **Configure Environment Variables**: Set production values for Cosmos, JWT, etc.
|
|
3. **Set Up Infrastructure**: Azure Cosmos DB, platform service instance
|
|
4. **Configure CI/CD**: Update Gitea Actions with production registry
|
|
5. **Test Deployments**: Verify all deployment scripts work in production
|
|
6. **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:**
|
|
```bash
|
|
# 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.
|