Track CI section timings and chart trends over commits#1080
Open
adrienbernede wants to merge 5 commits into
Open
Track CI section timings and chart trends over commits#1080adrienbernede wants to merge 5 commits into
adrienbernede wants to merge 5 commits into
Conversation
build_and_test.sh now writes a machine-readable timings.json (per-section durations) via an EXIT trap, so timings are captured even on failure. A new parent-pipeline `pages` job collects these across child pipelines, merges them into a persistent history.jsonl, and publishes per-job stacked-area trend charts to GitLab Pages. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the optional needs from the pages job; the build-and-test trigger jobs already inherit trigger:strategy: depend from the shared-CI .build-and-test template, so the build-and-test stage completes only once all child pipelines finish. The pages job, in the last stage, therefore runs after them without a DAG dependency (and avoids the empty-optional- needs early-start case). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
scripts/gitlab/build_and_test.shalready prints collapsible per-section timings into the job log. This PR additionally persists those timings as data and charts how each section's duration evolves across commits, so we can spot build/test regressions over time.The chart is what was envisioned: one cumulative (stacked-area) graph per
(machine, job)— commit on the X axis, seconds on the Y axis, one band per top-level section — published to GitLab Pages and regenerated by a dedicated job after the per-machine child pipelines.What changed
scripts/gitlab/build_and_test.sh—section_start/section_endnow also capture each section's title, nesting depth, and parent. A newwrite_timings_file()helper emits a machine-readabletimings.json(commit SHA, machine, job, spec, pipeline id,exit_code, total seconds, and asections[]array). It is registered as atrap … EXITso timings are written even when the build fails (each completed section is recorded before any earlyexit)..gitlab/custom-jobs.yml— addstimings.jsonto the per-job artifacts and setsartifacts:when: alwaysso the file (and junit.xml) is uploaded even on job failure..gitlab-ci.yml— newpagesjob in theradiuss-spack-testingstage, gated to the default branch.scripts/gitlab/collect_and_chart_timings.py(new) — collects each child job'stimings.jsonvia the GitLab API, merges into a persistenthistory.jsonl, renders the charts, and writes anindex.html.Design choices
artifacts:reports:metrics/ browser-performance reports only render as merge-request-vs-target-branch widgets (and metrics reports are Premium) — they do not produce a cross-commit time series. The "evolution over commits" view therefore has to be built: collect → persist → render.pagesjob's ownhistory.jsonlartifact is the store: each default-branch run downloads the latest default-branch pipeline'shistory.jsonl, appends the new data points (deduped bysha|machine|job, newesttswins), and re-publishes it. This relies on GitLab's "Keep artifacts from the most recent successful pipelines" setting (default on);expire_in: neveris set as belt-and-suspenders. No data branch, no push token."schema": 1version field is included for forward-compatibility if the record shape changes.needs:on the trigger jobs isoptional: true, so thepagesjob still runs (charting whatever exists) when a machine block is commented out or its availability check fails. Failed builds upload partial timings; each record carriesexit_codefor optional downstream filtering.Verification done locally
bash -nandpy_compilepass; both YAML files parse.write_timings_filewith populated records → valid JSON with correct nesting and quote-escaping (incl. the failure/EXIT-trap path).(machine, job)PNGs +index.htmlgenerated, and the stacked chart renders as intended (nested depth-1 sections correctly excluded from the stack).To verify on real CI / left to do
pagesjob assumes the*-build-and-testtrigger jobs propagate downstream completion (GitLabtrigger:strategy: depend). The RADIUSS.build-and-testtemplate is expected to set this; if child artifacts are missing inpages, addstrategy: dependto the trigger blocks. (Flagged in a comment on the job.)[shell, oslic]runner needspython3+ outbound network for thevenv/pip install matplotlibstep and the GitLab API calls. Confirm GitLab Pages is enabled and the keep-latest-artifacts setting is on.requirements-charts.txt+ acache:block, or a runner image with matplotlib preinstalled.exit_code, if partial-timing data proves noisy.🤖 Generated with Claude Code