Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have one Dockerfile instead of multiples #364

Merged
merged 19 commits into from
Sep 5, 2023
Merged

Conversation

valentin-seitz
Copy link
Member

@valentin-seitz valentin-seitz commented Aug 13, 2023

As discussed in precice/precice#1700 this PR introduces a small, but working protoype of the ansatz described in precice/precice#1700 using just one Dockerfile

To execute the test use python systemtests.py --suites=openfoam-adapter-release
or python systemtests.py --suites=calculix_test

It currently supports the following adapters:

  • fenics
  • nutils
  • openfoam
  • calculix

But this approach is more flexible as we can easily "install" a certain precice/precice version by using the PRECICE_REF build argument without the need of publishing a tag to a docker registry first.

Copy link
Member

@MakisH MakisH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good generally, how/what should I test?

What is the problem with CalculiX? The steps look very similar to the VM provisioning script, which works: https://github.com/precice/vm/blob/develop/provisioning/install-calculix.sh

I guess you probably stumbled upon the GCC-related issue, since you are basing on Ubuntu 22.04, and the VM on 20.04: https://precice.org/adapter-calculix-get-adapter.html#compiling-with-gcc-10-or-newer

Here is how we solve this when preparing Debian packages: https://github.com/precice/calculix-adapter/blob/9057470c6b7018a28895c24c964f65364a7fbd04/.github/workflows/ubuntu_build.yml#L16

tools/tests/dockerfiles/Dockerfile Outdated Show resolved Hide resolved
tools/tests/dockerfiles/Dockerfile Outdated Show resolved Hide resolved
tools/tests/dockerfiles/Dockerfile Outdated Show resolved Hide resolved
tools/tests/dockerfiles/Dockerfile Outdated Show resolved Hide resolved
tools/tests/dockerfiles/Dockerfile Outdated Show resolved Hide resolved
@MakisH
Copy link
Member

MakisH commented Aug 14, 2023

Closes precice/openfoam-adapter#184

Valentin Seitz added 4 commits August 15, 2023 20:56
- refactored into exceptions instead of exit(1)
-
- Added Calculix
- Added reference results for some cases
- Added heat exchanger tutorial
- Added logging and more verbose output
- Added timing output
@valentin-seitz valentin-seitz marked this pull request as ready for review August 28, 2023 22:36
@valentin-seitz
Copy link
Member Author

@MakisH if you could maybe have a quick look if it also runs smoothly on your machine?

Mainly python systemtests.py --suites=calculix_test
and maybe python systemtests.py --suites=fenics_test

Copy link
Member

@MakisH MakisH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MakisH if you could maybe have a quick look if it also runs smoothly on your machine?

Mainly python systemtests.py --suites=calculix_test and maybe python systemtests.py --suites=fenics_test

The calculix_test seems to be a false negative (it fails after a long time, but it seems to work actually):

~/repos/precice/tutorials [chonky-dockerfile]$ python tools/tests/systemtests.py --suites=calculix_test
Using log-level: INFO
INFO: About to run the following systemtest in the directory /home/gc/repos/precice/tutorials/runs:
 [Perpendicular flap (fluid-openfoam, solid-calculix)]
INFO: Started running Perpendicular flap (fluid-openfoam, solid-calculix),  0/1
CRITICAL: Systemtest Perpendicular flap (fluid-openfoam, solid-calculix) had serious issues executin the docker compose command about to kill the docker compose command. Please check the logs! Command '['docker', 'compose', '--file', 'docker-compose.tutorial.yaml', 'up', '--build']' timed out after 360 seconds
CRITICAL: Docker Compose failed, skipping fieldcompare and writing stdout.log and stderr.log
INFO: Running Perpendicular flap (fluid-openfoam, solid-calculix) took 925.802237306998 seconds
ERROR: Failed to run Perpendicular flap (fluid-openfoam, solid-calculix)

even though the run completes and both solvers exit with zero:

stderr.log
stdout.log

The fenics_test succeeded:

~/repos/precice/tutorials [chonky-dockerfile]$ python tools/tests/systemtests.py --suites=fenics_test
Using log-level: INFO
INFO: About to run the following systemtest in the directory /home/gc/repos/precice/tutorials/runs:
 [Flow over heated plate (fluid-openfoam, solid-fenics)]
INFO: Started running Flow over heated plate (fluid-openfoam, solid-fenics),  0/1
INFO: Running Flow over heated plate (fluid-openfoam, solid-fenics) took 269.88722395299556 seconds
INFO: Success running Flow over heated plate (fluid-openfoam, solid-fenics)

However, in contrast to the failed case, I don't see any stderr.log and stdout.log files in the archive. These would always be useful (to check that indeed the test did what it was supposed to), especially since we now only print the overview.

tools/tests/components.yaml Outdated Show resolved Hide resolved
flow-over-heated-plate/reference_results.md Outdated Show resolved Hide resolved
tools/tests/dockerfiles/ubuntu_2204/Dockerfile Outdated Show resolved Hide resolved
tools/tests/dockerfiles/ubuntu_2204/Dockerfile Outdated Show resolved Hide resolved
Valentin Seitz and others added 7 commits September 4, 2023 21:32
- fallow-arguments vs std-legacy
- no nutils adapter, just install nutils
- generate new reference results
Co-authored-by: Gerasimos Chourdakis <chourdak@in.tum.de>
@valentin-seitz
Copy link
Member Author

The calculix_test seems to be a false negative (it fails after a long time, but it seems to work actually):

Yes and no :)
The script will also fail once it times out. Since you probably had to built the calculix image from scratch it probably timed out.
The newest version of the systemtests addresses it such that the actual solver time is the one that has a timeout as a deadlock is way more common there. (if one participant segfaults etc)

However, in contrast to the failed case, I don't see any stderr.log and stdout.log files in the archive. These would always be useful (to check that indeed the test did what it was supposed to), especially since we now only print the overview.

Is added, we now write always the logs into the .log files

@valentin-seitz valentin-seitz merged commit 0cd624e into develop Sep 5, 2023
5 checks passed
@valentin-seitz valentin-seitz deleted the chonky-dockerfile branch September 5, 2023 07:23
@MakisH
Copy link
Member

MakisH commented Sep 5, 2023

Works now, great job!

~/repos/precice/tutorials/tools/tests [develop]$ python systemtests.py --suites=calculix_test
Using log-level: INFO
INFO: About to run the following systemtest in the directory /home/gc/repos/precice/tutorials/runs:
 [Perpendicular flap (fluid-openfoam, solid-calculix)]
INFO: Started running Perpendicular flap (fluid-openfoam, solid-calculix),  0/1
INFO: Running Perpendicular flap (fluid-openfoam, solid-calculix) took 191.29625335900005 seconds
INFO: Success running Perpendicular flap (fluid-openfoam, solid-calculix)
+-------------------------------------------------------+---------+-------------------+-----------------+-----------------------+
| systemtest                                            | success | building time [s] | solver time [s] | fieldcompare time [s] |
+-------------------------------------------------------+---------+-------------------+-----------------+-----------------------+
| Perpendicular flap (fluid-openfoam, solid-calculix)   |    1    |       71.39       |     104.51      |         15.22         |
+-------------------------------------------------------+---------+-------------------+-----------------+-----------------------+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants