Add remote autoscaler daemon endpoint support
This commit is contained in:
parent
95021a4253
commit
679b5c8d07
11 changed files with 291 additions and 22 deletions
|
|
@ -218,16 +218,23 @@ def main() -> None:
|
|||
reconciler_thread.start()
|
||||
metrics_thread.start()
|
||||
|
||||
socket_path = Path(config.server.socket_path)
|
||||
socket_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
if socket_path.exists():
|
||||
socket_path.unlink()
|
||||
|
||||
uvicorn_config = uvicorn.Config(
|
||||
app=app,
|
||||
uds=config.server.socket_path,
|
||||
log_level=config.server.log_level.lower(),
|
||||
)
|
||||
if config.server.listen_port > 0:
|
||||
uvicorn_config = uvicorn.Config(
|
||||
app=app,
|
||||
host=config.server.listen_host,
|
||||
port=config.server.listen_port,
|
||||
log_level=config.server.log_level.lower(),
|
||||
)
|
||||
else:
|
||||
socket_path = Path(config.server.socket_path)
|
||||
socket_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
if socket_path.exists():
|
||||
socket_path.unlink()
|
||||
uvicorn_config = uvicorn.Config(
|
||||
app=app,
|
||||
uds=config.server.socket_path,
|
||||
log_level=config.server.log_level.lower(),
|
||||
)
|
||||
server = uvicorn.Server(uvicorn_config)
|
||||
|
||||
def _handle_signal(signum: int, _: FrameType | None) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue