systemtests: add heat-exchanger-simplified test suite#731
systemtests: add heat-exchanger-simplified test suite#731AdityaGupta716 wants to merge 1 commit intoprecice:developfrom
Conversation
|
This pull request has been mentioned on preCICE Forum on Discourse. There might be relevant details there: https://precice.discourse.group/t/gsoc-2026-aditya-gupta/2773/2 |
e576056 to
e0727cb
Compare
|
@MakisH plz review! |
MakisH
left a comment
There was a problem hiding this comment.
Thanks for the detailed PR. Some interesting ideas here, but a PR implementing so many ideas at once cannot really be reviewed/merged. I would suggest restricting it to the most important ones that make sense to include as one PR, and delegate the rest to issues and other PRs.
Fine to keep this open for now to discuss which of these ideas would make sense to port to other PRs and how.
There was a problem hiding this comment.
This is difficult to review as-is, because of the many changes in one PR, which is also clear from the five entries in this file. I would split this into one PR per work package. All of them sound useful, but should not be in one PR.
There was a problem hiding this comment.
I've stripped the PR down accordingly , All other changes will be moved to separate issues/PRs.
There was a problem hiding this comment.
The reference results are not meant to be added by the contributor - we have a GitHub Actions workflow for that, which maintainers can trigger. This is also important since we compare floating-point values, which might change based on the system.
There was a problem hiding this comment.
Removed, will let the CI workflow handle reference result generation.
| # 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 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 |
There was a problem hiding this comment.
Interesting, but I would like to see some evidence/reference for the issue, or test it separately. A smaller PR just for this would be good.
| #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 --read-timeout=120 http://www.dhondt.de/ccx_${CALCULIX_VERSION}.src.tar.bz2 && \ |
There was a problem hiding this comment.
A --tries setting would also be useful for the wget of OpenFOAM. That one actually fails often.
The --retry-connrefused should not be needed: what should change if connection is refused? We are using publicly accessible files, one refuse should mean that the page has been moved.
What are you trying to achieve with the timeout? Increase it or decrease it? Why? Default value seems to be 900s.
There was a problem hiding this comment.
timeout=30 sets the connect timeout to 30s (to fail fast if the server is unreachable), while --read-timeout=120 gives 2 minutes for slow downloads to complete. The intent was to avoid the 900s default hanging the build for 15 minutes on a dead connection, while still allowing time for large files to transfer. You're right that --retry-connrefused doesn't make sense for public files will drop it. should i make the changes in this pr or open a seperate one ?
| BUILD_TIMEOUT = 1800 # builds include compilation + downloads; increased from upstream 900s to prevent timeouts on slow machines or networks | ||
| GLOBAL_TIMEOUT = 900 # timeout for solver runs and field comparison |
There was a problem hiding this comment.
Instead of increasing it globally (which would make the system tests on GitHub Actions exit later if something goes wrong), a better approach to deal with slower local builds would be a way to override this with an environment variable.
There was a problem hiding this comment.
Removed from this PR. Will address in #735 keeping GLOBAL_TIMEOUT as is (no rename), making it overridable via PRECICE_SYSTEMTEST_TIMEOUT environment variable as you suggested. The per-test timeout field in tests.yaml will default to GLOBAL_TIMEOUT instead of hardcoding a separate value.
| @functools.lru_cache(maxsize=1) | ||
| def _get_docker_compose_cmd(): | ||
| """Return the docker compose command list: ['docker', 'compose'] or ['docker-compose'].""" | ||
| try: | ||
| subprocess.run( | ||
| ['docker', 'compose', 'version'], | ||
| capture_output=True, timeout=5, check=True, | ||
| ) | ||
| return ['docker', 'compose'] | ||
| except (subprocess.CalledProcessError, FileNotFoundError, subprocess.TimeoutExpired): | ||
| try: | ||
| subprocess.run( | ||
| ['docker-compose', 'version'], | ||
| capture_output=True, timeout=5, check=True, | ||
| ) | ||
| return ['docker-compose'] | ||
| except (subprocess.CalledProcessError, FileNotFoundError, subprocess.TimeoutExpired): | ||
| logging.warning("Could not detect 'docker compose' or 'docker-compose'; defaulting to 'docker compose'. This will fail with a clear error if Docker is not available.") | ||
| return ['docker', 'compose'] | ||
|
|
||
|
|
There was a problem hiding this comment.
I would not add this, to keep the code shorter and simpler. Clearly documenting the requirement should be enough - this script is mainly meant to be used by specific users that first read the documentation or talk to someone.
I would rather have the script fail and then have the person talk to a maintainer, than automatically switching what it runs. That could hide issues down the line.
The official way nowadays is docker compose. We should just use that everywhere, as the script currently does. If that is not available, the solution should be to upgrade Docker.
There was a problem hiding this comment.
Agreed Better to let it fail so the user knows to upgrade Docker.Removed it
| # On macOS, GID may conflict with Ubuntu system groups (e.g. GID 20 = dialout). | ||
| # Fall back to 1000 if the GID is below 100 (system range in Ubuntu). | ||
| if gid < 100: | ||
| logging.warning(f"Host GID {gid} is in Ubuntu system range, using 1000 instead.") | ||
| gid = 1000 |
There was a problem hiding this comment.
I am not sure that I understand the issue, it should be in a separate PR/issue, with references on what the group numbers are in the related systems.
It's true that we have not tested this with macOS, so such issues would be useful, for developers that develop on macOS (we don't really have much experience there yet among maintainers).
There was a problem hiding this comment.
will do , removed it from this pr
tools/tests/components.yaml
Outdated
| default: "master" | ||
| PYTHON_BINDINGS_REF: | ||
| semnantic: Git ref of the Python bindings to use | ||
| description: Git ref of the Python bindings to use |
There was a problem hiding this comment.
Sounds like we don't even use this anywhere, so I would rather delete it (in another PR).
tools/tests/tests.yaml
Outdated
| - 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: |
There was a problem hiding this comment.
I was not aware of anchors in YAML, that can indeed be useful here.
Interesting to have individual tutorials as test cases, but I think this should be a stand-alone PR to add different tutorials as test cases.
43acd04 to
149f4f1
Compare
|
hi @MakisH thanks for the review i will check out everything and reply shortly currently a bit busy with viva in college will surely check out everything by tomorrow |
No hurry, I am the bottleneck here. Good luck with your viva! |
3539239 to
9205670
Compare
9205670 to
f4e5008
Compare
What this PR does
Adds
heat-exchanger-simplifiedto the system test suites intools/tests/tests.yamlas both a new standalone suiteheat_exchanger_simplified_testand as an entry in the existingrelease_testsuite.Also fixes several Docker and Ubuntu 24.04 compatibility issues that prevented local system test runs.
Changes
tests.yaml
heat_exchanger_simplified_teststandalone suite with case(fluid-top-openfoam, fluid-btm-openfoam, solid-calculix)release_testso it runs in release CISystemtest.py
_get_docker_compose_cmd()to auto-detectdocker composevsdocker-composedocker compose --filePopen calls to use the detection helper with-fDockerfile (ubuntu_2404)
userdel -r ubuntubefore creatingpreciceuser, removing the default Ubuntu 24.04 user including its home directory — cleaner fix for the UID/GID 1000 conflict=masterdefaults for all six adapter ARGs:OPENFOAM_ADAPTER_REF,PYTHON_BINDINGS_REF,FENICS_ADAPTER_REF,CALCULIX_ADAPTER_REF,SU2_ADAPTER_REF,DEALII_ADAPTER_REF--tries=3 --retry-connrefused --timeout=30to wget for both CalculiX and SU2 downloadscomponents.yaml
PYTHON_BINDINGS_REFto calculix-adapter build argsVerification
heat-exchanger-simplifiedhas a completemetadata.yamlwith all required participants and casesmetadata.yamlpython3 print_test_suites.py— bothheat_exchanger_simplified_testandrelease_testshow the new tutorialpython3 systemtests.py --suites=heat_exchanger_simplified_test --build_args=TUTORIALS_REF:develop— Docker images build and coupled run completes; fails only at field-comparison due to missing reference archive (expected)Notes on reference results
Reference results for heat-exchanger-simplified will need to be generated on a Linux machine via CI or
generate_reference_results.py. The.gitkeepplaceholder has been added toheat-exchanger-simplified/reference-results/.Checklist
changelog-entries/731.md