perf(ci): use self-hosted macos runner if available, fallback to public runners if not#587
perf(ci): use self-hosted macos runner if available, fallback to public runners if not#587
Conversation
|
Success on the first run, how about that. Took 22mins to run the macos tests on build-quick workflow, of which 3'23" was restoring rust cache, which was a 2GB network transfer (the largest transfer in the entire workflow) Going to eliminate the rust cache for self-hosted builds, and also alter the release workflow to use the macos-tartelet runner, and see how it goes |
|
mild hiccup - expanded my local Tartelet ephemeral self-hosted runner manager to do 2 at once for this push / CI run
Additionally, the holy grail here is to use the self-hosted runner if I make it available, but fallback to a public runner if it is offline. This does not appear to be built-in functionality but there is an API endpoint that lists runners and their status, and you can use that in a pre-step to select what runner to use: https://github.com/orgs/community/discussions/20019#discussioncomment-13391511 (or this action, with this PR for organization runner support https://github.com/jimmygchen/runner-fallback-action/pull/28/files) 2nd run initial findings are that the JDK download can stall. JDK17 is in the image I'm using as a base, but 21 is not, so it has to download. I should update my base VM to have what we want by default:
|
|
Okay, some optimization thoughts above, as a proof of concept experiment I was able to take this from an idea to ... working in just about 90 minutes, which is promising. I don't see any technical difficulties really preventing me from dynamically using the self-hosted runner if available and fallback if not - I'm the one that implemented dynamic OS matrix construction in the first place and we have scripts that use the GitHub API in workflows already, it's all tech we're familiar with. So I'm going to sleep now, but this seems like a valid way to un-bottleneck macOS runners in this repo which is a good thing because they're unavailability is effectively blocking all development at the moment. |
8d79219 to
be9a087
Compare
|
100% CPU bound now after implementation and execution of a "VM prep" script on the local Tart VM image that serves as the clone base for Tartelet ephemeral build runners. Performance now acceptable IMHO, just a touch slower than windows now build-quick results:
build-release results:
Run parameters:
Very positive result. The public runners are clearly faster but there is still room for improvement on self-hosted perf, and it's already usefully quick. Still a couple items to resolve
|
52d9068 to
8844f8b
Compare
|
Rust caching was a nest of bugs, peeled into separate PR that is merging then I'll rebase this and re-push before moving forward #588 |
8844f8b to
dc752e5
Compare
this makes them more or less machine-parseable for workflow runner preparation scripts
this will install all the build pre-requisites for a Tartelet/Tart self-hosted VM and warm up the cache with one build run should be used on the persistent base Tart VM image, prior to starting Tartelet which will clone that into ephemeral runners
2bac98a to
dbccd86
Compare
|
Okay - ready to go
Has a couple little fixes in separate commits, wasn't worth separating IMHO If CI goes green, this current run represents the failure / runners offline test, so that means the new worst case works And the best case is 2 more macos runners available sometimes, that work a bit faster than the public ones They are at the organization level so are available (as is the fallback action token) in all ankidroid repos as desired. |
dbccd86 to
49e1f4f
Compare
GitHub macos runners are performing incredibly badly at the moment
This is a change that lets us use Tartelet / Tart to do a self-hosted runner, with fallback if they're offline
https://josephduffy.co.uk/posts/self-hosting-macos-github-runners
If this should be unwound: