mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
Return version info from Ray client connect, to allow for discovering version mismatches
This commit is contained in:
parent
7a0597d03f
commit
4aeb0ea550
4 changed files with 25 additions and 2 deletions
|
@ -29,6 +29,11 @@ def test_num_clients(shutdown_only):
|
|||
api3 = RayAPIStub()
|
||||
info3 = api3.connect("localhost:50051")
|
||||
assert info3["num_clients"] == 1, info3
|
||||
|
||||
# Check info contains ray and python version.
|
||||
assert isinstance(info3["ray_version"], str), info3
|
||||
assert isinstance(info3["ray_commit"], str), info3
|
||||
assert isinstance(info3["python_version"], str), info3
|
||||
finally:
|
||||
server.stop(0)
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import ray
|
||||
import logging
|
||||
import grpc
|
||||
import sys
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
from threading import Lock
|
||||
|
@ -51,7 +53,12 @@ class DataServicer(ray_client_pb2_grpc.RayletDataStreamerServicer):
|
|||
with self._clients_lock:
|
||||
cur_num_clients = self._num_clients
|
||||
info = ray_client_pb2.ConnectionInfoResponse(
|
||||
num_clients=cur_num_clients)
|
||||
num_clients=cur_num_clients,
|
||||
python_version="{}.{}.{}".format(
|
||||
sys.version_info[0], sys.version_info[1],
|
||||
sys.version_info[2]),
|
||||
ray_version=ray.__version__,
|
||||
ray_commit=ray.__commit__)
|
||||
resp = ray_client_pb2.DataResponse(connection_info=info)
|
||||
else:
|
||||
raise Exception(f"Unreachable code: Request type "
|
||||
|
|
|
@ -89,7 +89,12 @@ class Worker:
|
|||
data = self.data_client.ConnectionInfo()
|
||||
except grpc.RpcError as e:
|
||||
raise e.details()
|
||||
return {"num_clients": data.num_clients}
|
||||
return {
|
||||
"num_clients": data.num_clients,
|
||||
"python_version": data.python_version,
|
||||
"ray_version": data.ray_version,
|
||||
"ray_commit": data.ray_commit,
|
||||
}
|
||||
|
||||
def get(self, vals, *, timeout: Optional[float] = None) -> Any:
|
||||
to_get = []
|
||||
|
|
|
@ -260,6 +260,12 @@ message ConnectionInfoRequest {
|
|||
message ConnectionInfoResponse {
|
||||
// The number of data clients connected to the server, including the caller.
|
||||
int32 num_clients = 1;
|
||||
// The Ray version (e.g., "1.2.0").
|
||||
string ray_version = 2;
|
||||
// The Ray commit (git sha1 hash).
|
||||
string ray_commit = 3;
|
||||
// The Python version (e.g., "3.7.2").
|
||||
string python_version = 4;
|
||||
}
|
||||
|
||||
message DataRequest {
|
||||
|
|
Loading…
Add table
Reference in a new issue