Test suite clean up #5812
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Install and Test Firedrake | |
on: | |
# Push to master or PR | |
push: | |
branches: | |
- master | |
pull_request: | |
schedule: | |
- cron: '0 0 * * 0' | |
- cron: '0 0 1 * *' # Monthly release | |
concurrency: | |
# Cancels jobs running if new commits are pushed | |
group: > | |
${{ github.workflow }}- | |
${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
RELEASE_TAG: latest | |
jobs: | |
build: | |
name: "Build Firedrake" | |
# Run on our self-hosted machines | |
runs-on: [self-hosted, Linux] | |
container: | |
image: firedrakeproject/firedrake-env:latest | |
strategy: | |
# Don't immediately kill real if complex fails and vice versa. | |
fail-fast: false | |
matrix: | |
include: | |
- scalar-type: real | |
complex: "" | |
petsc_arch: default | |
- scalar-type: complex | |
complex: --complex | |
petsc_arch: complex | |
env: | |
# PETSC_DIR and MPICH_DIR are set inside the docker image | |
FIREDRAKE_CI_TESTS: 1 | |
PYOP2_CI_TESTS: 1 | |
PETSC_ARCH: ${{ matrix.petsc_arch }} | |
OMP_NUM_THREADS: 1 | |
OPENBLAS_NUM_THREADS: 1 | |
COMPLEX: ${{ matrix.complex }} | |
RDMAV_FORK_SAFE: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cleanup | |
if: ${{ always() }} | |
run: | | |
cd .. | |
rm -rf firedrake_venv | |
- name: Build Firedrake | |
run: | | |
cd .. | |
# Linting should ignore unquoted shell variable $COMPLEX | |
# shellcheck disable=SC2086 | |
./firedrake/scripts/firedrake-install \ | |
$COMPLEX \ | |
--honour-petsc-dir \ | |
--mpicc="$MPICH_DIR"/mpicc \ | |
--mpicxx="$MPICH_DIR"/mpicxx \ | |
--mpif90="$MPICH_DIR"/mpif90 \ | |
--mpiexec="$MPICH_DIR"/mpiexec \ | |
--venv-name firedrake_venv \ | |
--no-package-manager \ | |
--disable-ssh \ | |
--documentation-dependencies \ | |
--torch \ | |
--jax \ | |
--netgen \ | |
--slepc \ | |
--install thetis \ | |
--install gusto \ | |
--install icepack \ | |
--install irksome \ | |
--install femlium \ | |
--install fascd \ | |
--install defcon \ | |
--install gadopt \ | |
--install asQ \ | |
|| (cat firedrake-install.log && /bin/false) | |
- name: Install test dependencies | |
run: | | |
. ../firedrake_venv/bin/activate | |
cd ../firedrake_venv/src/pytest-mpi | |
git checkout JDBetteridge/spawn | |
cd - | |
python "$(which firedrake-clean)" | |
python -m pip install \ | |
pytest-xdist pytest-timeout ipympl pytest-split | |
pip install git+https://github.com/JDBetteridge/mpispawn | |
python -m pip list | |
- name: Test Firedrake Serial | |
run: | | |
. ../firedrake_venv/bin/activate | |
echo OMP_NUM_THREADS is "$OMP_NUM_THREADS" | |
echo OPENBLAS_NUM_THREADS is "$OPENBLAS_NUM_THREADS" | |
python -m pytest -v tests/test_0init.py | |
python -m pytest \ | |
--durations=200 \ | |
--timeout=1800 \ | |
--timeout-method=thread \ | |
-o faulthandler_timeout=1860 \ | |
-m "not parallel" \ | |
-n 12 --dist worksteal \ | |
--junit-xml=firedrake1.xml \ | |
-sv tests | |
timeout-minutes: 60 | |
- name: Test Firedrake 2 ranks | |
run: | | |
. ../firedrake_venv/bin/activate | |
echo OMP_NUM_THREADS is "$OMP_NUM_THREADS" | |
echo OPENBLAS_NUM_THREADS is "$OPENBLAS_NUM_THREADS" | |
mpispawn -nU 12 -nW 2 --propagate-errcodes pytest \ | |
--splitting-algorithm least_duration \ | |
--splits \$MPISPAWN_NUM_TASKS \ | |
--group \$MPISPAWN_TASK_ID1 \ | |
--timeout=1800 \ | |
--timeout-method=thread \ | |
-o faulthandler_timeout=1860 \ | |
--junit-xml=firedrake2_\$MPISPAWN_TASK_ID1.xml \ | |
-m "parallel[\$MPISPAWN_WORLD_SIZE] and not broken" \ | |
-v tests | |
timeout-minutes: 30 | |
- name: Test Firedrake 3 ranks | |
run: | | |
. ../firedrake_venv/bin/activate | |
echo OMP_NUM_THREADS is "$OMP_NUM_THREADS" | |
echo OPENBLAS_NUM_THREADS is "$OPENBLAS_NUM_THREADS" | |
mpispawn -nU 12 -nW 3 --propagate-errcodes pytest \ | |
--splitting-algorithm least_duration \ | |
--splits \$MPISPAWN_NUM_TASKS \ | |
--group \$MPISPAWN_TASK_ID1 \ | |
--timeout=1800 \ | |
--timeout-method=thread \ | |
-o faulthandler_timeout=1860 \ | |
--junit-xml=firedrake3_\$MPISPAWN_TASK_ID1.xml \ | |
-m "parallel[\$MPISPAWN_WORLD_SIZE] and not broken" \ | |
-v tests | |
timeout-minutes: 60 | |
- name: Test Firedrake 4 ranks | |
run: | | |
. ../firedrake_venv/bin/activate | |
echo OMP_NUM_THREADS is "$OMP_NUM_THREADS" | |
echo OPENBLAS_NUM_THREADS is "$OPENBLAS_NUM_THREADS" | |
mpispawn -nU 8 -nW 4 --propagate-errcodes pytest \ | |
--splitting-algorithm least_duration \ | |
--splits \$MPISPAWN_NUM_TASKS \ | |
--group \$MPISPAWN_TASK_ID1 \ | |
--timeout=1800 \ | |
--timeout-method=thread \ | |
-o faulthandler_timeout=1860 \ | |
--junit-xml=firedrake4_\$MPISPAWN_TASK_ID1.xml \ | |
-m "parallel[\$MPISPAWN_WORLD_SIZE] and not broken" \ | |
-v tests | |
timeout-minutes: 30 | |
- name: Test Firedrake 6 ranks | |
run: | | |
. ../firedrake_venv/bin/activate | |
echo OMP_NUM_THREADS is "$OMP_NUM_THREADS" | |
echo OPENBLAS_NUM_THREADS is "$OPENBLAS_NUM_THREADS" | |
mpiexec -n 6 python -m pytest \ | |
--timeout=1800 \ | |
--timeout-method=thread \ | |
-o faulthandler_timeout=1860 \ | |
--junit-xml=firedrake6.xml \ | |
-m "parallel[6] and not broken" \ | |
-sv tests | |
timeout-minutes: 30 | |
- name: Test Firedrake 7 ranks | |
run: | | |
. ../firedrake_venv/bin/activate | |
echo OMP_NUM_THREADS is "$OMP_NUM_THREADS" | |
echo OPENBLAS_NUM_THREADS is "$OPENBLAS_NUM_THREADS" | |
mpiexec -n 7 python -m pytest \ | |
--timeout=1800 \ | |
--timeout-method=thread \ | |
-o faulthandler_timeout=1860 \ | |
--junit-xml=firedrake7.xml \ | |
-m "parallel[7] and not broken" \ | |
-sv tests | |
timeout-minutes: 30 | |
- name: Test Firedrake 8 ranks | |
run: | | |
. ../firedrake_venv/bin/activate | |
echo OMP_NUM_THREADS is "$OMP_NUM_THREADS" | |
echo OPENBLAS_NUM_THREADS is "$OPENBLAS_NUM_THREADS" | |
mpiexec -n 8 python -m pytest \ | |
--timeout=1800 \ | |
--timeout-method=thread \ | |
-o faulthandler_timeout=1860 \ | |
--junit-xml=firedrake8.xml \ | |
-m "parallel[8] and not broken" \ | |
-sv tests | |
timeout-minutes: 30 | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v5.0.0-a02 | |
if: ${{ always() && ( github.ref != 'refs/heads/master') }} | |
with: | |
report_paths: '/__w/firedrake/firedrake/firedrake*.xml' | |
comment: true | |
check_name: "Firedrake ${{ matrix.scalar-type }}" | |
updateComment: true | |
flaky_summary: true | |
- name: Test pyadjoint | |
if: ${{ matrix.scalar-type == 'real' }} | |
run: | | |
. ../firedrake_venv/bin/activate | |
cd ../firedrake_venv/src/pyadjoint | |
python -m pytest \ | |
--durations=200 \ | |
--timeout=600 \ | |
--timeout-method=thread \ | |
-o faulthandler_timeout=660 \ | |
-n 12 --dist worksteal \ | |
-sv tests/firedrake_adjoint | |
timeout-minutes: 30 | |
- name: Cleanup | |
# Belt and braces: clean up before and after the run. | |
if: ${{ always() }} | |
run: | | |
cd .. | |
rm -rf firedrake_venv | |
docker_tag: | |
name: "Set the Docker release tag" | |
runs-on: [self-hosted, Linux] | |
if: ${{ github.ref == 'refs/heads/master' }} | |
steps: | |
- name: Set release tag | |
# Set a release tag if triggered by monthly CRON job | |
if: github.event.schedule == '0 0 1 * *' | |
run: | | |
DATE_TAG="$(date +%Y-%m)" | |
echo "RELEASE_TAG=$DATE_TAG" >> "$GITHUB_ENV" | |
- name: Print release tag being used | |
run: | | |
echo The release tag is "$RELEASE_TAG" | |
outputs: | |
tag: ${{ env.RELEASE_TAG }} | |
docker: | |
name: "Build Docker containers" | |
# Only run on master, but always generate firedrake-env image, | |
# even if build fails (see docker.yml) | |
if: ${{ (github.ref == 'refs/heads/master') && always() }} | |
needs: [build, docker_tag] | |
uses: ./.github/workflows/docker.yml | |
with: | |
tag: ${{ needs.docker_tag.outputs.tag }} | |
status: ${{ needs.build.result }} | |
secrets: inherit |