[serve] Basic autoscaling policy (#9845)

This commit is contained in:
Edward Oakes
2020-08-05 21:11:35 -05:00
committed by GitHub
parent 1760586628
commit 38408574c4
9 changed files with 221 additions and 38 deletions
+4 -4
View File
@@ -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