Production-grade DevOps platform. Autonomous deployment, monitoring, cost optimization, incident response.
- Node.js 18+
- Python 3.11+
- PostgreSQL 14+
- Docker & Docker Compose
- Git
git clone <repo>
cd forge-autonomy-os
# Copy env template
cp .env.example .envEdit .env:
# Database
DATABASE_URL=postgresql://devops:devops@localhost:5432/devops_pilot
# APIs
OPENAI_API_KEY=sk-your-key-here
ANTHROPIC_API_KEY=sk-ant-your-key-here
# GitHub
GITHUB_APP_ID=123456
GITHUB_APP_SECRET=your-secret
GITHUB_WEBHOOK_SECRET=your-webhook-secret
# Cloud (optional)
AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secret
GCP_PROJECT_ID=your-project
AZURE_SUBSCRIPTION_ID=your-subscription
# Backend
BACKEND_PORT=8000
LOG_LEVEL=info
# Frontend
VITE_API_URL=http://localhost:8000
VITE_ENV=developmentdocker-compose up -dServices start:
- Backend: http://localhost:8000
- Frontend: http://localhost:5173
- PostgreSQL: localhost:5432
- API Docs: http://localhost:8000/docs
# Backend health
curl http://localhost:8000/health
# Should return: {"status": "healthy", "version": "1.0.0"}
# Frontend loads
open http://localhost:5173cd backend
# Install dependencies
python -m pip install --upgrade pip
pip install -r requirements.txt
# Database migrations
alembic upgrade head
# Run server
python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4# Install dependencies
npm install
# Dev server
npm run dev
# Production build
npm run build
npm run preview# Create database
psql -U postgres -c "CREATE DATABASE devops_pilot"
psql -U postgres -c "CREATE USER devops WITH PASSWORD 'devops'; GRANT ALL PRIVILEGES ON DATABASE devops_pilot TO devops;"
# Verify connection
psql postgresql://devops:devops@localhost:5432/devops_pilot -c "SELECT version();"POST /api/v1/build-agent/analyze-repo
POST /api/v1/build-agent/generate-dockerfile
GET /api/v1/build-agent/recommendations
POST /api/v1/build-agent/validate-dockerfile
POST /api/v1/build-agent/estimate-build-time
GET /api/v1/build-agent/sbom
POST /api/v1/build-agent/test-build
GET /api/v1/build-agent/build-history
POST /api/v1/docker-agent/scan-image
GET /api/v1/docker-agent/layer-analysis
POST /api/v1/docker-agent/optimize-image
GET /api/v1/docker-agent/sbom
POST /api/v1/docker-agent/set-registry-policy
GET /api/v1/docker-agent/image-history
POST /api/v1/docker-agent/cleanup-unused-images
GET /api/v1/docker-agent/vulnerability-trends
POST /api/v1/docker-agent/auto-tag
POST /api/v1/k8s-agent/generate-manifests
POST /api/v1/k8s-agent/validate-manifests
POST /api/v1/k8s-agent/recommend-resources
POST /api/v1/k8s-agent/generate-policies
POST /api/v1/k8s-agent/deploy-strategy
GET /api/v1/k8s-agent/cluster-health
POST /api/v1/k8s-agent/generate-hpa
POST /api/v1/k8s-agent/cost-analysis
POST /api/v1/k8s-agent/multi-cluster-deploy
GET /api/v1/k8s-agent/manifest-drift
POST /api/v1/deployment-agent/deploy
GET /api/v1/deployment-agent/status/:deployment_id
POST /api/v1/deployment-agent/pause
POST /api/v1/deployment-agent/rollback
GET /api/v1/deployment-agent/health-metrics
POST /api/v1/deployment-agent/smoke-tests
GET /api/v1/deployment-agent/estimated-duration
POST /api/v1/deployment-agent/validate-pre-deploy
POST /api/v1/monitoring-agent/generate-dashboards
POST /api/v1/monitoring-agent/generate-alerts
POST /api/v1/monitoring-agent/define-slos
GET /api/v1/monitoring-agent/metric-recommendations
POST /api/v1/monitoring-agent/validate-slos
GET /api/v1/monitoring-agent/alert-effectiveness
POST /api/v1/monitoring-agent/auto-scale-alerts
GET /api/v1/monitoring-agent/dashboard-library
POST /api/v1/monitoring-agent/export-config
GET /api/v1/cost-agent/analysis
POST /api/v1/cost-agent/rightsizing
GET /api/v1/cost-agent/savings-potential
POST /api/v1/cost-agent/spot-candidates
POST /api/v1/cost-agent/reserved-instances
GET /api/v1/cost-agent/forecast
POST /api/v1/cost-agent/budget-alerts
GET /api/v1/cost-agent/committed-usage
POST /api/v1/cost-agent/anomaly-spend
POST /api/v1/cost-agent/generate-report
POST /api/v1/nlc/parse
POST /api/v1/nlc/execute
GET /api/v1/nlc/examples
GET /api/v1/nlc/suggestions
POST /api/v1/nlc/confirm
GET /api/v1/nlc/history
GET /api/v1/nlc/help
# Backend image
docker build -t your-registry/devops-pilot-api:v1 backend/
docker push your-registry/devops-pilot-api:v1
# Frontend image
docker build -t your-registry/devops-pilot-ui:v1 .
docker push your-registry/devops-pilot-ui:v1# Create namespace
kubectl create namespace devops-pilot
# Create secrets
kubectl create secret generic devops-secrets \
--from-literal=database-url=$DATABASE_URL \
--from-literal=openai-key=$OPENAI_API_KEY \
-n devops-pilot
# Deploy
kubectl apply -f deploy/kubernetes/cluster-config.yaml
kubectl apply -f deploy/kubernetes/deploy-multi-cluster.sh
# Port forward for testing
kubectl port-forward -n devops-pilot svc/api-gateway 8000:8000
kubectl port-forward -n devops-pilot svc/frontend 5173:5173# Run tests
cd backend
pytest
# Check health
curl http://localhost:8000/health
# View API docs
open http://localhost:8000/docs
# Database reset (dev only)
alembic downgrade base
alembic upgrade head# Dev server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Lint & format
npm run lint
npm run format# Connect to DB
psql $DATABASE_URL
# Run migrations
alembic upgrade head
# Rollback migrations
alembic downgrade -1
# Check migration history
alembic history# Check Python version
python --version # Should be 3.11+
# Check dependencies
pip list | grep fastapi
# Check database connection
psql $DATABASE_URL -c "SELECT 1"
# Check logs
tail -f backend.log# Clear cache
rm -rf node_modules .next
npm install
# Check Node version
node --version # Should be 18+
# Rebuild
npm run build --verbose# Test connection
psql -h localhost -U devops -d devops_pilot -c "SELECT 1"
# Check running services
docker ps | grep postgres
# Restart database
docker-compose down postgres
docker-compose up -d postgres# Kill process on port 8000
lsof -ti:8000 | xargs kill -9
# Kill process on port 5173
lsof -ti:5173 | xargs kill -9-- Create indexes for common queries
CREATE INDEX idx_deployments_app_env
ON deployments(app_id, environment);
CREATE INDEX idx_cost_records_period
ON cost_records(period_start, period_end);
-- Check slow queries
SELECT query, calls, mean_time FROM pg_stat_statements
ORDER BY mean_time DESC LIMIT 10;# In main.py, enable caching
from fastapi_cache2 import FastAPICache2
from fastapi_cache2.backends.redis import RedisBackend
from redis import asyncio as aioredis
redis = await aioredis.from_url("redis://localhost")
FastAPICache2.init(RedisBackend(redis))# Enable compression
npm install compression
# Add to vite.config.ts
import compression from 'vite-plugin-compression'
export default {
plugins: [compression()]
}# Access metrics
curl http://localhost:8000/metrics
# Common queries
rate(http_requests_total[5m])
histogram_quantile(0.99, http_request_duration_seconds_bucket)# Backend logs
docker logs devops-pilot-api
# Frontend console
open http://localhost:5173 (F12 → Console)
# Database slow queries
tail -f /var/log/postgresql.log- Change default passwords
- Enable HTTPS (SSL certificates)
- Setup firewall rules
- Enable database backups
- Setup VPC/network isolation
- Rotate API keys monthly
- Enable audit logging
- Setup rate limiting
- Enable CORS properly (not
*) - Setup secrets management (Vault, AWS Secrets)
# Generate secure random password
openssl rand -base64 32
# Create self-signed cert for testing
openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365
# Check for vulnerabilities
npm audit
pip install safety && safety check# Multiple backend instances
docker-compose up -d --scale api=3
# Load balance with nginx (deploy/nginx.conf)
docker-compose up -d nginx# Increase worker count
python -m uvicorn app.main:app --workers 8
# Increase database connections
# In .env: DATABASE_POOL_SIZE=20API Docs: http://localhost:8000/docs
GitHub Issues: https://github.com/your-org/devops-pilot/issues
Slack: #devops-pilot channel
Built with: FastAPI • React • PostgreSQL • Kubernetes • Prometheus • Terraform