-
Notifications
You must be signed in to change notification settings - Fork 571
Fix slow cache restore on Windows #515
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
base: main
Are you sure you want to change the base?
Conversation
Use D drive for faster cache restore Signed-off-by: Anton Troshin <anton@diagrid.io>
Signed-off-by: Anton Troshin <anton@diagrid.io>
Signed-off-by: Anton Troshin <anton@diagrid.io>
Signed-off-by: Anton Troshin <anton@diagrid.io>
Signed-off-by: Anton Troshin <anton@diagrid.io>
Signed-off-by: Anton Troshin <anton@diagrid.io>
Signed-off-by: Anton Troshin <anton@diagrid.io>
Signed-off-by: Anton Troshin <anton@diagrid.io>
Signed-off-by: Anton Troshin <anton@diagrid.io>
…rs for Windows Signed-off-by: Anton Troshin <anton@diagrid.io>
Signed-off-by: Anton Troshin <anton@diagrid.io>
@antontroshin When do you plan to merge it? |
@y-bruin Unfortunately, I cannot merge, as this is up to repo maintainers, once the PR is reviewed and approved. |
For anyone else also waiting for this to get some attention:
Setting GOTMPDIR to D: was necessary to cut down the time it took to go install from cache. |
add validation for GOCACHE, GOMODCACHE, and GOTMPDIR on Windows Signed-off-by: Anton Troshin <anton@diagrid.io>
Hi @HarithaVattikuti, @priya-kinthali, @aparnajyothi-y, @priyagupta108 |
Hello @antontroshin, Thank you for submitting this pull request. We will review and get back to you once we have some feedback on this :) |
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: