Smaller container images for review app jobs
TL;DR
This MR will give users 70 seconds back per MR when deploying a review-app
Context
Closes #386783 (closed)
About review-apps deployment
- The
review-deploy
job is the job deploying review-apps to the k8s cluster. -
review-build-cng-env
needs to be finished before thereview-deploy
job run (i.e. it's on the critical path)
If we improve the time it takes to run one of those two jobs, users will have a faster feedback.
review-build-cng-env job
review-build-cng-env
takes around 30 seconds to setup a runner, mainly because the container image it is downloading is big (~370MB or 1GB to download - I don't know which value is used):
REPOSITORY TAG IMAGE ID CREATED PLATFORM SIZE BLOB SIZE
registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-2.7 bundler-2.3 0391eef3ffaa 5 days ago linux/amd64 1019.2 MiB 362.9 MiB
review-deploy job
review-deploy
takes around 55 seconds to setup a runner, mainly because the container image it is downloading is very big (~581MB or 2GB to download - I don't know which value is used):
REPOSITORY TAG IMAGE ID CREATED PLATFORM SIZE BLOB SIZE
registry.gitlab.com/gitlab-org/gitlab-build-images/ruby-3.0 gcloud-383-kubectl-1.23-helm-3.5 add63212b0c8 7 weeks ago linux/amd64 1.9 GiB 581.8 MiB
What does this MR do?
Experiment with smaller container images to improve the time it takes to setup a runner:
- For
review-build-cng-env
, we use aruby-alpine
image (e.g.ruby:2.7-alpine
), as we only run one ruby script in the entire job (e.g. https://gitlab.com/gitlab-org/gitlab/-/jobs/3548098581) - For
review-deploy
, we use an image with only helm/kubectl installed:dtzar/helm-kubectl
. The other image we used has gcloud baked in (huge dependency), but we do not use it in this job (e.g. https://gitlab.com/gitlab-org/gitlab/-/jobs/3552387169)
Results
- When the cache was cold,
review-build-cng-env
took 11 seconds to setup a runner (https://gitlab.com/gitlab-org/gitlab/-/jobs/3553231360#L6)-
20 seconds improvement
🚀
-
20 seconds improvement
- When the cache was cold,
review-deploy
took 11 seconds to setup a runner (https://gitlab.com/gitlab-org/gitlab/-/jobs/3553231370).-
50 seconds improvement
🚀
-
50 seconds improvement
What's next?
Those jobs will be made faster if we can avoid a git clone
in them. This will be tried out as part of #191273 (closed) (see #191273 (comment 1227409061) for context).
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.