Skip to content

git: Embed bundled Git binaries

James Liu requested to merge jliu/bundle-git-binary into master

There are several methods which Gitaly can use to execute the Git binary. The bundled Git environment is the default for customer installations.

This MR makes two important changes to how the bundled Git environment is managed:

  1. We now embed Git binaries into the Gitaly binary using the embed package. This allows Gitaly to be in total control of the execution environment, and allows for atomic upgrades of Gitaly + Git. This addresses the concerns in #6089 (closed) and enhances support for zero-downtime upgrades.
  2. Tests are now forced to use the bundled Git environment. It was previously possible for tests to "fall-back" to whatever Git version was on the PATH, which is not ideal as it can result in test gaps. The consequence with this change is that you will be forced to run make build-bundled-git manually if you run tests without using the make test... target. The compiled binaries persist in the _build/bin directory and can be used for future tests, until make clean or the Git version is bumped.

This change should not require changes to how Gitaly is packaged. i.e. Omnibus can continue to build and ship Git and Gitaly will simply ignore it. Several follow-up tasks are required, but are non-blocking:

  1. Introduce a gitaly git subcommand that allows users to manually run Git commands using the same execution environment as Gitaly. I didn't include this as part of this MR because it's already quite a significant change. #6194 (closed)
  2. Remove the Git build task from Omnibus and wherever else it's executed. It would be beneficial to complete #6183 as a prerequisite. #6195
Edited by James Liu

Merge request reports