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

GRPC server is down when running the model.ipynb #3

Open
geek-yang opened this issue Nov 3, 2023 · 4 comments
Open

GRPC server is down when running the model.ipynb #3

geek-yang opened this issue Nov 3, 2023 · 4 comments

Comments

@geek-yang
Copy link

The GRPC server is down when running the Hype model (see the code and the error message below).

model.initialize(cfg_file)

---------------------------------------------------------------------------
_InactiveRpcError                         Traceback (most recent call last)
Cell In[8], line 1
----> 1 model.initialize(cfg_file)

File /opt/conda/envs/ewatercycle/lib/python3.10/site-packages/ewatercycle/base/model.py:168, in eWaterCycleModel.initialize(self, config_file)
    162 def initialize(self, config_file: str) -> None:
    163     """Initialize the model.
    164 
    165     Args:
    166         config_file: Name of initialization file.
    167     """
--> 168     self._bmi.initialize(config_file)

File /opt/conda/envs/ewatercycle/lib/python3.10/site-packages/grpc4bmi/bmi_optionaldest.py:49, in OptionalDestBmi.initialize(self, config_file)
     48 def initialize(self, config_file: Optional[str]) -> None:
---> 49     return self.origin.initialize(config_file)

File /opt/conda/envs/ewatercycle/lib/python3.10/site-packages/grpc4bmi/bmi_memoized.py:57, in MemoizedBmi.initialize(self, filename)
     55 def initialize(self, filename):
     56     self.cache = dict()
---> 57     return self.origin.initialize(filename)

File /opt/conda/envs/ewatercycle/lib/python3.10/site-packages/grpc4bmi/bmi_grpc_client.py:101, in BmiClient.initialize(self, filename)
     99     return self.stub.initialize(bmi_pb2.InitializeRequest(config_file=fname))
    100 except grpc.RpcError as e:
--> 101     handle_error(e)

File /opt/conda/envs/ewatercycle/lib/python3.10/site-packages/grpc4bmi/bmi_grpc_client.py:99, in BmiClient.initialize(self, filename)
     97 fname = "" if filename is None else filename
     98 try:
---> 99     return self.stub.initialize(bmi_pb2.InitializeRequest(config_file=fname))
    100 except grpc.RpcError as e:
    101     handle_error(e)

File /opt/conda/envs/ewatercycle/lib/python3.10/site-packages/grpc/_channel.py:1161, in _UnaryUnaryMultiCallable.__call__(self, request, timeout, metadata, credentials, wait_for_ready, compression)
   1146 def __call__(
   1147     self,
   1148     request: Any,
   (...)
   1153     compression: Optional[grpc.Compression] = None,
   1154 ) -> Any:
   1155     (
   1156         state,
   1157         call,
   1158     ) = self._blocking(
   1159         request, timeout, metadata, credentials, wait_for_ready, compression
   1160     )
-> 1161     return _end_unary_response_blocking(state, call, False, None)

File /opt/conda/envs/ewatercycle/lib/python3.10/site-packages/grpc/_channel.py:1004, in _end_unary_response_blocking(state, call, with_call, deadline)
   1002         return state.response
   1003 else:
-> 1004     raise _InactiveRpcError(state)

_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.UNAVAILABLE
	details = "Socket closed"
	debug_error_string = "UNKNOWN:Error received from peer  {created_time:"2023-11-03T10:12:17.896994836+01:00", grpc_status:14, grpc_message:"Socket closed"}"
>
@BSchilperoort
Copy link
Member

image

Seems like the image is broken. It has to be fixed. The Dockerfile is in https://github.com/eWaterCycle/hype-bmi/, but it's very rotten.

@BSchilperoort
Copy link
Member

The apr2020 image does run, but I don't seem to be able to connect to it, even with the basic gprc4bmi functions

@BSchilperoort
Copy link
Member

The apr2020 image does run, but I don't seem to be able to connect to it, even with the basic gprc4bmi functions

The reason why eWaterCycle doesn't connect, is that the ewatercycle/hype-grpc4bmi:apr2020 image uses the port 50051. eWC 2.0 uses 55555 by default.

When overwriting the _make_bmi_instance method, making use of the correct port, we can connect to the model successfully.
get_component_name() returns hype-5.6.1.

However, upon initialization with a config file the docker container fails with:

_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.UNAVAILABLE
	details = "Socket closed"
	debug_error_string = "UNKNOWN:Error received from peer  {created_time:"2023-12-21T13:17:02.851491892+01:00", grpc_status:14, grpc_message:"Socket closed"}"
>

Perhaps this has to do with the following comment in the Dockerfiles:

# The input data root directory should be mounted as /data
# The filedir.txt in the input directory should only contain the single line: /data/

eWaterCycle 2.0 does not mount the input data root directory as /data.

@BSchilperoort
Copy link
Member

The entire log of the container is:

BMI grpc server attached to server address 0.0.0.0:50051
 ---------------------------------------------
    HYPE version 5.6.2                        
 ---------------------------------------------
 New versions of HYPE at the HYPE Open Source 
 Community website (hypecode.smhi.se), as well
 as information on up-coming courses.         
 ---------------------------------------------
STOP 1

Not helpful.

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

No branches or pull requests

2 participants