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
Add support for backing up and restoring workspaces from snapshot volumes #9475
Conversation
a8f8ab1
to
546fa5e
Compare
/werft run 👍 started the job as gitpod-build-pavel-9469.34 |
6351617
to
d10f599
Compare
/werft run with-clean-slate-deployment 👍 started the job as gitpod-build-pavel-9469.60 |
/werft run with-clean-slate-deployment 👍 started the job as gitpod-build-pavel-9469.61 |
2bbd591
to
66b7cee
Compare
@jenting thank you for review! ❤️ PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recently PRs deprecated the xerrors.Errorf
, and use fmt.Errorf
instead.
We could update it if you want or in the following PR.
return false, err | ||
} | ||
if volumeSnapshot.Status != nil { | ||
if volumeSnapshot.Status.ReadyToUse != nil && *(volumeSnapshot.Status.ReadyToUse) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, personally I'd prefer to use a function to do check (is not nil and is true/false), refer to code.
I've check the code in the common-go, looks like currently we don't have the same function. We could enhance it in the future 🛹
@jenting PTAL ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not launch a cluster to test (will do it tomorrow) but workspace related code LGTM.
Let's ship the 🛹 , thank you @sagor999 for the hard work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly focused on reviewing the self-hosted team owned files. These are looking awesome. 🕺 Ship it! 🚢
@aledbf can you please review Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM based on my context. Also @geropl is out so hopefully this review unblocks you.
For next time, I'd recommend making the Proto changes in a separate PR.
/hold |
/unhold |
Description
Add support for creating snapshot volume from PVC that was used by workspace to mount
/workspace
folder, and then use that snapshot volume to restore workspace from it.Related Issue(s)
Fixes #9469
Fixes #9984
How to test
Loom video showing how this is working:
https://www.loom.com/share/feed9ce2d31c4e7ab71a7c094252fd15
Loom video walking through code changes and explaining them:
https://www.loom.com/share/46b5719f32894af7b3817d784ef6f608
Test steps if you have access to workspace preview environment:
You need to use https://github.com/gitpod-io/workspace-preview and use installer that was generated by this PR.
(Support for dev env for this feature will be a separate PR)
Then go into admin panel and enable
persistent_volume_claim
feature flag on your account.Now create a new workspace. Edit some files. Do things in there.
Close workspace.
Observe that any pending changes are correctly showing up in dashboard.
In k8s, you can check that
VolumeSnapshot
object was created when workspace was stopped.Now open that workspace again. All your files should be there with correct permissions, etc.
Additionally you can observe that no S3 backup was created for your workspace. All your data is now stored in snapshot volume.
Release Notes
Documentation