Skip to content

GitHub Actions CI: CPU compilers with ECT validation - #1469

Open
cenamiller wants to merge 8 commits into
MPAS-Dev:developfrom
NCAR:feature/ci-cpu-testing
Open

cenamiller wants to merge 8 commits into
MPAS-Dev:developfrom
NCAR:feature/ci-cpu-testing

Conversation

@cenamiller

Copy link
Copy Markdown

This PR adds some initial GitHub Actions continuous integration (CI) for MPAS-A. These workflows do automated build and correctness testing for Intel OneAPI, NVHPC, and GNU compilers on CPU.

This is a subset of the testing that's been developed on the
github.com/NCAR/MPAS-Model-CI fork.

The goal of this testing is to catch build issues and validate that
the model output remains within the bounds of internal variability
using the Ensemble Consistency Test
(ECT/PyCECT; Price-Broncucia et al. 2025,
doi:10.5194/gmd-18-2349-2025).

These workflows:

  • Build MPAS-A in double precision with SMIOL I/O inside
    NCAR hpcdev Docker containers on GitHub-hosted runners.
    (PIO testing is available on the MPAS-Model-CI fork and
    will be included in future PRs)
  • Test three compiler families (GNU, Intel OneAPI, NVHPC)
    with two MPI implementations each (MPICH and OpenMPI)
  • Validate correctness by running 3 perturbed ensemble
    members and comparing against a previously generated
    200-member PyCECT ensemble summary
  • Update CI status badges in README.md

Test case data and ECT ensemble summaries are still hosted as
GitHub release assets on NCAR/MPAS-Model-CI. The
DATA_REPOSITORY variable in .github/ci-config.env
controls where data is downloaded from.

File descriptions:

  • .github/ci-config.env — central CI configuration
  • .github/actions/ — 9 composite actions (build-mpas,
    download-testdata, resolve-container, run-mpas,
    run-perturb-mpas, validate-ect, mpas-version,
    print-mpas-logs, ect-summary)
  • .github/workflows/_test-compiler.yml — reusable CPU
    build + ECT validation workflow
  • .github/workflows/test-{gcc,intel,nvhpc}-{mpich, openmpi}.yml — 6 caller workflows
  • .github/data/ect_excluded_vars.txt — ECT variable
    exclusion list
  • README.md — CI status badges

Developed in NCAR/MPAS-Model-CI. Cursor assistance.

@cenamiller

cenamiller commented Jun 10, 2026

Copy link
Copy Markdown
Author

I think the tests will be able to start running against 'develop' PRs once these workflows are on the 'develop' branch, and we shouldn't need to add everything to the master branch yet like I told you I was afraid we had to do. (Caveat: parts of the github actions UI might not show up until the workflows are on the default branch, but I think we can still do testing and make sure things are working how they should without that until the next release)

*pull_request and push aren't listed as needing to be on the default branch, just the merge ref https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows

@mgduda
mgduda requested review from abishekg7 and mgduda July 9, 2026 21:41
@abishekg7

abishekg7 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this work, @cenamiller! It will be a much needed addition to the MPAS dev workflow. Here are my suggestions so far - but let's check with @mgduda first before going ahead with proposed changes.

  • We probably need to test the builds of the MPAS init_atmosphere CORE with at least one toolchain. Let's hold off on run tests for the init_atmosphere CORE for now.

  • The number of tests that launch by default on every push can be reduced. By default, just building CORE=atmosphere with GNU and MPICH might be enough, and perhaps the ECT runs following that too. The rest of the test suite could be manually triggered via workflow_dispatch probably.

    But I was also wondering how simple it might be to trigger by issue_comment. It would be nice to have the ability to launch targeted tests, without having to run all other tests in the suite. I can say more about this offline.

  • In the reporting screen, at the bottom of a PR, I see about 24 checks being performed. For each test case, there is config, build, ect validate, cleanup. I was wondering if we could just have one line item for each test case, and not separately list config and build, etc. It's fine for now, but wondering if it might be a long list when we add more test cases.

  • Re. .github/workflows/test-compiler-mpi.yml, is there an advantage to keep these as separate files, or would it be okay to fold them into a matrix inside _test-compiler.yml

  • Eventually, it would be good to have GPU tests and tests for idealized case, etc. But it might be better to postpone them to a next iteration of the CI.

  • I was wondering how difficult adding a CMake build test here would be. That could benefit some developers downstream.

cenamiller and others added 7 commits September 11, 2026 15:26
Add the GitHub Actions CI infrastructure for
MPAS-Atmosphere CPU testing. This includes:

- ci-config.env: central configuration for container
  images, compiler mappings, MPI flags, test data release
  tags, and ECT parameters. Test data is hosted on
  NCAR/MPAS-Model-CI GitHub releases.
- Composite actions for building MPAS (build-mpas),
  downloading test data archives (download-testdata),
  resolving container images (resolve-container), running
  MPAS (run-mpas), running perturbed ensemble members for
  ECT (run-perturb-mpas), validating with PyCECT
  (validate-ect), extracting the MPAS version from
  Registry.xml (mpas-version), printing per-rank log files
  (print-mpas-logs), and generating consolidated ECT
  summary tables (ect-summary).
- ECT variable exclusion list.

Developed in NCAR/MPAS-Model-CI. Cursor assistance.
Add GitHub Actions workflows that build MPAS-Atmosphere
and validate correctness using the Ensemble Consistency
Test (PyCECT) across three compiler families and two MPI
implementations:

- _test-compiler.yml: reusable workflow (build ->
  3 perturbed ensemble members in parallel -> PyCECT
  validation -> artifact cleanup)
- Per-compiler callers: GCC+MPICH, GCC+OpenMPI,
  Intel+MPICH, Intel+OpenMPI, NVHPC+MPICH, NVHPC+OpenMPI

All callers run automatically on push/PR to master,
develop, and feature/ci-cpu-testing.

All builds run on GitHub-hosted ubuntu-latest runners
inside NCAR hpcdev Docker containers. Test data and ECT
ensemble summaries are downloaded from NCAR/MPAS-Model-CI
GitHub releases.

ECT reference: Price-Broncucia et al. (2025),
doi:10.5194/gmd-18-2349-2025

Developed in NCAR/MPAS-Model-CI. Cursor assistance.
Add a CI Status section to the top of README.md showing
ECT validation badges for all six compiler+MPI
combinations (GCC, Intel, NVHPC x MPICH, OpenMPI).
Badges link to the GitHub Actions workflow runs.

Cursor assistance.
Prevent GITHUB_TOKEN from persisting in .git/config
after checkout. Only the build job's checkouts had this
set; add it to config, ect-run, and ect-validate jobs.

Cursor assistance.
Move actions:write from workflow-level to the cleanup
job, which is the only job that needs it (for deleting
temporary artifacts). Other jobs now run with only
contents:read.

Cursor assistance.
Pin all GitHub Actions (checkout, upload-artifact,
download-artifact, cache, setup-python) to full commit
SHAs instead of mutable version tags.

Pin PyCECT clone to a verified commit SHA (3.3.1 tag)
and add a commit verification check in validate-ect.

Cursor assistance.
Derive ECT release tags from the MPAS major/minor version so compatible patch releases use the same ensemble summary and spin-up restart.

Assisted-by: Claude
@cenamiller
cenamiller force-pushed the feature/ci-cpu-testing branch from 0f773fd to 19b169e Compare September 11, 2026 21:51
Resolve ECT versions from the source under test, fail when required artifacts or restart data are missing, and retain failed ECT summaries.

Guard optional container setup, verify NVHPC Makefile edits, and remove the unused run-mpas action.

Assisted-by: Claude
@cenamiller

Copy link
Copy Markdown
Author

Hi @abishekg7, thank you for the comments!

  • I agree on a small test to build the init_atmosphere core. I'll create and test it over in ncar/mpas-model-ci, and have it ready for the next iteration of CI if that's okay. It will use the existing framework
  • Just to clarify, the 6 tests should only run on pushes/prs to the master and develop branches, or by manual dispatch. So they shouldn't be running on every push. Do we still think that's too much? I do think an nvhpc build is an important check
  • "In the reporting screen, at the bottom of a PR, I see about 24 checks being performed. For each test case, there is config, build, ect validate, cleanup. I was wondering if we could just have one line item for each test case, and not separately list config and build, etc. It's fine for now, but wondering if it might be a long list when we add more test cases." > Yeah I'm not a fan of that either. This isn't an ultimate solution, but if you go to the 'checks' tab at the top of the PR, it groups them by test.
  • The reason/advantage is that each yaml file gets its own badge and can individually report a failure. But it's a matter of preference. The reusable actions support moving back to a matrix approach
  • agreed, GPU testing is implemented in NCAR/MPAS-Model-CI, but we need to address some security concerns with the main repo before we move it over
  • Yes, a cmake build test is also on the list to do next :) I recommend we try it in NCAR/MPAS-Model-CI and then move it over

@cenamiller

Copy link
Copy Markdown
Author

@abishekg7 Hi again, I addressed some of your other concerns with 8c35e70

  • Missing-data guidance now points to the ECT generation workflow in NCAR/MPAS-Model-CI.
  • /container/config_env.sh is now optional, and the NVHPC Makefile edits fail clearly if the expected lines cannot be found.
  • I removed the unused run-mpas action from this PR. It can return with the later workflows that use it, good call
  • About the python3 -c indentation concern... It turns out YAML "removes the common block indentation before passing the script to bash." So that's why it doesn't cause issues (and hasn't been an issue during testing on NCAR/MPAS-Model-CI)

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