Skip to content

Pulled backups, managed snapshots, recipes and podman - #160

Merged
arnelirobles merged 16 commits into
mainfrom
batch/backlog-5
Oct 29, 2026
Merged

arnelirobles merged 16 commits into
mainfrom
batch/backlog-5

Conversation

@arnelirobles

Copy link
Copy Markdown
Contributor

Wave 5 of the backlog: pulled backups, managed database snapshots, recipes and podman.

  • backups are stored on the VM they exist to survive #39: stack backup --pull copies the files that backup run made to ~/.baryovm/backups/<stack>/ (dir 0700, files 0600, temp file and rename). A .partial file, an unsafe name or a hand-edited stack name is refused. Refused on a forced-command VM and with --dry-run.
  • Use the Azure CLI and AWS CLI the owner is signed into, for the managed pieces beside a VM #81: stack set-managed names the RDS or Azure Postgres database beside a stack. stack release snapshots it with the operator's signed-in aws or az and waits, before the VM backup and before anything changes. --no-backup skips it, --dry-run lists the calls, doctor checks each CLI is installed and signed in. Values are checked and run as an argv, no shell. CLAUDE.md now names internal/managed as the one place that shells out to a cloud CLI.
  • Recipes: stacks read a versioned recipe from the app repo #88: stack add --recipe and stack release --recipe/--input. A recipe release writes the compose file as .new, pulls, keeps .prev, promotes, then brings each service up with a health probe and rolls back on failure. It takes the managed snapshot and the VM backup first, holds the host lock, and writes .env inputs only after a successful pull. Input references come only from --input; recipe defaults are literals.
  • the container runtime is hardcoded to docker, and bootstrap assumes systemd #35: --runtime podman on stack add, stack discover, deploy, up and vm bootstrap, and an optional runtime in remote.json. It reaches compose, backup, deploy, manifest and recipe releases, and discover. Bootstrap detects apt-get, dnf, yum, apk and pacman, and skips the systemd steps on a host without systemd.

Proof: go test ./... passes and the nine gates pass (gofmt, build, vet, gen-docs, style-scan, golangci-lint, gosec, govulncheck, race suite). Adversarial review: 23 candidates, 17 confirmed and fixed, 6 refuted. The blocker was a recipe release skipping the managed snapshot. Other fixes: recipe releases ran docker on a podman stack, took no host lock, and wrote .env before the pull; a hand-edited stack name .. pointed the pull dir at ~/.baryovm; input defaults skipped value checks; the project file did not validate runtime or managed. Each fix has a test that fails with its line reverted.

Known limits:

  • Podman was not run against a real host. podman-compose may differ on config --format json, ps --format json, pull --ignore-pull-failures and compose ls; docker-compose v2 as the provider is the tested shape. TLS and caddy, health, patch, prune, scan and the docker version line in doctor and vm ping stay on docker.
  • The runtime is per stack, not per VM as the container runtime is hardcoded to docker, and bootstrap assumes systemd #35 first said.
  • A recipe release refuses --dry-run, --resume, --clear, --no-build and --adopt, and keeps no step record (a failed deploy rolls itself back). Files, routes and builds are not part of a recipe release yet.
  • --pull holds each file in memory while copying and never prunes old pulled files.
  • Use the Azure CLI and AWS CLI the owner is signed into, for the managed pieces beside a VM #81 does not check that the database is reachable, and vm ping and stack ps do not show the managed database.
  • Nothing ran against a real VM, AWS or Azure account.

Closes #39
Closes #81
Closes #88
Closes #35

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@arnelirobles
arnelirobles marked this pull request as ready for review October 29, 2026 17:45
@arnelirobles
arnelirobles merged commit 31d89b2 into main Oct 29, 2026
3 checks passed
@arnelirobles
arnelirobles deleted the batch/backlog-5 branch October 29, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant