Skip to content

ssh & smarthttp: Advertise server-side backups as bundle-URI

Toon Claes requested to merge toon-poc-bundle-uri into master

This implementation of bundle-URI piggybacks onto server-side backups.

It uses Google Cloud Storage Signed URLs, using the v4 signing process.

To use this feature:

  1. Create a service account and download a credentials .json file.

  2. In GDK, in gdk.yml configure gitaly.env to have GOOGLE_APPLICATION_CREDENTIALS: "/path/to/service-account.json"

  3. Create a bucket on Google Cloud: https://cloud.google.com/load-balancing/docs/https/ext-load-balancer-backend-buckets#create_buckets.

  4. In GDK, enabled backups, with the bucket created above:

    backup:
      enabled: true
      go_cloud_url: "gs://<bucket-name>"
  5. Set and export the GITALY_SERVERS env as documented in gitaly-backups.md:

    export GITALY_SERVERS=`echo '{"default":{"address":"unix:/var/opt/gitlab/gitaly.socket","token":""}}' | base64 --wrap=0`
  6. Write a backup_job.json with all the projects you want to create bundles for:

     {
       "storage_name":"default",
       "relative_path":"@hashed/f5/ca/f5ca38f748a1d6eaf726b8a42fb575c3c71f1864a8143301782de13da2d9202b.git",
       "gl_project_path":"diaspora/diaspora-client"
     }
     {
       "storage_name":"default",
       "relative_path":"@hashed/6b/86/6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b.git",
       "gl_project_path":"brightbox/puppet"
     }
  7. Create server-side backups:

    _build/bin/gitaly-backup create -server-side < backup_job.json
  8. Now do a git -c transfer.bundleURI=true clone on the project that has server-side backups and bundles should be used. The easiest way to see this is when you see a smaller number of objects is sent over.

Issue: #4536 (closed)
Issue: #5603 (closed)

Edited by Toon Claes

Merge request reports