-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip install firedrake #4011
Draft
connorjward
wants to merge
75
commits into
master
Choose a base branch
from
connorjward/pip-install
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
pip install firedrake #4011
Changes from 56 commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
272b8c4
Begin work on new installation process
connorjward 279ff3a
try again, force a container build
connorjward 26714ce
fixup
connorjward a8494ba
fixup
connorjward a0b6f1f
fixup
connorjward 778e57f
fixup
connorjward dfb995a
path hacking
connorjward 36d250a
noodling
connorjward a597456
noodling
connorjward b026e3f
wip
connorjward 50fb89b
wip
connorjward eaa080a
globbing
connorjward 778f335
wip
connorjward fcc0417
testing things out
connorjward 1693e66
Merge remote-tracking branch 'origin/master' into connorjward/pip-ins…
connorjward 1e7acad
Add support for ARM
connorjward f23b443
noodling
connorjward 34eb8d3
fixup
connorjward 65a7ce4
fixup
connorjward 9263612
fixup
connorjward 0a79641
fixup
connorjward d8ed518
use single petsc arch for the moment
connorjward eac1caa
fixup
connorjward b1b1309
fixup
connorjward a19ccbd
can I at least build a container
connorjward 5171259
wip
connorjward 6687ca1
improvements
connorjward 52e6fcc
fixup
connorjward ba8bf58
fixup
connorjward 18600ac
cleanup
connorjward a612f14
fixup
connorjward c627662
fixup
connorjward 7b705bd
fixup
connorjward efc536b
bad hypre
connorjward 31594f3
fixup
connorjward 2ddb8b5
fixup
connorjward af81e35
fixup
connorjward 9b0680d
DUMB
connorjward 9e1bbc6
firedrake-configure lives
connorjward 3d61458
improvements
connorjward 50168d4
small tweak
connorjward d9b3181
Use new script in CI
connorjward 1ffa65d
finally fix petsc4py nightmare?
connorjward 48be846
fixup?
connorjward 1b7d7aa
fixup?
connorjward bdfed2b
fixup?
connorjward 836e0e5
Use a venv
connorjward cf04bed
Merge remote-tracking branch 'origin/master' into connorjward/pip-ins…
connorjward be6c7f0
backslash
connorjward b628d5e
Abandon setup-python
connorjward 2b9646a
gah
connorjward 74d9b27
Lots of tweaks
connorjward ddffbfc
fixups
connorjward ba01f68
Less strict cleanup
connorjward 5c39fc0
remove make check for now
connorjward 0a11857
tidy up and no hypre in complex and macos bison
connorjward dd8a600
fix strings and add wait in old install script
connorjward 6c42019
update CI timeouts
connorjward b9310b4
Fix paths
connorjward 27c5d68
less aggressive homebrew management
connorjward b9879a2
Merge remote-tracking branch 'origin/master' into connorjward/pip-ins…
connorjward 6c65d08
fixup
connorjward e643e5f
Dockerfile changes
connorjward 22afa3a
yucky, undo a bunch of linting rules
connorjward 6e554c0
fixups
connorjward 000ccc3
some changes, no skips allowed
connorjward 982dbe8
lots of tweaks
connorjward 45d63e8
fixups
connorjward dc92716
fixups
connorjward 924ae85
fixup
connorjward 4663559
docs noodling
connorjward bd2abca
WIP
connorjward b26f44f
Install instructions nearly done
connorjward d0532e6
docs tweaks
connorjward fcde36d
Merge remote-tracking branch 'origin/master' into connorjward/pip-ins…
connorjward File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
name: Install and Test Firedrake | ||
name: CI | ||
|
||
on: | ||
# Push to master or PR | ||
push: | ||
branches: | ||
- master | ||
|
@@ -11,7 +10,7 @@ on: | |
- cron: '0 0 1 * *' # Monthly release | ||
|
||
concurrency: | ||
# Cancels jobs running if new commits are pushed | ||
# Cancel running jobs if new commits are pushed | ||
group: > | ||
${{ github.workflow }}- | ||
${{ github.event.pull_request.number || github.ref }} | ||
|
@@ -22,152 +21,123 @@ env: | |
|
||
jobs: | ||
test: | ||
name: "Run Firedrake tests (Linux)" | ||
runs-on: [self-hosted, Linux] | ||
container: | ||
image: firedrakeproject/firedrake-env:latest | ||
name: Install and test Firedrake (Linux) | ||
strategy: | ||
# We want to know all of the tests which fail, so don't 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 | ||
arch: [default, complex] | ||
runs-on: [self-hosted, Linux] | ||
container: | ||
image: firedrakeproject/firedrake-env:pip | ||
env: | ||
# PETSC_DIR and MPICH_DIR are set inside the docker image | ||
# NOTE: Do not set a lot of vars here, single source of truth | ||
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 | ||
EXTRA_PYTEST_ARGS: --splitting-algorithm least_duration --timeout=1800 --timeout-method=thread -o faulthandler_timeout=1860 tests/firedrake | ||
PYOP2_SPMD_STRICT: 1 | ||
EXTRA_PYTEST_ARGS: --splitting-algorithm least_duration --timeout=1800 --timeout-method=thread -o faulthandler_timeout=1860 repo/tests/firedrake | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Cleanup | ||
if: ${{ always() }} | ||
- name: Pre-run cleanup | ||
run: | | ||
cd .. | ||
rm -rf firedrake_venv | ||
: # Make sure the current directory is empty | ||
find . -delete | ||
|
||
- 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 \ | ||
--mpihome="$MPICH_DIR"/.. \ | ||
--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 | ||
id: build | ||
run: | | ||
sudo apt update | ||
sudo apt -y install parallel | ||
. ../firedrake_venv/bin/activate | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: repo | ||
|
||
- name: Install system dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get -y install \ | ||
$(python3 ./repo/scripts/firedrake-configure --arch ${{ matrix.arch }} --show-system-dependencies) | ||
: # Extra test dependencies | ||
sudo apt-get -y install parallel | ||
|
||
- name: Install PETSc | ||
run: | | ||
git clone https://github.com/firedrakeproject/petsc.git | ||
cd petsc | ||
./configure \ | ||
$(python3 ../repo/scripts/firedrake-configure --arch ${{ matrix.arch }} --show-petsc-configure-options) \ | ||
--with-make-np=12 | ||
make | ||
# TODO: This fails for some reason | ||
# make check | ||
|
||
- name: Install Firedrake | ||
id: install | ||
run: | | ||
export PETSC_DIR=$PWD/petsc PETSC_ARCH=arch-firedrake-${{ matrix.arch }} | ||
export HDF5_MPI=ON | ||
export CC=mpicc CXX=mpicxx | ||
export MPICC=$CC | ||
python3 -m venv venv | ||
. venv/bin/activate | ||
: # Force a rebuild of petsc4py as the cached one will not link to the fresh | ||
: # install of PETSc. A similar trick may be needed for compiled dependencies | ||
: # like h5py or mpi4py if changing HDF5/MPI libraries. | ||
pip cache remove petsc4py | ||
pip install --verbose --no-binary h5py ./repo[test] | ||
firedrake-clean | ||
python -m pip install pytest-timeout ipympl pytest-split pytest-xdist | ||
python -m pip list | ||
: # Extra test dependencies | ||
pip install ipympl pytest-split pytest-timeout pytest-xdist | ||
pip list | ||
|
||
- name: Run tests (nprocs = 1) | ||
run: | | ||
. venv/bin/activate | ||
: # Use pytest-xdist here so we can have a single collated output (not possible | ||
: # for parallel tests) | ||
. ../firedrake_venv/bin/activate | ||
firedrake-run-split-tests 1 1 "-n 12 $EXTRA_PYTEST_ARGS --junit-xml=firedrake1_{#}.xml" | ||
|
||
- name: Run tests (nprocs = 2) | ||
# Run even if earlier tests failed | ||
if: ${{ success() || steps.build.conclusion == 'success' }} | ||
if: ${{ success() || steps.install.conclusion == 'success' }} | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
. venv/bin/activate | ||
firedrake-run-split-tests 2 6 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake2_{#}.xml" | ||
|
||
- name: Run tests (nprocs = 3) | ||
if: ${{ success() || steps.build.conclusion == 'success' }} | ||
if: ${{ success() || steps.install.conclusion == 'success' }} | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
. venv/bin/activate | ||
firedrake-run-split-tests 3 4 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake3_{#}.xml" | ||
|
||
- name: Run tests (nprocs = 4) | ||
if: ${{ success() || steps.build.conclusion == 'success' }} | ||
if: ${{ success() || steps.install.conclusion == 'success' }} | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
. venv/bin/activate | ||
firedrake-run-split-tests 4 3 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake4_{#}.xml" | ||
|
||
- name: Run tests (nprocs = 5) | ||
if: ${{ success() || steps.build.conclusion == 'success' }} | ||
if: ${{ success() || steps.install.conclusion == 'success' }} | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
. venv/bin/activate | ||
firedrake-run-split-tests 5 2 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake5_{#}.xml" | ||
|
||
- name: Run tests (nprocs = 6) | ||
if: ${{ success() || steps.build.conclusion == 'success' }} | ||
if: ${{ success() || steps.install.conclusion == 'success' }} | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
. venv/bin/activate | ||
firedrake-run-split-tests 6 2 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake6_{#}.xml" | ||
|
||
- name: Run tests (nprocs = 7) | ||
if: ${{ success() || steps.build.conclusion == 'success' }} | ||
if: ${{ success() || steps.install.conclusion == 'success' }} | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
. venv/bin/activate | ||
firedrake-run-split-tests 7 1 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake7_{#}.xml" | ||
|
||
- name: Run tests (nprocs = 8) | ||
if: ${{ success() || steps.build.conclusion == 'success' }} | ||
if: ${{ success() || steps.install.conclusion == 'success' }} | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
. venv/bin/activate | ||
firedrake-run-split-tests 8 1 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake8_{#}.xml" | ||
|
||
- name: Test pyadjoint | ||
if: (success() || steps.build.conclusion == 'success') && matrix.scalar-type == 'real' | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
cd ../firedrake_venv/src/pyadjoint | ||
python -m pytest \ | ||
--strict-markers \ | ||
--durations=200 \ | ||
--timeout=600 \ | ||
--timeout-method=thread \ | ||
-o faulthandler_timeout=660 \ | ||
-n 12 --dist worksteal \ | ||
-sv tests/firedrake_adjoint | ||
timeout-minutes: 5 | ||
|
||
- name: Run Gusto smoke tests | ||
# Only test Gusto in real mode | ||
if: (success() || steps.build.conclusion == 'success') && matrix.scalar-type == 'real' | ||
if: (success() || steps.install.conclusion == 'success') && matrix.arch == 'default' | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
cd ../firedrake_venv/src/gusto | ||
|
@@ -177,31 +147,31 @@ jobs: | |
integration-tests/transport/test_embedded_dg_advection.py | ||
timeout-minutes: 5 | ||
|
||
- name: Publish Test Report | ||
- name: Publish test report | ||
uses: mikepenz/[email protected] | ||
# To avoid permissions issues do not run with forked repos | ||
# (see https://github.com/mikepenz/action-junit-report/issues/23) | ||
if: ${{ always() && (github.ref != 'refs/heads/master') && (github.event.pull_request.head.repo.full_name == github.repository) }} | ||
if: | | ||
(success() || steps.install.conclusion == 'success') | ||
&& (github.ref != 'refs/heads/master') | ||
&& (github.event.pull_request.head.repo.full_name == github.repository) | ||
with: | ||
report_paths: 'firedrake*.xml' | ||
comment: true | ||
check_name: "Firedrake ${{ matrix.scalar-type }}" | ||
check_name: "Firedrake ${{ matrix.arch }}" | ||
updateComment: true | ||
flaky_summary: true | ||
|
||
- name: Upload log files | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
if: success() || steps.install.conclusion == 'success' | ||
with: | ||
name: firedrake-logs-${{ matrix.scalar-type }} | ||
name: firedrake-logs-${{ matrix.arch }} | ||
path: pytest_*.log | ||
|
||
- name: Cleanup | ||
# Belt and braces: clean up before and after the run. | ||
if: ${{ always() }} | ||
run: | | ||
cd .. | ||
rm -rf firedrake_venv | ||
- name: Post-run cleanup | ||
if: always() | ||
run: find . -delete | ||
|
||
docker_tag: | ||
name: "Set the Docker release tag" | ||
|
@@ -224,10 +194,10 @@ jobs: | |
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: [test, docker_tag] | ||
# if: always() && (github.ref == 'refs/heads/master') | ||
# needs: [test, docker_tag] | ||
uses: ./.github/workflows/docker.yml | ||
with: | ||
tag: ${{ needs.docker_tag.outputs.tag }} | ||
status: ${{ needs.test.result }} | ||
tag: pip | ||
status: success | ||
secrets: inherit | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need undoing before merging