-
Notifications
You must be signed in to change notification settings - Fork 1
188 lines (161 loc) · 6.92 KB
/
Copy pathtest.yml
File metadata and controls
188 lines (161 loc) · 6.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: Run tests
# I stole this from the main firedrake repo
on:
# Run on pushes to main
push:
branches:
- main
# And all pull requests
# cd /opt/firedrake/
# git fetch
# git checkout indiamai/fuse-closures-with-pyop3
# git pull
pull_request:
jobs:
test:
name: Run tests
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:
arch: [default]
runs-on: [self-hosted, Linux]
container:
image: ubuntu:latest
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMP_NUM_THREADS: 1
OPENBLAS_NUM_THREADS: 1
FIREDRAKE_CI: 1
PYOP2_SPMD_STRICT: 1
EXTRA_PYTEST_ARGS: --splitting-algorithm least_duration --timeout=600 --timeout-method=thread -o faulthandler_timeout=660 --durations-path=./fuse-repo/test/test_durations.json --durations=50
PYTEST_MPI_MAX_NPROCS: 8
steps:
- name: Fix HOME
# For unknown reasons GitHub actions overwrite HOME to /github/home
# which will break everything unless fixed
# (https://github.com/actions/runner/issues/863)
run: echo "HOME=/root" >> "$GITHUB_ENV"
- name: Pre-run cleanup
# Make sure the current directory is empty
run: find . -delete
# Use a different mirror to fetch apt packages from to get around
# temporary outage.
# (https://askubuntu.com/questions/1549622/problem-with-archive-ubuntu-com-most-of-the-servers-are-not-responding)
# The mirror was chosen from https://launchpad.net/ubuntu/+archivemirrors.
- name: Configure apt
run: |
sed -i 's|http://archive.ubuntu.com/ubuntu|http://www.mirrorservice.org/sites/archive.ubuntu.com/ubuntu/|g' /etc/apt/sources.list.d/ubuntu.sources
apt-get update
# Git is needed for actions/checkout and Python for firedrake-configure
- name: Install system dependencies (1)
run: apt-get -y install git python3
- uses: actions/checkout@v5
with:
repository: firedrakeproject/firedrake
path: firedrake-repo
ref: refs/heads/connorjward/pyop3
- name: Validate single source of truth
run: ./firedrake-repo/scripts/check-config
# Check that the Dockerfile is using the latest Ubuntu version.
# The version is hardcoded into the Dockerfile so that the OS
# for each release is fixed.
- name: Check Dockerfile Ubuntu version
run: |
latest_version=$(grep "VERSION_ID=" /etc/os-release | cut -d '"' -f 2)
docker_version=$(grep FROM firedrake-repo/docker/Dockerfile.vanilla | cut -d ':' -f 2)
echo "Latest version: $latest_version"
echo "Docker version: $docker_version"
if [[ "$docker_version" != "$latest_version" ]]; then
echo "Ubuntu version ${docker_version} in Dockerfile is out of date with latest version ${latest_version}"
exit 1
fi
- name: Install system dependencies (2)
run: |
apt-get -y install \
$(python3 ./firedrake-repo/scripts/firedrake-configure --arch ${{ matrix.arch }} --show-system-packages)
apt-get -y install python3-venv
: # Dependencies needed to run the test suite
apt-get -y install fonts-dejavu graphviz graphviz-dev parallel poppler-utils
- name: Install PETSc
run: |
git clone --depth 1 https://gitlab.com/petsc/petsc.git
cd petsc
python3 ../firedrake-repo/scripts/firedrake-configure \
--arch ${{ matrix.arch }} --show-petsc-configure-options | \
xargs -L1 ./configure --with-make-np=8 --download-slepc
make PETSC_DIR=/__w/fuse/fuse/petsc PETSC_ARCH=arch-firedrake-${{ matrix.arch }}
make check
{
echo "PETSC_DIR=/__w/fuse/fuse/petsc"
echo "PETSC_ARCH=arch-firedrake-${{ matrix.arch }}"
echo "SLEPC_DIR=/__w/fuse/fuse/petsc/arch-firedrake-${{ matrix.arch }}"
} >> "$GITHUB_ENV"
- name: Install Firedrake
id: install
run: |
export $(python3 ./firedrake-repo/scripts/firedrake-configure --arch "${{ matrix.arch }}" --show-env)
python3 -m venv venv
. venv/bin/activate
: # Empty the pip cache to ensure that everything is compiled from scratch
pip cache purge
: # Fix for petsc4py+slepc4py build
echo 'setuptools<81' > constraints.txt
export PIP_CONSTRAINT=constraints.txt
: # Install build dependencies
pip install "$PETSC_DIR"/src/binding/petsc4py
pip install -r ./firedrake-repo/requirements-build.txt
: # Install runtime dependencies that have been removed from the pyproject.toml
: # because they rely on non-PyPI versions of petsc4py.
pip install --no-build-isolation --no-deps \
"$PETSC_DIR"/"$PETSC_ARCH"/externalpackages/git.slepc/src/binding/slepc4py
pip install --no-deps git+https://github.com/NGSolve/ngsPETSc.git netgen-mesher netgen-occt
: # We have to pass '--no-build-isolation' to use a custom petsc4py
EXTRA_BUILD_ARGS='--no-isolation'
EXTRA_PIP_FLAGS='--no-build-isolation'
: # Install from an sdist so we can make sure that it is not ill-formed
: # pip install build
: # python -m build ./firedrake-repo --sdist $EXTRA_BUILD_ARGS
: #pip install --verbose $EXTRA_PIP_FLAGS \
: # --no-binary h5py \
: # --extra-index-url https://download.pytorch.org/whl/cpu \
: # "$(echo ./firedrake-repo/dist/firedrake-*.tar.gz)[ci]"
pip install --verbose $EXTRA_PIP_FLAGS \
--no-binary h5py \
--extra-index-url https://download.pytorch.org/whl/cpu \
-e ./firedrake-repo[ci]
firedrake-clean
pip list
- uses: actions/checkout@v5
with:
repository: firedrakeproject/firedrake
path: firedrake-repo
ref: refs/heads/indiamai/fuse_mesh_cell
- name: Make cython
run: |
. venv/bin/activate
cd ./firedrake-repo
make
- uses: actions/checkout@v5
with:
path: fuse-repo
- name: Install checked out fuse
run: |
. venv/bin/activate
python3 -m pip install --break-system-packages -e './fuse-repo[dev]'
- uses: actions/checkout@v5
with:
repository: firedrakeproject/fiat
path: fiat-repo
ref: refs/heads/indiamai/fuse_cell_change
- name: Install checked out FIAT
run: |
. venv/bin/activate
python3 -m pip install --break-system-packages -e './fiat-repo'
- name: Run tests
run: |
. venv/bin/activate
cd ./fuse-repo
firedrake-run-split-tests 1 1 -n 8 "$EXTRA_PYTEST_ARGS" ./test