Skip to content

CI: save the madtrex cache on main only, build it in warm_cache - #530

Merged
oliviermattelaer merged 1 commit into
mainfrom
claude/cache-main-branch-restrict-f802a2
Nov 22, 2026
Merged

oliviermattelaer merged 1 commit into
mainfrom
claude/cache-main-branch-restrict-f802a2

Conversation

@oliviermattelaer

Copy link
Copy Markdown
Contributor

What

  • acceptancetest_mg7.yml (acceptancetest_mg7_madtrex): the madtrex/install cache is now saved only on refs/heads/main. A PR whose madtrex/ + madspace/ sources match main restores main's entry (PRs can read their base branch's caches); otherwise the job builds madtrex itself and leaves no per-PR cache behind. This job is the only consumer of the build, so nothing else in a PR run loses anything.
  • warm_cache.yml: new main-only madtrex_cache job, same content-addressed key. It restores the entry (which keeps it warm on the twice-weekly scheduled run); on a miss it builds/restores madspace via build_madspace, gets numpy from the pip cache (as the acceptance job does), runs madtrex/install.py, verifies the result with reweight_backend.madtrex_is_installed() / madtrex_build_problem(), then saves.

Why

Branch/PR runs were creating madtrex (and other) cache entries against the shared 10 GB quota. The non-main caches present today (PR #521 pyamplicol + cargo, feat-madmatrix-* madspace/madtrex, ~0.26 GB) were deleted by hand; this stops madtrex from recreating them.

Notes for the reviewer

  • The madtrex key expression now lives in both files; each carries a keep-in-sync comment.
  • madtrex/** is deliberately not added to warm_cache's push paths: a push-triggered warm run also rebuilds the whole heptools chain (~3.5 GB). The acceptance job already saves madtrex on main pushes.
  • Not changed: madspace (PR runs must save it so the run's test jobs can restore it), build_pyamplicol, and the cargo cache still save from branches.
  • Untested in CI yet; YAML parses and the verify step was exercised locally (fails loudly without an install).

🤖 Generated with Claude Code

acceptancetest_mg7_madtrex saved its content-addressed madtrex/install
cache from every branch and PR on a miss. It is the only consumer of that
build, so the save is now gated on refs/heads/main: a PR with main's
madtrex/madspace sources restores main's entry, any other PR builds it in
the job without leaving a per-PR cache behind.

warm_cache.yml gets a main-only madtrex_cache job (same key), which
restores it -- keeping it warm on the scheduled run -- and on a miss
builds madspace + madtrex, checks the install with
reweight_backend.madtrex_is_installed/madtrex_build_problem and saves it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

How CI reacts to this PR

  • Not a draft: the full CI runs automatically when the PR is opened and on every push.
  • Draft: only the unittest and IOtest workflows run. Mark the PR "Ready for review" to start the full CI.
  • run-ci label: while this label is on the PR, every job keeps running after a failure, so you see all failures. Without it, the first failing job cancels the other runs of that commit.
  • Closing or merging: the unfinished CI runs of this PR are cancelled. A merge gets its own run on main.
  • Pushes to main: the full CI runs after each merge.
  • Other branches: run CI only through workflow_dispatch.
  • Forks: the runs use a read-only token, so they cannot cancel each other.
  • Merge: a green CI and one approval are required to merge.

@oliviermattelaer
oliviermattelaer merged commit 08f9acc into main Nov 22, 2026
84 of 92 checks passed
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