2026-05-17 15:54:19 +02:00
|
|
|
host: piha
|
|
|
|
|
|
|
|
|
|
services:
|
2026-05-29 12:26:34 +02:00
|
|
|
ha-diag-agent:
|
|
|
|
|
role: ha-diagnostic-agent
|
|
|
|
|
deployment_model: docker-compose
|
|
|
|
|
exposure: local-only
|
|
|
|
|
offline_required: false
|
|
|
|
|
depends_on:
|
|
|
|
|
local: []
|
|
|
|
|
external: [homeassistant]
|
|
|
|
|
config:
|
|
|
|
|
target_url: http://localhost:8123
|
|
|
|
|
location_tag: "ken"
|
|
|
|
|
events_dir: /opt/homelab/events/piha
|
|
|
|
|
runtime:
|
|
|
|
|
config_path: /opt/homelab/config/ha-diag-agent
|
|
|
|
|
data_path: /var/lib/ha-diag-agent
|
|
|
|
|
|
feat(node-agent): implement health monitor and safe cleanup policy
scripts/monitor/health-monitor.sh (new):
- Standalone bash health monitor: disk/RAM/CPU checks + docker container health
- Per-node-type cleanup policy enforced:
lte_node (chelsty-infra, chelsty-ha): NO cleanup, no docker ops
sd_card (piha, saturn): dangling images + containers, rate-limited once/24h
ai_node (solaria): dangling + containers + build cache, NEVER -a
standard (vps): dangling + containers + build cache + CP filesystem rotation
- VPS filesystem rotation: completed/failed actions >7d, deploy logs >30d,
events >3d AND past observer checkpoint
- Emits structured JSON events (node_health, disk_pressure, high_memory, high_cpu,
containers_not_running, healthcheck_failed)
services/node-agent/ (new):
- Python daemon (node_agent.py): same policy as bash script, Docker SDK
for container checks and cleanup, /proc for system metrics
- Optional event shipping to VPS via rsync+SSH (VPS_EVENTS_HOST env var)
- Dockerfile: python:3.11-slim + openssh-client + rsync + docker>=6.0
- docker-compose.yml: mounts docker socket, /opt/homelab, repo read-only
observer.py:
- Handle node_health: update node status + disk/mem/cpu metrics, clear disk_pressure
- Handle disk_pressure: record severity on node, clear when healthy
- Handle high_memory / high_cpu: record pressure level for correlation
supervisor.py:
- Add NO_DISK_CLEANUP_NODES = {chelsty-infra, chelsty-ha}
- reconcile() step 3: generate disk_cleanup actions for nodes with high disk pressure
- _generate_disk_cleanup_recommendation(): stable ID disk-cleanup-{node},
checks all active states, risk=guarded (operator approval required)
executor.py:
- Handle disk_cleanup action type via _execute_disk_cleanup()
- Commands come from action payload; safety gate rejects any command touching
/opt/homelab/data/, /opt/homelab/config/, /opt/homelab/state/, or rm -rf /
hosts/*/services.yaml:
- Rename stability-agent -> node-agent on piha, vps, solaria, chelsty-infra
- Add node-agent to chelsty-ha (previously missing)
- Add cleanup policy notes to LTE node comments
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 13:15:06 +02:00
|
|
|
node-agent:
|
2026-05-17 15:54:19 +02:00
|
|
|
role: node-stability-monitor
|
|
|
|
|
deployment_model: docker-compose
|
|
|
|
|
exposure: local-only
|
|
|
|
|
offline_required: true
|
|
|
|
|
depends_on:
|
|
|
|
|
local: []
|
|
|
|
|
external: []
|
|
|
|
|
runtime:
|
feat(node-agent): implement health monitor and safe cleanup policy
scripts/monitor/health-monitor.sh (new):
- Standalone bash health monitor: disk/RAM/CPU checks + docker container health
- Per-node-type cleanup policy enforced:
lte_node (chelsty-infra, chelsty-ha): NO cleanup, no docker ops
sd_card (piha, saturn): dangling images + containers, rate-limited once/24h
ai_node (solaria): dangling + containers + build cache, NEVER -a
standard (vps): dangling + containers + build cache + CP filesystem rotation
- VPS filesystem rotation: completed/failed actions >7d, deploy logs >30d,
events >3d AND past observer checkpoint
- Emits structured JSON events (node_health, disk_pressure, high_memory, high_cpu,
containers_not_running, healthcheck_failed)
services/node-agent/ (new):
- Python daemon (node_agent.py): same policy as bash script, Docker SDK
for container checks and cleanup, /proc for system metrics
- Optional event shipping to VPS via rsync+SSH (VPS_EVENTS_HOST env var)
- Dockerfile: python:3.11-slim + openssh-client + rsync + docker>=6.0
- docker-compose.yml: mounts docker socket, /opt/homelab, repo read-only
observer.py:
- Handle node_health: update node status + disk/mem/cpu metrics, clear disk_pressure
- Handle disk_pressure: record severity on node, clear when healthy
- Handle high_memory / high_cpu: record pressure level for correlation
supervisor.py:
- Add NO_DISK_CLEANUP_NODES = {chelsty-infra, chelsty-ha}
- reconcile() step 3: generate disk_cleanup actions for nodes with high disk pressure
- _generate_disk_cleanup_recommendation(): stable ID disk-cleanup-{node},
checks all active states, risk=guarded (operator approval required)
executor.py:
- Handle disk_cleanup action type via _execute_disk_cleanup()
- Commands come from action payload; safety gate rejects any command touching
/opt/homelab/data/, /opt/homelab/config/, /opt/homelab/state/, or rm -rf /
hosts/*/services.yaml:
- Rename stability-agent -> node-agent on piha, vps, solaria, chelsty-infra
- Add node-agent to chelsty-ha (previously missing)
- Add cleanup policy notes to LTE node comments
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 13:15:06 +02:00
|
|
|
config_path: /opt/homelab/config/node-agent
|
2026-05-17 15:54:19 +02:00
|
|
|
data_path: /opt/homelab/state
|
|
|
|
|
logs_path: /opt/homelab/events
|
2026-06-01 17:54:36 +02:00
|
|
|
|
|
|
|
|
brain-watchdog:
|
|
|
|
|
role: control-plane-watchdog
|
|
|
|
|
deployment_model: docker-compose
|
|
|
|
|
exposure: private
|
|
|
|
|
offline_required: false
|
|
|
|
|
depends_on:
|
|
|
|
|
local: []
|
|
|
|
|
external: [control-plane]
|
|
|
|
|
runtime:
|
|
|
|
|
config_path: /opt/homelab/config/brain-watchdog
|
2026-06-17 15:02:37 +02:00
|
|
|
|
|
|
|
|
vikunja:
|
|
|
|
|
role: task-management
|
|
|
|
|
deployment_model: docker-compose
|
|
|
|
|
exposure: private # public via npm reverse proxy at vikunja.okit.pl
|
|
|
|
|
offline_required: false
|
|
|
|
|
depends_on:
|
|
|
|
|
local: []
|
|
|
|
|
external: [forgejo] # OIDC identity provider
|
|
|
|
|
ports:
|
|
|
|
|
- name: http
|
|
|
|
|
container_port: 3456
|
|
|
|
|
protocol: tcp
|
|
|
|
|
runtime:
|
|
|
|
|
# secrets (.env) + OIDC config (config.yml) live alongside the compose file
|
|
|
|
|
config_path: services/vikunja
|
|
|
|
|
# data is in Docker named volumes: vikunja_vikunja_db, vikunja_vikunja_files
|
2026-06-22 19:59:58 +02:00
|
|
|
|
2026-07-03 13:41:44 +02:00
|
|
|
llm-gateway:
|
|
|
|
|
role: llm-router # FastAPI proxy -> Ollama @ SOLARIA :11434
|
|
|
|
|
deployment_model: docker-compose
|
|
|
|
|
exposure: private # Tailscale-only bind (TAILSCALE_BIND_IP); no public ingress
|
|
|
|
|
offline_required: false
|
|
|
|
|
depends_on:
|
|
|
|
|
local: []
|
|
|
|
|
external: [ollama] # SOLARIA may be powered down -> routes 502, health stays ok
|
|
|
|
|
ports:
|
|
|
|
|
- name: http
|
|
|
|
|
container_port: 8080
|
|
|
|
|
protocol: tcp
|
|
|
|
|
runtime:
|
|
|
|
|
# .env (TAILSCALE_BIND_IP) lives alongside the compose file; stateless, no data path
|
|
|
|
|
config_path: services/llm-gateway
|
|
|
|
|
|
2026-06-22 19:59:58 +02:00
|
|
|
kb-postgres:
|
|
|
|
|
role: kb-database # KB spine: Postgres 16 + pgvector (always-on)
|
|
|
|
|
deployment_model: docker-compose
|
|
|
|
|
exposure: local-only # Tailscale-accessible; no public ingress
|
|
|
|
|
offline_required: false
|
|
|
|
|
depends_on:
|
|
|
|
|
local: []
|
|
|
|
|
external: []
|
|
|
|
|
ports:
|
|
|
|
|
- name: postgres
|
|
|
|
|
host_port: 5433
|
|
|
|
|
protocol: tcp
|
|
|
|
|
runtime:
|
|
|
|
|
config_path: /opt/homelab/config/kb-postgres
|
|
|
|
|
# data is in Docker named volume kb_postgres_data — must land on the NVMe
|
|
|
|
|
# (Docker data-root on /home); see hosts/piha/runtime/kb-postgres override.
|