feat: backup revolution #361
Merged
decentral1se
merged 7 commits from 2024-01-12 20:52:34 +00:00
backup-revolution into main
Labels
Clear labels
bug
build
ci/cd
critical fix
design
documentation
duplicate
easy-first-issue
enhancement
help wanted
i10n
i18n
installer
invalid
question
release
release-candidate
security
tech-debt
test
wontfix
Something is not working
go build related issues
Building things with CI/CD
https://docs.coopcloud.tech/federation/resolutions/passed/010/
UI/UX
Documenting all the things
This issue or pull request already exists
Something for new people to get stuck into. We hope it's easy!
New feature
Need some help
Everything to do with localisation
Everything to do with internationalisation
Everything to do with the install script.
Something is wrong
More information is needed
Release management
Related to the new release candidate
Security related
Unit/integration testing
This won't be fixed
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
BornDeleuze
Brooke
carla
cas (Cassowary)
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
iexos
jade (Jade Ambrose)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
moosemower
moritz
notplants
oxaliq (sorrel)
p4u1
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
renovate-bot (Comrade Renovate Bot)
ripclap
simon
sixsmith (Sixsmith)
stevensting
trav (Trav Fryer)
val (val (he/him))
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: toolshed/abra#361
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
See coop-cloud/organising#485.
Building on work in coop-cloud/backup-bot-two#23.
Agreed on in R011: https://docs.coopcloud.tech/federation/resolutions/passed/011
cf37076865toed0ab7fb90ed0ab7fb90toc4c73d2ba8c4c73d2ba8to17513967de17513967deto02a83057fcThank you for the work! So existing, we're getting very close to
abrabackupbot integration!@@ -414,0 +392,4 @@}if targetPath != "" {logrus.Debugf("including TARGET=%s in backupbot exec invocation", targetPath)execEnv = append(execEnv, fmt.Sprintf("TARGET=%s", targetPath))The
TARGETenv need to be part of restore. For listing snapshots it's not relevant.Ah yes, nice one. Removed and added to
restorelogic. Force pushed but unsure if it's showing up yet. Thanks for the review!02a83057fcto5127966438I'm gonna try put out a point release before merging this.
Commences integration test suite engines...
@@ -135,0 +98,4 @@AttachStderr: true,AttachStdin: true,AttachStdout: true,Cmd: []string{"/usr/bin/backup", "--", "snapshots"},snapshotsneed to be replaced withrestore5127966438to63387a011a63387a011ato7ee89d3a8fTrying to finish the last step of this to get it off my plate...
Final steps for
abra app backup download ...implementation...7ee89d3a8fto529cb9bd12WIP: backup revolutionto feat: backup revolutionReady For Review 🎉
@@ -135,3 +83,1 @@if !ok {logrus.Fatalf("no backup config for %s? does %s exist?", serviceName, serviceName)}chosenService, err := service.GetServiceByLabel(context.Background(), cl, config.BackupbotLabel, internal.NoInput)Could add a helper function to retrieve the backup bot container
@@ -153,3 +112,1 @@logrus.Fatal(err)}}execBackupListOpts := types.ExecConfig{Maybe add a helper functions to exec the backup script on the remote container?
@@ -40,4 +38,3 @@},Before: internal.SubCommandBefore,BashComplete: autocomplete.AppNameComplete,Description: `Why remove the description? :)
Think I was waiting for design and/or direction. See coop-cloud/abra#361 (comment). Will see how that discussion pans out and re-instate something.
@@ -32,4 +30,2 @@Name: "restore",Aliases: []string{"rs"},Usage: "Run app restore",ArgsUsage: "<domain> <service> <file>",Is it possible to set a backup file (which was previously downloaded) here?
At the moment the backupbot only support to restore from restic snapshots directly. I'm not sure if this must be implemented in the backupbot or if abra could do the restore completely by itself.
Yes, I guess the backupbot does not necessarily need to do a manual backup. This can also be implemented in abra. @decentral1se Maybe the code path for restoring from a local backup should be kept.
@p4u1 @moritz looking at this again, I'm not sure how to proceed. There is still some outstanding discussion re: design of restore? See coop-cloud/backup-bot-two#26 and coop-cloud/backup-bot-two#42? We're already wildly over budget for this work, so not sure what can be done beyond what has been implemented now. Let me know what you think.
Maybe we need a meeting to discuss this? I think the feature to restore from a local backup is pretty important. And I guess creating a backup to the local machine should also still be possible.
@@ -16,1 +16,4 @@// GetService retrieves a service container based on a label. If prompt is true// and the retrievd count of service containers does not match 1, then a prompt// is presented to let the user choose. A count of 0 is handled gracefully." A count of 0 is handled gracefully." What does this mean? If I understood the code, an error gets returned, when no service was found.
@@ -17,0 +27,4 @@return swarm.Service{}, fmt.Errorf("no services deployed?")}var backupServices []swarm.ServiceThe variable name should not contain "backup", since this is function is not specific to backup right?
@@ -15,2 +15,3 @@func RunExec(dockerCli command.Cli, client *apiclient.Client, containerID string, execConfig *types.ExecConfig) error {func RunExec(dockerCli command.Cli, client *apiclient.Client, containerID string,execConfig *types.ExecConfig) (io.Writer, error) {Can you add a doc comment for this function and explain what the io.Writer is that gets returned?
Also is the returned io.Writer used anywhere? I could not find any usage of the first return value
So far the
outis ignored but I think we'll eventually want it. It's a pretty involved refactor (simple, but changes a few things in a few places), so I'd rather leave it as is for now.I'm really looking forward to the backupbot integration in abra! I didn't test it localy yet. Just added a few comments to the code :)
@@ -135,3 +75,1 @@if !ok {logrus.Fatalf("no backup config for %s? does %s exist?", serviceName, serviceName)}targetContainer, err := internal.RetrieveBackupBotContainer(cl)I think
backupContaineris a better variable name here and at the other occurrencesRestore functionality needs to be worked out, a meeting is in the works... for another PR!