From 4fab16aafa4355e34b52f8494f60a705336ef629 Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Sat, 28 Feb 2026 20:00:25 +0530 Subject: [PATCH 1/5] systemtests: add heat-exchanger-simplified test suite Add heat-exchanger-simplified to the system test suites, covering the fluid-top-openfoam, fluid-btm-openfoam, solid-calculix case combination. --- changelog-entries/731.md | 1 + .../reference-results/.gitkeep | 0 tools/tests/components.yaml | 3 + .../tests/dockerfiles/ubuntu_2404/Dockerfile | 24 ++++---- tools/tests/systemtests/Systemtest.py | 61 +++++++++++++------ tools/tests/tests.yaml | 16 ++++- 6 files changed, 75 insertions(+), 30 deletions(-) create mode 100644 changelog-entries/731.md create mode 100644 heat-exchanger-simplified/reference-results/.gitkeep diff --git a/changelog-entries/731.md b/changelog-entries/731.md new file mode 100644 index 000000000..39fc2a45e --- /dev/null +++ b/changelog-entries/731.md @@ -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). diff --git a/heat-exchanger-simplified/reference-results/.gitkeep b/heat-exchanger-simplified/reference-results/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/tools/tests/components.yaml b/tools/tests/components.yaml index 35f5d1739..878120b01 100644 --- a/tools/tests/components.yaml +++ b/tools/tests/components.yaml @@ -117,6 +117,9 @@ calculix-adapter: TUTORIALS_REF: description: Tutorial git reference to use default: "master" + PYTHON_BINDINGS_REF: + description: Git ref of the Python bindings (required when shared Dockerfile builds python_bindings stage) + default: "master" CALCULIX_VERSION: description: Version of Calculix to use default: "2.20" diff --git a/tools/tests/dockerfiles/ubuntu_2404/Dockerfile b/tools/tests/dockerfiles/ubuntu_2404/Dockerfile index 8e067fbda..0d4ab2787 100644 --- a/tools/tests/dockerfiles/ubuntu_2404/Dockerfile +++ b/tools/tests/dockerfiles/ubuntu_2404/Dockerfile @@ -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" @@ -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 @@ -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 @@ -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 && \ @@ -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 && \ @@ -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}" @@ -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 @@ -189,4 +191,4 @@ RUN git clone https://github.com/precice/dealii-adapter.git &&\ if [ -n "${DEALII_ADAPTER_PR}" ]; then git fetch origin pull/${DEALII_ADAPTER_PR}/head; fi && \ git checkout ${DEALII_ADAPTER_REF} && \ cmake . && \ - make -j $(nproc) \ No newline at end of file + make -j $(nproc) diff --git a/tools/tests/systemtests/Systemtest.py b/tools/tests/systemtests/Systemtest.py index bfb1151cf..2758920a7 100644 --- a/tools/tests/systemtests/Systemtest.py +++ b/tools/tests/systemtests/Systemtest.py @@ -19,10 +19,37 @@ import os -GLOBAL_TIMEOUT = 600 +GLOBAL_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 @@ -381,13 +408,11 @@ 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() + [ + '-f', '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, @@ -428,11 +453,11 @@ 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() + [ + '-f', 'docker-compose.tutorial.yaml', + 'build' + ] + process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, start_new_session=True, @@ -472,11 +497,11 @@ 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() + [ + '-f', 'docker-compose.tutorial.yaml', + 'up' + ] + process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, start_new_session=True, diff --git a/tools/tests/tests.yaml b/tools/tests/tests.yaml index 30bfd6ba2..b31997581 100644 --- a/tools/tests/tests.yaml +++ b/tools/tests/tests.yaml @@ -128,4 +128,18 @@ test_suites: - fluid-openfoam - solid-upstream-dealii - solid-downstream-dealii - reference_result: ./perpendicular-flap/reference-results/fluid-openfoam_solid-upstream-dealii_solid-downstream-dealii.tar.gz \ No newline at end of file + 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 From e0727cbcbe03e1d8194aa63ed152ca8be107232b Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Fri, 6 Mar 2026 18:58:57 +0530 Subject: [PATCH 2/5] fix: use --file flag for docker compose consistency; fix semnantic typo in components.yaml --- tools/tests/components.yaml | 8 ++++---- tools/tests/systemtests/Systemtest.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/tests/components.yaml b/tools/tests/components.yaml index 878120b01..a1bf5b90a 100644 --- a/tools/tests/components.yaml +++ b/tools/tests/components.yaml @@ -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: @@ -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: @@ -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: diff --git a/tools/tests/systemtests/Systemtest.py b/tools/tests/systemtests/Systemtest.py index 2758920a7..fb5e82212 100644 --- a/tools/tests/systemtests/Systemtest.py +++ b/tools/tests/systemtests/Systemtest.py @@ -409,7 +409,7 @@ def _run_field_compare(self): try: # Execute docker-compose command cmd = _get_docker_compose_cmd() + [ - '-f', 'docker-compose.field_compare.yaml', + '--file', 'docker-compose.field_compare.yaml', 'up', '--exit-code-from', 'field-compare' ] process = subprocess.Popen(cmd, @@ -454,7 +454,7 @@ def _build_docker(self): try: # Execute docker-compose command cmd = _get_docker_compose_cmd() + [ - '-f', 'docker-compose.tutorial.yaml', + '--file', 'docker-compose.tutorial.yaml', 'build' ] process = subprocess.Popen(cmd, @@ -498,7 +498,7 @@ def _run_tutorial(self): try: # Execute docker-compose command cmd = _get_docker_compose_cmd() + [ - '-f', 'docker-compose.tutorial.yaml', + '--file', 'docker-compose.tutorial.yaml', 'up' ] process = subprocess.Popen(cmd, From 18126c2dda47bc581a497e99b28bf28960808d9c Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Sun, 8 Mar 2026 07:19:45 +0530 Subject: [PATCH 3/5] fix: remove PYTHON_BINDINGS_REF from calculix-adapter component (not used by calculix_adapter Dockerfile stage) --- tools/tests/components.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/tests/components.yaml b/tools/tests/components.yaml index 5cfe2f696..0d878d8c5 100644 --- a/tools/tests/components.yaml +++ b/tools/tests/components.yaml @@ -117,9 +117,6 @@ calculix-adapter: TUTORIALS_REF: description: Tutorial git reference to use default: "master" - PYTHON_BINDINGS_REF: - description: Git ref of the Python bindings (required when shared Dockerfile builds python_bindings stage) - default: "master" CALCULIX_VERSION: description: Version of Calculix to use default: "2.20" From ca0a6a29a0276587a54c363122f7d6a003f69336 Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Sun, 8 Mar 2026 20:59:53 +0530 Subject: [PATCH 4/5] systemtests: add PYTHON_BINDINGS_REF to calculix-adapter build args --- tools/tests/components.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/tests/components.yaml b/tools/tests/components.yaml index 0d878d8c5..4806c20f8 100644 --- a/tools/tests/components.yaml +++ b/tools/tests/components.yaml @@ -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 From 9275c10f183bd42a8462f49adfd976e7ac874956 Mon Sep 17 00:00:00 2001 From: AdityaGupta716 Date: Sun, 15 Mar 2026 16:16:58 +0530 Subject: [PATCH 5/5] fix: align timeout constants with add-timeout-support; fix semnantic typo --- tools/tests/components.yaml | 2 +- tools/tests/systemtests/Systemtest.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/tests/components.yaml b/tools/tests/components.yaml index 4806c20f8..0e664eb67 100644 --- a/tools/tests/components.yaml +++ b/tools/tests/components.yaml @@ -193,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: diff --git a/tools/tests/systemtests/Systemtest.py b/tools/tests/systemtests/Systemtest.py index fb5e82212..f2bfe612b 100644 --- a/tools/tests/systemtests/Systemtest.py +++ b/tools/tests/systemtests/Systemtest.py @@ -19,7 +19,7 @@ import os -GLOBAL_TIMEOUT = 900 +BUILD_TIMEOUT = 900 SHORT_TIMEOUT = 10 @@ -419,7 +419,7 @@ def _run_field_compare(self): 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 @@ -464,7 +464,7 @@ def _build_docker(self): 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) @@ -508,7 +508,7 @@ def _run_tutorial(self): 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)