Skip to content

Ensure that we're installing the gems from the correct Gemfile

Rémy Coutable requested to merge rc/fix-ruby-make into master

I discovered that in GitLab CE's CI runs, precisely in the setup-test-env job, the gems installed during Gitaly's make are the ones from the GitLab project instead of the ones at https://gitlab.com/gitlab-org/gitaly/blob/master/ruby/Gemfile.

You can see for yourself in this job's logs that the bundle install done during Gitaly's make finishes with Bundle complete! 226 Gemfile dependencies, 418 gems now installed. (which is actually the number of gems installed when you run bundle install in GitLab) and takes almost 8 minutes (I've added some date -R calls to be able to see how long that takes): https://gitlab.com/gitlab-org/gitlab-ce/-/jobs/48603700

On the contrary, when I run the same job with this custom version of Gitaly (i.e. that sets BUNDLE_FLAGS ?= --deployment --jobs 4 --gemfile=$(BUILD_DIR)/ruby/Gemfile, then make finishes way faster in less than 2 minutes, and we have way less gems installed (Bundle complete! 9 Gemfile dependencies, 61 gems now installed.): https://gitlab.com/gitlab-org/gitlab-ce/-/jobs/48603845

This simple change seems to make make 4x faster when run in the context of GitLab's CI runs.

@jacobvosmaer-gitlab What do you think?

Merge request reports