feat: backup revolution #361
Labels
No Label
bug
build
ci/cd
contributing
design
documentation
duplicate
enhancement
help wanted
invalid
meta
question
security
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/abra#361
Loading…
Reference in New Issue
No description provided.
Delete Branch "backup-revolution"
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?
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
cf37076865
toed0ab7fb90
ed0ab7fb90
toc4c73d2ba8
c4c73d2ba8
to17513967de
17513967de
to02a83057fc
Thank you for the work! So existing, we're getting very close to
abra
backupbot 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
TARGET
env need to be part of restore. For listing snapshots it's not relevant.Ah yes, nice one. Removed and added to
restore
logic. Force pushed but unsure if it's showing up yet. Thanks for the review!02a83057fc
to5127966438
I'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"},
snapshots
need to be replaced withrestore
5127966438
to63387a011a
63387a011a
to7ee89d3a8f
Trying to finish the last step of this to get it off my plate...
Final steps for
abra app backup download ...
implementation...7ee89d3a8f
to529cb9bd12
WIP: 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 #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.Service
The 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
out
is 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
backupContainer
is 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!