chore: optimize CI setup time on Windows#17666
Conversation
57b3159 to
7ef265b
Compare
| # 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.
This should probably check the SHA256 of the downloaded files for extra safety.
| # 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.
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.
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_TEMPdirectory with a RAM disk. This directory is used by actions like cache, setup-go, and setup-terraform as a staging areaGOCACHEandGOMODCACHEwith a RAM disk$GITHUB_WORKSPACEwith 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.