Commit 7eff4841 authored by Patrick Steinhardt's avatar Patrick Steinhardt

spec: Convert Gitaly setup to use bundled Git binaries

Up to now, Gitaly has been using an external Git distribution to serve
all Git requests. This has somewhat changed with the introduction of the
`make git` target, which moved responsibility of providing a compatible
Git distribution into Gitaly. While this was a step into the right
direction, it still didn't give Gitaly full control over which Git
binaries exist and where these are located. This is proving to be
problematic in some contexts: we cannot switch between multiple Git
versions via feature flags, rollouts of new Git versions will overwrite
the old installation while Gitaly may still be running, and in general
we have no specific knowledge about which Git version we're currently
running with except for the version string.

To fix this, Gitaly has introduced a new distribution mode: instead of
pointing Gitaly's configuration at a specific Git distribution, Gitaly
can now run with in "bundled" mode. Like this, Gitaly only requires two
binaries gitaly-git and gitaly-git-remote-http which are installed into
the typicaly binary directory where all the other Gitaly-specific
binaries are installed into. Gitaly will then bootstrap a full Git
execution environment from these two binaries which is sufficient to
serve all Git requests in Gitaly.

With this in place, Gitaly has much tighter control over which Git
version is installed into what place. As a result, we can eventually
build on top of this and easily install multiple Git versions, use
feature flags and avoid issues like overwrites of the Git distribution
while an old Gitaly version is still running.

While the old configuration of pointing Gitaly at a specific Git
installation will not go away, the recommended default will at some
point become to always use the bundled Git mode. As a first test
balloon, this commit switches over the Gitaly setup helper for our Ruby
specs to use this bundled Git mode.
parent 99841486
......@@ -113,7 +113,7 @@ module Gitlab
# sidekiq jobs, and concurrency will be low anyway in test.
git: {
catfile_cache_size: 5,
bin_path: File.expand_path(File.join(gitaly_dir, '_build', 'deps', 'git', 'install', 'bin', 'git'))
use_bundled_binaries: true
},
prometheus_listen_addr: prometheus_listen_addr
}.compact
......
......@@ -120,7 +120,7 @@ module GitalySetup
end
def build_gitaly
run_command(%w[make all git], env: env.merge('GIT_VERSION' => nil))
run_command(%w[make all WITH_BUNDLED_GIT=YesPlease], env: env.merge('GIT_VERSION' => nil))
end
def start_gitaly(toml = nil)
......@@ -336,7 +336,7 @@ module GitalySetup
end
def git_binary
File.join(tmp_tests_gitaly_dir, "_build", "deps", "git", "install", "bin", "git")
File.join(tmp_tests_gitaly_dir, "_build", "bin", "gitaly-git")
end
def gitaly_binary
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment