[api] Clean up and document Actor name / lifetime API (#10332)

This commit is contained in:
Eric Liang
2020-08-27 13:38:39 -07:00
committed by GitHub
parent 17f465d5c1
commit bd245a1c18
11 changed files with 96 additions and 53 deletions
+1
View File
@@ -94,6 +94,7 @@ def init(name: Optional[str] = None,
controller = ServeController.options(
name=controller_name,
lifetime="detached",
max_restarts=-1,
max_task_retries=-1,
).remote(name, http_host, http_port, _http_middlewares)
+2 -2
View File
@@ -127,9 +127,9 @@ class ReplicaConfig:
if not isinstance(self.ray_actor_options, dict):
raise TypeError("ray_actor_options must be a dictionary.")
elif "detached" in self.ray_actor_options:
elif "lifetime" in self.ray_actor_options:
raise ValueError(
"Specifying detached in actor_init_args is not allowed.")
"Specifying lifetime in actor_init_args is not allowed.")
elif "name" in self.ray_actor_options:
raise ValueError(
"Specifying name in actor_init_args is not allowed.")
+2
View File
@@ -180,6 +180,7 @@ class ServeController:
self.http_port))
router = HTTPProxyActor.options(
name=router_name,
lifetime="detached",
max_concurrency=ASYNC_CONCURRENCY,
max_restarts=-1,
max_task_retries=-1,
@@ -391,6 +392,7 @@ class ServeController:
replica_name = format_actor_name(replica_tag, self.instance_name)
worker_handle = ray.remote(backend_info.worker_class).options(
name=replica_name,
lifetime="detached",
max_restarts=-1,
max_task_retries=-1,
**backend_info.replica_config.ray_actor_options).remote(