Skip to content

Commit 438b380

Browse files
committed
Bump base image to Ubuntu 24.04
1 parent 6198cb1 commit 438b380

File tree

4 files changed

+175
-11
lines changed

4 files changed

+175
-11
lines changed

tools/tests/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ Metadata and workflow/script files:
161161
- `fenics-adapter.yaml`
162162
- `openfoam-adapter.yaml`
163163
- ...
164-
- `dockerfiles/ubuntu_2204/`
165-
- Dockerfile: a multi-stage build Dockerfile that defines how to build each component, in a layered approach
164+
- `dockerfiles/`
165+
- Multi-stage build Dockerfiles that define how to build each component, in a layered approach
166166
- `docker-compose.template.yaml`: Describes how to prepare each test (Docker Componse service template)
167167
- `docker-compose.field_compare.template.yaml`: Describes how to compare results with fieldcompare (Docker Compose service template)
168168
- `components.yaml`: Declares the available components and their parameters/options
@@ -253,7 +253,7 @@ openfoam-adapter:
253253
default: "production-audit"
254254
PLATFORM:
255255
description: Dockerfile platform used
256-
default: "ubuntu_2204"
256+
default: "ubuntu_2404"
257257
TUTORIALS_REF:
258258
description: Tutorial git reference to use
259259
default: "master"

tools/tests/components.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ bare: # A default component used when the solver does not have any dependencies
1010
default: "production-audit"
1111
PLATFORM:
1212
description: Dockerfile platform used
13-
default: "ubuntu_2204"
13+
default: "ubuntu_2404"
1414
TUTORIALS_REF:
1515
description: Tutorial git reference to use
1616
default: "master"
@@ -27,7 +27,7 @@ python-bindings:
2727
default: "production-audit"
2828
PLATFORM:
2929
description: Dockerfile platform used
30-
default: "ubuntu_2204"
30+
default: "ubuntu_2404"
3131
TUTORIALS_REF:
3232
description: Tutorial git reference to use
3333
default: "master"
@@ -47,7 +47,7 @@ openfoam-adapter:
4747
default: "production-audit"
4848
PLATFORM:
4949
description: Dockerfile platform used
50-
default: "ubuntu_2204"
50+
default: "ubuntu_2404"
5151
TUTORIALS_REF:
5252
description: Tutorial git reference to use
5353
default: "master"
@@ -72,7 +72,7 @@ fenics-adapter:
7272
default: "production-audit"
7373
PLATFORM:
7474
description: Dockerfile platform used
75-
default: "ubuntu_2204"
75+
default: "ubuntu_2404"
7676
TUTORIALS_REF:
7777
description: Tutorial git reference to use
7878
default: "master"
@@ -95,7 +95,7 @@ nutils-adapter:
9595
default: "production-audit"
9696
PLATFORM:
9797
description: Dockerfile platform used
98-
default: "ubuntu_2204"
98+
default: "ubuntu_2404"
9999
TUTORIALS_REF:
100100
description: Tutorial git reference to use
101101
default: "master"
@@ -115,7 +115,7 @@ calculix-adapter:
115115
default: "production-audit"
116116
PLATFORM:
117117
description: Dockerfile platform used
118-
default: "ubuntu_2204"
118+
default: "ubuntu_2404"
119119
TUTORIALS_REF:
120120
description: Tutorial git reference to use
121121
default: "master"
@@ -138,7 +138,7 @@ su2-adapter:
138138
default: "production-audit"
139139
PLATFORM:
140140
description: Dockerfile platform used
141-
default: "ubuntu_2204"
141+
default: "ubuntu_2404"
142142
TUTORIALS_REF:
143143
description: Tutorial git reference to use
144144
default: "master"
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
FROM ubuntu:24.04 as base_image
2+
USER root
3+
SHELL ["/bin/bash", "-c"]
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
# We set a sensical value, but still have the possibilty to influence this via the build time arguments.
6+
# When the dockerfile is built using the systemtests.py we set the PRECICE_UID and PRECICE_GID to the user executing the systemtests.
7+
# This ensures no file ownership problems down the line and is the most easy fix, as we normally built the containers locally
8+
# If not built via the systemtests.py its either possible to specify manually but 1000 would be the default anyway.
9+
ARG PRECICE_UID=1000
10+
ARG PRECICE_GID=1000
11+
RUN groupadd -g ${PRECICE_GID} precice && useradd -u ${PRECICE_UID} -g ${PRECICE_GID} -ms /bin/bash precice
12+
ENV PATH="${PATH}:/home/precice/.local/bin"
13+
ENV LD_LIBRARY_PATH="/home/precice/.local/lib:${LD_LIBRARY_PATH}"
14+
ENV CPATH="/home/precice/.local/include:$CPATH"
15+
# Enable detection with pkg-config and CMake
16+
ENV PKG_CONFIG_PATH="/home/precice/.local/lib/pkgconfig:$PKG_CONFIG_PATH"
17+
ENV CMAKE_PREFIX_PATH="/home/precice/.local:$CMAKE_PREFIX_PATH"
18+
USER precice
19+
20+
FROM base_image as precice_dependecies
21+
USER root
22+
# Installing necessary dependecies for preCICE
23+
RUN apt-get -qq update && \
24+
apt-get -qq -y install \
25+
build-essential \
26+
software-properties-common \
27+
cmake \
28+
curl \
29+
g++ \
30+
gfortran \
31+
git \
32+
libbenchmark-dev \
33+
libboost-all-dev \
34+
libeigen3-dev \
35+
libxml2-dev \
36+
lsb-release \
37+
petsc-dev \
38+
python3-dev \
39+
python3-numpy \
40+
python3-pip \
41+
python3-venv \
42+
pkg-config \
43+
wget
44+
USER precice
45+
RUN python3 -m pip install --upgrade pip
46+
47+
48+
FROM precice_dependecies as precice
49+
# Install & build precice into /home/precice/precice
50+
ARG PRECICE_REF
51+
ARG PRECICE_PRESET
52+
USER precice
53+
WORKDIR /home/precice
54+
RUN git clone https://github.com/precice/precice.git precice && \
55+
cd precice && \
56+
git checkout ${PRECICE_REF} && \
57+
mkdir build && cd build &&\
58+
cmake .. --preset=${PRECICE_PRESET} -DCMAKE_INSTALL_PREFIX=/home/precice/.local/ -DPRECICE_PETScMapping=OFF -DBUILD_TESTING=OFF && \
59+
make all install -j $(nproc)
60+
61+
FROM precice_dependecies as openfoam_adapter
62+
ARG OPENFOAM_EXECUTABLE
63+
USER root
64+
RUN apt-get update &&\
65+
wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | bash &&\
66+
apt-get -qq install ${OPENFOAM_EXECUTABLE}-dev &&\
67+
ln -s $(which ${OPENFOAM_EXECUTABLE} ) /usr/bin/openfoam
68+
USER precice
69+
COPY --from=precice /home/precice/.local/ /home/precice/.local/
70+
ARG OPENFOAM_ADAPTER_REF
71+
# Build the OpenFOAM adapter
72+
USER precice
73+
WORKDIR /home/precice
74+
RUN git clone https://github.com/precice/openfoam-adapter.git &&\
75+
cd openfoam-adapter && \
76+
git checkout ${OPENFOAM_ADAPTER_REF} && \
77+
/usr/bin/${OPENFOAM_EXECUTABLE} ./Allwmake -j $(nproc)
78+
79+
80+
FROM precice_dependecies as python_bindings
81+
COPY --from=precice /home/precice/.local/ /home/precice/.local/
82+
ARG PYTHON_BINDINGS_REF
83+
USER precice
84+
WORKDIR /home/precice
85+
# Builds the precice python bindings for python3
86+
# Installs also matplotlib as its needed for the elastic-tube 1d fluid-python participant.
87+
RUN python3 -m venv /home/precice/venv && \
88+
. /home/precice/venv/bin/activate && \
89+
pip3 install git+https://github.com/precice/python-bindings.git@${PYTHON_BINDINGS_REF} && \
90+
pip3 install matplotlib
91+
92+
FROM precice_dependecies as fenics_adapter
93+
COPY --from=python_bindings /home/precice/.local /home/precice/.local
94+
USER root
95+
RUN add-apt-repository -y ppa:fenics-packages/fenics && \
96+
apt-get -qq update && \
97+
apt-get -qq install --no-install-recommends fenics
98+
USER precice
99+
ARG FENICS_ADAPTER_REF
100+
# Building fenics-adapter
101+
RUN python3 -m venv /home/precice/venv && \
102+
. /home/precice/venv/bin/activate && \
103+
pip3 install git+https://github.com/precice/fenics-adapter.git@${FENICS_ADAPTER_REF}
104+
105+
106+
FROM precice_dependecies as nutils_adapter
107+
COPY --from=python_bindings /home/precice/.local /home/precice/.local
108+
USER precice
109+
# Installing nutils - There is no adapter
110+
RUN python3 -m venv /home/precice/venv && \
111+
. /home/precice/venv/bin/activate && \
112+
pip3 install nutils
113+
114+
115+
FROM precice_dependecies as calculix_adapter
116+
COPY --from=precice /home/precice/.local /home/precice/.local
117+
USER root
118+
RUN apt-get -qq update && \
119+
apt-get -qq install libarpack2-dev libspooles-dev libyaml-cpp-dev
120+
ARG CALCULIX_VERSION
121+
USER precice
122+
#Download Calculix
123+
WORKDIR /home/precice
124+
RUN wget http://www.dhondt.de/ccx_${CALCULIX_VERSION}.src.tar.bz2 && \
125+
tar xvjf ccx_${CALCULIX_VERSION}.src.tar.bz2 && \
126+
rm -fv ccx_${CALCULIX_VERSION}.src.tar.bz2
127+
128+
ARG CALCULIX_ADAPTER_REF
129+
WORKDIR /home/precice
130+
RUN git clone https://github.com/precice/calculix-adapter.git && \
131+
cd calculix-adapter && \
132+
git checkout ${CALCULIX_ADAPTER_REF} &&\
133+
make CXX_VERSION=${CALCULIX_VERSION} ADDITIONAL_FFLAGS="-fallow-argument-mismatch" -j $(nproc) && \
134+
ln -s /home/precice/calculix-adapter/bin/ccx_preCICE /home/precice/.local/bin/ccx_preCICE
135+
136+
FROM python_bindings as su2_adapter
137+
COPY --from=precice /home/precice/.local /home/precice/.local
138+
USER root
139+
RUN apt-get -qq update && \
140+
apt-get -qq install swig
141+
ARG SU2_VERSION
142+
USER precice
143+
144+
# Download and build SU2 (We could also use pre-built binaries from the SU2 releases)
145+
WORKDIR /home/precice
146+
RUN wget https://github.com/su2code/SU2/archive/refs/tags/v${SU2_VERSION}.tar.gz && \
147+
tar xvzf v${SU2_VERSION}.tar.gz && \
148+
rm -fv v${SU2_VERSION}.tar.gz
149+
RUN python3 -m venv /home/precice/venv && \
150+
. /home/precice/venv/bin/activate && \
151+
pip3 install mpi4py
152+
ARG SU2_ADAPTER_REF
153+
WORKDIR /home/precice
154+
ENV SU2_RUN="/home/precice/SU2_RUN"
155+
ENV SU2_HOME="/home/precice/SU2-${SU2_VERSION}"
156+
ENV PATH="/home/precice/su2-adapter/run:$SU2_RUN:$PATH"
157+
ENV PYTHONPATH="$SU2_RUN:$PYTHONPATH"
158+
RUN git clone https://github.com/precice/su2-adapter.git && \
159+
cd su2-adapter &&\
160+
git checkout ${SU2_ADAPTER_REF} &&\
161+
./su2AdapterInstall
162+
RUN cd "${SU2_HOME}" &&\
163+
./meson.py build -Denable-pywrapper=true --prefix=$SU2_RUN &&\
164+
./ninja -C build install

tools/tests/reference_versions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ OPENFOAM_ADAPTER_REF: "v1.3.1"
55
PYTHON_BINDINGS_REF: "v3.1.2"
66
FENICS_ADAPTER_REF: "v2.2.0"
77
TUTORIALS_REF: "f5ecfb3" # develop, February 18, 2025
8-
PLATFORM: "ubuntu_2204"
8+
PLATFORM: "ubuntu_2404"
99
CALCULIX_VERSION: "2.20"
1010
CALCULIX_ADAPTER_REF: "v2.20.1"
1111
SU2_VERSION: "7.5.1"

0 commit comments

Comments
 (0)