openedx / wg-devops

Issue repository for the DevOps Working Group
1 stars 1 forks source link

Can we improve Docker image build time? #6

Open regisb opened 1 year ago

regisb commented 1 year ago

Re-building the Open edX Docker images with Tutor is consistently identified as one of the main pain points of platform administrators and developers:

A constructive proposal was made by @ARMBouhali to improve this situation: https://discuss.openedx.org/t/tutor-enhancement-proposal-tep-improve-support-for-build-caching/9036

To address this issue, I think that we should beware of two pitfalls:

a. That improving build-time in one scenario will make the others worse. b. Implementing ad-hoc solutions that will increase the complexity (and thus: the reliability) of Tutor and Open edX

Before we go any further, we will need to identify/profile the build time required for each step of the building process, in each scenario (development, CI, production).

Then, my intuition is that the best solutions will reside in either:

  1. Making better use of the Docker build cache.
  2. Making upstream changes to openedx repos (including edx-platform and MFEs).

I am worried that other solutions will cause to stumble into either pitfalls listed above -- though of course we must remain open to alternatives.

Ideas

regisb commented 1 year ago

A couple optimizations are in progress here, notably for "cold-start" builds: https://github.com/overhangio/tutor/pull/812/

regisb commented 1 year ago

I propose that we prototype solutions and measure their impact in this GitHub project: https://github.com/overhangio/test-docker-build/ For instance, the Docker layer caching in a remote registry is reducing vanilla "cold-start" build-time from 28 minutes to 9 minutes:

kdmccormick commented 1 year ago

Fantastic!! I will certainly be adding some tests there later.