[Meta] Improve speed of CI
GitLab CI is awesome, but not always fast. Let's make it fast, and fast by default. Everyone should be able to have CI run in less than 5 minutes.
This is a meta issue to track a variety of ideas for speed improvements.
- Sticky runners (to avoid start time when a runner can be re-used for the same project and to avoid needing to re-download cache and artifacts; re-use common services (e.g. docker daemon)).
- Pre-pull common docker images (to load docker images during boot rather than build start).
- Build "gitlab/kitchensink" image that contains 90%+ of the tools/binaries that users need (e.g. docker, awscli, python, ruby, kubectl, etc.).
- Change default cache key to a string constant so it is shared between branches and jobs: #22419 (closed)
- Cache known system directories e.g. for ruby gems automatically.
- Start reporting build queue times so people can be aware of delays and look to reduce them.
- Include Timestamps in CI Output: #22745
- Start reporting times for each step in a build (i.e. git fetch, docker pull, etc.) so people can monitor and reduce them.
- Analytics of pipeline runs to help people discover and diagnose speed problems.
- Allow users to disable unneeded steps such as git fetch when the job doesn't need the repo.
- Formalize parallel jobs: #21480
- Automatically balance parallel jobs (e.g. by file name, by junit data, by knapsack data).
.gitlab-ci.ymltemplates to use caching and other optimizations.
Encourage people to use
.gitlab-ci.ymleditor/creator that helps people create efficient, parallel pipelines: #21485
- Enable failing fast (so a pipeline returns failure as soon as any test fails)
- Prioritize tests that tend to fail or have failed recently
- Docker caching. (Image registry doesn't prevent all layers from being rebuild.)
Plugins and/or includable templates with good defaults (e.g.
bundle install -n $(nproc))
- Support massive parallelization (e.g. 500 parallel jobs) efficiently and reliably
- Increase size of docker image proxy cache
- Document information and tips on improving speed of tests and builds
- Cancel a pipeline automatically if the relevant commit no longer exists due to a rebase + force push.
- Cancel a pipeline automatically if it's not HEAD: #8998 (closed)
- Cancel a pipeline automatically if a new pipeline for the same branch is started
- Cancel running pipelines automatically if a new pipeline for the same branch is started
- Make it easier to kill an older pipeline after rebasing a merge request
- When a pipeline is queued, show other queued and running builds (and quickly be able to cancel them)
- Pending builds without knowing why
- Inadequate monitoring for all steps of a pipeline
- Pre-seed cache/image/whatever so first build is fast: #28552
- Dedicated (paid) persistent Docker daemon (on .com) for faster Docker push/pull/caching
- Inconsistent pipeline performance on GitLab.com
- Run tests in the cloud pre-commit from a client: #19267
- Prioritize previously failed tests: #38967