-
-
Notifications
You must be signed in to change notification settings - Fork 182
204 lines (168 loc) · 6.66 KB
/
build-wheels.yml
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
name: Build wheels
# By default this action does not push to test or production PyPI. The wheels
# are available as an artifact that can be downloaded and tested locally.
on:
workflow_dispatch:
inputs:
dolfinx_ref:
description: "dolfinx git ref to checkout"
default: ""
type: string
build_fenicsx_stack:
description: "Build wheels for whole FEniCSx stack"
default: false
type: boolean
basix_ref:
description: "basix git ref to checkout"
default: ""
type: string
ufl_ref:
description: "ufl git ref to checkout"
default: ""
type: string
ffcx_ref:
description: "ffcx git ref to checkout"
default: ""
type: string
workflow_call:
inputs:
dolfinx_ref:
description: "dolfinx git ref to checkout"
default: ""
type: string
build_fenicsx_stack:
description: "Build wheels for entire FEniCSx stack"
default: false
type: boolean
basix_ref:
description: "basix git ref to checkout"
default: ""
type: string
ufl_ref:
description: "ufl git ref to checkout"
default: ""
type: string
ffcx_ref:
description: "ffcx git ref to checkout"
default: ""
type: string
jobs:
build_wheels:
name: Build wheels
runs-on: ubuntu-latest
env:
MPI4PY_VERSION: 3.1.2
PETSC4PY_VERSION: 3.16.1
CIBW_MANYLINUX_X86_64_IMAGE: docker.io/fenicsproject/wheelbuilder_x86_64:latest
CIBW_BUILD: cp37-manylinux_x86_64 cp38-manylinux_x86_64 cp39-manylinux_x86_64
CIBW_BUILD_VERBOSITY: 1
CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=file:///project/simple PETSC_DIR=/usr/local MAKEFLAGS=-j2
steps:
- uses: actions/setup-python@v5
- name: Install Python dependencies
run: python -m pip install cibuildwheel simple503 wheel
- name: Checkout Basix
if: ${{ github.event.inputs.build_fenicsx_stack == 'true' }}
uses: actions/checkout@v4
with:
repository: FEniCS/basix
path: basix
ref: ${{ github.event.inputs.basix_ref }}
- name: Build Basix wheel
if: ${{ github.event.inputs.build_fenicsx_stack == 'true' }}
run: |
cd basix
python -m cibuildwheel --output-dir ../wheelhouse .
- name: Checkout UFL
if: ${{ github.event.inputs.build_fenicsx_stack == 'true' }}
uses: actions/checkout@v4
with:
repository: FEniCS/ufl
path: ufl
ref: ${{ github.event.inputs.ufl_ref }}
- name: Build UFL wheel
if: ${{ github.event.inputs.build_fenicsx_stack == 'true' }}
run: python -m pip wheel --no-deps -w wheelhouse ./ufl
- name: Checkout FFCx
if: ${{ github.event.inputs.build_fenicsx_stack == 'true' }}
uses: actions/checkout@v4
with:
repository: FEniCS/ffcx
path: ffcx
ref: ${{ github.event.inputs.ffcx_ref }}
- name: Build FFCx wheel
if: ${{ github.event.inputs.build_fenicsx_stack == 'true' }}
run: python -m pip wheel --no-deps -w wheelhouse ./ffcx
- name: Download mpi4py
run: |
curl -L -O https://github.com/mpi4py/mpi4py/releases/download/${MPI4PY_VERSION}/mpi4py-${MPI4PY_VERSION}.tar.gz
mkdir -p mpi4py
tar -xf mpi4py-${MPI4PY_VERSION}.tar.gz -C mpi4py --strip-components 1
- name: Build mpi4py wheels
run: python -m cibuildwheel --output-dir wheelhouse mpi4py
- name: Make temporary simple503 repository
run: |
mkdir -p simple
cp wheelhouse/* simple/
python -m simple503 --base-url file:///project/simple simple
- name: Download petsc4py
run: |
curl -L -O https://pypi.io/packages/source/p/petsc4py/petsc4py-${PETSC4PY_VERSION}.tar.gz
mkdir -p petsc4py
tar -xf petsc4py-${PETSC4PY_VERSION}.tar.gz -C petsc4py --strip-components 1
- name: Build petsc4py wheels
run: python -m cibuildwheel --output-dir wheelhouse petsc4py
env:
CIBW_BEFORE_BUILD: python -m pip install numpy # Not specified correctly in petsc4py
- name: Update temporary simple503 repository
run: |
cp wheelhouse/* simple/
python -m simple503 --base-url file:///project/simple simple
- name: Checkout DOLFINx
uses: actions/checkout@v4
with:
path: dolfinx
ref: ${{ github.event.inputs.dolfinx_ref }}
# fenics-ffcx and fenics-basix are required by DOLFINx C++ build
# mpi4py and petsc4py are build_requirements of DOLFINx Python
- name: Build DOLFINx wheel
run: python -m cibuildwheel --output-dir wheelhouse dolfinx/python
env:
CIBW_BEFORE_BUILD: python -m pip -v install --prefer-binary fenics-ffcx fenics-basix && python -m pip -v install --prefer-binary petsc4py mpi4py && cmake -S dolfinx/cpp -B build-dir -DPython3_EXECUTABLE=$(which python) && cmake --build build-dir && cmake --install build-dir
CIBW_REPAIR_WHEEL_COMMAND_LINUX: export LD_LIBRARY_PATH=$(python -c "import site; print(site.getsitepackages()[0] + '/fenics_basix.libs')") && auditwheel repair -w {dest_dir} {wheel}
- name: Update temporary simple503 repository
run: |
cp wheelhouse/* simple
python -m simple503 --base-url file:///shared simple
# Artifact can be unzipped into $(pwd) and tested with e.g.:
# docker run -ti -v $(pwd):/shared --env PIP_EXTRA_INDEX_URL=file:///shared python:3.9 /bin/bash -l
- name: Upload simple503-test artifact
uses: actions/upload-artifact@v4
with:
name: "simple503-test"
path: simple/*
- name: Upload wheelhouse artifact
uses: actions/upload-artifact@v4
with:
name: wheelhouse
path: wheelhouse/*
- name: Update FEniCS Project simple503 repository
run: |
python -m simple503 --base-url http://packages.fenicsproject.org/simple simple
# For manual upload.
- name: Upload simple503 artifact
uses: actions/upload-artifact@v4
with:
name: "simple503"
path: simple/*
# Extract mpiexec from docker image
- name: Extract mpiexec.hydra from Docker image
run: |
export CONTAINER_ID=$(docker create ${CIBW_MANYLINUX_X86_64_IMAGE})
docker cp ${CONTAINER_ID}:/usr/local/bin/mpiexec.hydra mpiexec.hydra
docker rm ${CONTAINER_ID}
- name: Upload mpiexec artifact
uses: actions/upload-artifact@v4
with:
name: "mpiexec.hydra"
path: mpiexec.hydra