chore: sync all changes to Gitea
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled

- Config, docs, scripts, and backup manifests
- Submodule refs unchanged (m = modified content in submodules)

Made-with: Cursor
This commit is contained in:
defiQUG
2026-03-02 11:37:34 -08:00
parent ed85135249
commit b3a8fe4496
883 changed files with 73580 additions and 4796 deletions

View File

@@ -0,0 +1,18 @@
# VM 5702 — Inference: llama.cpp server (CPU-friendly)
# Copy to /opt/ai/inference/ and place model at /opt/ai/inference/data/models/model.gguf
# See: docs/02-architecture/AI_AGENTS_57XX_DEPLOYMENT_PLAN.md Appendix D
services:
llama:
image: ghcr.io/ggerganov/llama.cpp:server
container_name: ai-inf-prod
volumes:
- /opt/ai/inference/data/models:/models
command: >
-m /models/model.gguf
--host 0.0.0.0 --port 8000
--n-gpu-layers 0
--ctx-size 4096
ports:
- "8000:8000"
restart: unless-stopped

View File

@@ -0,0 +1,13 @@
# VM 5703 agent — copy to /opt/ai/agent/.env
# Replace hostnames with your 5701/5702 hostnames or IPs if not using numeric hostnames.
MCP_URL=http://5701:3000/mcp/call
INF_URL=http://5702:8000
MODE=read-only
# Set to an allowlisted pool address when using dodo.get_pool_state
POOL_ADDRESS=POOL_ADDRESS_HERE
# Optional: when VM 5704 is used
# PG_DSN=postgresql://ai:YOUR_PASSWORD@5704:5432/ai
# REDIS_URL=redis://5704:6379/0

View File

@@ -0,0 +1,24 @@
# VM 5703 — Agent worker: calls 5701 (MCP) and 5702 (inference)
# Copy to /opt/ai/agent/ and copy agent.py to /opt/ai/agent/config/
# See: docs/02-architecture/AI_AGENTS_57XX_DEPLOYMENT_PLAN.md Appendix E
services:
agent:
image: python:3.11-slim
container_name: ai-agent-prod
working_dir: /app
volumes:
- /opt/ai/agent/config:/app
- /opt/ai/agent/logs:/logs
env_file: .env
environment:
MCP_URL: ${MCP_URL:-http://5701:3000/mcp/call}
INF_URL: ${INF_URL:-http://5702:8000}
MODE: ${MODE:-read-only}
POOL_ADDRESS: ${POOL_ADDRESS:-POOL_ADDRESS_HERE}
# PG_DSN: postgresql://ai:...@5704:5432/ai
# REDIS_URL: redis://5704:6379/0
command: >
sh -lc "pip install --no-cache-dir requests &&
python agent.py"
restart: unless-stopped

View File

@@ -0,0 +1,2 @@
# VM 5704 state — copy to /opt/ai/state/.env and set a strong password
POSTGRES_PASSWORD=change_me_strong

View File

@@ -0,0 +1,47 @@
# VM 5704 — Memory/State: Postgres + Redis
# Copy to /opt/ai/state/ and run: docker compose up -d
# See: docs/02-architecture/AI_AGENTS_57XX_DEPLOYMENT_PLAN.md Appendix B
services:
postgres:
image: postgres:16
container_name: ai-state-postgres
environment:
POSTGRES_DB: ai
POSTGRES_USER: ai
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- /opt/ai/state/data/postgres:/var/lib/postgresql/data
ports:
- "5432:5432"
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ai -d ai"]
interval: 10s
timeout: 5s
retries: 10
redis:
image: redis:7
container_name: ai-state-redis
command: ["redis-server", "--appendonly", "yes", "--save", "60", "1"]
volumes:
- /opt/ai/state/data/redis:/data
ports:
- "6379:6379"
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "PING"]
interval: 10s
timeout: 3s
retries: 10
# Optional vector DB (uncomment if needed)
# qdrant:
# image: qdrant/qdrant:latest
# container_name: ai-state-qdrant
# volumes:
# - /opt/ai/state/data/qdrant:/qdrant/storage
# ports:
# - "6333:6333"
# restart: unless-stopped

View File

@@ -0,0 +1,39 @@
# 57xx AI/Agents deploy artifacts
Copy these files to the target VMs per the [deployment task list](../../docs/02-architecture/AI_AGENTS_57XX_DEPLOYMENT_TASKS.md).
**VMID band:** 57005999 (see [VMID_ALLOCATION_FINAL.md](../../docs/02-architecture/VMID_ALLOCATION_FINAL.md)).
## Layout
| Path | Purpose |
|------|---------|
| **5704-state/** | Postgres + Redis for VM 5704. Copy `docker-compose.yml` and `.env.example``/opt/ai/state/`, rename `.env.example` to `.env`, set `POSTGRES_PASSWORD`. |
| **5702-inference/** | llama.cpp server for VM 5702. Copy `docker-compose.yml``/opt/ai/inference/`. Put GGUF at `/opt/ai/inference/data/models/model.gguf`. |
| **5703-agent/** | Agent worker for VM 5703. Copy `agent.py``/opt/ai/agent/config/`, `docker-compose.yml` and `.env.example``/opt/ai/agent/`. Rename `.env.example` to `.env`, set `MCP_URL`, `INF_URL`, and optionally `POOL_ADDRESS`. |
**5701 (MCP Hub)** is the **ai-mcp-pmm-controller** submodule at repo root; see [AI_AGENTS_57XX_DEPLOYMENT_TASKS.md](../../docs/02-architecture/AI_AGENTS_57XX_DEPLOYMENT_TASKS.md) Task 2.
## Optional: copy to /opt/ai (run on target host with repo at /opt/proxmox)
```bash
REPO=/opt/proxmox
sudo mkdir -p /opt/ai/state/data/postgres /opt/ai/state/data/redis
sudo mkdir -p /opt/ai/inference/data/models /opt/ai/agent/config /opt/ai/agent/logs
sudo chown -R $USER:$USER /opt/ai
cp "$REPO/scripts/57xx-deploy/5704-state/docker-compose.yml" /opt/ai/state/
cp "$REPO/scripts/57xx-deploy/5704-state/.env.example" /opt/ai/state/.env
cp "$REPO/scripts/57xx-deploy/5702-inference/docker-compose.yml" /opt/ai/inference/
cp "$REPO/scripts/57xx-deploy/5703-agent/agent.py" /opt/ai/agent/config/
cp "$REPO/scripts/57xx-deploy/5703-agent/docker-compose.yml" /opt/ai/agent/
cp "$REPO/scripts/57xx-deploy/5703-agent/.env.example" /opt/ai/agent/.env
# Edit secrets and URLs:
# - /opt/ai/state/.env → POSTGRES_PASSWORD
# - /opt/ai/agent/.env → MCP_URL, INF_URL, POOL_ADDRESS (if used)
```
Then start each stack from its directory (see [AI_AGENTS_57XX_DEPLOYMENT_TASKS.md](../../docs/02-architecture/AI_AGENTS_57XX_DEPLOYMENT_TASKS.md)).

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# Copy 57xx deploy artifacts to /opt/ai. Run from repo root or set REPO.
# Usage: ./scripts/57xx-deploy/copy-to-opt-ai.sh
set -e
REPO="${REPO:-$(cd "$(dirname "$0")/../.." && pwd)}"
DEPLOY="$REPO/scripts/57xx-deploy"
echo "Using REPO=$REPO"
sudo mkdir -p /opt/ai/state/data/postgres /opt/ai/state/data/redis
sudo mkdir -p /opt/ai/inference/data/models /opt/ai/agent/config /opt/ai/agent/logs
sudo chown -R "$USER:$USER" /opt/ai
cp "$DEPLOY/5704-state/docker-compose.yml" /opt/ai/state/
if [[ ! -f /opt/ai/state/.env ]]; then
cp "$DEPLOY/5704-state/.env.example" /opt/ai/state/.env
echo "Created /opt/ai/state/.env — set POSTGRES_PASSWORD"
fi
cp "$DEPLOY/5702-inference/docker-compose.yml" /opt/ai/inference/
cp "$DEPLOY/5703-agent/agent.py" /opt/ai/agent/config/
cp "$DEPLOY/5703-agent/docker-compose.yml" /opt/ai/agent/
if [[ ! -f /opt/ai/agent/.env ]]; then
cp "$DEPLOY/5703-agent/.env.example" /opt/ai/agent/.env
echo "Created /opt/ai/agent/.env — set MCP_URL, INF_URL, POOL_ADDRESS"
fi
echo "Done. Next: edit /opt/ai/state/.env and /opt/ai/agent/.env, then start each stack (see docs/02-architecture/AI_AGENTS_57XX_DEPLOYMENT_TASKS.md)."