Adjust workflow job runner choices for better efficiency
After confirming with higher levels of our org that we have the budget for it, I configured customized larger GitHub-hosted runners for the Quantumlib organization. These new runners are 8-core runners for Linux and Windows. (GitHub offers even larger runners, but let's see first how much using 8-cores will speed up the workflows in case there are some other bottlenecks that prevent us from gaining any further advantages.)
By contrast, some of the workflows can also make use of ubuntu-slim runners, which are faster to start and cheaper to run. As I understand it, those slim runners have only 1 core, so I looked for jobs that don't do things that can be parallelized. The slim runners take longer to run the jobs, but they're priced at 1/8 the cost per minute of the regular runners, and the particular jobs they're being used for are not bottlenecks; thus, the longer execution of these small jobs doesn't affect the overall workflow time.
GitHub offers a macos-15-large runner with 12 cores. They're about 10x the price of regular runners, so we want to apply them carefully.
Finally, I found that the pytest -n auto flag does not make full use of the available vCPUS. It seems to use only 1/2 of the total available. So to make full use of the runners, I changed -n auto to use the number of processors available.
Demonstration of the speed improvements: first, a run from yesterday without the changes:
Now a run (this PR) with the changes:
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 99.57%. Comparing base (14b3382) to head (34f7823).
:warning: Report is 3 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #7775 +/- ##
=======================================
Coverage 99.57% 99.57%
=======================================
Files 1102 1102
Lines 98641 98641
=======================================
Hits 98220 98220
Misses 421 421
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@pavoljuhas This looks great! Thank you for making the changes.
@pavoljuhas This looks great! Thank you for making the changes.
Thanks! FYI - I changed the initial comment to have text instead of images so we get that info in a plain text commit message.
@pavoljuhas This looks great! Thank you for making the changes.
Thanks! FYI - I changed the initial comment to have text instead of images so we get that info in a plain text commit message.
Oh, interesting. I will make a mental to avoid pasting images in the commit messages in the future.