Skip to content

Enable max mode docker cache and push cache to separate registry

What does this MR do?

This change is a follow up to changes from Refactor rails dockerfile for better layer cach... (!1987 - merged).

In order to fully get the benefits of updated multi-stage rails dockerfile, max mode for docker cache needs to be enabled so all stages can be cached.

This merge request contains following changes:

  • Changes mode=min to mode=max for docker cache export
  • Exports cache to separate registry which is required for max cache mode
  • Adds fallback cache so builds on new branches can still leverage cache from default branch until branch specific cache is populated
  • Adds docker-container driver startup which is required for separate registry cache export

Note: In order to fully get the benefit of this change, rails build requires beefier runner. Full cache export step is very slow on default small runners.

Comparison on how export times are affected by combination of runner capacity and compression settings: gitlab-org/quality/quality-engineering/CNG-mirror!5 (comment 2022410914)

Related issues

Epic: gitlab-org/quality/quality-engineering&89 (closed)
Issue: gitlab-org/quality/quality-engineering/team-tasks#2841 (closed)

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com
  • When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Integration tests added to GitLab QA
  • The impact any change in container size has should be evaluated
  • New dependencies are managed with dependencies.io
Edited by Andrejs Cunskis

Merge request reports

Loading