Files
Heimdall/skills/backup-restore/SKILL.md
T
arnaud.dartois 636154572b
Heimdall Gitea / Detect CI scope (push) Successful in 6s
Heimdall Gitea / Build and tests (push) Successful in 19m19s
Heimdall Gitea / Publish versioned release (push) Skipped
Heimdall Gitea / Build and scan server image (push) Successful in 6m13s
Heimdall Gitea / Build and scan agent image (push) Successful in 14m44s
Heimdall Gitea / Publish Docker Hub latest tags (push) Successful in 1m48s
Heimdall Gitea / Build and scan NVIDIA Agent image (push) Successful in 19m9s
Heimdall Gitea / CI policy (push) Successful in 10s
Complete remaining Heimdall features and acceptance
Merge pull request #138

Co-authored-by: Arnaud Dartois <admin@tordais.cc>
2026-11-06 11:14:49 +01:00

3.9 KiB

name, description
name description
backup-restore Validate Heimdall PostgreSQL and protected-volume backups using isolated Compose projects and the production backup/restore scripts.

Heimdall backup and restore

Use this workflow when changing docker/scripts/backup*.sh, docker/scripts/restore*.sh, the backup Compose, or the disaster-recovery runbook.

Project-specific behavior

  • PostgreSQL backups use docker/scripts/backup.sh and restores use restore.sh. Supply credentials through a generated POSTGRES_PASSWORD_FILE or a generated environment file; never reuse docker/.env, production secrets, or live volumes.
  • backup-protected-data.sh archives the Central data volume, including local objects and dp-keys. Restore with restore-protected-data.sh only while Central is stopped. The script overlays files and deliberately keeps unrelated target files.
  • PostgreSQL and protected-volume archives are separate snapshots. The application does not coordinate them into one atomic point in time.
  • test-backup-restore.sh uses a named isolated network, tmpfs for its disposable PostgreSQL data directory, and a temporary host directory. Its cleanup must leave no container, network, or anonymous volume.

Acceptance

  1. Read docker/backup/README.md and docker/scripts/test-backup-restore.sh before changing the flow.
  2. Run the script and require all assertions to pass, including row/FK integrity, object/key digests, and Data Protection key permissions.
  3. For changes to volume-level restore or Compose behavior, build a disposable Compose project from the checkout with unique project name, generated credentials, and generated named volumes. Dump from one PostgreSQL volume and restore into a different volume; check a known row. Archive and remove synthetic files from the protected volume, restore them, and compare digests and key permissions.
  4. Measure only the synthetic restore duration and label it as a local fixture measurement. Do not present it as a production RTO. Derive the configured backup interval separately; do not imply it is a measured production RPO.
  5. Install an EXIT cleanup trap before build/start. Tear down only the disposable project with docker compose -p <name> down --volumes --remove-orphans; query its Compose project labels and confirm zero containers, volumes, and networks. Remove generated files even on a failed assertion. These fixtures use upstream PostgreSQL/RustFS images and build no local image unless a recipe change explicitly adds one; retain those upstream images. If adding a local build, record its unique tag and remove/verify that exact tag in the same trap after teardown. Never use --rmi all or broad prune commands.
  6. The scheduled backup image installs Alpine's aws-cli, bash, and GNU coreutils (date -d retention cutoffs do not work in BusyBox). Do not rely on the retired MinIO client download URL. The scripts pass configured S3 credentials explicitly to AWS CLI for each invocation.
  7. Validate S3 behavior with a disposable RustFS service, unique Compose project/network/volumes and generated keys. Create a synthetic row, run backup.sh, verify both dated and latest.sql.gz objects, mutate the row, then run restore.sh --latest --yes and verify the prior value. Add ancient synthetic daily and weekly keys and confirm both retention jobs delete them. Also exercise backup-protected-data.sh upload and backup-rustfs.sh mirror/manifest where changed.
  8. Keep real-volume production recovery and production RPO/RTO open until validated on their actual service and data.

These backup recipes use shared upstream PostgreSQL/RustFS images and do not build a Heimdall image by default; retain those base images. Record local image tags: none for such a run. If a changed recipe adds any local build, tag it uniquely for the Compose project and remove/verify that exact tag after teardown in the same EXIT trap, even on failure. Do not use image-prune commands.