MCPcopy Index your code
hub / github.com/QQ3221197721/cloudai-fusion

github.com/QQ3221197721/cloudai-fusion @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
5,841 symbols 18,913 edges 256 files 3,849 documented · 66% updated 3mo ago★ 1,0581 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

CloudAI Fusion

Cloud-Native AI Unified Management Platform

<a href="https://github.com/cloudai-fusion/cloudai-fusion/actions"><img src="https://github.com/cloudai-fusion/cloudai-fusion/workflows/CloudAI%20Fusion%20CI%2FCD/badge.svg" alt="CI"></a>
<a href="https://codecov.io/gh/cloudai-fusion/cloudai-fusion"><img src="https://codecov.io/gh/cloudai-fusion/cloudai-fusion/branch/main/graph/badge.svg" alt="Coverage"></a>
<a href="https://goreportcard.com/report/github.com/cloudai-fusion/cloudai-fusion"><img src="https://goreportcard.com/badge/github.com/cloudai-fusion/cloudai-fusion" alt="Go Report"></a>
<a href="https://github.com/QQ3221197721/cloudai-fusion/raw/main/LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License"></a>
<a href="https://github.com/cloudai-fusion/cloudai-fusion/releases"><img src="https://img.shields.io/github/v/release/cloudai-fusion/cloudai-fusion" alt="Release"></a>

CloudAI Fusion is an open-source platform that unifies cloud-native infrastructure management with AI-powered resource scheduling. It solves three core enterprise pain points:

  • Cloud-native deployment complexity — 68% of enterprises struggle with cluster management
  • Multi-cloud security fragmentation — 86% of organizations use multi-cloud but face siloed security
  • AI resource waste — GPU utilization under 30% in traditional deployment models

Key Features

Feature Description
Multi-Cloud Management Unified API for Alibaba Cloud ACK, AWS EKS, Azure AKS, GCP GKE, Huawei CCE, Tencent TKE
GPU Topology-Aware Scheduling NVLink-aware placement, fine-grained GPU sharing, preemption, RL-based optimization
4 AI Agents Scheduling optimizer, security monitor, cost analyzer, operations automator
LLM Integration OpenAI GPT-4o / DashScope Qwen-Max / Ollama / vLLM with graceful fallback
AI Chat Assistant Conversational operations assistant with LLM-powered incident analysis
eBPF Service Mesh Sidecarless networking via Istio Ambient / Cilium with <1% overhead
Wasm Runtime Millisecond cold-start functions for serverless & edge workloads
Edge-Cloud Architecture Three-tier (Cloud → Edge → Terminal) with 50B-parameter edge model support
Security & Compliance Pod security, network policies, CIS benchmarks, vulnerability scanning, threat detection
Full Observability Prometheus metrics, OpenTelemetry tracing, Grafana dashboards, intelligent alerting
Feature Toggles Runtime feature flags with profiles (minimal / standard / full) for modular deployment
Docker Optimized Multi-stage builds, distroless images for Go services, GPU image reduced from 5-8GB to ~2-3GB

Architecture

┌─────────────────────────────────────────────────────────────────────┐
│                         CloudAI Fusion                              │
├─────────────┬──────────────┬─────────────┬─────────────────────────┤
│  API Server │  Scheduler   │    Agent    │      AI Engine          │
│   (Go/Gin)  │ (GPU-aware)  │ (DaemonSet) │   (Python/FastAPI)     │
├─────────────┴──────────────┴─────────────┴─────────────────────────┤
│  Auth │ Cloud │ Cluster │ Security │ Monitor │ Mesh │ Wasm │ Edge  │
├───────┴───────┴─────────┴──────────┴─────────┴──────┴──────┴───────┤
│            PostgreSQL  │  Redis  │  Kafka  │  NATS  │  Prometheus     │
└─────────────────────────────────────────────────────────────────────┘

Quick Start

Prerequisites

Run (one command)

Windows:

cd cloudai-fusion
start.bat

Linux / macOS:

cd cloudai-fusion
chmod +x start.sh && ./start.sh

This starts all services (API Server, Scheduler, Agent, AI Engine, PostgreSQL, Redis, Kafka, NATS, Prometheus, Grafana, Jaeger).

Verify

# Health check
curl http://localhost:8080/healthz

# Login (get JWT token)
curl -X POST http://localhost:8080/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"admin123"}'

# List clusters (use token from login response)
curl http://localhost:8080/api/v1/clusters \
  -H "Authorization: Bearer <token>"

Service Endpoints

Service URL
API Server http://localhost:8080
AI Engine http://localhost:8090
Prometheus http://localhost:9090
Grafana http://localhost:3000 (admin / cloudai)
Jaeger http://localhost:16686

Tech Stack

Layer Technology
Backend Go 1.25, Gin, Cobra, Viper, GORM
AI Engine Python 3.11, FastAPI, PyTorch, TensorFlow, NumPy, scikit-learn, OpenAI SDK
Container Kubernetes 1.30+, Istio Ambient, Cilium eBPF
Database PostgreSQL 16, Redis 7
Messaging Apache Kafka, NATS
Monitoring Prometheus, Grafana, OpenTelemetry, Jaeger
CI/CD GitHub Actions, Docker, Helm 3

Project Structure

cloudai-fusion/
├── cmd/                          # Service entry points
│   ├── apiserver/                # API Server
│   ├── scheduler/                # GPU Scheduler
│   ├── agent/                    # Node Agent
│   └── healthcheck/              # Lightweight healthcheck binary (for distroless)
├── pkg/                          # Go packages (48 packages, 47/47 tests pass)
│   ├── api/                      # HTTP routes, handlers, debug endpoints (6-layer auth)
│   ├── auth/                     # JWT + RBAC + OIDC federation (4 roles, 20+ perms)
│   ├── cache/                    # Redis cache + distributed lock + PubSub
│   ├── cloud/                    # Multi-cloud providers (6 clouds)
│   ├── cluster/                  # Kubernetes cluster management
│   ├── config/                   # Unified configuration + JWT secret validation
│   ├── edge/                     # Edge-cloud architecture + 50B model quantization
│   ├── feature/                  # Runtime feature toggles (minimal/standard/full)
│   ├── mesh/                     # eBPF service mesh
│   ├── monitor/                  # Prometheus metrics & alerting
│   ├── scheduler/                # GPU scheduling + queue snapshot persistence
│   ├── security/                 # Policy, scanning, compliance, threats
│   ├── store/                    # Database layer (GORM)
│   └── wasm/                     # WebAssembly container runtime
├── ai/                           # Python AI components
│   ├── agents/                   # Multi-agent FastAPI server + LLM client
│   ├── anomaly/                  # Anomaly detection engine
│   └── scheduler/                # RL scheduling optimizer
├── deploy/helm/                  # Helm chart (7 templates)
├── docker/                       # Dockerfiles (5 services, distroless + multi-stage)
├── monitoring/                   # Prometheus + Grafana configs
├── scripts/                      # env-generate, diagnose, setup-gpu, deploy-cloud
├── api/                          # OpenAPI 3.1 specification
├── .devcontainer/                # Dev Container (Go + Python + full toolchain)
├── docker-compose.yml            # Full-stack local deployment (profiles support)
├── docker-compose.gpu.yml        # GPU overlay (NVIDIA runtime)
├── Makefile                      # Build, test, deploy, diagnose commands
└── start.bat / start.sh          # One-click start (--gpu, --minimal flags)

Development

# First-time setup (generate .env with secure secrets)
make setup

# Build all Go binaries
make build

# Run tests
make test

# Run tests with coverage report
make coverage-report

# Run linter
make lint

# Build Docker images (optimized: distroless for Go, multi-stage for AI)
make docker-build

# Deploy to Kubernetes
make helm-install

# Start with GPU support
./start.sh --gpu          # Linux / macOS
start.bat --gpu           # Windows (WSL2 + NVIDIA)

# Start minimal mode (core services only)
./start.sh --minimal

# Health diagnostics
make diagnose

# Feature flag management
make features-list

API Overview

Full specification: api/openapi.yaml

Endpoint Group Description
POST /api/v1/auth/login JWT authentication
GET /api/v1/clusters List managed K8s clusters
GET /api/v1/providers List cloud providers
POST /api/v1/workloads Submit AI workload
GET /api/v1/security/policies Security policies
GET /api/v1/monitoring/alerts/events Alert events
GET /api/v1/cost/summary Cost analysis
GET /api/v1/mesh/status Service mesh status
POST /api/v1/wasm/deploy Deploy Wasm function
GET /api/v1/edge/topology Edge-cloud topology
AI Engine (port 8090)
POST /api/v1/scheduling/optimize LLM-enhanced GPU scheduling
POST /api/v1/anomaly/detect Anomaly detection + threat analysis
POST /api/v1/cost/analyze Cost optimization with LLM insights
GET /api/v1/insights Dynamic AI-powered insights
GET /api/v1/models/status Honest model & LLM status
POST /api/v1/chat Conversational AI assistant
POST /api/v1/ops/incident Incident root cause analysis
POST /api/v1/ops/scaling Predictive scaling
GET /api/v1/ops/history Incident history
Debug (requires CLOUDAI_DEBUG_ENABLED=true + JWT admin)
GET /debug/info Runtime information
GET /debug/pprof/ Go pprof (rate-limited)
PUT /debug/log-level Dynamic log level
GET /debug/services Cross-service health probe

Roadmap

Version Timeline Focus
v0.1 MVP 2026 Q2 Core management, basic scheduling, auth, monitoring
v1.0 2026 Q3 Multi-cloud SDK integration, Istio Ambient, AIOps
v2.0 2026 Q4 Full Agent system, edge deployment, cost optimization
v3.0 2027 H1 Cross-cloud security, heterogeneous scheduling, plugin ecosystem

Contributing

See CONTRIBUTING.md for guidelines.

License

Apache License 2.0

Extension points exported contracts — how you extend this code

PubSub (Interface)
============================================================================ PubSub — Redis-backed publish/subscribe for [6 …
pkg/cache/cache.go
ScorePlugin (Interface)
ScorePlugin assigns a numeric score to each candidate node. Scores are normalized to [0, 100] by the framework. [7 implementers]
pkg/plugin/scheduler_ext.go
Consumer (Interface)
Consumer subscribes to a queue and processes messages. [6 implementers]
pkg/messaging/queue.go
Provider (Interface)
============================================================================ Provider Interface ======================== [6 …
pkg/cloud/manager.go
AuditSink (Interface)
============================================================================ Audit Sink ================================ [10 …
pkg/auth/audit.go
Reconciler (Interface)
============================================================================ Reconciler Interface — the core abstraction [5 …
pkg/controller/types.go
SecurityService (Interface)
SecurityService defines the contract for security management across clusters. The API layer depends on this interface ra [3 …
pkg/security/interfaces.go
EventBus (Interface)
============================================================================ EventBus Interface — the contract all backe [3 …
pkg/eventbus/bus.go

Core symbols most depended-on inside this repo

Error
called by 880
pkg/errors/errors.go
Add
called by 241
pkg/controller/queue.go
NowUTC
called by 165
pkg/common/types.go
Set
called by 143
pkg/cache/cache.go
JSON
called by 126
pkg/version/version.go
NewUUID
called by 120
pkg/common/types.go
get
called by 108
ai/tracing.py
String
called by 96
pkg/store/twopc.go

Shape

Method 2,381
Function 2,178
Struct 1,018
TypeAlias 124
Class 63
Interface 60
Route 11
FuncType 6

Languages

Go93%
Python7%

Modules by API surface

pkg/testutil/mocks.go92 symbols
pkg/cache/cache.go88 symbols
pkg/edge/offline_enhanced.go83 symbols
pkg/controller/controller_test.go74 symbols
pkg/plugin/admission.go73 symbols
pkg/cloud/providers_mock_test.go73 symbols
pkg/store/interfaces.go69 symbols
pkg/api/router.go62 symbols
pkg/scheduler/engine.go56 symbols
pkg/scheduler/engine_test.go54 symbols
pkg/edge/edge_hardware_test.go52 symbols
pkg/edge/edge_cloud_collab.go52 symbols

Datastores touched

insertDatabase · 1 repos
cloudaiDatabase · 1 repos
dbDatabase · 1 repos

For agents

$ claude mcp add cloudai-fusion \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact