-
Notifications
You must be signed in to change notification settings - Fork 54
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
Update workflows to use real build cache #2196
Update workflows to use real build cache #2196
Conversation
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
echo "yarn-cache-dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | ||
|
||
- name: Yarn Cache | ||
uses: actions/cache@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why removing yarn cache? do they actually work? i remember trying to set it up long time ago but didn't work for some reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the unit tests they have no performance diff still -- the compilation is implicit to jest/babel
Optimizing jest will need separate work since even if the cache is there it won't get used (you see it when you run yarn test
with any specific file). Something about Babel and jest-ts
not cooperating very well. I had historic success trying the fixes discussed at https://stackoverflow.com/questions/45087018/jest-simple-tests-are-slow, maybe I'll try to make a benchmarked PR out of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are two caches, npm packages and transpiled/optimized javascript. does cache for npm packages work in this workflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You would expect so, but it doesn't look like it. Bootstrap also doesn't have a noticeable speedup by caching just the packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i think i saw similar results when i tried it, not sure why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/dashboards-observability/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/dashboards-observability/backport-2.x
# Create a new branch
git switch --create backport/backport-2196-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c146bc85ec24144799fe438da9ed6c7fd91eab37
# Push it to GitHub
git push --set-upstream origin backport/backport-2196-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/dashboards-observability/backport-2.x Then, create a pull request where the |
* Update workflows to use real build cache Signed-off-by: Simeon Widdis <sawiddis@amazon.com> * Update snapshots Signed-off-by: Simeon Widdis <sawiddis@amazon.com> * Update snapshots Signed-off-by: Simeon Widdis <sawiddis@amazon.com> * Are You There Snapshots? It's Me, Margaret. Signed-off-by: Simeon Widdis <sawiddis@amazon.com> --------- Signed-off-by: Simeon Widdis <sawiddis@amazon.com> (cherry picked from commit c146bc8) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Update workflows to use real build cache * Update snapshots * Update snapshots * Are You There Snapshots? It's Me, Margaret. --------- (cherry picked from commit c146bc8) Signed-off-by: Simeon Widdis <sawiddis@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Following opensearch-project/OpenSearch-Dashboards#8472 and #2188, this PR switches the cache to the actual build target directories to speed up caching dramatically.
Issues Resolved
Resolves #2188
Avenges #925
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.