WIP: Backup volumes from /var/lib/docker/volumes instead of copying individual paths #16
No reviewers
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/backup-bot-two#16
Loading…
Reference in New Issue
No description provided.
Delete Branch "backup_volumes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
So we realized that copying several hundred gigabytes of data just for backup purpose
is a lot for our infrastructure. This is why we wanted to get rid of the
docker cp
stuff.We investigated the current use of backupbot in all recipes and there are actually more or
less two use-cases:
So we thought we could reduce complexity by backing up the /var/lib/docker/volumes/
path instead. Backupbot will still look for a
backupbot.backup = 'true'
label,and select all volumes with prefixed with the stack_name (involves bash globbing magic).
We considered running
docker run -v ...:...
for every service too, but decided that justcopying from the host filesystem is much simpler and comes with no other costs (we could see now).
Secondly we removed the Dockerfile as it does only very few things. For now it's just
simpler to have bash, jq etc. installed in the entrypoint. We don't have to build a image,
no more frankenstein-repo, versioning just like any other recipe ...
Before releasing a new version of this, we'd have to adjust all Recipes including backupbot, to:
/var/lib/postgresql/data/
).paths
labelsBackup volumes from /var/lib/docker/volumes instead of copying individual pathsto WIP: Backup volumes from /var/lib/docker/volumes instead of copying individual pathseda232819c
to24d2c0e85b
WIP: Backup volumes from /var/lib/docker/volumes instead of copying individual pathsto Backup volumes from /var/lib/docker/volumes instead of copying individual paths@ -7,3 +6,3 @@
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "backups:/backups"
- "/var/lib/docker/volumes/:/var/lib/docker/volumes/"
Mounting the volumes read-only could prevent any kind of unexpected modifications:
"/var/lib/docker/volumes/:/var/lib/docker/volumes/:ro"
Sorry folks, I'm not deep enough into using
backup-bot-two
to grok much of this. I think @3wordchant and autonomicz will have more context to help review this. Cool to see the approach adapting to larger scale.I just realised, we'll still need the
.paths labels
forabra app backup
functionality or have to alter abra so, to just backup volumes too ...Ah yes. That explains my weird hesitation about this otherwise-great change 🤔
TBH the
abra backup
functionality as it currently stands is bad for a lot of cases, once there's more than a trivial amount of data, copying usingdocker cp
is very painful because of lack of compression (see #324).The Heroku CLI -- which was the inspiration for a lot of the initial
abra
functionality -- does backups server-side. Running non-Docker stuff on the remote server would be a reasonably significant design change, but maybe now's the time? Perhaps we can discuss in "Co-op Cloud Tech", or on a call soon?I'd still count this approach as docker-stuff, but it's vague :D
Yes let's have a chat/call!
regarding this, I thought to just keep the .pats labels in the recipes, but point everything to a volume folder ... So we can have both for the moment, until we find a better solution.
Backup volumes from /var/lib/docker/volumes instead of copying individual pathsto WIP: Backup volumes from /var/lib/docker/volumes instead of copying individual pathsMoved to https://git.coopcloud.tech/coop-cloud/backup-bot-two/src/branch/backupbot_revolution
Pull request closed