tutor-mfe
tutor-mfe copied to clipboard
[Spike/R&D] Cache usage in tutor-mfe build
In Tutor Users meeting on May 20th, 2024, a large chunk of the meeting was focused on discussing the large build times of tutor-mfe (https://openedx.atlassian.net/wiki/spaces/COMM/pages/3583016961/Tutor+Users+Group#2024-05-20). When various MFEs are building in parallel, both install and build steps take quite a while, often leading to npm connection error. The only workaround is to limit buildx parallelism to 1/2/4, depending on the resources.
One of the items discussed in the meeting was the usage of cache during MFE build. There are various items we would want to test/verify:
- Is docker cache being shared properly across layers? https://github.com/overhangio/tutor-mfe/blob/5bb43faa21218352436e1d90e16f2202963576ee/tutormfe/templates/mfe/build/mfe/Dockerfile#L46
- Is npm cache working as expected? How often do we see cache miss when npm install is running for MFEs?
- We might need
-d --progress=plain
in image build command to see expanded logs
- We might need
- Is anything being cached at all? https://discuss.openedx.org/t/npm-clean-install-in-mounted-directories-sh-super-slow-on-tutor-nightly-dev-with-mounted-edx-platform/12761/3
Besides the above items' verification, identify what cache led (or other workarounds) can we do to improve/reduce MFE build times.