Skip to content

Adds kopia/restic uploader type #1102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

mpryc
Copy link
Contributor

@mpryc mpryc commented Jul 25, 2023

Implements #1101 part of the #1046

Testing instructions:

  1. Uninstall previous version of OADP
  2. Ensure you are logged as an admin
$ oc whoami
system:admin
  1. Remove left over CRD's:
$ oc delete crd dataprotectionapplications.oadp.openshift.io volumesnapshotrestores.datamover.oadp.openshift.io volumesnapshotbackups.datamover.oadp.openshift.io cloudstorages.oadp.openshift.io

5a. You may want to use the following patch to not install or symlink podman to docker:

$ patch -p1 < /below/patch/file/location.diff
index 94cfa11..bf250a4 100644
--- a/Makefile
+++ b/Makefile
@@ -212,10 +212,10 @@ run: manifests generate fmt vet ## Run a controller from your host.
 # related enhancements that may remove the need to manually install qemu-user-static https://bugzilla.redhat.com/show_bug.cgi?id=2061584
 DOCKER_BUILD_ARGS ?= --platform=linux/amd64
 docker-build: ## Build docker image with the manager.
-	docker build -t $(IMG) . $(DOCKER_BUILD_ARGS)
+	podman build -t $(IMG) . $(DOCKER_BUILD_ARGS)
 
 docker-push: ## Push docker image with the manager.
-	docker push ${IMG}
+	podman push ${IMG}
 
 ##@ Deployment
 
@@ -361,7 +361,7 @@ nullable-crds-config:
 
 .PHONY: bundle-build
 bundle-build: ## Build the bundle image.
-	docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) . $(DOCKER_BUILD_ARGS)
+	podman build -f bundle.Dockerfile -t $(BUNDLE_IMG) . $(DOCKER_BUILD_ARGS)
 
 .PHONY: bundle-push
 bundle-push: ## Push the bundle image.

5b. Build and deploy OADP from this PR:

$ make build-deploy
$ make deploy-olm
  1. Create DPA, ensure to choose restic or kopia and ensure to use unsupportedOverrides with provided veleroImageFqin

Make sure to specify the backupLocations accordingly to your cluster configuration and s3 bucket

Part of the DPA for restic:

apiVersion: oadp.openshift.io/v1alpha1
kind: DataProtectionApplication
metadata:
  name: dpa-sample
spec:
  configuration:
    nodeAgentConfig:
      enable: true
      uploaderType: restic
[...]
  unsupportedOverrides:
    veleroImageFqin: 'docker.io/sseago/velero:kopia'

And for Kopia

apiVersion: oadp.openshift.io/v1alpha1
kind: DataProtectionApplication
metadata:
  name: dpa-sample
spec:
  configuration:
    nodeAgentConfig:
      enable: true
      uploaderType: kopia
[...]
  unsupportedOverrides:
    veleroImageFqin: 'docker.io/sseago/velero:kopia'
  1. Create Backup object to trigger backup, ensure to include defaultVolumesToFsBackup: true
apiVersion: velero.io/v1
kind: Backup
metadata:
  name: mysql-persistent
  namespace: openshift-adp
spec:
  includedNamespaces:
  - mysql-persistent
  storageLocation: dpa-sample
  defaultVolumesToFsBackup: true
  ttl: 720h0m0s

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 25, 2023
@openshift-ci
Copy link

openshift-ci bot commented Jul 25, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 1, 2023
@mpryc mpryc force-pushed the kopia_work branch 5 times, most recently from 01c5186 to ac25c81 Compare August 1, 2023 16:31
@mpryc mpryc force-pushed the kopia_work branch 2 times, most recently from dc0cc1e to 65281de Compare August 2, 2023 16:14
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 2, 2023
@sseago
Copy link
Contributor

sseago commented Aug 4, 2023

Looks like timeout isn't being set properly with nodeAgentConfig. If you add timeout to restic, it's pulled into the velero deployment, but if you add to nodeAgentConfig it's not. Here's where you need to check for nodeAgentConfig and then restic, rather than just restic:
https://github.com/openshift/oadp-operator/blob/master/controllers/velero.go#L429-L431

	if dpa.Spec.Configuration.Restic != nil && len(dpa.Spec.Configuration.Restic.Timeout) > 0 {
		fsBackupTimeout = dpa.Spec.Configuration.Restic.Timeout
	}

@sseago
Copy link
Contributor

sseago commented Aug 4, 2023

Other than the timeout config bug, I was able to successfully back up and restore the OADP mysql-persistent testing app with kopia fs backup using this PR.

@weshayutin
Copy link
Contributor

@sseago nice! Thanks for testing mysql-persistent. If mysql db was successful w/ just a regular kopia backup then we have at least a data point to investigate https://issues.redhat.com/browse/OADP-2360 w/ kopia + DM. Thank you!

@mpryc mpryc force-pushed the kopia_work branch 2 times, most recently from 37a2ec2 to 7c07be1 Compare August 7, 2023 13:22
@mpryc mpryc force-pushed the kopia_work branch 2 times, most recently from e8a7f5c to 9733d40 Compare August 8, 2023 09:29
@mpryc mpryc changed the title WIP: Adds kopia/restic uploader type Adds kopia/restic uploader type Aug 8, 2023
@mpryc mpryc marked this pull request as ready for review August 8, 2023 09:30
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 8, 2023
@openshift-ci openshift-ci bot requested review from eemcmullan and sseago August 8, 2023 09:31
Copy link
Contributor

@sseago sseago left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. One additional thing -- for final merge, it's better to remove code we don't want than just commenting it out.

@mpryc mpryc force-pushed the kopia_work branch 3 times, most recently from 9c00af6 to 50c061a Compare August 22, 2023 21:09
Implements:
 openshift#1101

Signed-off-by: Michal Pryc <[email protected]>
}
// Append restic timeout option manually. Not configurable via install package, missing from podTemplateConfig struct. See: https://github.com/vmware-tanzu/velero/blob/8d57215ded1aa91cdea2cf091d60e072ce3f340f/pkg/install/deployment.go#L34-L45
veleroContainer.Args = append(veleroContainer.Args, fmt.Sprintf("--fs-backup-timeout=%s", fsBackupTimeout))
// Append FS timeout option manually. Not configurable via install package, missing from podTemplateConfig struct. See: https://github.com/vmware-tanzu/velero/blob/8d57215ded1aa91cdea2cf091d60e072ce3f340f/pkg/install/deployment.go#L34-L45
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 25, 2023
@openshift-ci
Copy link

openshift-ci bot commented Aug 25, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kaovilai, mpryc, shubham-pampattiwar, sseago

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [kaovilai,shubham-pampattiwar,sseago]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kaovilai
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 29, 2023
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 3dbdc4e and 2 for PR HEAD c3e68cf in total

@openshift-ci
Copy link

openshift-ci bot commented Aug 29, 2023

@mpryc: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants