Fix runtime error with grpcio#3971
Conversation
|
The latest $ rm -rf .venv
$ git checkout Bihan/fix_issue_3957_runtime_error_with_grpcio
$ uv venv
$ uv pip install "grpcio<1.81.1"
$ uv pip install .[all] --refresh
$ ./.venv/bin/dstack server
File "/dstack/.venv/lib/python3.13/site-packages/smg_grpc_proto/generated/mlx_engine_pb2_grpc.py", line 21, in <module>
raise RuntimeError(
...<5 lines>...
)
RuntimeError: The grpc package installed is at version 1.81.0, but the generated code in mlx_engine_pb2_grpc.py depends on grpcio>=1.81.1. Please upgrade your grpc module to grpcio>=1.81.1 or downgrade your generated code using grpcio-tools<=1.81.0.Looking at some of the previous $ pip install smg-grpc-proto==0.4.10
$ sed -n 8p /tmp/venv/lib64/python3.14/site-packages/smg_grpc_proto/generated/common_pb2_grpc.py
GRPC_GENERATED_VERSION = '1.81.1'
$ pip install smg-grpc-proto==0.4.9
$ sed -n 8p /tmp/venv/lib64/python3.14/site-packages/smg_grpc_proto/generated/common_pb2_grpc.py
GRPC_GENERATED_VERSION = '1.81.0'
$ pip install smg-grpc-proto==0.4.8
$ sed -n 8p /tmp/venv/lib64/python3.14/site-packages/smg_grpc_proto/generated/common_pb2_grpc.py
GRPC_GENERATED_VERSION = '1.80.0'
$ pip install smg-grpc-proto==0.4.5
$ sed -n 8p /tmp/venv/lib64/python3.14/site-packages/smg_grpc_proto/generated/common_pb2_grpc.py
GRPC_GENERATED_VERSION = '1.78.0'I assume this means that we will keep seeing the |
|
Seems restrictive to bump grpcio to the latest version constantly. How about making smg-grpc-proto an optional dep to limit the blast radius? |
I'm not sure, it will add an extra setup step for our users to get the SMG integration running, and users that need the integration will still have to deal with a potential version mismatch. If we add it to the I think I would prefer to restrict the And optionally ask its maintainers to address the issue on their side. I don't know if there are any established best practices for shipping gRPC SDKs as Python packages, but I assume the package could at least:
By the way, google packages don't seem to have that runtime version check. |
|
So for now I will update the PR with |
Fixes issue #3957
Supporting
grpcio<1.81would require pinningsmg-grpc-proto<=0.4.8, since 0.4.9+ stubs enforce grpcio>=1.81 at import time. Pinning smg-grpc-proto<=0.4.8 keeps us on older pre-built stubs and blocks newer fixes, which is risky long-term. Therefore this PR prefers pinninggrpcio>=1.81.0instead.