-
Notifications
You must be signed in to change notification settings - Fork 52
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
[FEATURE] [CI] Cache build artifacts to reduce build times #2188
Comments
Experimented in #2190 with just caching the modules and targets, the results aren't great -- the total build time is basically the same (though interestingly has a completely different shape, slower start of the build and faster end). Probably need to get attention on opensearch-project/OpenSearch-Dashboards#8428 to get any noticeable improvements here. Interestingly, from debug output on a cache it, it looks like the caching is based on the bootstrap hashes, which explicitly say "These are for debugging, don't use these". Wonder what's up with that. |
/target
s
In the upstream issue, I developed a POC that fixes the cache reuse problem. The other side of this is figuring out when to refresh the cache: we still have the issue that over time more code changes will accumulate and cause the cache to lose its potency. I don't want to just regenerate the cache on every code change, but OTOH just depending on yarn.lock will probably not refresh as fast as we'd like. My proposal:
Alternatively: Figure out how to check if the compile time is taking longer than some threshold (15s?) and force-save the cache if so. Less straightforward than the above but more foolproof. |
Looking again at the core codebase, it looks like |
Is your feature request related to a problem?
Coming from #2187, build times are very slow because of time taken to repeatedly compile the same modules. These build artifacts are stored in various
/target
directories around the OSD directory. A quick search shows 4 general glob patterns (relative to/OpenSearch-Dashboards
):src/core/target
src/plugins/*/target
packages/*/target
plugins/*/target
<-- We are hereSomehow, we should cache these build artifacts.
What solution would you like?
The tricky thing about a global cache that matches all of these directories' source is that, in aggregate, these directories change very often, multiple times per day. This means trying to put all of them in one cache is going to be mostly fruitless. But individually, these different packages don't get changed that often: lots of the core plugins and packages have been stable for months or sometimes years, and the "hotspots" for code changes drift over time.
Ideally, we would be able to store one separate cache for each of these modules. This isn't supported very well by the cache action, however. I generally see two options in this direction:
What alternatives have you considered?
plugins/*
): also works in principle, but only marginally more efficient than the above since core also changes very often.Do you have any additional context?
N/A
The text was updated successfully, but these errors were encountered: