Can I get object in different driver not the driver create it since objectref has a unique id?

For example, can I call
obj_ref1 = foo.remote(1)
in one driver, then I get the obj1’s id,or anything that I can reconstruct it.
then I open another terminal connect to this ray cluster,then do something like
obj_ref2 = ObjectRef(something_like_obj_id)
obj2 = ray.get(obj_ref2)

Or another example:
obj_ref1 = ray.put(3)

in another driver,
obj_ref2 = ObjectRef(something_like_obj_id)
obj2 = ray.get(obj_ref2)

Can I do this?

You cannot do that. We don’t support out-of-band ObjectRefs (similar discussion

What’s your use case? Why do you need that?

thx for reply, I don’t have to use this feature.
My use case is that I want use producer-consumer pattern.
And producer just submit some config to database , then consumer use it and some template rendering the real code to run in ray cluster and get the result.
I used to wish I can just use the object id to get the result from ray directly
Now I realise this would be impossible for ray need to delete these object after the task finished in a while.
What I need is use some other storage service such as hdfs or Object Storage service to store the result and producer just use the result key to get them

1 Like