Hello! If two clients are running as separate processes and one puts
data into the object store, is there a way to use the ObjectRef
from one to access the objects in the store from the other?
Libs
@ray.remote
def serialize(value):
c = ray.put(value)
print('returned value is %s' % c)
return c
@ray.remote
def deserialize(value):
print('value 1234 is %s' % value)
print('type value is %s' % type(value))
return ray.get(value)
Process A
ray.util.connect('127.0.0.1:10001')
data_string = '{"1001": 301.27, "1002": 433.21, "1003": 502.22}'
order_data_dict = json.loads(data_string)
ret_ref = serialize.remote(order_data_dict)
(pid=xyz) returned value is ObjectRef(some_id)
Inside the serialize function ray.put returns ObjectRef(some_id)
but the returned value is
ref_ref
ClientObjectRef(some_other_id)
Then pickling to send across processes
ret_p = pickle.dumps(ret_ref)
Process B
ret_p
is passed to the process
ray.util.connect('127.0.0.1:10001')
result = pickle.loads(ret_p)
val = deserialize.remote(result) #Fails
expected would hope to be
ray.get(val)
{'1001': 301.27, '1002': 433.21, '1003': 502.22}
It seems the ClientObjectRef
is specific to the client, but
is there a way to get the actual object ref so multiple clients
can access the object in the store? Or is there a better way to do this?