Skip to content

ci(mg7): build madspace once per workflow and cache the wheel#19

Open
oliviermattelaer wants to merge 7 commits into
mainfrom
build_madspace_in_cache
Open

ci(mg7): build madspace once per workflow and cache the wheel#19
oliviermattelaer wants to merge 7 commits into
mainfrom
build_madspace_in_cache

Conversation

@oliviermattelaer

Copy link
Copy Markdown
Contributor

Add a single build_madspace job to acceptancetest_mg7.yml that compiles the madspace wheel and caches it under a content-addressed key (hashFiles('madspace/**')), so it is only rebuilt when the madspace sources change. All mg7 test jobs now depend on this job (needs: build_madspace) and install the cached wheel via the new install_madspace composite action (restore-only + pip install) instead of recompiling the C++/CUDA extension themselves. This guarantees exactly one madspace build per workflow run.

checkout_mg5 still installs madspace for now; removing that is a separate follow-up commit.

Add a single build_madspace job to acceptancetest_mg7.yml that compiles the
madspace wheel and caches it under a content-addressed key
(hashFiles('madspace/**')), so it is only rebuilt when the madspace sources
change. All mg7 test jobs now depend on this job (needs: build_madspace) and
install the cached wheel via the new install_madspace composite action
(restore-only + pip install) instead of recompiling the C++/CUDA extension
themselves. This guarantees exactly one madspace build per workflow run.

checkout_mg5 still installs madspace for now; removing that is a separate
follow-up commit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@oliviermattelaer oliviermattelaer added this to the Alpha release milestone Jun 25, 2026
@oliviermattelaer

Copy link
Copy Markdown
Contributor Author

this still need to remove the old way to install madspace...
This is postponed on purpose to check CI first, then remove it and resubmit and the failing jobs will need to be migrated between files (or guarded correctly to use the new install)

madspace is only needed by the mg7 acceptance workflow, which now builds it
once per run and installs the cached wheel via install_madspace. Remove the
pip install ./madspace step from the shared checkout_mg5 action so non-mg7
workflows no longer recompile the C++/CUDA extension. Any other workflow that
turns out to need madspace will be migrated to the same build/cache pattern.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@theoheimel theoheimel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See suggested changes

Comment thread .github/actions/install_madspace/action.yml Outdated
Comment thread .github/workflows/acceptancetest_mg7.yml Outdated
oliviermattelaer and others added 5 commits June 29, 2026 00:23
Install the cached wheel with --target=madspace/install (the local prefix the
mg7 runtime and madspace/install.py expect) instead of site-packages, so the
generated madevent.py finds it rather than triggering a source rebuild. Export
that dir on PYTHONPATH so the test harness own import madspace availability
check resolves and the mg7 tests run instead of self-skipping.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pass -Ccmake.define.ENABLE_OPENBLAS=ON so the OpenBLAS dependency is built
from source and linked statically into the extension (BUILD_SHARED_LIBS=OFF in
madspace/CMakeLists.txt). The cached wheel is then self-contained and works in
every test job without a system libopenblas. Previously libopenblas-dev was
apt-installed only inside the cache-miss build step, so a dynamically linked
wheel would have lacked its BLAS dependency on a cache hit; remove that apt
step since it is no longer needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Build_madspace now builds and installs madspace into madspace/install (the
prefix the mg7 runtime and madspace/install.py expect) and caches that
directory directly. The install_madspace action restores madspace/install and
puts it on PYTHONPATH, dropping the per-job pip install: every test job reuses
the ready-to-use install built once for the commit.

The cache key (clean-source hashFiles) is unchanged and is evaluated before
madspace/install exists, so build and restore agree. OpenBLAS stays statically
linked (ENABLE_OPENBLAS=ON) so the cached install is self-contained.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

2 participants