ssh & smarthttp: Advertise server-side backups as bundle-URI
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:
-
Create a service account and download a credentials
.json
file. -
In GDK, in
gdk.yml
configuregitaly.env
to haveGOOGLE_APPLICATION_CREDENTIALS: "/path/to/service-account.json"
-
Create a bucket on Google Cloud: https://cloud.google.com/load-balancing/docs/https/ext-load-balancer-backend-buckets#create_buckets.
-
In GDK, enabled backups, with the bucket created above:
backup: enabled: true go_cloud_url: "gs://<bucket-name>"
-
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`
-
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" }
-
Create server-side backups:
_build/bin/gitaly-backup create -server-side < backup_job.json
-
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)