-
Notifications
You must be signed in to change notification settings - Fork 530
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
Fix slow cache restore on Windows #515
Open
antontroshin
wants to merge
15
commits into
actions:main
Choose a base branch
from
antontroshin:windows-go-mod-cache
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+59
−4
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use D drive for faster cache restore Signed-off-by: Anton Troshin <[email protected]>
Signed-off-by: Anton Troshin <[email protected]>
Signed-off-by: Anton Troshin <[email protected]>
Signed-off-by: Anton Troshin <[email protected]>
Signed-off-by: Anton Troshin <[email protected]>
Signed-off-by: Anton Troshin <[email protected]>
Signed-off-by: Anton Troshin <[email protected]>
Signed-off-by: Anton Troshin <[email protected]>
Signed-off-by: Anton Troshin <[email protected]>
Signed-off-by: Anton Troshin <[email protected]>
Signed-off-by: Anton Troshin <[email protected]>
Signed-off-by: Anton Troshin <[email protected]>
Signed-off-by: Anton Troshin <[email protected]>
…rs for Windows Signed-off-by: Anton Troshin <[email protected]>
Signed-off-by: Anton Troshin <[email protected]>
antontroshin
changed the title
Add GOCACHE AND GOMODCACHE symlink on Windows
Fix slow cache restore on Windows
Nov 20, 2024
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
The issue with running setup-go and restoring relatively big cache files, causes the cache restore process to be very slow on Github Action Windows runners.
Similar to the change that was made in version v5.0.0 (PR #411), I've made a change to override the default
GOCACHE
andGOMODCACHE
variables on Windows runners to be using drive D.On average, restoring ~1.7Gb cache on Windows pipelines took about 13-15 minutes to extract.
With this change, the extraction time was reduced to ~1m.
Restore cache logs before the change:
Restore cache logs after the change:
Solution:
At first, I tried to implement a solution similar to #411 by using symlink, however, during testing, it was clear that the
GOCACHE
andGOMODCACHE
directories were created early by the tooling, which did not present an easy way to create symlinks without deleting the already in-use directories and introducing bigger code changes.The solution to override the path for env vars as early as possible only on Windows runners is easier.
This PR adds the code to make this change by default for Windows runners, this "workaround" is possible to use via the Github Action code itself, by manually overriding the env vars.
Preferably, this change would be accepted and merged (after review of course), so users can enjoy this improvement by default without manually modifying each and every Github action.
Related issue:
Numerous related issues were raised regarding this issue, some improvements were made to address it.
Check list: