Skip to content

Commit aff2559

Browse files
authored
Firedrake container on ARM (#4640)
* Begin working on ARM container for full-fat container * Make extra apps dependent on architecture * Do not install downstream packages in the container
1 parent 1f1be3e commit aff2559

File tree

2 files changed

+35
-22
lines changed

2 files changed

+35
-22
lines changed

.github/workflows/docker.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,17 @@ jobs:
7575
if: ${{ ! inputs.build_dev }}
7676
needs: docker_merge_vanilla
7777
uses: ./.github/workflows/docker_build.yml
78-
# Only build the 'firedrake' container for 'linux/amd64' because
79-
# netgen-mesher does not have ARM wheels so many Firedrake apps cannot
80-
# be installed.
78+
strategy:
79+
matrix:
80+
os: [Linux, macOS]
81+
include:
82+
- os: Linux
83+
platform: linux/amd64
84+
- os: macOS
85+
platform: linux/arm64
8186
with:
82-
os: Linux
83-
platform: linux/amd64
87+
os: ${{ matrix.os }}
88+
platform: ${{ matrix.platform }}
8489
target: firedrake
8590
tag: ${{ inputs.tag }}
8691
dockerfile: docker/Dockerfile.firedrake

docker/Dockerfile.firedrake

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
1-
# Dockerfile for Firedrake with a full set of capabilities and applications installed.
1+
# Dockerfile for Firedrake with a full set of capabilities installed.
22

33
FROM firedrakeproject/firedrake-vanilla-default:latest
44

55
# Install optional dependencies
66
RUN pip install --verbose \
77
--extra-index-url https://download.pytorch.org/whl/cpu \
8-
jax ngsPETSc torch vtk
8+
jax torch
99

10-
# Set PYTHONPATH so netgen can be found
11-
# (see https://github.com/NGSolve/netgen/issues/213)
12-
ENV PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH
13-
14-
# Install Firedrake apps
15-
RUN pip install --verbose --src /opt \
16-
-e git+https://github.com/firedrakeproject/asQ.git#egg=asQ \
17-
-e git+https://bitbucket.org/pefarrell/defcon.git#egg=defcon \
18-
-e git+https://bitbucket.org/pefarrell/fascd.git#egg=fascd \
19-
-e git+https://github.com/FEMlium/FEMlium.git#egg=FEMlium \
20-
-e git+https://github.com/g-adopt/g-adopt.git#egg=gadopt \
21-
-e git+https://github.com/firedrakeproject/gusto.git#egg=gusto \
22-
-e git+https://github.com/firedrakeproject/Irksome.git#egg=Irksome \
23-
-e git+https://github.com/icepack/icepack.git#egg=icepack \
24-
-e git+https://github.com/thetisproject/thetis.git#egg=thetis
10+
# Install ngsPETSc and dependencies. Netgen do not package ARM wheels so
11+
# we have to build it from source in that case. If on x86 then we have to
12+
# set PYTHONPATH so netgen can be found (see https://github.com/NGSolve/netgen/issues/213).
13+
RUN \
14+
if [ "$(dpkg --print-architecture)" == "arm64" ]; then \
15+
apt-get update \
16+
&& apt-get -y install python3-tk libxmu-dev tk-dev tcl-dev cmake g++ libglu1-mesa-dev liblapacke-dev libocct-data-exchange-dev libocct-draw-dev occt-misc libtbb-dev libxi-dev \
17+
&& rm -rf /var/lib/apt/lists/* \
18+
&& mkdir /opt/ngsuite \
19+
&& git clone --branch=v6.2.2505 --single-branch https://github.com/NGSolve/netgen.git /opt/ngsuite/netgen-src \
20+
&& git -C /opt/ngsuite/netgen-src submodule update --init --recursive \
21+
&& mkdir /opt/ngsuite/netgen-build \
22+
&& mkdir /opt/ngsuite/netgen-install \
23+
&& cmake -DCMAKE="-cxx-flags=-flax-vector-conversions" -DCMAKE_INSTALL_PREFIX=/opt/ngsuite/netgen-install /opt/ngsuite/netgen-src \
24+
&& make \
25+
&& make install \
26+
&& export PATH=/opt/ngsuite/netgen-install/bin:$PATH \
27+
&& export PYTHONPATH=/opt/ngsuite/netgen-install/lib/python3.12/site-packages:$PYTHONPATH \
28+
&& pip install ngsPETSc --no-deps; \
29+
else \
30+
export PYTHONPATH=/usr/local/lib/python3.12/site-packages:$PYTHONPATH \
31+
&& pip install ngsPETSc; \
32+
fi
2533

2634
# Install some other niceties
2735
RUN apt-get update \

0 commit comments

Comments
 (0)