Install a fresh GC stack using "recover from backup"#135
Conversation
| "gc-explorer": ["explorer"], | ||
| "comapeo-cloud": ["comapeo"], | ||
| "filebrowser": ["files"], | ||
| "nocodb": ["nocodb"], |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
I think I am missing something: In the readme, I note the section IV. Mock a "backup" file that contains your stack and install Caprover from it which provides two steps to run Does that docker incantation already "import" the backup? Is that because Or is there an extra step in the CapRover UI or CLI to import the backup TAR? (Might be worth clarifying this in one of the documentation files, in addition to, or as a substitution for, answering my question here on the issue.) |
|
There is no extra step. The My next steps for today:
|
ec8fa3c to
63e9d40
Compare
- no domains or SSL - Makefile can test both methods of installation
…ckage The CLI now ships its template backup as package data and resolves it via importlib.resources, so `pip install gen-backup` works with no git checkout on disk. --template is removed: Now we always use the one bundled with the installed package Drops all Makefile references to the throwaway dir: gen-backup now points at caprover/gen-backup, and generated output goes to build/gen-backup. That folder stays on disk but is no longer wired into the build. We unpack the template TAR for easier code review & change tracking
Writing this makes me realize gen-backup should be a second script (and/or submodule) inside gc-stack-deploy. This would allow: - Same plumbing to generate an example stack.yaml and docs around that. - Shared code to enable SSL, whichever road you took to install the app. - Easier fallack to the old way if you need to amend a deployment from backup.
includes weird stuff with importlib.resources.Traversible and requires getting rid of bundled_template()
63e9d40 to
4caebdf
Compare
- for use after installing from a gen_backup tar - extract function: setup_windmill_db - extract function: enable_and_force_ssl
If windmill's started before we've created the database, windmill will have created the DB itself already.
25669bf to
fc3486e
Compare
|
On one hand, this is a nicer experience not having to deal with Caprover-API and server errors and timeouts beget by doing everything iteratively. The TAR generation and subsequent install and caprover and the apps of the Guardian Connector stack "just works" every time -- up to the limitations we already know of:
Reluctantly, it's exactly for those limitations I don't think we should keep this the way forward.
Instead, I believe our focus should be on
I will close this without merge. I'm also merging the intended follow-up branch into this branch -- the semantic distinction starts with commit 71481f0. That and follow-up is the "finalize" step. |
Goal
Avoid the many classes of transient API errors we see from
gc-stack-deployby making the full GC stack install operation more or less atomic from the user's point of view.Closes #30
Benefits:
caprover CLIon the VM (caproverpackage not available on VM upon fresh install with Azure template #122)backup.tarfile onto the VM.What I changed and why
Adds a new Python project
gen_backup. Itstack.yamlas gc-stack-deploy where user can configure their new deploymentstack.yamlinto the template fileThen outside the Python project, this TAR can be used when installing caprover to pre-populate all the apps, env vars, volume mounts. I added the bare-bones instructions to a new README.
Notes to Reviewers
Best intro to this PR is to read https://github.com/ConservationMetrics/gc-deploy/blob/install-from-caprover-backup/caprover/gen-backup/README.md
How I convinced myself this is right
New unittests ensure we're doing variable substitution correctly.
Additions to the makefile allow you to spin up a new caprover locally from backup.
What I have NOT yet done are (1) review the script code itself, (2) ensure the stack that gets deployed is fully working: the Docker services are running but I have not dug into the services further than this.
What I'm not doing here
Concerns with this approach, not easily resolved:
CREATE DATABASE warehouse; deploy explorer; create windmill users; deploy windmill. But we cannot do that from within the backup; restoring from backup is from our point of view, an atomic operation.Things to probably change (without a lot of effort):
cli.pybasically bakes in a translation layer between one-click-app variables vs env variable names, of which the one-click-app defns need to be the source of truth. This needs to be DRY'd.gen-backuprelies on the stack.yaml written bygc-stack-deploy init, so for now you do need to install both packages.LLM use disclosure
Claude code wrote most of this code, I haven't looked closely at the code (yet) -- want to ensure this POC is worth future investment first.