Add self-deploying setup scripts for all sub-projects (P1-P8)

- Root setup.sh orchestrator with per-phase dispatch (./setup.sh p1..p8 | all | status)
- Makefile convenience targets (make infra, make llm, make status, etc.)
- scripts/common.sh: shared bash library for OS detection, Docker helpers,
  service management (launchd/systemd), package install, env management
- .env.example + .gitignore: shared config template and secret exclusions

P1 (homeai-infra): full implementation
- docker-compose.yml: Uptime Kuma, code-server, n8n
- Note: Home Assistant, Portainer, Gitea are pre-existing instances
- setup.sh: Docker install, homeai network, container health checks

P2 (homeai-llm): full implementation
- Ollama native install with CUDA/ROCm/Metal auto-detection
- launchd plist (macOS) + systemd service (Linux) for auto-start
- scripts/pull-models.sh: idempotent model puller from manifest
- scripts/benchmark.sh: tokens/sec measurement per model
- Open WebUI on port 3030 (avoids Gitea :3000 conflict)

P3-P8: working stubs with prerequisite checks and TODO sections

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Aodhan Collins
2026-03-04 21:10:53 +00:00
parent 38247d7cc4
commit 7978eaea14
23 changed files with 2525 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
# homeai-infra Docker secrets
# Copy to .env — never commit .env
DATA_DIR=${HOME}/homeai-data
# ─── code-server ───────────────────────────────────────────────────────────────
CODE_SERVER_PASSWORD=changeme123
# ─── n8n ───────────────────────────────────────────────────────────────────────
N8N_BASIC_AUTH_USER=admin
N8N_BASIC_AUTH_PASSWORD=changeme123
N8N_ENCRYPTION_KEY=changeme_random_32_char_string

View File

@@ -0,0 +1,91 @@
---
# homeai-infra/docker/docker-compose.yml
# P1 — Infrastructure services
#
# Provides: Uptime Kuma, code-server, n8n
#
# NOTE: Home Assistant, Portainer, and Gitea are pre-existing instances
# and are NOT managed here. Point .env.services at their existing URLs.
#
# Prerequisites:
# - Docker installed and running
# - `homeai` Docker network exists (created by setup.sh)
# - .env file present (copy from .env.example)
#
# Usage:
# docker compose -f docker/docker-compose.yml up -d
# docker compose -f docker/docker-compose.yml down
name: homeai-infra
# Linux compatibility: host.docker.internal:host-gateway resolves host IP
# On macOS this is already defined; on Linux it maps to the Docker bridge gateway.
x-host-gateway: &host-gateway
extra_hosts:
- "host.docker.internal:host-gateway"
services:
# ─── Uptime Kuma ─────────────────────────────────────────────────────────────
uptime-kuma:
container_name: homeai-uptime-kuma
image: louislam/uptime-kuma:latest
restart: unless-stopped
ports:
- "3001:3001"
volumes:
- ${DATA_DIR:-~/homeai-data}/uptime-kuma:/app/data
networks:
- homeai
labels:
- homeai.service=uptime-kuma
- homeai.url=http://localhost:3001
# ─── code-server (browser VS Code) ───────────────────────────────────────────
code-server:
container_name: homeai-code-server
image: codercom/code-server:latest
restart: unless-stopped
ports:
- "8090:8080" # Note: exposed on 8090 to avoid conflict with OpenClaw (8080)
volumes:
- ${DATA_DIR:-~/homeai-data}/code-server:/home/coder/.config
- ${HOME}:/home/coder/host:rw # Mount home dir for file access
environment:
- PASSWORD=${CODE_SERVER_PASSWORD:-changeme123}
<<: *host-gateway
networks:
- homeai
labels:
- homeai.service=code-server
- homeai.url=http://localhost:8090
# ─── n8n (workflow automation) ───────────────────────────────────────────────
n8n:
container_name: homeai-n8n
image: n8nio/n8n:latest
restart: unless-stopped
ports:
- "5678:5678"
volumes:
- ${DATA_DIR:-~/homeai-data}/n8n:/home/node/.n8n
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=${N8N_BASIC_AUTH_USER:-admin}
- N8N_BASIC_AUTH_PASSWORD=${N8N_BASIC_AUTH_PASSWORD:-changeme123}
- N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY:-changeme}
- N8N_HOST=0.0.0.0
- N8N_PORT=5678
- N8N_PROTOCOL=http
- WEBHOOK_URL=http://localhost:5678/
<<: *host-gateway
networks:
- homeai
labels:
- homeai.service=n8n
- homeai.url=http://localhost:5678
networks:
homeai:
external: true
name: homeai