Stacks overview and detail were doing an N+1 inspect storm: list_stacks called containers_for_stack AND compute_status (which re-fetched) per stack, and containers.list(sparse=False) full-inspects every container plus c.image triggered an image-inspect each. For N stacks that was ~2N*(1 list + M inspects + M image-inspects) sequential socket round trips (~1s for just 2 stacks, growing linearly). - compose_service.stack_status_summaries(): one low-level api.containers(all=True) summary call grouped by compose project label → whole list served in a single Docker round-trip (~10x faster). - compute_status() takes optional pre-fetched containers; get_stack and _stack_summary no longer double-fetch. - containers_for_stack() reads the image name from the inspect it already has instead of c.image (drops the per-container image-inspect). - Same batching applied to the agent's stack list/detail. Also: Forgejo (registry + git) moved to 10.10.6.10:3020 — updated image refs in docker-compose.yml, agent/Dockerfile, agent/docker-compose.yml. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
24 lines
858 B
YAML
24 lines
858 B
YAML
# StackPilot agent — deploy this on each remote host you want to manage.
|
|
# It needs only the Docker socket and a shared AGENT_TOKEN (must match the
|
|
# token you enter when adding this host in the central StackPilot UI).
|
|
services:
|
|
agent:
|
|
image: 10.10.6.10:3020/menzelj/stackpilot-agent:latest
|
|
build:
|
|
context: .
|
|
args:
|
|
BACKEND_IMAGE: 10.10.6.10:3020/menzelj/stackpilot-backend:latest
|
|
restart: unless-stopped
|
|
environment:
|
|
- AGENT_TOKEN=${AGENT_TOKEN:?set AGENT_TOKEN in .env}
|
|
- STACKS_DIR=/opt/stacks
|
|
- HOST_PROC_PATH=/host_proc
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- ${STACKS_HOST_DIR:-./data/stacks}:/opt/stacks
|
|
- /proc:/host_proc:ro
|
|
# Read-only host devices for status/detection parity with the main host.
|
|
- /dev:/dev:ro
|
|
ports:
|
|
- "5010:5010"
|