-
Notifications
You must be signed in to change notification settings - Fork 6
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
Initial implementation of Linux support. #71
Conversation
c9a231f
to
ac4b4f1
Compare
ac4b4f1
to
cc45f0b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is exciting :) ... I really look forward to being able to use mikeio1d with linux soon. It'll simplify installing some of the optional dependencies (like geopandas), as well as allow things like devcontainers.
These are my main comments:
- Should we add MacOS at the same time? I also wondered about testing a few other linux distros, but it seems github actions only includes ubuntu as convenience.
- I think we should include some high-level end-to-end tests that show expected results are returned regardless of the OS. These could compare all timeseries results for a few different files to what is expected. We could mark these as 'slow' tests that are only run when merging into main.
I don't think that https://www.nuget.org/packages/DHI.MikeCore.Linux.rhel7 will work on Mac OS, but I am happy to be proven wrong🙂. |
.github/workflows/full_test.yml
Outdated
@@ -26,7 +27,7 @@ jobs: | |||
- name: Set up .NET | |||
uses: actions/setup-dotnet@v3 | |||
with: | |||
dotnet-version: '5.0' | |||
dotnet-version: '3.1.x' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.NET 3.1 reached end-of-life in 2022😳
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the runtime.json we get when building MIKE 1D has this version set. I kept the things simple and did not fiddle around with it yet. For netstandard dlls which we use in MIKE IO 1D it should not be relevant. In principle it is possible to specify several runtimes as per
https://github.com/dotnet/sdk/blob/main/documentation/specs/runtime-configuration-file.md
We would need to check how Python.NET handles it, etc. Feel free to experiment, maybe everything works out of the box :-). I just set this version, because it was certain that it will work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ecomodeller I updated the runtimeconfig.json to use latest available .NET runtime and setup-dotnet@v3 to use .NET 6.0. Apparently was quite simple :-).
Instruct setup-dotnet@v3 to use .NET 6.0.x
@rywm-dhi This is a good idea. I think we could simply dump the present res1d, etc. files as csv or similar, check that content of it is proper, and compare against that. I don't even think that will be a slow test :-). |
Merge changes for version 0.4.1.
…stem is case sensitive.
@rywm-dhi The newly introduced test_core.py fails now, because of the slight differences in the date time indices (for example, '1994-08-07 16:36:01.869000' vs. '1994-08-07 16:36:01.870000'). It is not fully clear if it is a rounding, different MIKE Core version (on Linux we use version 20.0, because that is the only available in NuGet now), running Linux vs. Windows, or etc. issue. Note that the time is stored as seconds after simulation start time in 64-bit float, so from first glance it does not seem like the lack of precision rounding error (the simulation start is '1994-08-07 16:35:00'). |
…een .NET and Python date times. Still round to millisecond precision to keep the old behaviour.
e723b63
to
c9b90f6
Compare
I installed the branch on WSL (Ubuntu 22.04) with Python 3.12.1, using .NET v6.0. The "off by one test" fails actually. When I remove the one tick adjustment, it passes. |
58aa9ac
to
5a615aa
Compare
5a615aa
to
7b6a78b
Compare
Update CHANGELOG and README with Linux support.
README.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we hint that dotnet is required if installing with linux? Maybe add a quick shortcut sudo apt install dotnet-sdk-7.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good idea.
Initial implementation of Linux support.
This is initial implementation of MIKE IO 1D working on Linux. The main changes are related to deployment of the package:
"rollForward": "LatestMajor"
option.There are a few things, which I don't think are fully proper, but still I think it is a good idea to already merge it in into main:
For example, the mikecore-python package dependency should not be necessary. I use it here because it helped to resolve the native libraries correctly, because mikecore-python is deployed with patchelfed libraries. To my understanding setting LD_LIBRARY_PATH in Python process environment does not really help as per this thread:
https://stackoverflow.com/questions/23244418/set-ld-library-path-before-importing-in-python
For now we have MIKE Core binaries in two places.
Another thing is the strict requirement of .NET Core 3.1 presence. In principle it should work with any .NET 5 and above.Having 10 checks in GitHub actions maybe is a bit too much. Additionally, we get Python.NET not closing properly once in a while and failing tests (some garbage collector failure).