Skip to content

Commit f83a5db

Browse files
committed
CI: the examples leave the fast tier, the native pull-request leg keeps the oldest and the newest Python (#442)
The first run of this pull request took 31.8 minutes, and both jobs that ended it were example jobs: `Test Python Examples (linux/amd64, Python 3.14)` (29.8 minutes) and `Examples on the installed wheel (linux-x86_64, Python 3.12)` (19.0). Their longest step is `Download datasets` (891 s and 608 s), which mostly builds the vectors of the Stack Overflow dataset. The target for a pull request is about 15 minutes. - A pull request runs no example leg in either workflow. The examples run on a push to main, in the nightly run, on a manual run and with the label ci:full, like the rest of the full tier. - Exception, by path and at job level: a pull request that changes a file under examples/ (not examples/README.md), scripts/run_examples.sh or scripts/native_examples_skip.txt runs the example leg of Linux x86-64. scripts/ci_tier.py reads the changed files from the API and hands the planners the event pull_request_examples. Files that cannot be read: the example legs run (fails open). - The workflows still start and their summary checks still report, so no check is left pending: `Examples Test Summary` and `Examples summary` are green for exactly the case "the plan has no example leg and the job was skipped", and red when a planned leg failed, was cancelled or did not run. In test-python-examples.yml the first job downloads no jars when there is no leg. - The native `pyver` job runs Python 3.11 and 3.14 on a pull request (the ends of the range, about a minute each, beside the parity suite). 3.13, 3.15 and the free-threaded 3.14t stay in the full tier: in 30 days no pyver leg was red on a commit whose Linux parity run was green. What stays on every pull request: the arcadedb-jvm wheel and its tests, the native image and wheel built from the pull request, and the parity suite against the installed wheel.
1 parent 794acd8 commit f83a5db

10 files changed

Lines changed: 372 additions & 128 deletions

File tree

‎.github/workflows/test-native.yml‎

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@
44
#
55
# A native image build takes about 5 to 30 minutes per platform and the ArcadeData organisation shares a runner cap with
66
# upstream ArcadeDB, so the load is selective (scripts/select_native_matrix.py holds the legs, tests/test_select_native_matrix.py pins them):
7-
# pull request only when a native path changed (the `paths` filter below); linux-x86_64, Python 3.12 (the fast tier); not for a draft.
8-
# With the label ci:full, or opened by Dependabot: the legs of a push to main (scripts/ci_tier.py)
7+
# pull request only when a native path changed (the `paths` filter below); linux-x86_64, Python 3.12, no example leg (the fast tier);
8+
# not for a draft. The example leg runs when the pull request changes the examples or their runner. With the label
9+
# ci:full, or opened by Dependabot: the legs of a push to main (scripts/ci_tier.py decides all three)
910
# push to main only when a native path changed; all four platforms, Python 3.12 and 3.14
1011
# nightly all four platforms, Python 3.12 and 3.14, but only when something besides docs changed in the last 25 hours (a full run on Mondays)
1112
# dispatch all four platforms, Python 3.12 and 3.14
1213
# workflow_call from release-native.yml with `release: true`: all four platforms, Python 3.11 to 3.14
1314
# This workflow never publishes: it has no id-token permission and no environment.
1415
#
1516
# Beside the full parity runs, the `pyver` job installs the already built linux-x86_64 wheel (py3-none: no rebuild) into the Pythons the full
16-
# runs of the event leave out (main, nightly, dispatch: 3.11, 3.13; a release: none; a pull request has no `pyver` legs, the fast tier is one Python), into 3.15 (the full suite
17+
# runs of the event leave out (main, nightly, dispatch: 3.11, 3.13; a release: none; a pull request runs only 3.11 and 3.14 of this job), into 3.15 (the full suite
1718
# needs jpype1 and ladybug, which have no cp315 wheel yet, so 3.15 runs without the test files that need jpype1) and into the free-threaded 3.14t, and runs a small subset of the tests there (about 20 s of tests per Python). A release needs it: a leg that passes uploads a marker (native-passed-pyver-py<version>), and release-native.yml
1819
# publishes nothing unless the legs of a release (3.15 and the free-threaded 3.14t) passed. Only linux-x86_64 is checked on them.
1920
# scripts/select_native_matrix.py decides its legs.
2021
#
21-
# The `examples` job runs every script of examples/ against the installed wheel of each platform (Python 3.12 and 3.14; a pull request: linux-x86_64, 3.12), through
22+
# The `examples` job runs every script of examples/ against the installed wheel of each platform (Python 3.12 and 3.14; a pull request: none, or linux-x86_64 on 3.12 when it changes the examples), through
2223
# scripts/run_examples.sh, the runner test-python-examples.yml uses too. scripts/native_examples_skip.txt lists, with a reason, the examples that need the JVM package.
2324
# `examples-summary` is the one check for all its legs. They do not decide what a release publishes (release-native.yml reads the markers and the wheels only).
2425
#
@@ -234,9 +235,10 @@ jobs:
234235
run: |
235236
set -euo pipefail
236237
run=true
237-
# A pull request runs the fast tier (one platform, one Python). With the label ci:full, or opened by Dependabot, it runs the legs
238-
# of a push to main: scripts/ci_tier.py turns its event into pull_request_full (it reads the labels again from the API, so a re-run
239-
# after adding the label is enough). Every other event passes through unchanged.
238+
# A pull request runs the fast tier (one platform, one Python, no examples). scripts/ci_tier.py turns its event into
239+
# pull_request_examples when it changes the examples or their runner (the example leg too), and into pull_request_full with the
240+
# label ci:full or a Dependabot author (the legs of a push to main; it reads the labels again from the API, so a re-run after
241+
# adding the label is enough). Every other event passes through unchanged.
240242
event="$(python3 -I scripts/ci_tier.py "$EVENT")"
241243
echo "legs of the event: $event"
242244
if [ "$RELEASE" = true ]; then event=release; fi
@@ -770,7 +772,9 @@ jobs:
770772
name: Examples on the installed wheel (${{ matrix.key }}, Python ${{ matrix.python }})
771773
needs: [plan, build]
772774
# A platform whose build failed has no wheel to download and shows red here; the other platforms still run.
773-
if: ${{ !cancelled() && needs.plan.outputs.run == 'true' }}
775+
# A pull request (the fast tier) has no example leg unless it changes the examples or their runner (scripts/ci_tier.py): the list is
776+
# empty then and the job is skipped, because an empty matrix is an error. `Examples summary` below knows that case.
777+
if: ${{ !cancelled() && needs.plan.outputs.run == 'true' && needs.plan.outputs.examples != '[]' }}
774778
runs-on: ${{ matrix.runner }}
775779
timeout-minutes: 240
776780
defaults:
@@ -955,6 +959,8 @@ jobs:
955959
retention-days: 3
956960

957961
# One check for the examples of every platform and Python: red when any leg of the `examples` job failed or the job did not run to the end.
962+
# When the plan has no example leg on purpose (the list is `[]`: a pull request, the fast tier) it is green only if the job was skipped.
963+
# An empty list text (the plan step failed half way) is not that case: the job must then have succeeded, so the check is red.
958964
examples-summary:
959965
name: Examples summary
960966
needs: [plan, examples]
@@ -965,17 +971,22 @@ jobs:
965971
- name: Check the examples legs
966972
env:
967973
RESULT: ${{ needs.examples.result }}
974+
LEGS: ${{ needs.plan.outputs.examples }}
968975
run: |
976+
want=success
977+
if [ "$LEGS" = '[]' ]; then want=skipped; fi
969978
{
970979
echo "## Examples on the installed wheel"
971980
echo
972-
if [ "$RESULT" = success ]; then
973-
echo "All example legs passed."
981+
if [ "$RESULT" != "$want" ]; then
982+
echo "The examples job ended with: $RESULT (expected: $want). See the legs of the job \"Examples on the installed wheel\"."
983+
elif [ "$want" = skipped ]; then
984+
echo "No example leg in this run: a pull request runs the examples only when it changes them or their runner, or carries the label ci:full."
974985
else
975-
echo "The examples job ended with: $RESULT. See the legs of the job \"Examples on the installed wheel\"."
986+
echo "All example legs passed."
976987
fi
977988
} >> "$GITHUB_STEP_SUMMARY"
978-
[ "$RESULT" = success ]
989+
[ "$RESULT" = "$want" ]
979990
980991
# The cheap Python-version coverage of the wheel of linux-x86_64 (py3-none: the same file for every Python, nothing is rebuilt): a subset of
981992
# the test files, not the whole suite. The legs are the supported Pythons the full parity runs of this event leave out, plus the
@@ -990,8 +1001,8 @@ jobs:
9901001
name: Python ${{ matrix.python }} on the wheel (linux-x86_64)
9911002
needs: [plan, build]
9921003
# The linux-x86_64 build may have failed: then there is no wheel to download and this shows red, as the test job does.
993-
# A pull request (the fast tier) has no legs here: the list is empty and the job is skipped, because an empty matrix is an error.
994-
# No other job needs this one, so a skipped pyver job changes no summary.
1004+
# Skipped when the list is empty, because an empty matrix is an error (every event has legs today: a pull request the oldest and the
1005+
# newest Python). No other job needs this one, so a skipped pyver job changes no summary.
9951006
if: ${{ !cancelled() && needs.plan.outputs.run == 'true' && needs.plan.outputs.pyver != '[]' }}
9961007
runs-on: ubuntu-latest
9971008
timeout-minutes: 20

‎.github/workflows/test-python-examples.yml‎

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,23 @@ jobs:
132132
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
133133
outputs:
134134
arcadedb-tag: ${{ steps.jars.outputs.arcadedb-tag }}
135+
# "true" when this run has example legs, "false" when it has none on purpose (a pull request, the fast tier)
136+
run: ${{ steps.matrix.outputs.run }}
135137
matrix: ${{ steps.matrix.outputs.matrix }}
136138
wheel-matrix: ${{ steps.matrix.outputs.wheel-matrix }}
137139
steps:
138140
- name: Checkout code
139141
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
140142

141143
# The platform x Python legs of this run (scripts/select_matrix.py). A pull request runs
142-
# the fast tier (linux/amd64, the newest Python); every other event runs the full matrix.
143-
# The organisation shares one runner cap with ArcadeData/arcadedb, so a pull request does
144-
# not wait for the macOS and Windows runners. A pull request with the label ci:full, and
145-
# one Dependabot opened, runs the legs of a push to main: scripts/ci_tier.py turns its
146-
# event into pull_request_full (it reads the labels again from the API, so a re-run after
147-
# adding the label is enough).
144+
# the fast tier, which has NO example leg: the examples are the slowest jobs (20 to 30
145+
# minutes), so they run on a push to main, in the nightly run and on a manual run. The
146+
# matrix is then empty, `run` is false, the rest of this job and the two jobs below are
147+
# skipped, and the summary job says so and stays green. A pull request that changes the
148+
# examples or their runner runs the leg of linux/amd64 on the newest Python
149+
# (pull_request_examples). A pull request with the label ci:full, and one Dependabot
150+
# opened, runs the legs of a push to main (pull_request_full). scripts/ci_tier.py decides:
151+
# it reads the labels again from the API, so a re-run after adding the label is enough.
148152
# The wheel matrix is the platforms of those legs, one build each: the wheel is
149153
# py3-none-<platform>, the same file for every Python.
150154
# Done first, so a failure here costs no Docker pull.
@@ -166,11 +170,17 @@ jobs:
166170
echo "$wheel_matrix"
167171
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
168172
echo "wheel-matrix=$wheel_matrix" >> "$GITHUB_OUTPUT"
173+
# An empty matrix is an error for a job, so the jobs that take it are skipped when there is no leg
174+
if [ "$matrix" = '{"include":[]}' ]; then run=false; else run=true; fi
175+
echo "example legs in this run: $run"
176+
echo "run=$run" >> "$GITHUB_OUTPUT"
169177
170178
- name: Set up Docker Buildx
179+
if: steps.matrix.outputs.run == 'true'
171180
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
172181

173182
- name: Download JARs from ArcadeDB Docker image
183+
if: steps.matrix.outputs.run == 'true'
174184
id: jars
175185
shell: bash
176186
run: |
@@ -210,6 +220,7 @@ jobs:
210220
# Unfiltered on purpose: build-native.sh applies scripts/jar_exclusions.txt
211221
# to whatever lands in the jars directory, so the list lives in one place.
212222
- name: Upload JARs as artifact
223+
if: steps.matrix.outputs.run == 'true'
213224
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
214225
with:
215226
name: arcadedb-jars-examples
@@ -224,7 +235,7 @@ jobs:
224235
name: Build wheel for examples (${{ matrix.platform }})
225236
runs-on: ${{ matrix.runs-on }}
226237
needs: download-jars
227-
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
238+
if: (github.event_name != 'pull_request' || github.event.pull_request.draft == false) && needs.download-jars.outputs.run == 'true'
228239
env:
229240
BUILD_VERSION: ${{ inputs.build-version }}
230241
strategy:
@@ -329,7 +340,7 @@ jobs:
329340
name: Test Python Examples (${{ matrix.platform }}, Python ${{ matrix.python-version }})
330341
runs-on: ${{ matrix.runs-on }}
331342
needs: [download-jars, build]
332-
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
343+
if: (github.event_name != 'pull_request' || github.event.pull_request.draft == false) && needs.download-jars.outputs.run == 'true'
333344
env:
334345
# Pin the Hugging Face cache inside the workspace so it is cacheable with
335346
# one path on every platform (the default differs per OS). The examples
@@ -585,31 +596,43 @@ jobs:
585596
if-no-files-found: ignore
586597
retention-days: 14
587598

588-
# Summary job that checks every leg this run started. The legs are a matrix, so the result of the job is "success" only when
589-
# every leg of it passed, whatever their number: one leg on a pull request (the fast tier), 16 on the other events. A leg that
590-
# failed, was cancelled or never started (its build failed) makes the result something else, and this job red.
599+
# Summary job that checks every leg this run started, and the one check that always reports for this workflow.
600+
# - The run has example legs (`run` is true): green only when the build and the example legs both ended with "success". They are
601+
# matrix jobs, so the result is one word for the whole matrix whatever the number of legs; a leg that failed, was cancelled or
602+
# never started (its build failed) makes it something else, and this job red.
603+
# - The run has no example leg on purpose (`run` is false: a pull request, the fast tier): green only when the first job
604+
# succeeded and both jobs were skipped.
605+
# - Anything else is red: the first job failed, `run` is empty, or a job that should have been skipped ran.
591606
test-examples-summary:
592607
name: Examples Test Summary
593-
needs: [build, test-examples]
608+
needs: [download-jars, build, test-examples]
594609
runs-on: ubuntu-latest
595610
# Skipped (not red) when the matrix was skipped for a draft PR.
596611
if: always() && (github.event_name != 'pull_request' || github.event.pull_request.draft == false)
597612
steps:
598613
- name: Check test results
599614
shell: bash
615+
env:
616+
PLAN: ${{ needs.download-jars.result }}
617+
RUN: ${{ needs.download-jars.outputs.run }}
618+
BUILD: ${{ needs.build.result }}
619+
LEGS: ${{ needs.test-examples.result }}
600620
run: |
601-
echo "## 🎯 Overall Examples Test Summary" >> $GITHUB_STEP_SUMMARY
602-
echo "" >> $GITHUB_STEP_SUMMARY
603-
604-
if [ "${{ needs.build.result }}" = "success" ] && [ "${{ needs.test-examples.result }}" = "success" ]; then
605-
echo "✅ **Every leg of this run passed example testing!**" >> $GITHUB_STEP_SUMMARY
606-
echo "" >> $GITHUB_STEP_SUMMARY
607-
echo "All examples ran successfully on every leg this run started, against one wheel built for each platform." >> $GITHUB_STEP_SUMMARY
608-
echo "" >> $GITHUB_STEP_SUMMARY
609-
echo "**Legs**: a pull request runs linux/amd64 only (the fast tier). A push to main, the nightly run, a manual run and a pull request with the label ci:full run linux/amd64, linux/arm64, darwin/arm64 and windows/amd64. The jobs of this run list its legs." >> $GITHUB_STEP_SUMMARY
621+
echo "## 🎯 Overall Examples Test Summary" >> "$GITHUB_STEP_SUMMARY"
622+
echo "" >> "$GITHUB_STEP_SUMMARY"
623+
echo "first job: $PLAN, example legs in this run: ${RUN:-unknown}, build: $BUILD, examples: $LEGS"
624+
625+
if [ "$PLAN" = success ] && [ "$RUN" = false ] && [ "$BUILD" = skipped ] && [ "$LEGS" = skipped ]; then
626+
echo "⏭️ **No example leg in this run**" >> "$GITHUB_STEP_SUMMARY"
627+
echo "" >> "$GITHUB_STEP_SUMMARY"
628+
echo "A pull request runs the examples only when it changes them or their runner, or carries the label ci:full. A push to main, the nightly run and a manual run run them on every platform." >> "$GITHUB_STEP_SUMMARY"
629+
elif [ "$PLAN" = success ] && [ "$RUN" = true ] && [ "$BUILD" = success ] && [ "$LEGS" = success ]; then
630+
echo "✅ **Every leg of this run passed example testing!**" >> "$GITHUB_STEP_SUMMARY"
631+
echo "" >> "$GITHUB_STEP_SUMMARY"
632+
echo "All examples ran successfully on every leg this run started, against one wheel built for each platform. The jobs of this run list its legs." >> "$GITHUB_STEP_SUMMARY"
610633
else
611-
echo "❌ **Some legs failed example testing**" >> $GITHUB_STEP_SUMMARY
612-
echo "" >> $GITHUB_STEP_SUMMARY
613-
echo "Please check the individual platform jobs for details." >> $GITHUB_STEP_SUMMARY
634+
echo "❌ **Some legs failed example testing**" >> "$GITHUB_STEP_SUMMARY"
635+
echo "" >> "$GITHUB_STEP_SUMMARY"
636+
echo "Please check the individual platform jobs for details." >> "$GITHUB_STEP_SUMMARY"
614637
exit 1
615638
fi

‎CONTRIBUTING.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,13 @@ shellcheck and hadolint run as `docker_image` hooks (Docker pulls the images aut
146146

147147
CI has two tiers, so that a pull request does not wait for the macOS and Windows runners that the organisation shares with ArcadeData/arcadedb.
148148

149-
- **A pull request runs the fast tier.** The static checks (pre-commit, Bandit, the dependency audits) run as before. The builds and tests run on Linux x86-64 only: the `arcadedb-jvm` wheel with the tests on Python 3.11 and 3.14 and the examples on Python 3.14 and, when a native path changed, the native image and wheel with the tests and the examples on Python 3.12. A pull request that changes only documentation runs no platform job.
150-
- **`main` runs the full tier.** A push to `main` and the nightly run (03:00 to 04:00 UTC) test all four platforms: Linux x86-64, Linux arm64, macOS arm64 and Windows x86-64. A release tests every platform on every Python version.
149+
- **A pull request runs the fast tier.** The static checks (pre-commit, Bandit, the dependency audits) run as before. The builds and tests run on Linux x86-64 only: the `arcadedb-jvm` wheel with the tests on Python 3.11 and 3.14 and, when a native path changed, the native image and wheel with the parity suite on Python 3.12 and a short subset on Python 3.11 and 3.14. The examples do not run, unless the pull request changes a file under `examples/` or their runner (`scripts/run_examples.sh`, `scripts/native_examples_skip.txt`). A pull request that changes only documentation runs no platform job.
150+
- **`main` runs the full tier.** A push to `main` and the nightly run (03:00 to 04:00 UTC) test all four platforms (Linux x86-64, Linux arm64, macOS arm64 and Windows x86-64) and run the examples on each. A release tests every platform on every Python version.
151151
- **To run the full tier on a pull request**, add the label `ci:full`, then push a commit or choose "Re-run all jobs" on its test workflows. The pull request then runs what a push to `main` runs. Use it for a change that can behave differently on another platform: file paths, processes and signals, the wheel build, the native library, a workflow file. If you cannot add labels, ask for it in the pull request. Dependabot pull requests always run the full tier.
152152

153-
A problem that only another platform shows is found on `main` after the merge: the badges at the top of the README turn red, and the fix or the revert comes before the next release. [Continuous integration](docs/modules/ROOT/pages/development/ci.adoc) lists the legs of each event.
153+
The wait of a pull request is set by the native image build and the parity suite that follows it. A pull request that changes no native path waits for the `arcadedb-jvm` tests only.
154+
155+
A problem that only another platform or an example shows is found on `main` after the merge: the badges at the top of the README turn red, and the fix or the revert comes before the next release. [Continuous integration](docs/modules/ROOT/pages/development/ci.adoc) lists the legs of each event.
154156

155157
A commit message starts with a short subject that says what changes and where, for example `Native find_nearest: send the query vector as one float32 array, not a Python list`. The body says why. Link the issue with `Closes #N` in the pull request.
156158

0 commit comments

Comments
 (0)