Closed berndverst closed 1 year ago
With env var set:
>>> import os
>>> os.environ.update({"DAPR_GRPC_ENDPOINT": "daprdomaindoesnotexist.dev"})
>>> from dapr.clients import DaprClient
>>> with DaprClient() as c:
... c.get_metadata()
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/Users/bverst/src/dapr/python-sdk/dapr/clients/grpc/client.py", line 1441, in get_metadata
_resp, call = self._stub.GetMetadata.with_call(GrpcEmpty())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bverst/.pyenv/versions/3.11.3/lib/python3.11/site-packages/grpc/_channel.py", line 1043, in with_call
return _end_unary_response_blocking(state, call, True, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bverst/.pyenv/versions/3.11.3/lib/python3.11/site-packages/grpc/_channel.py", line 910, in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "DNS resolution failed for daprdomaindoesnotexist.dev:50001: C-ares status is not ARES_SUCCESS qtype=A name=daprdomaindoesnotexist.dev is_balancer=0: Domain name not found"
debug_error_string = "UNKNOWN:DNS resolution failed for daprdomaindoesnotexist.dev:50001: C-ares status is not ARES_SUCCESS qtype=A name=daprdomaindoesnotexist.dev is_balancer=0: Domain name not found {grpc_status:14, created_time:"2023-06-16T15:39:29.606707-07:00"}"
With env var not set:
>>> from dapr.clients import DaprClient
>>> with DaprClient() as c:
... c.get_metadata()
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/Users/bverst/src/dapr/python-sdk/dapr/clients/grpc/client.py", line 1441, in get_metadata
_resp, call = self._stub.GetMetadata.with_call(GrpcEmpty())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bverst/.pyenv/versions/3.11.3/lib/python3.11/site-packages/grpc/_channel.py", line 1043, in with_call
return _end_unary_response_blocking(state, call, True, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/bverst/.pyenv/versions/3.11.3/lib/python3.11/site-packages/grpc/_channel.py", line 910, in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:50001: Failed to connect to remote host: Connection refused"
debug_error_string = "UNKNOWN:failed to connect to all addresses; last error: UNKNOWN: ipv4:127.0.0.1:50001: Failed to connect to remote host: Connection refused {grpc_status:14, created_time:"2023-06-16T15:30:53.68215-07:00"}"
Ignore the errors here - I was not running a sidecar.
Merging #578 (0d61dce) into master (5051a9d) will increase coverage by
0.00%
. The diff coverage is80.00%
.
@@ Coverage Diff @@
## master #578 +/- ##
=======================================
Coverage 87.14% 87.14%
=======================================
Files 73 73
Lines 3531 3533 +2
=======================================
+ Hits 3077 3079 +2
Misses 454 454
Impacted Files | Coverage Δ | |
---|---|---|
dapr/aio/clients/grpc/client.py | 70.50% <0.00%> (ø) |
|
dapr/clients/http/client.py | 94.11% <ø> (ø) |
|
dapr/clients/grpc/client.py | 85.41% <100.00%> (ø) |
|
dapr/conf/global_settings.py | 100.00% <100.00%> (ø) |
|
dapr/version/version.py | 100.00% <100.00%> (ø) |
Closing this PR because the proposal this is based on was modified.
Description
Adds support for
DAPR_GRPC_ENDPOINT
andDAPR_HTTP_ENDPOINT
in addition to the existingDAPR_RUNTIME_HOST
environment variables to support talking to remote Dapr instances.Fixes #577
Also bumps the development version of the SDKs!