Skip to content

CMBAgents/cmbcluster

Β 
Β 

Repository files navigation

CMBCluster

Enterprise-Grade Multi-Tenant Research Computing Platform

CMBCluster is a scalable, secure multi-tenant platform that provides isolated research environments for teams. Built with modern cloud-native technologies (Kubernetes, FastAPI, Next.js), it delivers professional-grade infrastructure for collaborative scientific computing.

πŸ—οΈ Architecture Overview

graph TB
    Users[πŸ‘₯ Users] --> Ingress[🌐 NGINX Ingress<br/>Load Balancer & TLS]
    
    Ingress --> Frontend[πŸ“Š Next.js Frontend<br/>React-based Dashboard]
    Ingress --> API[βš™οΈ FastAPI Backend<br/>REST API Server]
    
    API --> Auth[πŸ” OAuth 2.0<br/>Google Authentication]
    API --> DB[(πŸ“¦ Database<br/>SQLite/PostgreSQL)]
    API --> K8s[☸️ Kubernetes API<br/>Pod Management]
    
    K8s --> ImageRegistry["🐳 Docker Images<br/>β€’ Docker Hub<br/>β€’ Private Registries<br/>β€’ Local Images"]
    
    ImageRegistry --> AppPods["πŸš€ Multi-Agent Research<br/>Environments<br/>β€’ CMBAgent (Agentic)<br/>β€’ Denario (ML)<br/>β€’ Custom Research Apps"]
    
    K8s --> Storage[πŸ’Ύ Persistent Volumes<br/>User Workspaces]
    
    CloudVolumes[☁️ GCP Cloud Storage<br/>Object Storage] --> AppPods
    
    subgraph "Kubernetes Cluster"
        Ingress
        Frontend
        API
        Auth
        DB
        K8s
        ImageRegistry
        AppPods
        Storage
    end
    
    style Users fill:#f9f,stroke:#333,stroke-width:2px,color:#000
    style Ingress fill:#52c41a,stroke:#333,stroke-width:2px,color:#fff
    style Frontend fill:#1890ff,stroke:#333,stroke-width:2px,color:#fff
    style API fill:#1890ff,stroke:#333,stroke-width:2px,color:#fff
    style Auth fill:#ff7a45,stroke:#333,stroke-width:2px,color:#fff
    style DB fill:#ff7a45,stroke:#333,stroke-width:2px,color:#fff
    style K8s fill:#52c41a,stroke:#333,stroke-width:2px,color:#fff
    style ImageRegistry fill:#ff6b6b,stroke:#333,stroke-width:2px,color:#fff
    style AppPods fill:#faad14,stroke:#333,stroke-width:2px,color:#000
    style Storage fill:#13c2c2,stroke:#333,stroke-width:2px,color:#fff
Loading

✨ Key Features

  • πŸ” Enterprise Security - Google OAuth 2.0, RBAC, TLS 1.3, Network Policies
  • πŸš€ Scalable Infrastructure - Auto-scaling, load balancing, multi-cloud ready
  • πŸ”¬ Research-Focused - Pre-installed scientific libraries, persistent workspaces
  • πŸ“Š Modern Dashboard - Next.js-based UI with real-time monitoring
  • ☁️ Cloud-Native - Kubernetes-native, Helm charts, CI/CD ready

πŸ“‹ Tech Stack

Component Technology Purpose
Frontend Next.js (React) Professional dashboard and management UI
Backend FastAPI (Python) REST API server with async support
Authentication Google OAuth 2.0 Enterprise single sign-on
Orchestration Kubernetes Container orchestration and pod management
User Environment Multi-Agent Research Isolated multi-agent research environments
Ingress NGINX Load balancing and TLS termination
Certificates cert-manager + Let's Encrypt Automated SSL/TLS management

πŸš€ Quick Start

Local Development (2 minutes)

# 1. Clone and setup
git clone https://github.com/archetana/cmbcluster.git
cd cmbcluster
cp compose.env.example .env

# 2. Start services
docker-compose up --build

# 3. Access
# Dashboard:     http://localhost:3000
# Backend API:   http://localhost:8000
# API Docs:      http://localhost:8000/docs

Production Deployment

# Prerequisites: GCP account, kubectl, helm

# 1. Setup infrastructure
./scripts/setup-cluster.sh YOUR_PROJECT_ID us-central1

# 2. Configure OAuth in Google Cloud Console
# Add redirect URI: https://your-domain.com/auth/callback

# 3. Build and deploy
./scripts/build-images.sh YOUR_PROJECT_ID
./scripts/deploy.sh YOUR_PROJECT_ID your-domain.com

See DEPLOYMENT.md for detailed production setup instructions.

πŸ“ Project Structure

cmbcluster/
β”œβ”€β”€ backend/              # FastAPI REST API server
β”œβ”€β”€ nextjs-frontend/      # Next.js React dashboard
β”œβ”€β”€ k8s/                  # Kubernetes manifests (dev)
β”œβ”€β”€ helm/                 # Helm charts (production)
β”œβ”€β”€ scripts/              # Deployment automation scripts
β”œβ”€β”€ compose.yml           # Local development with Docker Compose
β”œβ”€β”€ README.md             # This file
β”œβ”€β”€ docs/                 # Detailed documentation
β”‚   β”œβ”€β”€ ARCHITECTURE.md   # Component architecture
β”‚   β”œβ”€β”€ API.md            # API reference
β”‚   β”œβ”€β”€ DEPLOYMENT.md     # Production deployment
β”‚   β”œβ”€β”€ SECURITY.md       # Security & authentication
β”‚   └── TROUBLESHOOTING.md # Common issues & debugging
└── planning/             # Architecture & implementation plans

πŸ“š Documentation

πŸ”§ Environment Setup

Required Variables (Production)

PROJECT_ID=your-gcp-project-id
BASE_DOMAIN=your-domain.com
GOOGLE_CLIENT_ID=your-oauth-client-id
GOOGLE_CLIENT_SECRET=your-oauth-client-secret
SECRET_KEY=your-secure-random-key-min-32-chars

Optional Configuration

DEV_MODE=false              # Enable development features
DEBUG=false                 # Enable debug logging
TOKEN_EXPIRE_HOURS=8        # JWT token expiration
MAX_USER_PODS=1             # Pods per user
FREE_TIER_MAX_UPTIME_MINUTES=60  # Free tier uptime limit

See Configuration for all available options.

🎯 Usage

For End Users

  1. Navigate to your domain and login with Google
  2. Click "Launch Environment" to start a multi-agent research environment
  3. Access your isolated research workspace with pre-installed scientific libraries and agent frameworks
  4. Manage files and environment variables from the dashboard

See [SECURITY.md](docs/SECURITY.md) for admin procedures and [TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md) for common tasks.

## πŸ—οΈ Architecture

CMBCluster consists of:

- **NGINX Ingress**: Load balancing and TLS termination
- **Next.js Frontend**: React-based management dashboard
- **FastAPI Backend**: REST API with Kubernetes integration
- **User Pods**: Isolated multi-agent research environments
- **Persistent Volumes**: Per-user workspace storage

For detailed architecture diagrams and component responsibilities, see [ARCHITECTURE.md](docs/ARCHITECTURE.md).

## πŸ” Security

- Google OAuth 2.0 authentication
- Role-based access control (RBAC)
- TLS 1.3 encryption in transit
- Network policies for pod isolation
- Content Security Policy headers
- Encrypted file storage
- Regular security audits

See [SECURITY.md](docs/SECURITY.md) for comprehensive security documentation.

## πŸ§ͺ Testing

```bash
# Backend tests
cd backend && python -m pytest tests/ -v

# Frontend tests
cd nextjs-frontend && npm test

# Local integration test
docker-compose up -d && sleep 30 && \
  curl http://localhost:8000/health && \
  curl http://localhost:3000/api/health

See TESTING_README.md for test coverage details.

πŸ› Troubleshooting

Common issues and solutions are documented in TROUBLESHOOTING.md:

  • Pods won't start
  • Authentication errors
  • DNS/ingress issues
  • Storage problems
  • Performance tuning

πŸ“ˆ Roadmap

  • Core platform infrastructure βœ…
  • Google OAuth integration βœ…
  • Kubernetes pod orchestration βœ…
  • Dashboard and API βœ…
  • Enhanced monitoring (in progress)
  • Backup system (planned)
  • AWS EKS integration (in development)
  • Custom container images
  • Enterprise SSO (SAML/LDAP)

See full roadmap in DEPLOYMENT.md.

🀝 Contributing

We welcome contributions! Please see our CONTRIBUTING.md for:

  • Development setup
  • Code standards
  • Pull request process
  • Testing requirements

πŸ“ž Support

πŸ“„ License

MIT License - see LICENSE file for details.


Built with: Kubernetes β€’ FastAPI β€’ Next.js β€’ Docker β€’ Helm
Status: βœ… Production Ready β€’ Version: 1.0.0

About

CMBAgent Cloud - personal research environments

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 50.5%
  • Python 32.1%
  • CSS 8.0%
  • Shell 6.6%
  • JavaScript 2.1%
  • Dockerfile 0.3%
  • Other 0.4%