Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog-entries/731.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Added heat-exchanger-simplified to system tests: new standalone suite `heat_exchanger_simplified_test` and included in `release_test`. Fixed Docker compatibility for Ubuntu 24.04 (default ubuntu user removal with home dir cleanup, docker compose/docker-compose detection, ARG defaults for all adapter refs, wget retries for CalculiX and SU2 downloads).
Empty file.
13 changes: 8 additions & 5 deletions tools/tests/components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ python-bindings:
description: Tutorial git reference to use
default: "master"
PYTHON_BINDINGS_REF:
semnantic: Git ref of the Python bindings to use
description: Git ref of the Python bindings to use
default: "master"

openfoam-adapter:
Expand Down Expand Up @@ -75,10 +75,10 @@ fenics-adapter:
description: Tutorial git reference to use
default: "master"
PYTHON_BINDINGS_REF:
semnantic: Git ref of the Python bindings to use
description: Git ref of the Python bindings to use
default: "master"
FENICS_ADAPTER_REF:
semnantic: Git ref of the fenics adapter to use
description: Git ref of the fenics adapter to use
default: "master"

nutils-adapter:
Expand All @@ -98,7 +98,7 @@ nutils-adapter:
description: Tutorial git reference to use
default: "master"
PYTHON_BINDINGS_REF:
semnantic: Git ref of the Python bindings to use
description: Git ref of the Python bindings to use
default: "master"

calculix-adapter:
Expand All @@ -123,6 +123,9 @@ calculix-adapter:
CALCULIX_ADAPTER_REF:
description: Version of Calculix-Adapter to use
default: "master"
PYTHON_BINDINGS_REF:
description: Git ref of the Python bindings to use
default: "master"

su2-adapter:
repository: https://github.com/precice/su2-adapter
Expand Down Expand Up @@ -190,7 +193,7 @@ dumux-adapter:
description: Version of DuMux to use
default: "3.7"
DUMUX_ADAPTER_REF:
semnantic: Git ref of the dumux adapter to use
description: Git ref of the dumux adapter to use
default: "main"

micro-manager:
Expand Down
67 changes: 12 additions & 55 deletions tools/tests/dockerfiles/ubuntu_2404/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ FROM ubuntu:24.04 AS base_image
USER root
SHELL ["/bin/bash", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
# We set a sensical value, but still have the possibilty to influence this via the build time arguments.
# We set a sensical value, but still have the possibilty to influence this via the build time arguments.
# When the dockerfile is built using the systemtests.py we set the PRECICE_UID and PRECICE_GID to the user executing the systemtests.
# This ensures no file ownership problems down the line and is the most easy fix, as we normally built the containers locally
# If not built via the systemtests.py its either possible to specify manually but 1000 would be the default anyway.
ARG PRECICE_UID=1000
ARG PRECICE_GID=1000
RUN groupadd -g ${PRECICE_GID} precice && useradd -u ${PRECICE_UID} -g ${PRECICE_GID} -ms /bin/bash precice
# Ubuntu 24.04+ images include a default user "ubuntu" with UID/GID 1000; remove it so we can create "precice" with the same UID/GID.
RUN userdel -r ubuntu 2>/dev/null || true; groupdel ubuntu 2>/dev/null || true; \
groupadd -g ${PRECICE_GID} precice && useradd -u ${PRECICE_UID} -g ${PRECICE_GID} -ms /bin/bash precice
ENV PATH="${PATH}:/home/precice/.local/bin"
ENV LD_LIBRARY_PATH="/home/precice/.local/lib:${LD_LIBRARY_PATH}"
ENV CPATH="/home/precice/.local/include:$CPATH"
Expand Down Expand Up @@ -70,7 +72,7 @@ RUN apt-get update &&\
USER precice
COPY --from=precice /home/precice/.local/ /home/precice/.local/
ARG OPENFOAM_ADAPTER_PR
ARG OPENFOAM_ADAPTER_REF
ARG OPENFOAM_ADAPTER_REF=master
# Build the OpenFOAM adapter
USER precice
WORKDIR /home/precice
Expand All @@ -83,7 +85,7 @@ RUN git clone https://github.com/precice/openfoam-adapter.git &&\

FROM precice_dependecies AS python_bindings
COPY --from=precice /home/precice/.local/ /home/precice/.local/
ARG PYTHON_BINDINGS_REF
ARG PYTHON_BINDINGS_REF=master
USER precice
WORKDIR /home/precice
# Builds the precice python bindings for python3
Expand All @@ -100,7 +102,7 @@ RUN add-apt-repository -y ppa:fenics-packages/fenics && \
apt-get -qq update && \
apt-get -qq install --no-install-recommends fenics
USER precice
ARG FENICS_ADAPTER_REF
ARG FENICS_ADAPTER_REF=master
# Building fenics-adapter
RUN python3 -m venv --system-site-packages /home/precice/venv && \
. /home/precice/venv/bin/activate && \
Expand All @@ -125,12 +127,12 @@ ARG CALCULIX_VERSION
USER precice
#Download Calculix
WORKDIR /home/precice
RUN wget http://www.dhondt.de/ccx_${CALCULIX_VERSION}.src.tar.bz2 && \
RUN wget --tries=3 --retry-connrefused --timeout=30 http://www.dhondt.de/ccx_${CALCULIX_VERSION}.src.tar.bz2 && \
tar xvjf ccx_${CALCULIX_VERSION}.src.tar.bz2 && \
rm -fv ccx_${CALCULIX_VERSION}.src.tar.bz2

ARG CALCULIX_ADAPTER_PR
ARG CALCULIX_ADAPTER_REF
ARG CALCULIX_ADAPTER_REF=master
WORKDIR /home/precice
RUN git clone https://github.com/precice/calculix-adapter.git && \
cd calculix-adapter && \
Expand All @@ -150,13 +152,13 @@ USER precice
# Download and build SU2 (We could also use pre-built binaries from the SU2 releases)
# The sed command applies a patch needed for Ubuntu 24.04.
WORKDIR /home/precice
RUN wget https://github.com/su2code/SU2/archive/refs/tags/v${SU2_VERSION}.tar.gz && \
RUN wget --tries=3 --retry-connrefused --timeout=30 https://github.com/su2code/SU2/archive/refs/tags/v${SU2_VERSION}.tar.gz && \
tar xvzf v${SU2_VERSION}.tar.gz && \
rm -fv v${SU2_VERSION}.tar.gz
RUN python3 -m venv /home/precice/venv && \
. /home/precice/venv/bin/activate
ARG SU2_ADAPTER_PR
ARG SU2_ADAPTER_REF
ARG SU2_ADAPTER_REF=master
WORKDIR /home/precice
ENV SU2_RUN="/home/precice/SU2_RUN"
ENV SU2_HOME="/home/precice/SU2-${SU2_VERSION}"
Expand All @@ -179,7 +181,7 @@ RUN apt-get update &&\
USER precice
COPY --from=precice /home/precice/.local/ /home/precice/.local/
ARG DEALII_ADAPTER_PR
ARG DEALII_ADAPTER_REF
ARG DEALII_ADAPTER_REF=master
# Build the deal.II adapter
USER precice
WORKDIR /home/precice
Expand All @@ -190,48 +192,3 @@ RUN git clone https://github.com/precice/dealii-adapter.git &&\
git checkout ${DEALII_ADAPTER_REF} && \
cmake . && \
make -j $(nproc)


FROM precice_dependecies AS micro_manager
USER precice
WORKDIR /home/precice
COPY --from=precice /home/precice/.local/ /home/precice/.local/

ARG MICRO_MANAGER_VERSION
RUN python3 -m venv /home/precice/venv && \
. /home/precice/venv/bin/activate && \
git clone https://github.com/precice/micro-manager.git && \
cd micro-manager && \
git checkout ${MICRO_MANAGER_VERSION} && \
pip3 install .

FROM micro_manager AS dumux_adapter
USER root
COPY --from=precice /home/precice/.local/ /home/precice/.local/
ARG DUNE_VERSION
ARG DUMUX_VERSION
USER precice
WORKDIR /home/precice
RUN mkdir dumux&&\
cd dumux&&\
git clone --depth 1 https://gitlab.dune-project.org/core/dune-common.git -b releases/${DUNE_VERSION} &&\
git clone --depth 1 https://gitlab.dune-project.org/core/dune-geometry.git -b releases/${DUNE_VERSION} &&\
git clone --depth 1 https://gitlab.dune-project.org/core/dune-grid.git -b releases/${DUNE_VERSION} &&\
git clone --depth 1 https://gitlab.dune-project.org/core/dune-istl.git -b releases/${DUNE_VERSION} &&\
git clone --depth 1 https://gitlab.dune-project.org/extensions/dune-subgrid.git -b releases/${DUNE_VERSION} &&\
git clone --depth 1 https://git.iws.uni-stuttgart.de/dumux-repositories/dumux.git -b releases/${DUMUX_VERSION} &&\
git clone -b cell_problems https://git.iws.uni-stuttgart.de/dumux-appl/dumux-phasefield.git &&\
git clone --depth 1 https://gitlab.dune-project.org/extensions/dune-SPGrid.git -b releases/${DUNE_VERSION} &&\
git clone --depth 1 https://gitlab.dune-project.org/core/dune-localfunctions.git -b releases/${DUNE_VERSION}
WORKDIR /home/precice/dumux
ENV PATH="/home/precice/dumux/dune-common/bin:${PATH}"
# build core DUNE, DuMuX and the adapter
ARG DUMUX_ADAPTER_PR
ARG DUMUX_ADAPTER_REF
RUN git clone https://github.com/precice/dumux-adapter.git &&\
cd dumux-adapter && \
if [ -n "${DUMUX_ADAPTER_PR}" ]; then git fetch origin pull/${DUMUX_ADAPTER_PR}/head; fi && \
git checkout ${DUMUX_ADAPTER_REF} && \
cd .. &&\
./dune-common/bin/dunecontrol --opts=./dumux/cmake.opts cmake &&\
./dune-common/bin/dunecontrol make -j $(nproc)
67 changes: 46 additions & 21 deletions tools/tests/systemtests/Systemtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,37 @@
import os


GLOBAL_TIMEOUT = 900
BUILD_TIMEOUT = 900
SHORT_TIMEOUT = 10


# Cached result of docker compose command detection
_DOCKER_COMPOSE_CMD = None


def _get_docker_compose_cmd():
"""Return the docker compose command list: ['docker', 'compose'] or ['docker-compose']."""
global _DOCKER_COMPOSE_CMD
if _DOCKER_COMPOSE_CMD is not None:
return _DOCKER_COMPOSE_CMD
try:
subprocess.run(
['docker', 'compose', 'version'],
capture_output=True, timeout=5, check=True,
)
_DOCKER_COMPOSE_CMD = ['docker', 'compose']
except (subprocess.CalledProcessError, FileNotFoundError, subprocess.TimeoutExpired):
try:
subprocess.run(
['docker-compose', 'version'],
capture_output=True, timeout=5, check=True,
)
_DOCKER_COMPOSE_CMD = ['docker-compose']
except (subprocess.CalledProcessError, FileNotFoundError, subprocess.TimeoutExpired):
_DOCKER_COMPOSE_CMD = ['docker', 'compose'] # default; will fail with clear error
return _DOCKER_COMPOSE_CMD


def slugify(value, allow_unicode=False):
"""
Taken from https://github.com/django/django/blob/master/django/utils/text.py
Expand Down Expand Up @@ -381,20 +408,18 @@ def _run_field_compare(self):
file.write(docker_compose_content)
try:
# Execute docker-compose command
process = subprocess.Popen(['docker',
'compose',
'--file',
'docker-compose.field_compare.yaml',
'up',
'--exit-code-from',
'field-compare'],
cmd = _get_docker_compose_cmd() + [
'--file', 'docker-compose.field_compare.yaml',
'up', '--exit-code-from', 'field-compare'
]
process = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
start_new_session=True,
cwd=self.system_test_dir)

try:
stdout, stderr = process.communicate(timeout=GLOBAL_TIMEOUT)
stdout, stderr = process.communicate(timeout=self.timeout)
except KeyboardInterrupt as k:
process.kill()
raise KeyboardInterrupt from k
Expand Down Expand Up @@ -428,18 +453,18 @@ def _build_docker(self):

try:
# Execute docker-compose command
process = subprocess.Popen(['docker',
'compose',
'--file',
'docker-compose.tutorial.yaml',
'build'],
cmd = _get_docker_compose_cmd() + [
'--file', 'docker-compose.tutorial.yaml',
'build'
]
process = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
start_new_session=True,
cwd=self.system_test_dir)

try:
stdout, stderr = process.communicate(timeout=GLOBAL_TIMEOUT)
stdout, stderr = process.communicate(timeout=BUILD_TIMEOUT)
except KeyboardInterrupt as k:
process.kill()
# process.send_signal(9)
Expand Down Expand Up @@ -472,18 +497,18 @@ def _run_tutorial(self):
stderr_data = []
try:
# Execute docker-compose command
process = subprocess.Popen(['docker',
'compose',
'--file',
'docker-compose.tutorial.yaml',
'up'],
cmd = _get_docker_compose_cmd() + [
'--file', 'docker-compose.tutorial.yaml',
'up'
]
process = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
start_new_session=True,
cwd=self.system_test_dir)

try:
stdout, stderr = process.communicate(timeout=GLOBAL_TIMEOUT)
stdout, stderr = process.communicate(timeout=self.timeout)
except KeyboardInterrupt as k:
process.kill()
# process.send_signal(9)
Expand Down
14 changes: 14 additions & 0 deletions tools/tests/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,17 @@ test_suites:
- solid-upstream-dealii
- solid-downstream-dealii
reference_result: ./perpendicular-flap/reference-results/fluid-openfoam_solid-upstream-dealii_solid-downstream-dealii.tar.gz
- path: heat-exchanger-simplified
case_combination:
- fluid-top-openfoam
- fluid-btm-openfoam
- solid-calculix
reference_result: ./heat-exchanger-simplified/reference-results/fluid-top-openfoam_fluid-btm-openfoam_solid-calculix.tar.gz
heat_exchanger_simplified_test:
tutorials:
- path: heat-exchanger-simplified
case_combination:
- fluid-top-openfoam
- fluid-btm-openfoam
- solid-calculix
reference_result: ./heat-exchanger-simplified/reference-results/fluid-top-openfoam_fluid-btm-openfoam_solid-calculix.tar.gz