747 lines
27 KiB
HTML
747 lines
27 KiB
HTML
|
|
<!DOCTYPE HTML>
|
||
|
|
<html lang="en" class="light sidebar-visible" dir="ltr">
|
||
|
|
<head>
|
||
|
|
<!-- Book generated using mdBook -->
|
||
|
|
<meta charset="UTF-8">
|
||
|
|
<title>Provisioning Integration - VAPORA Platform Documentation</title>
|
||
|
|
|
||
|
|
|
||
|
|
<!-- Custom HTML head -->
|
||
|
|
|
||
|
|
<meta name="description" content="Comprehensive documentation for VAPORA, an intelligent development orchestration platform built entirely in Rust.">
|
||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
|
|
<meta name="theme-color" content="#ffffff">
|
||
|
|
|
||
|
|
<link rel="icon" href="../favicon.svg">
|
||
|
|
<link rel="shortcut icon" href="../favicon.png">
|
||
|
|
<link rel="stylesheet" href="../css/variables.css">
|
||
|
|
<link rel="stylesheet" href="../css/general.css">
|
||
|
|
<link rel="stylesheet" href="../css/chrome.css">
|
||
|
|
<link rel="stylesheet" href="../css/print.css" media="print">
|
||
|
|
|
||
|
|
<!-- Fonts -->
|
||
|
|
<link rel="stylesheet" href="../FontAwesome/css/font-awesome.css">
|
||
|
|
<link rel="stylesheet" href="../fonts/fonts.css">
|
||
|
|
|
||
|
|
<!-- Highlight.js Stylesheets -->
|
||
|
|
<link rel="stylesheet" id="highlight-css" href="../highlight.css">
|
||
|
|
<link rel="stylesheet" id="tomorrow-night-css" href="../tomorrow-night.css">
|
||
|
|
<link rel="stylesheet" id="ayu-highlight-css" href="../ayu-highlight.css">
|
||
|
|
|
||
|
|
<!-- Custom theme stylesheets -->
|
||
|
|
|
||
|
|
|
||
|
|
<!-- Provide site root and default themes to javascript -->
|
||
|
|
<script>
|
||
|
|
const path_to_root = "../";
|
||
|
|
const default_light_theme = "light";
|
||
|
|
const default_dark_theme = "dark";
|
||
|
|
</script>
|
||
|
|
<!-- Start loading toc.js asap -->
|
||
|
|
<script src="../toc.js"></script>
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<div id="mdbook-help-container">
|
||
|
|
<div id="mdbook-help-popup">
|
||
|
|
<h2 class="mdbook-help-title">Keyboard shortcuts</h2>
|
||
|
|
<div>
|
||
|
|
<p>Press <kbd>←</kbd> or <kbd>→</kbd> to navigate between chapters</p>
|
||
|
|
<p>Press <kbd>S</kbd> or <kbd>/</kbd> to search in the book</p>
|
||
|
|
<p>Press <kbd>?</kbd> to show this help</p>
|
||
|
|
<p>Press <kbd>Esc</kbd> to hide this help</p>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div id="body-container">
|
||
|
|
<!-- Work around some values being stored in localStorage wrapped in quotes -->
|
||
|
|
<script>
|
||
|
|
try {
|
||
|
|
let theme = localStorage.getItem('mdbook-theme');
|
||
|
|
let sidebar = localStorage.getItem('mdbook-sidebar');
|
||
|
|
|
||
|
|
if (theme.startsWith('"') && theme.endsWith('"')) {
|
||
|
|
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
|
||
|
|
}
|
||
|
|
|
||
|
|
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
|
||
|
|
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
|
||
|
|
}
|
||
|
|
} catch (e) { }
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<!-- Set the theme before any content is loaded, prevents flash -->
|
||
|
|
<script>
|
||
|
|
const default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? default_dark_theme : default_light_theme;
|
||
|
|
let theme;
|
||
|
|
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
|
||
|
|
if (theme === null || theme === undefined) { theme = default_theme; }
|
||
|
|
const html = document.documentElement;
|
||
|
|
html.classList.remove('light')
|
||
|
|
html.classList.add(theme);
|
||
|
|
html.classList.add("js");
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
|
||
|
|
|
||
|
|
<!-- Hide / unhide sidebar before it is displayed -->
|
||
|
|
<script>
|
||
|
|
let sidebar = null;
|
||
|
|
const sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
|
||
|
|
if (document.body.clientWidth >= 1080) {
|
||
|
|
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
|
||
|
|
sidebar = sidebar || 'visible';
|
||
|
|
} else {
|
||
|
|
sidebar = 'hidden';
|
||
|
|
}
|
||
|
|
sidebar_toggle.checked = sidebar === 'visible';
|
||
|
|
html.classList.remove('sidebar-visible');
|
||
|
|
html.classList.add("sidebar-" + sidebar);
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
|
||
|
|
<!-- populated by js -->
|
||
|
|
<mdbook-sidebar-scrollbox class="sidebar-scrollbox"></mdbook-sidebar-scrollbox>
|
||
|
|
<noscript>
|
||
|
|
<iframe class="sidebar-iframe-outer" src="../toc.html"></iframe>
|
||
|
|
</noscript>
|
||
|
|
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
|
||
|
|
<div class="sidebar-resize-indicator"></div>
|
||
|
|
</div>
|
||
|
|
</nav>
|
||
|
|
|
||
|
|
<div id="page-wrapper" class="page-wrapper">
|
||
|
|
|
||
|
|
<div class="page">
|
||
|
|
<div id="menu-bar-hover-placeholder"></div>
|
||
|
|
<div id="menu-bar" class="menu-bar sticky">
|
||
|
|
<div class="left-buttons">
|
||
|
|
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
|
||
|
|
<i class="fa fa-bars"></i>
|
||
|
|
</label>
|
||
|
|
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
|
||
|
|
<i class="fa fa-paint-brush"></i>
|
||
|
|
</button>
|
||
|
|
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
|
||
|
|
<li role="none"><button role="menuitem" class="theme" id="default_theme">Auto</button></li>
|
||
|
|
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
|
||
|
|
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
|
||
|
|
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
|
||
|
|
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
|
||
|
|
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
|
||
|
|
</ul>
|
||
|
|
<button id="search-toggle" class="icon-button" type="button" title="Search (`/`)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="/ s" aria-controls="searchbar">
|
||
|
|
<i class="fa fa-search"></i>
|
||
|
|
</button>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<h1 class="menu-title">VAPORA Platform Documentation</h1>
|
||
|
|
|
||
|
|
<div class="right-buttons">
|
||
|
|
<a href="../print.html" title="Print this book" aria-label="Print this book">
|
||
|
|
<i id="print-button" class="fa fa-print"></i>
|
||
|
|
</a>
|
||
|
|
<a href="https://github.com/vapora-platform/vapora" title="Git repository" aria-label="Git repository">
|
||
|
|
<i id="git-repository-button" class="fa fa-github"></i>
|
||
|
|
</a>
|
||
|
|
<a href="https://github.com/vapora-platform/vapora/edit/main/docs/src/../integrations/provisioning-integration.md" title="Suggest an edit" aria-label="Suggest an edit">
|
||
|
|
<i id="git-edit-button" class="fa fa-edit"></i>
|
||
|
|
</a>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div id="search-wrapper" class="hidden">
|
||
|
|
<form id="searchbar-outer" class="searchbar-outer">
|
||
|
|
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
|
||
|
|
</form>
|
||
|
|
<div id="searchresults-outer" class="searchresults-outer hidden">
|
||
|
|
<div id="searchresults-header" class="searchresults-header"></div>
|
||
|
|
<ul id="searchresults">
|
||
|
|
</ul>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
|
||
|
|
<script>
|
||
|
|
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
|
||
|
|
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
|
||
|
|
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
|
||
|
|
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
|
||
|
|
});
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<div id="content" class="content">
|
||
|
|
<main>
|
||
|
|
<h1 id="-provisioning-integration"><a class="header" href="#-provisioning-integration">⚙️ Provisioning Integration</a></h1>
|
||
|
|
<h2 id="deploying-vapora-via-provisioning-taskservs--kcl"><a class="header" href="#deploying-vapora-via-provisioning-taskservs--kcl">Deploying VAPORA via Provisioning Taskservs & KCL</a></h2>
|
||
|
|
<p><strong>Version</strong>: 0.1.0
|
||
|
|
<strong>Status</strong>: Specification (VAPORA v1.0 Deployment)
|
||
|
|
<strong>Purpose</strong>: How Provisioning creates and manages VAPORA infrastructure</p>
|
||
|
|
<hr />
|
||
|
|
<h2 id="-objetivo"><a class="header" href="#-objetivo">🎯 Objetivo</a></h2>
|
||
|
|
<p>Provisioning es el <strong>deployment engine</strong> para VAPORA:</p>
|
||
|
|
<ul>
|
||
|
|
<li>Define infraestructura con <strong>KCL schemas</strong> (no Helm)</li>
|
||
|
|
<li>Crea <strong>taskservs</strong> para cada componente VAPORA</li>
|
||
|
|
<li>Ejecuta <strong>batch workflows</strong> para operaciones complejas</li>
|
||
|
|
<li>Escala <strong>agents</strong> dinámicamente</li>
|
||
|
|
<li>Monitorea <strong>health</strong> y triggers <strong>rollback</strong></li>
|
||
|
|
</ul>
|
||
|
|
<hr />
|
||
|
|
<h2 id="-vapora-workspace-structure"><a class="header" href="#-vapora-workspace-structure">📁 VAPORA Workspace Structure</a></h2>
|
||
|
|
<pre><code>provisioning/vapora-wrksp/
|
||
|
|
├── workspace.toml # Workspace definition
|
||
|
|
├── kcl/ # KCL Infrastructure-as-Code
|
||
|
|
│ ├── cluster.k # K8s cluster (nodes, networks)
|
||
|
|
│ ├── services.k # Microservices (backend, agents)
|
||
|
|
│ ├── storage.k # SurrealDB + Rook Ceph
|
||
|
|
│ ├── agents.k # Agent pools + scaling
|
||
|
|
│ └── multi-ia.k # LLM Router + providers
|
||
|
|
├── taskservs/ # Taskserv definitions
|
||
|
|
│ ├── vapora-backend.toml # API backend
|
||
|
|
│ ├── vapora-frontend.toml # Web UI
|
||
|
|
│ ├── vapora-agents.toml # Agent runtime
|
||
|
|
│ ├── vapora-mcp-gateway.toml # MCP plugins
|
||
|
|
│ └── vapora-llm-router.toml # Multi-IA router
|
||
|
|
├── workflows/ # Batch operations
|
||
|
|
│ ├── deploy-full-stack.yaml
|
||
|
|
│ ├── scale-agents.yaml
|
||
|
|
│ ├── upgrade-vapora.yaml
|
||
|
|
│ └── disaster-recovery.yaml
|
||
|
|
└── README.md # Setup guide
|
||
|
|
</code></pre>
|
||
|
|
<hr />
|
||
|
|
<h2 id="-kcl-schemas"><a class="header" href="#-kcl-schemas">🏗️ KCL Schemas</a></h2>
|
||
|
|
<h3 id="1-cluster-definition-clusterk"><a class="header" href="#1-cluster-definition-clusterk">1. Cluster Definition (cluster.k)</a></h3>
|
||
|
|
<pre><code class="language-kcl">import kcl_plugin.kubernetes as k
|
||
|
|
|
||
|
|
# VAPORA Cluster
|
||
|
|
cluster = k.Cluster {
|
||
|
|
name = "vapora-cluster"
|
||
|
|
version = "1.30"
|
||
|
|
|
||
|
|
network = {
|
||
|
|
cni = "cilium" # Network plugin
|
||
|
|
serviceMesh = "istio" # Service mesh
|
||
|
|
ingressController = "istio-gateway"
|
||
|
|
}
|
||
|
|
|
||
|
|
storage = {
|
||
|
|
provider = "rook-ceph"
|
||
|
|
replication_factor = 3
|
||
|
|
storage_classes = [
|
||
|
|
{ name = "ssd", type = "nvme" },
|
||
|
|
{ name = "hdd", type = "sata" },
|
||
|
|
]
|
||
|
|
}
|
||
|
|
|
||
|
|
nodes = [
|
||
|
|
# Control plane
|
||
|
|
{
|
||
|
|
role = "control-plane"
|
||
|
|
count = 3
|
||
|
|
instance_type = "t3.medium"
|
||
|
|
resources = { cpu = "2", memory = "4Gi" }
|
||
|
|
},
|
||
|
|
# Worker nodes for agents (scalable)
|
||
|
|
{
|
||
|
|
role = "worker"
|
||
|
|
count = 5
|
||
|
|
instance_type = "t3.large"
|
||
|
|
resources = { cpu = "4", memory = "8Gi" }
|
||
|
|
labels = { workload = "agents", tier = "compute" }
|
||
|
|
taints = []
|
||
|
|
},
|
||
|
|
# Worker nodes for data
|
||
|
|
{
|
||
|
|
role = "worker"
|
||
|
|
count = 3
|
||
|
|
instance_type = "t3.xlarge"
|
||
|
|
resources = { cpu = "8", memory = "16Gi" }
|
||
|
|
labels = { workload = "data", tier = "storage" }
|
||
|
|
},
|
||
|
|
]
|
||
|
|
|
||
|
|
addons = [
|
||
|
|
"metrics-server",
|
||
|
|
"prometheus",
|
||
|
|
"grafana",
|
||
|
|
]
|
||
|
|
}
|
||
|
|
</code></pre>
|
||
|
|
<h3 id="2-services-definition-servicesk"><a class="header" href="#2-services-definition-servicesk">2. Services Definition (services.k)</a></h3>
|
||
|
|
<pre><code class="language-kcl">import kcl_plugin.kubernetes as k
|
||
|
|
|
||
|
|
services = [
|
||
|
|
# Backend API
|
||
|
|
{
|
||
|
|
name = "vapora-backend"
|
||
|
|
namespace = "vapora-system"
|
||
|
|
replicas = 3
|
||
|
|
image = "vapora/backend:0.1.0"
|
||
|
|
port = 8080
|
||
|
|
resources = {
|
||
|
|
requests = { cpu = "1", memory = "2Gi" }
|
||
|
|
limits = { cpu = "2", memory = "4Gi" }
|
||
|
|
}
|
||
|
|
env = [
|
||
|
|
{ name = "DATABASE_URL", value = "surrealdb://surreal-0.vapora-system:8000" },
|
||
|
|
{ name = "NATS_URL", value = "nats://nats-0.vapora-system:4222" },
|
||
|
|
]
|
||
|
|
},
|
||
|
|
|
||
|
|
# Frontend
|
||
|
|
{
|
||
|
|
name = "vapora-frontend"
|
||
|
|
namespace = "vapora-system"
|
||
|
|
replicas = 2
|
||
|
|
image = "vapora/frontend:0.1.0"
|
||
|
|
port = 3000
|
||
|
|
resources = {
|
||
|
|
requests = { cpu = "500m", memory = "512Mi" }
|
||
|
|
limits = { cpu = "1", memory = "1Gi" }
|
||
|
|
}
|
||
|
|
},
|
||
|
|
|
||
|
|
# Agent Runtime
|
||
|
|
{
|
||
|
|
name = "vapora-agents"
|
||
|
|
namespace = "vapora-agents"
|
||
|
|
replicas = 3
|
||
|
|
image = "vapora/agents:0.1.0"
|
||
|
|
port = 8089
|
||
|
|
resources = {
|
||
|
|
requests = { cpu = "2", memory = "4Gi" }
|
||
|
|
limits = { cpu = "4", memory = "8Gi" }
|
||
|
|
}
|
||
|
|
# Autoscaling
|
||
|
|
hpa = {
|
||
|
|
min_replicas = 3
|
||
|
|
max_replicas = 20
|
||
|
|
target_cpu = "70"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
|
||
|
|
# MCP Gateway
|
||
|
|
{
|
||
|
|
name = "vapora-mcp-gateway"
|
||
|
|
namespace = "vapora-system"
|
||
|
|
replicas = 2
|
||
|
|
image = "vapora/mcp-gateway:0.1.0"
|
||
|
|
port = 8888
|
||
|
|
},
|
||
|
|
|
||
|
|
# LLM Router
|
||
|
|
{
|
||
|
|
name = "vapora-llm-router"
|
||
|
|
namespace = "vapora-system"
|
||
|
|
replicas = 2
|
||
|
|
image = "vapora/llm-router:0.1.0"
|
||
|
|
port = 8899
|
||
|
|
env = [
|
||
|
|
{ name = "CLAUDE_API_KEY", valueFrom = "secret:vapora-secrets:claude-key" },
|
||
|
|
{ name = "OPENAI_API_KEY", valueFrom = "secret:vapora-secrets:openai-key" },
|
||
|
|
{ name = "GEMINI_API_KEY", valueFrom = "secret:vapora-secrets:gemini-key" },
|
||
|
|
]
|
||
|
|
},
|
||
|
|
]
|
||
|
|
</code></pre>
|
||
|
|
<h3 id="3-storage-definition-storagek"><a class="header" href="#3-storage-definition-storagek">3. Storage Definition (storage.k)</a></h3>
|
||
|
|
<pre><code class="language-kcl">import kcl_plugin.kubernetes as k
|
||
|
|
|
||
|
|
storage = {
|
||
|
|
# SurrealDB StatefulSet
|
||
|
|
surrealdb = {
|
||
|
|
name = "surrealdb"
|
||
|
|
namespace = "vapora-system"
|
||
|
|
replicas = 3
|
||
|
|
image = "surrealdb/surrealdb:1.8"
|
||
|
|
port = 8000
|
||
|
|
storage = {
|
||
|
|
size = "50Gi"
|
||
|
|
storage_class = "rook-ceph"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
|
||
|
|
# Redis cache
|
||
|
|
redis = {
|
||
|
|
name = "redis"
|
||
|
|
namespace = "vapora-system"
|
||
|
|
replicas = 1
|
||
|
|
image = "redis:7-alpine"
|
||
|
|
port = 6379
|
||
|
|
storage = {
|
||
|
|
size = "20Gi"
|
||
|
|
storage_class = "ssd"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
|
||
|
|
# NATS JetStream
|
||
|
|
nats = {
|
||
|
|
name = "nats"
|
||
|
|
namespace = "vapora-system"
|
||
|
|
replicas = 3
|
||
|
|
image = "nats:2.10-scratch"
|
||
|
|
port = 4222
|
||
|
|
storage = {
|
||
|
|
size = "30Gi"
|
||
|
|
storage_class = "rook-ceph"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
}
|
||
|
|
</code></pre>
|
||
|
|
<h3 id="4-agent-pools-agentsk"><a class="header" href="#4-agent-pools-agentsk">4. Agent Pools (agents.k)</a></h3>
|
||
|
|
<pre><code class="language-kcl">agents = {
|
||
|
|
architect = {
|
||
|
|
role_id = "architect"
|
||
|
|
replicas = 2
|
||
|
|
max_concurrent = 1
|
||
|
|
container = {
|
||
|
|
image = "vapora/agents:architect-0.1.0"
|
||
|
|
resources = { cpu = "4", memory = "8Gi" }
|
||
|
|
}
|
||
|
|
},
|
||
|
|
|
||
|
|
developer = {
|
||
|
|
role_id = "developer"
|
||
|
|
replicas = 5 # Can scale to 20
|
||
|
|
max_concurrent = 2
|
||
|
|
container = {
|
||
|
|
image = "vapora/agents:developer-0.1.0"
|
||
|
|
resources = { cpu = "4", memory = "8Gi" }
|
||
|
|
}
|
||
|
|
hpa = {
|
||
|
|
min_replicas = 5
|
||
|
|
max_replicas = 20
|
||
|
|
target_queue_depth = 10 # Scale when queue > 10
|
||
|
|
}
|
||
|
|
},
|
||
|
|
|
||
|
|
reviewer = {
|
||
|
|
role_id = "code-reviewer"
|
||
|
|
replicas = 3
|
||
|
|
max_concurrent = 2
|
||
|
|
container = {
|
||
|
|
image = "vapora/agents:reviewer-0.1.0"
|
||
|
|
resources = { cpu = "2", memory = "4Gi" }
|
||
|
|
}
|
||
|
|
},
|
||
|
|
|
||
|
|
# ... other 9 roles
|
||
|
|
}
|
||
|
|
</code></pre>
|
||
|
|
<hr />
|
||
|
|
<h2 id="-taskservs-definition"><a class="header" href="#-taskservs-definition">🛠️ Taskservs Definition</a></h2>
|
||
|
|
<h3 id="example-backend-taskserv"><a class="header" href="#example-backend-taskserv">Example: Backend Taskserv</a></h3>
|
||
|
|
<pre><code class="language-toml"># taskservs/vapora-backend.toml
|
||
|
|
|
||
|
|
[taskserv]
|
||
|
|
name = "vapora-backend"
|
||
|
|
type = "service"
|
||
|
|
version = "0.1.0"
|
||
|
|
description = "VAPORA REST API backend"
|
||
|
|
|
||
|
|
[source]
|
||
|
|
repository = "ssh://git@repo.jesusperez.pro:32225/jesus/Vapora.git"
|
||
|
|
branch = "main"
|
||
|
|
path = "vapora-backend/"
|
||
|
|
|
||
|
|
[build]
|
||
|
|
runtime = "rust"
|
||
|
|
build_command = "cargo build --release"
|
||
|
|
binary_path = "target/release/vapora-backend"
|
||
|
|
dockerfile = "Dockerfile.backend"
|
||
|
|
|
||
|
|
[deployment]
|
||
|
|
namespace = "vapora-system"
|
||
|
|
replicas = 3
|
||
|
|
image = "vapora/backend:${version}"
|
||
|
|
image_pull_policy = "Always"
|
||
|
|
|
||
|
|
[ports]
|
||
|
|
http = 8080
|
||
|
|
metrics = 9090
|
||
|
|
|
||
|
|
[resources]
|
||
|
|
requests = { cpu = "1000m", memory = "2Gi" }
|
||
|
|
limits = { cpu = "2000m", memory = "4Gi" }
|
||
|
|
|
||
|
|
[health_check]
|
||
|
|
path = "/health"
|
||
|
|
interval_secs = 10
|
||
|
|
timeout_secs = 5
|
||
|
|
failure_threshold = 3
|
||
|
|
|
||
|
|
[dependencies]
|
||
|
|
- "surrealdb" # Must exist
|
||
|
|
- "nats" # Must exist
|
||
|
|
- "redis" # Optional
|
||
|
|
|
||
|
|
[scaling]
|
||
|
|
min_replicas = 3
|
||
|
|
max_replicas = 10
|
||
|
|
target_cpu_percent = 70
|
||
|
|
target_memory_percent = 80
|
||
|
|
|
||
|
|
[environment]
|
||
|
|
DATABASE_URL = "surrealdb://surrealdb-0:8000"
|
||
|
|
NATS_URL = "nats://nats-0:4222"
|
||
|
|
REDIS_URL = "redis://redis-0:6379"
|
||
|
|
RUST_LOG = "debug,vapora=trace"
|
||
|
|
|
||
|
|
[secrets]
|
||
|
|
JWT_SECRET = "secret:vapora-secrets:jwt-secret"
|
||
|
|
DATABASE_PASSWORD = "secret:vapora-secrets:db-password"
|
||
|
|
</code></pre>
|
||
|
|
<hr />
|
||
|
|
<h2 id="-workflows-batch-operations"><a class="header" href="#-workflows-batch-operations">🔄 Workflows (Batch Operations)</a></h2>
|
||
|
|
<h3 id="deploy-full-stack"><a class="header" href="#deploy-full-stack">Deploy Full Stack</a></h3>
|
||
|
|
<pre><code class="language-yaml"># workflows/deploy-full-stack.yaml
|
||
|
|
|
||
|
|
apiVersion: provisioning/v1
|
||
|
|
kind: Workflow
|
||
|
|
metadata:
|
||
|
|
name: deploy-vapora-full-stack
|
||
|
|
namespace: vapora-system
|
||
|
|
spec:
|
||
|
|
description: "Deploy complete VAPORA stack from scratch"
|
||
|
|
|
||
|
|
steps:
|
||
|
|
# Step 1: Create cluster
|
||
|
|
- name: create-cluster
|
||
|
|
task: provisioning.cluster
|
||
|
|
params:
|
||
|
|
config: kcl/cluster.k
|
||
|
|
timeout: 1h
|
||
|
|
on_failure: abort
|
||
|
|
|
||
|
|
# Step 2: Install operators (Istio, Prometheus, Rook)
|
||
|
|
- name: install-addons
|
||
|
|
task: provisioning.addon
|
||
|
|
depends_on: [create-cluster]
|
||
|
|
params:
|
||
|
|
addons: [istio, prometheus, rook-ceph]
|
||
|
|
timeout: 30m
|
||
|
|
|
||
|
|
# Step 3: Deploy data layer
|
||
|
|
- name: deploy-data
|
||
|
|
task: provisioning.deploy-taskservs
|
||
|
|
depends_on: [install-addons]
|
||
|
|
params:
|
||
|
|
taskservs: [surrealdb, redis, nats]
|
||
|
|
timeout: 30m
|
||
|
|
|
||
|
|
# Step 4: Deploy core services
|
||
|
|
- name: deploy-core
|
||
|
|
task: provisioning.deploy-taskservs
|
||
|
|
depends_on: [deploy-data]
|
||
|
|
params:
|
||
|
|
taskservs: [vapora-backend, vapora-llm-router, vapora-mcp-gateway]
|
||
|
|
timeout: 30m
|
||
|
|
|
||
|
|
# Step 5: Deploy frontend
|
||
|
|
- name: deploy-frontend
|
||
|
|
task: provisioning.deploy-taskservs
|
||
|
|
depends_on: [deploy-core]
|
||
|
|
params:
|
||
|
|
taskservs: [vapora-frontend]
|
||
|
|
timeout: 15m
|
||
|
|
|
||
|
|
# Step 6: Deploy agent pools
|
||
|
|
- name: deploy-agents
|
||
|
|
task: provisioning.deploy-agents
|
||
|
|
depends_on: [deploy-core]
|
||
|
|
params:
|
||
|
|
agents: [architect, developer, reviewer, tester, documenter, devops, monitor, security, pm, decision-maker, orchestrator, presenter]
|
||
|
|
initial_replicas: { architect: 2, developer: 5, ... }
|
||
|
|
timeout: 30m
|
||
|
|
|
||
|
|
# Step 7: Verify health
|
||
|
|
- name: health-check
|
||
|
|
task: provisioning.health-check
|
||
|
|
depends_on: [deploy-agents, deploy-frontend]
|
||
|
|
params:
|
||
|
|
services: all
|
||
|
|
timeout: 5m
|
||
|
|
on_failure: rollback
|
||
|
|
|
||
|
|
# Step 8: Initialize database
|
||
|
|
- name: init-database
|
||
|
|
task: provisioning.run-migrations
|
||
|
|
depends_on: [health-check]
|
||
|
|
params:
|
||
|
|
sql_files: [migrations/*.surql]
|
||
|
|
timeout: 10m
|
||
|
|
|
||
|
|
# Step 9: Configure ingress
|
||
|
|
- name: configure-ingress
|
||
|
|
task: provisioning.configure-ingress
|
||
|
|
depends_on: [init-database]
|
||
|
|
params:
|
||
|
|
gateway: istio-gateway
|
||
|
|
hosts:
|
||
|
|
- vapora.example.com
|
||
|
|
timeout: 10m
|
||
|
|
|
||
|
|
rollback_on_failure: true
|
||
|
|
on_completion:
|
||
|
|
- name: notify-slack
|
||
|
|
task: notifications.slack
|
||
|
|
params:
|
||
|
|
webhook: "${SLACK_WEBHOOK}"
|
||
|
|
message: "VAPORA deployment completed successfully!"
|
||
|
|
</code></pre>
|
||
|
|
<h3 id="scale-agents"><a class="header" href="#scale-agents">Scale Agents</a></h3>
|
||
|
|
<pre><code class="language-yaml"># workflows/scale-agents.yaml
|
||
|
|
|
||
|
|
apiVersion: provisioning/v1
|
||
|
|
kind: Workflow
|
||
|
|
spec:
|
||
|
|
description: "Dynamically scale agent pools based on queue depth"
|
||
|
|
|
||
|
|
steps:
|
||
|
|
- name: check-queue-depth
|
||
|
|
task: provisioning.query
|
||
|
|
params:
|
||
|
|
query: "SELECT queue_depth FROM agent_health WHERE role = '${AGENT_ROLE}'"
|
||
|
|
outputs: [queue_depth]
|
||
|
|
|
||
|
|
- name: decide-scaling
|
||
|
|
task: provisioning.evaluate
|
||
|
|
params:
|
||
|
|
condition: |
|
||
|
|
if queue_depth > 10 && current_replicas < max_replicas:
|
||
|
|
scale_to = min(current_replicas + 2, max_replicas)
|
||
|
|
action = "scale_up"
|
||
|
|
elif queue_depth < 2 && current_replicas > min_replicas:
|
||
|
|
scale_to = max(current_replicas - 1, min_replicas)
|
||
|
|
action = "scale_down"
|
||
|
|
else:
|
||
|
|
action = "no_change"
|
||
|
|
outputs: [action, scale_to]
|
||
|
|
|
||
|
|
- name: execute-scaling
|
||
|
|
task: provisioning.scale-taskserv
|
||
|
|
when: action != "no_change"
|
||
|
|
params:
|
||
|
|
taskserv: "vapora-agents-${AGENT_ROLE}"
|
||
|
|
replicas: "${scale_to}"
|
||
|
|
timeout: 5m
|
||
|
|
</code></pre>
|
||
|
|
<hr />
|
||
|
|
<h2 id="-cli-usage"><a class="header" href="#-cli-usage">🎯 CLI Usage</a></h2>
|
||
|
|
<pre><code class="language-bash">cd provisioning/vapora-wrksp
|
||
|
|
|
||
|
|
# 1. Create cluster
|
||
|
|
provisioning cluster create --config kcl/cluster.k
|
||
|
|
|
||
|
|
# 2. Deploy full stack
|
||
|
|
provisioning workflow run workflows/deploy-full-stack.yaml
|
||
|
|
|
||
|
|
# 3. Check status
|
||
|
|
provisioning health-check --services all
|
||
|
|
|
||
|
|
# 4. Scale agents
|
||
|
|
provisioning taskserv scale vapora-agents-developer --replicas 10
|
||
|
|
|
||
|
|
# 5. Monitor
|
||
|
|
provisioning dashboard open # Grafana dashboard
|
||
|
|
provisioning logs tail -f vapora-backend
|
||
|
|
|
||
|
|
# 6. Upgrade
|
||
|
|
provisioning taskserv upgrade vapora-backend --image vapora/backend:0.3.0
|
||
|
|
|
||
|
|
# 7. Rollback
|
||
|
|
provisioning taskserv rollback vapora-backend --to-version 0.1.0
|
||
|
|
</code></pre>
|
||
|
|
<hr />
|
||
|
|
<h2 id="-implementation-checklist"><a class="header" href="#-implementation-checklist">🎯 Implementation Checklist</a></h2>
|
||
|
|
<ul>
|
||
|
|
<li><input disabled="" type="checkbox"/>
|
||
|
|
KCL schemas (cluster, services, storage, agents)</li>
|
||
|
|
<li><input disabled="" type="checkbox"/>
|
||
|
|
Taskserv definitions (5 services)</li>
|
||
|
|
<li><input disabled="" type="checkbox"/>
|
||
|
|
Workflows (deploy, scale, upgrade, disaster-recovery)</li>
|
||
|
|
<li><input disabled="" type="checkbox"/>
|
||
|
|
Namespace creation + RBAC</li>
|
||
|
|
<li><input disabled="" type="checkbox"/>
|
||
|
|
PVC provisioning (Rook Ceph)</li>
|
||
|
|
<li><input disabled="" type="checkbox"/>
|
||
|
|
Service discovery (DNS, load balancing)</li>
|
||
|
|
<li><input disabled="" type="checkbox"/>
|
||
|
|
Health checks + readiness probes</li>
|
||
|
|
<li><input disabled="" type="checkbox"/>
|
||
|
|
Logging aggregation (ELK or similar)</li>
|
||
|
|
<li><input disabled="" type="checkbox"/>
|
||
|
|
Secrets management (RustyVault integration)</li>
|
||
|
|
<li><input disabled="" type="checkbox"/>
|
||
|
|
Monitoring (Prometheus metrics export)</li>
|
||
|
|
<li><input disabled="" type="checkbox"/>
|
||
|
|
Documentation + runbooks</li>
|
||
|
|
</ul>
|
||
|
|
<hr />
|
||
|
|
<h2 id="-success-metrics"><a class="header" href="#-success-metrics">📊 Success Metrics</a></h2>
|
||
|
|
<p>✅ Full VAPORA deployed < 1 hour
|
||
|
|
✅ All services healthy post-deployment
|
||
|
|
✅ Agent pools scale automatically
|
||
|
|
✅ Rollback works if deployment fails
|
||
|
|
✅ Monitoring captures all metrics
|
||
|
|
✅ Scaling decisions in < 1 min</p>
|
||
|
|
<hr />
|
||
|
|
<p><strong>Version</strong>: 0.1.0
|
||
|
|
<strong>Status</strong>: ✅ Integration Specification Complete
|
||
|
|
<strong>Purpose</strong>: Provisioning deployment of VAPORA infrastructure</p>
|
||
|
|
|
||
|
|
</main>
|
||
|
|
|
||
|
|
<nav class="nav-wrapper" aria-label="Page navigation">
|
||
|
|
<!-- Mobile navigation buttons -->
|
||
|
|
<a rel="prev" href="../../integrations/rag-integration.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
||
|
|
<i class="fa fa-angle-left"></i>
|
||
|
|
</a>
|
||
|
|
|
||
|
|
<a rel="next prefetch" href="../../examples-guide.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
||
|
|
<i class="fa fa-angle-right"></i>
|
||
|
|
</a>
|
||
|
|
|
||
|
|
<div style="clear: both"></div>
|
||
|
|
</nav>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<nav class="nav-wide-wrapper" aria-label="Page navigation">
|
||
|
|
<a rel="prev" href="../../integrations/rag-integration.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
||
|
|
<i class="fa fa-angle-left"></i>
|
||
|
|
</a>
|
||
|
|
|
||
|
|
<a rel="next prefetch" href="../../examples-guide.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
||
|
|
<i class="fa fa-angle-right"></i>
|
||
|
|
</a>
|
||
|
|
</nav>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
<script>
|
||
|
|
window.playground_copyable = true;
|
||
|
|
</script>
|
||
|
|
|
||
|
|
|
||
|
|
<script src="../elasticlunr.min.js"></script>
|
||
|
|
<script src="../mark.min.js"></script>
|
||
|
|
<script src="../searcher.js"></script>
|
||
|
|
|
||
|
|
<script src="../clipboard.min.js"></script>
|
||
|
|
<script src="../highlight.js"></script>
|
||
|
|
<script src="../book.js"></script>
|
||
|
|
|
||
|
|
<!-- Custom JS scripts -->
|
||
|
|
|
||
|
|
|
||
|
|
</div>
|
||
|
|
</body>
|
||
|
|
</html>
|