Docker backend: flesh out backend setup/status #345

Open
opened 2026-07-11 14:42:32 -04:00 by didericis-claude · 0 comments
Collaborator

The generic ./cli.py backend {setup,status} command dispatches to each backend's setup()/status() classmethods (added alongside the abstract BottleBackend.setup/status contract). Firecracker has a full implementation (network pool + nft table + range-overlap check). The Docker backend got a minimal placeholder in bot_bottle/backend/docker/setup.py:

  • status() — reports docker on PATH, daemon reachable (docker info), and whether the gVisor runsc runtime is registered.
  • setup() — install pointer if docker is missing, daemon-start hint if unreachable, otherwise "no privileged host setup required".

A richer implementation could cover:

  • gVisor / runsc: detect it's missing and print concrete registration steps (or offer to write /etc/docker/daemon.json runtime config), since bottles auto-use it when present.
  • Rootless docker: detect rootless vs rootful and surface the implications (socket path, /dev/kvm access, etc.).
  • Daemon config sanity: e.g. userland-proxy / iptables settings that affect the sidecar bundle networking.
  • Compose plugin: confirm docker compose (v2) is available, since enumerate/cleanup rely on it.
  • Subnet pressure: warn when the docker address pools are near exhaustion (per-bottle --internal networks).

Scope: this is polish, not blocking — the placeholder is enough for the generic command to work across backends.

Ref: introduced when ./cli.py firecracker {setup,status} was replaced by the generic ./cli.py backend {setup,status}.

The generic `./cli.py backend {setup,status}` command dispatches to each backend's `setup()`/`status()` classmethods (added alongside the abstract `BottleBackend.setup`/`status` contract). Firecracker has a full implementation (network pool + nft table + range-overlap check). The Docker backend got a **minimal placeholder** in `bot_bottle/backend/docker/setup.py`: - `status()` — reports `docker` on PATH, daemon reachable (`docker info`), and whether the gVisor `runsc` runtime is registered. - `setup()` — install pointer if docker is missing, daemon-start hint if unreachable, otherwise "no privileged host setup required". A richer implementation could cover: - **gVisor / `runsc`**: detect it's missing and print concrete registration steps (or offer to write `/etc/docker/daemon.json` runtime config), since bottles auto-use it when present. - **Rootless docker**: detect rootless vs rootful and surface the implications (socket path, `/dev/kvm` access, etc.). - **Daemon config sanity**: e.g. userland-proxy / iptables settings that affect the sidecar bundle networking. - **Compose plugin**: confirm `docker compose` (v2) is available, since enumerate/cleanup rely on it. - **Subnet pressure**: warn when the docker address pools are near exhaustion (per-bottle `--internal` networks). Scope: this is polish, not blocking — the placeholder is enough for the generic command to work across backends. Ref: introduced when `./cli.py firecracker {setup,status}` was replaced by the generic `./cli.py backend {setup,status}`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: didericis/bot-bottle#345