Skip to content

ci: add Spack install + smoke test workflow#1447

Closed
sbryngelson wants to merge 9 commits into
MFlowCode:masterfrom
sbryngelson:spack-ci
Closed

ci: add Spack install + smoke test workflow#1447
sbryngelson wants to merge 9 commits into
MFlowCode:masterfrom
sbryngelson:spack-ci

Conversation

@sbryngelson
Copy link
Copy Markdown
Member

Summary

  • Adds .github/workflows/spack.yml that runs on every push, PR, and weekly schedule
  • Installs MFC via spack install mfc (all default variants: +mpi +pre_process +simulation +post_process)
  • Verifies binaries (pre_process, simulation, post_process, mfc shim) are present and executable
  • Runs a real dry-run case (1D_sodshocktube) through the full toolchain via the installed mfc shim

Uses the spack buildcache and actions/cache on the spack store for fast subsequent runs. Pinned to sbryngelson/spack-packages:add-mfc until the mfc recipe is merged into upstream spack/spack-packages.

Test plan

  • Confirm CI passes on this PR
  • After spack/spack-packages merges the mfc recipe, update packages_repository/packages_ref to point at upstream

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-code-review
Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@github-actions
Copy link
Copy Markdown

Claude Code Review

Head SHA: 447aa6d

Files changed:

  • 1
  • .github/workflows/spack.yml

Findings

Floating external branch reference breaks CI reproducibility

.github/workflows/spack.yml lines 24–25:

packages_repository: sbryngelson/spack-packages
packages_ref: add-mfc

packages_ref: add-mfc resolves to whatever HEAD of sbryngelson/spack-packages@add-mfc is at run time, not at the time this PR was authored. Any push to that branch — intentional update, accidental force-push, or compromise — silently changes what this workflow installs and tests without any review of the MFC repository. Two runs of this workflow against the same MFC commit can produce different outcomes. For a CI gate meant to verify a specific Spack recipe, this is a correctness concern.

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.

@sbryngelson
Copy link
Copy Markdown
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant