-
Notifications
You must be signed in to change notification settings - Fork 20
Use fast D: drive if available #567
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
Use fast D: drive if available #567
Conversation
/** | ||
* Some Azure VM types have a temporary disk which is local to the VM and therefore provides | ||
* _much_ faster disk IO than the OS Disk (or any other attached disk). | ||
* | ||
* Hosted GitHub Actions runners also leverage this disk and do their work in D:/a/_work, so let's | ||
* use it too if we can. It leads to a ~25% speed increase when doing heavy IO operations. | ||
* | ||
* https://learn.microsoft.com/en-us/azure/virtual-machines/managed-disks-overview#temporary-disk | ||
*/ | ||
function getDriveLetterPrefix(): string { | ||
if (fs.existsSync('D:/')) { | ||
core.info('Found a fast, temporary disk on this VM (D:/). Will use that.') | ||
return 'D:/' | ||
} | ||
|
||
return 'C:/' | ||
} | ||
|
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.
We could also leverage the $RUNNER_TEMP
environment variable which resolves to D:\a\_temp
for example. It depends on the directory where the Actions Runner is installed (e.g. D:\a
or C:\a
), meaning that we wouldn't have to use our own logic for this. WDYT? Any concerns about long path issues or something? I think D:\a\_temp\git-sdk-64-full
vs D:\git-sdk-64-full
isn't too much of a difference.
The path to a temporary directory on the runner. This directory is emptied at the beginning and end of each job. Note that files will not be removed if the runner's user account does not have permission to delete them. For example,
D:\a\_temp
That should also allow us to get rid of our custom cleanup logic 👀🔥
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.
My intuition is that using $RUNNER_TEMP
could potentially cause problems, even inadvertent ones, because the TEMP
part of the name suggests something ethereal, not-so-critical.
Long paths are not my concern here, either. But disk space is. I'd love to have the speed improvements, but we need to be sure that we're not accidentally running out of space. According to this documentation we have 14GB of SSD, which should be enough, even if the SDK weighs in with over 2GB.
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 just checked and it seems that there is still a bit over 12GB free, so we're good to go!
Some Azure VM types have a temporary disk which is local to the VM and therefore provides _much_ faster disk IO than the OS Disk (or any other attached disk). Hosted GitHub Actions runners also leverage this disk and do their work in D:/a/_work, so let's use it too if we can. It leads to a ~25% speed increase when doing heavy IO operations. Ref: https://learn.microsoft.com/en-us/azure/virtual-machines/managed-disks-overview#temporary-disk Ref: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources Signed-off-by: Dennis Ameling <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
736882d
to
6f5c3c0
Compare
It's now available as v1.7.0 of this Action. |
Some Azure VM types have a temporary disk which is local to the VM and therefore provides much faster disk IO than the OS Disk (or any other attached disk).
Hosted GitHub Actions runners also leverage this disk and do their work in D:/a/_work, so let's use it too if we can. It leads to a ~25% speed increase when doing heavy IO operations.
Ref: https://learn.microsoft.com/en-us/azure/virtual-machines/managed-disks-overview#temporary-disk