From 6f306ba851899f42f69e22aeb40d63776539abc2 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 16 May 2026 23:25:35 -0400 Subject: [PATCH 1/8] ci: add Spack build + smoke test workflow 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 #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. --- .github/workflows/spack.yml | 60 +++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/spack.yml diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml new file mode 100644 index 0000000000..75d681c088 --- /dev/null +++ b/.github/workflows/spack.yml @@ -0,0 +1,60 @@ +name: Spack +on: + push: + pull_request: + schedule: + - cron: '17 3 * * 0' + +jobs: + spack-install: + name: Spack install + smoke test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Check out Spack + uses: actions/checkout@v4 + with: + repository: spack/spack + path: spack + + - name: Check out spack-packages (sbryngelson/add-mfc until upstream merges) + uses: actions/checkout@v4 + with: + repository: sbryngelson/spack-packages + ref: add-mfc + path: spack-packages + + - name: Cache Spack store + uses: actions/cache@v4 + with: + path: | + spack/opt + spack/var/spack/cache + key: spack-mfc-${{ runner.os }}-${{ hashFiles('spack-packages/repos/spack_repo/builtin/packages/mfc/package.py', 'spack-packages/repos/spack_repo/builtin/packages/cantera/package.py', 'spack-packages/repos/spack_repo/builtin/packages/py_pyrometheus/package.py') }} + restore-keys: spack-mfc-${{ runner.os }}- + + - name: Install mfc+chemistry~mpi + run: | + source spack/share/spack/setup-env.sh + spack repo add --scope=site spack-packages/repos/spack_repo/builtin + spack install --reuse mfc+chemistry~mpi + + - name: Smoke test + run: | + source spack/share/spack/setup-env.sh + spack load mfc + prefix="$(spack location -i mfc)" + echo "MFC prefix: $prefix" + for t in pre_process simulation post_process; do + test -x "$prefix/bin/$t" || { echo "missing binary: $t"; exit 1; } + echo "found: $prefix/bin/$t" + done + test -x "$prefix/bin/mfc" || { echo "missing shim: mfc"; exit 1; } + echo "found shim: $prefix/bin/mfc" + # Validate a small example case file through MFC's toolchain + # (exercises Python venv-skip + PYTHONPATH wiring under MFC_PREBUILT_PREFIX). + cd "$prefix/share/mfc" + ./mfc.sh run --prebuilt-prefix="$prefix" \ + --no-mpi --dry-run \ + examples/1D_sodshocktube/case.py From 0c6c218cfd73794d181d0aef0645c7d83a4fe9c7 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 16 May 2026 23:33:44 -0400 Subject: [PATCH 2/8] ci(spack): use spack/setup-spack with buildcache 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. --- .github/workflows/spack.yml | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index 75d681c088..67e4d759ab 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -12,37 +12,20 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Check out Spack - uses: actions/checkout@v4 + - name: Set up Spack with buildcache + uses: spack/setup-spack@v3 with: - repository: spack/spack - path: spack - - - name: Check out spack-packages (sbryngelson/add-mfc until upstream merges) - uses: actions/checkout@v4 - with: - repository: sbryngelson/spack-packages - ref: add-mfc - path: spack-packages - - - name: Cache Spack store - uses: actions/cache@v4 - with: - path: | - spack/opt - spack/var/spack/cache - key: spack-mfc-${{ runner.os }}-${{ hashFiles('spack-packages/repos/spack_repo/builtin/packages/mfc/package.py', 'spack-packages/repos/spack_repo/builtin/packages/cantera/package.py', 'spack-packages/repos/spack_repo/builtin/packages/py_pyrometheus/package.py') }} - restore-keys: spack-mfc-${{ runner.os }}- + # Pin to the sbryngelson/add-mfc branch until upstream + # spack/spack-packages merges the mfc recipe. + packages_repository: sbryngelson/spack-packages + packages_ref: add-mfc + buildcache: true - name: Install mfc+chemistry~mpi - run: | - source spack/share/spack/setup-env.sh - spack repo add --scope=site spack-packages/repos/spack_repo/builtin - spack install --reuse mfc+chemistry~mpi + run: spack install --reuse mfc+chemistry~mpi - name: Smoke test run: | - source spack/share/spack/setup-env.sh spack load mfc prefix="$(spack location -i mfc)" echo "MFC prefix: $prefix" @@ -52,8 +35,6 @@ jobs: done test -x "$prefix/bin/mfc" || { echo "missing shim: mfc"; exit 1; } echo "found shim: $prefix/bin/mfc" - # Validate a small example case file through MFC's toolchain - # (exercises Python venv-skip + PYTHONPATH wiring under MFC_PREBUILT_PREFIX). cd "$prefix/share/mfc" ./mfc.sh run --prebuilt-prefix="$prefix" \ --no-mpi --dry-run \ From 03ca6b0ee0f279a736ff83ce0d244fbafabff23e Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 17 May 2026 11:21:29 -0400 Subject: [PATCH 3/8] ci(spack): source setup-env.sh before spack load in smoke test 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. --- .github/workflows/spack.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index 67e4d759ab..f508f15519 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -26,6 +26,7 @@ jobs: - name: Smoke test run: | + source spack/share/spack/setup-env.sh spack load mfc prefix="$(spack location -i mfc)" echo "MFC prefix: $prefix" From f3caaf4272b27abf134325027a1a592a091e80e7 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 17 May 2026 12:35:09 -0400 Subject: [PATCH 4/8] ci(spack): add concurrency group to auto-cancel stale runs 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. --- .github/workflows/spack.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index f508f15519..89744fc009 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -5,6 +5,10 @@ on: schedule: - cron: '17 3 * * 0' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: spack-install: name: Spack install + smoke test From 5614e39bb9269d204fbe0f793046d007ba54222a Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 17 May 2026 22:58:50 -0400 Subject: [PATCH 5/8] ci(spack): cache the spack install store across runs 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. --- .github/workflows/spack.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index 89744fc009..c74ab4b35e 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -25,6 +25,15 @@ jobs: packages_ref: add-mfc buildcache: true + - name: Cache Spack install store + uses: actions/cache@v4 + with: + path: | + spack/opt + spack/var/spack/cache + key: spack-store-${{ runner.os }}-${{ hashFiles('spack-packages/repos/spack_repo/builtin/packages/mfc/package.py', 'spack-packages/repos/spack_repo/builtin/packages/cantera/package.py', 'spack-packages/repos/spack_repo/builtin/packages/py_pyrometheus/package.py') }} + restore-keys: spack-store-${{ runner.os }}- + - name: Install mfc+chemistry~mpi run: spack install --reuse mfc+chemistry~mpi From 6e876050be62929972a6006dbc7db502c68ad85e Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Mon, 18 May 2026 10:51:39 -0400 Subject: [PATCH 6/8] ci(spack): build default variant (+mpi +chemistry) and run a real case 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. --- .github/workflows/spack.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index c74ab4b35e..89c77568b3 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -34,8 +34,8 @@ jobs: key: spack-store-${{ runner.os }}-${{ hashFiles('spack-packages/repos/spack_repo/builtin/packages/mfc/package.py', 'spack-packages/repos/spack_repo/builtin/packages/cantera/package.py', 'spack-packages/repos/spack_repo/builtin/packages/py_pyrometheus/package.py') }} restore-keys: spack-store-${{ runner.os }}- - - name: Install mfc+chemistry~mpi - run: spack install --reuse mfc+chemistry~mpi + - name: Install mfc (defaults to +mpi +chemistry +pre_process +simulation +post_process) + run: spack install --reuse mfc - name: Smoke test run: | @@ -51,5 +51,5 @@ jobs: echo "found shim: $prefix/bin/mfc" cd "$prefix/share/mfc" ./mfc.sh run --prebuilt-prefix="$prefix" \ - --no-mpi --dry-run \ + --mpi -N 1 -n 1 --dry-run \ examples/1D_sodshocktube/case.py From 447aa6d107ec10f9c6f4de5a1aaa92fdd265669f Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Mon, 18 May 2026 20:47:49 -0400 Subject: [PATCH 7/8] ci(spack): drop +chemistry from step name (variant removed) --- .github/workflows/spack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index 89c77568b3..a093e76442 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -34,7 +34,7 @@ jobs: key: spack-store-${{ runner.os }}-${{ hashFiles('spack-packages/repos/spack_repo/builtin/packages/mfc/package.py', 'spack-packages/repos/spack_repo/builtin/packages/cantera/package.py', 'spack-packages/repos/spack_repo/builtin/packages/py_pyrometheus/package.py') }} restore-keys: spack-store-${{ runner.os }}- - - name: Install mfc (defaults to +mpi +chemistry +pre_process +simulation +post_process) + - name: Install mfc (defaults to +mpi +pre_process +simulation +post_process) run: spack install --reuse mfc - name: Smoke test From e49d839138391b571fb424e9e3004764bd9418ba Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Mon, 18 May 2026 21:19:38 -0400 Subject: [PATCH 8/8] ci(spack): pin spack-packages to commit SHA for reproducibility --- .github/workflows/spack.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index a093e76442..e0ef5c9706 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -19,10 +19,11 @@ jobs: - name: Set up Spack with buildcache uses: spack/setup-spack@v3 with: - # Pin to the sbryngelson/add-mfc branch until upstream - # spack/spack-packages merges the mfc recipe. + # Pinned to a specific commit of sbryngelson/spack-packages + # until spack/spack-packages merges the mfc recipe. + # Update this SHA when the recipe branch advances. packages_repository: sbryngelson/spack-packages - packages_ref: add-mfc + packages_ref: f0bb11a611fb7f311e788da778208be234601797 buildcache: true - name: Cache Spack install store