ci: add Spack install + smoke test workflow#1447
Conversation
Installs MFC via Spack on Ubuntu (mfc+chemistry~mpi), verifies the three solver binaries plus the mfc shim land in prefix.bin, and runs mfc.sh run --prebuilt-prefix --dry-run on a tiny example case to exercise the venv-skip and PYTHONPATH wiring under MFC_PREBUILT_PREFIX (added in MFlowCode#1444). The workflow temporarily clones spack-packages from sbryngelson:add-mfc because the mfc recipe PR to upstream spack-packages is not merged yet. Once it lands, the checkout 'repository:'/'ref:' lines will be updated to spack/spack-packages / develop.
Replaces the manual spack + spack-packages clone + cache plumbing with the official spack/setup-spack@v3 action. buildcache: true pulls pre-built binaries from spack/github-actions-buildcache for common deps (cantera, boost, fftw, openblas, ...), cutting cold-cache wall time from ~1.5h to minutes when cache hits are available.
spack load uses shell functions (it modifies the calling shell's env) which require sourcing share/spack/setup-env.sh. The install step works without it because spack install is a plain executable. setup-spack puts spack on PATH but each GH Actions step starts a fresh shell, so shell-function support has to be reactivated per-step that needs it.
Picks up the latest spack-packages add-mfc tip (now includes the python-venv build dep) and saves CI minutes by cancelling in-progress runs on the same branch when a new push lands.
setup-spack itself doesn't cache the install store between runs (only the spack git tree). Adding actions/cache on spack/opt + spack/var/spack/cache keyed by the relevant recipe file hashes means cantera + py-pyrometheus + all transitive deps are reused across runs that didn't touch those recipes. First push to a new key takes ~1.5h; subsequent pushes are minutes.
Previously installed mfc+chemistry~mpi and used a placeholder smoke test because the example case requires parallel_io which requires +mpi. Now installs the default variant (+mpi +chemistry, all three targets) and runs the 1D_sodshocktube example via the shim under --prebuilt-prefix to verify the end-to-end prebuilt-mode bootstrap. This is a heavier install (openmpi + fftw+mpi + hdf5+mpi enter the graph) so the first run after this push will re-warm the cache. Subsequent pushes hit the cache.
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Claude Code ReviewHead SHA: 447aa6d Files changed:
FindingsFloating external branch reference breaks CI reproducibility
packages_repository: sbryngelson/spack-packages
packages_ref: add-mfc
Pin to the commit SHA instead: packages_ref: <full-commit-sha>The comment already documents the intent ("until upstream spack/spack-packages merges the mfc recipe"), so the SHA just needs to be updated when the upstream branch advances. A SHA-pin makes the dependency auditable and reproducible. |
|
Parking this for now. The recipe is ready but the upstream spack/spack-packages PR has uncertain ROI at the moment. Will revisit if a concrete use case arises. |
Summary
.github/workflows/spack.ymlthat runs on every push, PR, and weekly schedulespack install mfc(all default variants: +mpi +pre_process +simulation +post_process)pre_process,simulation,post_process,mfcshim) are present and executable1D_sodshocktube) through the full toolchain via the installedmfcshimUses the spack buildcache and
actions/cacheon the spack store for fast subsequent runs. Pinned tosbryngelson/spack-packages:add-mfcuntil the mfc recipe is merged into upstreamspack/spack-packages.Test plan
spack/spack-packagesmerges the mfc recipe, updatepackages_repository/packages_refto point at upstream