Skip to content

CI: per-run concurrency groups on master; make publish safe under concurrency - #1666

Merged
ChrisRackauckas merged 1 commit into
masterfrom
ci/per-run-master-concurrency
Aug 23, 2026
Merged

ChrisRackauckas merged 1 commit into
masterfrom
ci/per-run-master-concurrency

Conversation

@ChrisRackauckas

Copy link
Copy Markdown
Member

Problem

benchmarks.yml uses one concurrency group for every master run (benchmarks-refs/heads/master). GitHub allows one running + one pending run per group, and a newly queued run cancels the pending one. Effects observed this week:

Any workflow_dispatch on master right now would also evict the pending #1641 run and then wait behind SimpleHandwrittenPDE.

Changes

  • Per-run concurrency group on master (push + workflow_dispatch): group: benchmarks-${{ github.ref == 'refs/heads/master' && github.run_id || github.ref }}. Master runs now spread across all self-hosted runners and never evict each other. PR runs keep the per-ref cancel-in-progress behaviour.
  • Remove the job-level scimlbenchmarks-deploy group on Publish Results. It has the same one-pending semantics, so with several master runs finishing close together the middle run's publish would be cancelled and its results lost.
  • Make publish_benchmark_output.sh safe under concurrent publishers instead: clone → copy → commit → push in a retry loop; on a non-fast-forward rejection it re-clones and retries (default 6 attempts, jittered). Every attempt lays the same artifact files over the newest output, so there's nothing to merge. Also: early exit when no artifact dirs were downloaded, --depth 1 clone, and PUBLISH_OUTPUT_REPO / PUBLISH_PRE_PUSH_HOOK env overrides for testing.

Testing

  • YAML parses; expression semantics checked against GitHub's concurrency docs (one running + one pending per group).
  • Local two-publisher test of the script against a bare repo (hook injects a competing push between clone and push on attempt 1): push rejected → re-cloned → published on attempt 2, with both publishers' files present in the final tree.

Not in this PR (follow-ups)

  • SimpleHandwrittenPDE and StiffODE now run >119 h per folder (both got cancelled at that point on Aug 19); a per-folder timeout or per-file targets are needed so one folder can't hold a runner for a week. Being looked at separately.
  • The Weekly Update job is broken (never commits Manifest-only bumps because of > 1; crashed on git checkout GlobalOptimization; OrdinaryDiffEqBDF/SciMLBase AutoDespecialize resolve failure).

🤖 Generated with Claude Code

https://claude.ai/code/session_01KrTtUuDkfgNEq3asQuZ3F6

…currency

The Benchmarks workflow used a single concurrency group for every master
run (`benchmarks-refs/heads/master`). GitHub permits one running + one
pending run per group and a newly queued run cancels the pending one, so:

- run 32024671720 (#1651) has held the group since Aug 19 because its
  SimpleHandwrittenPDE job is multi-day; LinearSolve / ComplicatedPDE /
  AstroChem / LinearSolveGPU results from that run can't publish until it
  ends (timeout is 200 h) while amdci1-1 sits idle;
- run 32389171706 (#1663, NonStiffSDE) was parked pending and then
  cancelled at 2026-08-21T19:27:27Z, the second run 32518558085 (#1641)
  was queued; its benchmark jobs never ran;
- run 31479805309 (#1629) had DynamicalODE / NonlinearProblem /
  LinearSolveDistributed succeed but queued siblings expired (>24 h), the
  run was marked cancelled, and Publish Results was skipped, so those
  results never reached SciMLBenchmarksOutput.

Changes:

* Group master runs (push and workflow_dispatch) by run id instead of by
  ref, so they run concurrently across the self-hosted runners and never
  evict each other. PR runs keep the per-ref cancel-in-progress group.
* Drop the job-level `scimlbenchmarks-deploy` group on Publish Results —
  it has the same one-pending semantics and would cancel a publish (and
  lose that run's results) when several master runs finish close together.
* Make publish_benchmark_output.sh tolerate concurrent publishers instead:
  clone → copy → commit → push in a retry loop; on a non-fast-forward
  rejection it re-clones and retries (default 6 attempts with jitter).
  Each attempt lays the same files over the newest output, so there is
  nothing to merge. Also exits early when no artifact dirs exist, and uses
  a depth-1 clone. The remote URL and a pre-push hook are overridable via
  env for local testing; a local two-publisher test against a bare repo
  exercised the rejected → retried → published path.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KrTtUuDkfgNEq3asQuZ3F6
@ChrisRackauckas
ChrisRackauckas merged commit 14c0980 into master Aug 23, 2026
3 checks passed
@ChrisRackauckas
ChrisRackauckas deleted the ci/per-run-master-concurrency branch August 23, 2026 12:30
ChrisRackauckas added a commit that referenced this pull request Aug 23, 2026
…1668)

Publish Results needs only git, ssh and the small artifact directories,
but it ran on [self-hosted, benchmark] and so queued behind multi-hour
benchmark jobs. Observed today: AstroChem, LinearSolve, DynamicalODE and
NonlinearProblem all finished successfully between 12:45 and 14:42 UTC,
yet their publish jobs sat queued for hours because the three CPU
runners were held by SimpleHandwrittenPDE (multi-day) and two Bio
per-file PR jobs. Moving publish to a hosted runner decouples "results
reach SciMLBenchmarksOutput" from benchmark-runner availability. The
output clone is --depth 1 since #1666, so repo size isn't an issue on a
hosted runner.


Claude-Session: https://claude.ai/code/session_01KrTtUuDkfgNEq3asQuZ3F6

Co-authored-by: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant