Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we improve Docker image build time? #6

Open
Tracked by #21
regisb opened this issue Feb 27, 2023 · 3 comments
Open
Tracked by #21

Can we improve Docker image build time? #6

regisb opened this issue Feb 27, 2023 · 3 comments
Assignees
Labels
discovery Pre-work to determine if an idea is feasible enhancement Relates to new features or improvements to existing features

Comments

@regisb
Copy link
Contributor

regisb commented Feb 27, 2023

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

  • Encourage GitHub Actions users to make use of the Docker layer cache (docs). This affects Travis as described here.
  • Revert to npm ci instead of npm install (suggested by @bradenmacdonald here)
  • Jeff Cohen reduced Open edX image building time in CI from 90 to 15 minutes by moving from GitHub actions to self-hosted runners (see this slack conversation)
  • @ghassanmass suggests:
    • relying on a dedicated Docker cache for pip requirements
    • removing useless webpack assets
  • @kdmccormick is working on quite a few projects to resolve the problems upstream. Obviously, resolving the problems at the source is the best approach :)
@regisb regisb added discovery Pre-work to determine if an idea is feasible enhancement Relates to new features or improvements to existing features labels Feb 27, 2023
@regisb regisb moved this from Backlog to In Progress in DevOps Working Group Mar 14, 2023
@regisb regisb self-assigned this Mar 14, 2023
@regisb
Copy link
Contributor Author

regisb commented Mar 14, 2023

A couple optimizations are in progress here, notably for "cold-start" builds: overhangio/tutor#812

@regisb
Copy link
Contributor Author

regisb commented Mar 20, 2023

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
Copy link
Member

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

@regisb regisb moved this from In Progress to In Review in DevOps Working Group May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discovery Pre-work to determine if an idea is feasible enhancement Relates to new features or improvements to existing features
Projects
Status: In Review
Development

No branches or pull requests

2 participants