-
Notifications
You must be signed in to change notification settings - Fork 881
chore: optimize CI setup time on Windows #17666
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
Conversation
57b3159
to
7ef265b
Compare
.github/workflows/ci.yaml
Outdated
# a separate repository to allow its use before actions/checkout. | ||
- name: Setup RAM Disks | ||
if: runner.os == 'Windows' | ||
uses: coder/setup-ramdisk-action@fbbd000cb83aff384a5f457c9073135189a4cf55 |
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.
This should probably check the SHA256 of the downloaded files for extra safety.
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.
done
# RUNNER_TEMP should be backed by a RAM disk on Windows if | ||
# coder/setup-ramdisk-action was used | ||
export GOCACHE_DIR="$RUNNER_TEMP""\go-cache" | ||
export GOMODCACHE_DIR="$RUNNER_TEMP""\go-mod-cache" |
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.
Does anything go in GOPATH
? GOMODCACHE
is under GOPATH
by default, so it seems like it would be better to just move the entire GOPATH
to the ramdisk instead perhaps
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.
I’ve now backed GOPATH
with a RAM disk too. It doesn’t seem to boost performance, though. I’m wondering if some writes are happening in the background to another path on C:
. For example, unpacking archives in actions/cache
takes way more time than I’d expect, even though it extracts onto a RAM disk.
c10b504
to
a78e91c
Compare
For future reference, this helps unblock #15109. |
This PR focuses on optimizing go-test CI times on Windows. It:
$RUNNER_TEMP
directory with a RAM disk. This directory is used by actions like cache, setup-go, and setup-terraform as a staging areaGOCACHE
andGOMODCACHE
with a RAM disk$GITHUB_WORKSPACE
with a RAM disk - that's where the repository is checked outFrom what I've seen, these changes bring test times down to be on par with Linux and macOS. The biggest improvement comes from backing frequently accessed paths with RAM disks. The C drive is surprisingly slow - I ran some performance tests with fio where I tested IOPS on many small files, and the RAM disk was 100x faster.
Additionally, the depot runners seem to have more consistent performance than the ones provided by GitHub.