Created
February 24, 2021 19:22
-
-
Save edoakes/9cbdc271b74609f6c2e4192aee9bae3f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ray.init() | |
@ray.remote | |
class Controller: | |
def start_me_an_actor(self, cls): | |
# Start an actor on behalf of the caller. | |
ray.remote(cls).remote() | |
Controller.options(name="controller", lifetime="detached").remote() | |
# The below can happen in a new driver program. | |
ray.init(working_dir=".") | |
class MyNewActor: | |
pass | |
# The user probably wants the working_dir to be set properly here, but | |
# it won't because the controller was run in a different job. | |
controller = ray.get_actor("controller") | |
controller.start_me_an_actor.remote(MyNewActor) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment