[ENH] - Backup and restore CLI Interface
Feature description
This ticket is the first step in creating a reliable backup and restore service for Nebari. This ticket is an attempt to propose CLI interface for backup.
There are several sub components of backup and restore CLI.
- NFS
- KeyCloak
- CondaStore
- And a few more
Initially, we will be exposing the backup functionality in Nebari CLI.
Interface
Backup nebari
Save all components of Nebari
nebari backup --backup-location <BACKUP_LOCATION>
Backup:
<BACKUP LOCATION>/<YYYY-MM-DD:HH:mm:ss>/nebari-config.yaml
<BACKUP LOCATION>/<YYYY-MM-DD:HH:mm:ss>/NFS/keycloak/
<BACKUP LOCATION>/<YYYY-MM-DD:HH:mm:ss>/NFS/user_data/
...
Backup User data (Notebooks)
Backup user data Jupyter notebooks and associated files in NFS share.
nebari backup user-data --backup-location <BACKUP_LOCATION>
Location: <BACKUP LOCATION>/<YYYY-MM-DD:HH:mm:ss>/NFS/user_data/
Backup User credentials (Keycloak)
Backup user data Jupyter notebooks and associated files in NFS share.
nebari backup user-creds --backup-location <BACKUP_LOCATION>
Location: <BACKUP LOCATION>/<YYYY-MM-DD:HH:mm:ss>/NFS/keycloak/
Restore
Restore Nebari from a snapshot.
nebari restore user-data --backup-location <BACKUP_LOCATION>
Location: <BACKUP LOCATION>/<YYYY-MM-DD:HH:mm:ss>/
Value and/or benefit
Once we agree on CLI interface we can keep on extending it for all the components that need backing up.
One suggestion is that we start with just backing up the nebari-config.yaml.
Anything else?
No response
Linked issues:
- #2292
- #2295
- #2296
- #2297
- #2298
Notes:
- We must understand and define the consequences of backing up components individually.
- We could have a slim backup version later.
- We don't need to update the documentation for each verb before the final CLI is ready.
- We need to decide where the backup and restore needs to run. Local vs K8.
- For the POC we should do it on K8.
- Ideally, if some use the ML Flow component, they should be able to write an ML Flow backup.
- We could create a backup controller interface and extend it with each plugin.
Next steps:
- Add a ticket for backup controller. Possibly extend this ticket. can also write metadata files.
- Refine all tickets to he point where they can be estimated.
- Create a request for discussion in Nebari.
Closing in favor of #2518