-
Notifications
You must be signed in to change notification settings - Fork 4
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
Latest protobuf #126
Latest protobuf #126
Conversation
@goord I am trying to create a grpc4bmi Docker image around https://github.com/csdms/bmi-example-cxx , but am having link errors. error message Do you have any quick suggestions? |
Having linked to both grc++_unsecure.so and grpc++.so caused while loop and 100% cpu, just having one works
In https://github.com/eWaterCycle/grpc4bmi/tree/latest-protobuf/test/heat-images/c-bmi20-pb3 the DebugOutside Docker do docker run -ti --entrypoint bash heat:c-bmi20-pb3
apt-get update
apt-get install gdb
/usr/local/bin/run_bmi_server
# Call get_component_name in python shell
gdb /usr/local/bin/run_bmi_server /core.7
...
bt
#0 __strncpy_ssse3 () at ../sysdeps/x86_64/multiarch/strcpy-ssse3.S:98
#1 0x00007ff5bdd7b2a8 in Get_component_name () from /usr/local/lib/libbmiheatc.so
#2 0x00007ff5bde4cd59 in BmiCWrapper::GetComponentName[abi:cxx11]() () from /usr/local/lib/libgrpc4bmi.so
#3 0x00007ff5bde4dd4d in BmiGRPCService::getComponentName(grpc::ServerContext*, bmi::Empty const*, bmi::GetComponentNameResponse*) ()
... import grpc
from grpc4bmi.bmi_grpc_client import BmiClient
model = BmiClient(grpc.insecure_channel("172.17.0.2:50051"))
model.get_component_name()
# raises
_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "Socket closed"
debug_error_string = "UNKNOWN:Error received from peer ipv4:172.17.0.2:50051 {grpc_message:"Socket closed", grpc_status:14, created_time:"2023-01-30T16:15:57.894638216+01:00"}" |
Co-authored-by: Johan Hidding <[email protected]>
Docker files are now hidden away in some sub dir (https://github.com/eWaterCycle/grpc4bmi/tree/latest-protobuf/test/heat-images). We should put them in better location, for example
What to you think @Peter9192 ? |
I thought we were going to retire
Does that make sense? |
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.
Overall, very nice test suite! Got a few issues while testing. Also had some questions about the c++ changes, but I suppose those are not the most relevant, more to trigger myself to see if I could understand what was going on.
image, config_body = ( | ||
# Comment out line you want to run | ||
'heat:py-0.2',py_config | ||
# 'heat:py-0.2-legacy',py_config |
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.
with grpc4bmi install from branch bmi2 this gives
(ewatercycle) peter@DESKTOP-S380217:~/ewatercycle/grpc4bmi/test/heat-images$ python heat_tester.py
heat:py-0.2-legacy
The 2D Heat Equation
('plate_surface__temperature',)
[6 8]
Traceback (most recent call last):
File "/home/peter/ewatercycle/grpc4bmi/test/heat-images/heat_tester.py", line 59, in <module>
test_heat(tmp_path=Path('/tmp'))
File "/home/peter/ewatercycle/grpc4bmi/test/heat-images/heat_tester.py", line 53, in test_heat
values = model.get_value(var_name)
File "/home/peter/mambaforge/envs/ewatercycle/lib/python3.10/site-packages/grpc4bmi/bmi_optionaldest.py", line 105, in get_value
dest = reserve_values(self.origin, name)
File "/home/peter/mambaforge/envs/ewatercycle/lib/python3.10/site-packages/grpc4bmi/reserve.py", line 12, in reserve_values
size = total_size // item_size
ZeroDivisionError: integer division or modulo by zero
test/heat-images/heat_tester.py
Outdated
|
||
image, config_body = ( | ||
# Comment out line you want to run | ||
'heat:py-0.2',py_config |
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.
'heat:py-0.2',py_config | |
'heat:python-bmi02',py_config |
With bmi2 branch insides my existing ewatercycle env gives zerodivisionerror:
heat:python-bmi02
The 2D Heat Equation
('plate_surface__temperature',)
[6 8]
Traceback (most recent call last):
File "/home/peter/ewatercycle/grpc4bmi/test/heat-images/heat_tester.py", line 59, in <module>
test_heat(tmp_path=Path('/tmp'))
File "/home/peter/ewatercycle/grpc4bmi/test/heat-images/heat_tester.py", line 53, in test_heat
values = model.get_value(var_name)
File "/home/peter/mambaforge/envs/ewatercycle/lib/python3.10/site-packages/grpc4bmi/bmi_optionaldest.py", line 105, in get_value
dest = reserve_values(self.origin, name)
File "/home/peter/mambaforge/envs/ewatercycle/lib/python3.10/site-packages/grpc4bmi/reserve.py", line 12, in reserve_values
size = total_size // item_size
ZeroDivisionError: integer division or modulo by zero
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.
With clean mamba env and grpc4bmi installed from bmi2 branch, get
Traceback (most recent call last):
File "/home/peter/ewatercycle/grpc4bmi/test/heat-images/heat_tester.py", line 4, in <module>
from grpc4bmi.bmi_client_docker import BmiClientDocker
File "/home/peter/mambaforge/envs/testheat/lib/python3.10/site-packages/grpc4bmi/bmi_client_docker.py", line 8, in <module>
from typeguard import check_argument_types, qualified_name
ImportError: cannot import name 'check_argument_types' from 'typeguard' (/home/peter/mambaforge/envs/testheat/lib/python3.10/site-packages/typeguard/__init__.py)
downgrading typeguard
from v3.0.0
to v2.13.3
solved this issue.
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.
Fixed in #129
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.
I will have a look at the division by zero as the workaround in bmi_grpc_client.py::get_var_itemsize should fix it
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.
That division by zero workaround is only in branch of this PR at https://github.com/eWaterCycle/grpc4bmi/blob/latest-protobuf/grpc4bmi/bmi_grpc_client.py#L199 so that makes sense then when running the bmi2 branch it fails.
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.
Thanks for reviewing
test/heat-images/heat_tester.py
Outdated
|
||
image, config_body = ( | ||
# Comment out line you want to run | ||
'heat:py-0.2',py_config |
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.
Fixed in #129
test/heat-images/heat_tester.py
Outdated
|
||
image, config_body = ( | ||
# Comment out line you want to run | ||
'heat:py-0.2',py_config |
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.
I will have a look at the division by zero as the workaround in bmi_grpc_client.py::get_var_itemsize should fix it
Co-authored-by: Peter Kalverla <[email protected]>
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.
Thanks for reviewing
test/heat-images/heat_tester.py
Outdated
|
||
image, config_body = ( | ||
# Comment out line you want to run | ||
'heat:py-0.2',py_config |
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.
That division by zero workaround is only in branch of this PR at https://github.com/eWaterCycle/grpc4bmi/blob/latest-protobuf/grpc4bmi/bmi_grpc_client.py#L199 so that makes sense then when running the bmi2 branch it fails.
SonarCloud Quality Gate failed. |
Refs #115
Adds Dockerfiles for heat model in combinations of languages, and versions of bmi, protobuf, grpc4bmi.
To test
cd test/heat-images && docker compose build
After merge actions
RUN pip install https://github.com/eWaterCycle/grpc4bmi/archive/refs/heads/bmi2.zip
toRUN pip install grpc4bmi==<new version>