mirror of
https://github.com/wassname/ray.git
synced 2026-07-11 01:40:16 +08:00
[serve] Basic autoscaling policy (#9845)
This commit is contained in:
@@ -27,7 +27,7 @@ class HTTPProxy:
|
||||
# blocks forever
|
||||
"""
|
||||
|
||||
async def fetch_config_from_controller(self, instance_name=None):
|
||||
async def fetch_config_from_controller(self, name, instance_name=None):
|
||||
assert ray.is_initialized()
|
||||
controller = serve.api._get_controller()
|
||||
|
||||
@@ -43,7 +43,7 @@ class HTTPProxy:
|
||||
label_names=("route", ))
|
||||
|
||||
self.router = Router()
|
||||
await self.router.setup(instance_name)
|
||||
await self.router.setup(name, instance_name)
|
||||
|
||||
def set_route_table(self, route_table):
|
||||
self.route_table = route_table
|
||||
@@ -170,10 +170,10 @@ class HTTPProxy:
|
||||
|
||||
@ray.remote
|
||||
class HTTPProxyActor:
|
||||
async def __init__(self, host, port, instance_name=None):
|
||||
async def __init__(self, name, host, port, instance_name=None):
|
||||
serve.init(name=instance_name)
|
||||
self.app = HTTPProxy()
|
||||
await self.app.fetch_config_from_controller(instance_name)
|
||||
await self.app.fetch_config_from_controller(name, instance_name)
|
||||
self.host = host
|
||||
self.port = port
|
||||
|
||||
|
||||
Reference in New Issue
Block a user