CI: fan out Azure pipelines on Python version (parallel matrix) - speedup x5#5013
Draft
GuillemSeCa wants to merge 1 commit into
Draft
CI: fan out Azure pipelines on Python version (parallel matrix) - speedup x5#5013GuillemSeCa wants to merge 1 commit into
GuillemSeCa wants to merge 1 commit into
Conversation
Previously, each (os, test_suite) pair ran as a single Azure Pipelines
job and iterated over python_versions as a template loop inside that
job's steps:
strategy:
matrix:
<test_suite>: {...}
steps:
- ${{ each pyver in parameters.python_versions }}:
- install python pyver
- configure
- run test_suite
Consequence: all Python versions for a given (os, test_suite) ran
sequentially on the same agent. If the first Python version failed
(e.g. an env-specific test failure on the *_latest_from_pip matrix),
all subsequent Python versions were skipped instead of also running
and showing whether they were affected.
Move python_version into the strategy.matrix so each
(python_version, test_suite) combination runs as its own parallel
job on its own agent VM. Each job becomes shorter (one Python
install + configure + test run instead of N of each) and an issue
affecting one Python version no longer hides results for the others.
Matrix keys are of the form 'py3_10_all' / 'py3_11_misc_and_scancode'
etc. (matrix keys must be alphanumeric+underscore, so dots in version
strings are replaced).
No changes to the per-job test command or to the caller pipelines in
azure-pipelines.yml -- the python_versions and test_suites parameters
keep the same shape.
Signed-off-by: Guillem Serra Cazorla <gserracazorla@gmail.com>
8a3752d to
175da9b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In
etc/ci/azure-posix.ymlandetc/ci/azure-win.yml,python_versionsare iterated as a sequential template loop inside a single job'ssteps:, instead of being part ofstrategy.matrix. So each(os, test_suite)runs all Python versions back-to-back on the same agent VM.Two visible consequences:
ubuntu24_cpython allruns 3.10 → 3.11 → 3.12 → 3.13 → 3.14 in series (~10 min each = ~50 min total).*_latest_from_pipmatrix because of a click 8.2 error-message change), all later Python versions are markedskippedinstead of also running, hiding whether they're affected too.Example from a recent UV PR run:
Change
Move
python_versionintostrategy.matrix(alongsidetest_suite) in both templates so each(python_version, test_suite)combination runs as its own parallel job on its own agent VM.Matrix keys are of the form
py3_10_all,py3_11_misc_and_scancode, etc. (Azure matrix keys must be alphanumeric+underscore, so dots in version strings are replaced).No changes to caller pipelines in
azure-pipelines.yml— thepython_versionsandtest_suitesparameters keep the same shape.Tradeoffs
ubuntu24_cpython all(5 pyvers)Marked as draft for that reason — merge at your discretion.
Guillem Serra Cazorla gserracazorla@gmail.com