Skip to content

Initial support for gitaly server-side backups

James Fargher requested to merge gitaly_server_side_backups into main

What does this merge request do and why?

Adds initial configuration to enable gitaly server-side backups using the included minio.

How to set up and validate locally

  1. Switch GDK to this branch:

    $ cd <gdk_root>
    $ git switch gitaly_server_side_backups
  2. Turn on object storage. gdk.yml:

    object_store:
      enabled: true
  3. Reconfigure and restart.

    $ gdk reconfigure && gdk restart
  4. Open minio in a browser and create a bucket named gitaly-backups if one doesn't already exist.

  5. In gitlab, create a server-side backup (skip db so it's faster and less invasive):

    $ cd <gdk_root>/gitlab
    $ bundle exec rake gitlab:backup:create REPOSITORIES_SERVER_SIDE=true SKIP=db
    ...
    2023-08-09 03:02:04 UTC -- Backup 1691550107_2023_08_09_16.3.0-pre is done.
    2023-08-09 03:02:04 UTC -- Deleting backup and restore PID file ... done
  6. You can browse minio and verify that a bunch of stuff was added 🎉 🎉

  7. Try restore from said backup:

    $ bundle exec rake gitlab:backup:restore BACKUP=1691550107_2023_08_09_16.3.0-pre
    ...
  8. The output will have a lot of "skipped" errors. This is just how repositories that don't exist are handled at the moment. Hopefully there will be some successful ones, they'll print completed restore:

    {"command":"restore","gl_project_path":"jashkenas/Underscore","level":"info","msg":"completed restore","relative_path":"@hashed/e7/f6/e7f6c011776e8db7cd330b54174fd76f7d0216b612387a5ffcfb81e6f0919683.git","storage_name":"default","time":"2023-08-09T03:06:48.899Z"}
    

Impacted categories

The following categories relate to this merge request:

Merge request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise an issue to follow-up.
  • Documentation added/updated, if needed.
  • Announcement added, if change is notable.
  • gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.
Edited by James Fargher

Merge request reports

Loading