nebari icon indicating copy to clipboard operation
nebari copied to clipboard

[ENH] - Backup and restore CLI Interface

Open pt247 opened this issue 1 year ago • 3 comments

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.

  1. NFS
  2. KeyCloak
  3. CondaStore
  4. 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

pt247 avatar Mar 06 '24 17:03 pt247

Linked issues:

  1. #2292
  2. #2295
  3. #2296
  4. #2297
  5. #2298

pt247 avatar Mar 06 '24 17:03 pt247

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.

pt247 avatar Mar 19 '24 16:03 pt247

Next steps:

  1. Add a ticket for backup controller. Possibly extend this ticket. can also write metadata files.
  2. Refine all tickets to he point where they can be estimated.
  3. Create a request for discussion in Nebari.

pt247 avatar Mar 19 '24 16:03 pt247

Closing in favor of #2518

pt247 avatar Jun 18 '24 21:06 pt247