Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named actor #2120

Closed
wants to merge 2 commits into from
Closed

Named actor #2120

wants to merge 2 commits into from

Conversation

heyucongtom
Copy link
Contributor

What do these changes do?

Implementing the named-actor issue addressed in #1424, with the API:

# Create named actor.
ray.actors["actor1"] = a

# Get named actor handle (done by a different driver).
a = ray.actors["actor1"]

This is a rough wrapper on the idea of pickling. Would love to talk through it later this week and add some unit test.

Related issue number

#1424

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/5572/
Test PASSed.

@robertnishihara
Copy link
Collaborator

Thanks a lot @heyucongtom! I think the shortest path to merging this is the following.

  1. Let's start off with a non-map API. In particular, can you change this to

    ray.experimental.register_actor(actor_handle, name)
    
    actor_handle = ray.experimental.get_actor(name)

    We can of course iterate on this.

  2. As shown above, let's mark this as "experimental", by putting it in something like ray/python/ray/experimental/named_actors.py.

  3. Can you add a test for this?

    • In test/actor_test.py e.g., right after testPicklingActorHandle, we can add a test that uses these methods in the same process.
    • In test/multi_node_test.py under MultiNodeTest (which really should be called MultiDriverTest) it would be good to add a test that creates a named actor from one driver and then uses it from another.
    • We should add a test that attempts to get a named actor on a name that was never created and verify that a reasonable exception is raised.
  4. Verify that we raise a good error message when no named actor exists.

cc @ericl @richardliaw

@heyucongtom
Copy link
Contributor Author

Thank you for your reply! Would deal with that soon today.

@robertnishihara
Copy link
Collaborator

One more case we should handle is the following. If someone attempts to create an actor with a certain name, but an actor with that name has already been created, we should raise an exception.

@robertnishihara
Copy link
Collaborator

Replaced by #2129.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants