mirror of
https://github.com/wassname/ray.git
synced 2026-07-30 12:30:30 +08:00
[api] Clean up and document Actor name / lifetime API (#10332)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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.")
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user