Skip to content

Commit

Permalink
fix: manager configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Nov 10, 2023
1 parent 346ec8f commit 2caf7c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/ai/backend/install/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,33 +282,34 @@ async def configure_manager(self) -> None:
}
await self.put_etcd_json("", data)
data = {}
if self.install_info.halfstack_config.ha_setup:
assert self.install_info.halfstack_config.redis_sentinel_addrs
if halfstack.ha_setup:
assert halfstack.redis_sentinel_addrs
data["redis"] = {
"sentinel": ",".join(
f"{binding.host}:{binding.port}"
for binding in self.install_info.halfstack_config.redis_sentinel_addrs
f"{binding.host}:{binding.port}" for binding in halfstack.redis_sentinel_addrs
),
"service_name": "mymaster",
"password": self.install_info.halfstack_config.redis_password,
"helper": {
"socket_timeout": 5.0,
"socket_connect_timeout": 2.0,
"reconnect_poll_timeout": 0.3,
},
}
if halfstack.redis_password:
data["redis"]["password"] = halfstack.redis_password
else:
assert self.install_info.halfstack_config.redis_addr
assert halfstack.redis_addr
data["redis"] = {
"addr": f"{self.install_info.halfstack_config.redis_addr.face.host}:{self.install_info.halfstack_config.redis_addr.face.port}",
"password": self.install_info.halfstack_config.redis_password,
"addr": f"{halfstack.redis_addr.face.host}:{halfstack.redis_addr.face.port}",
"helper": {
"socket_timeout": 5.0,
"socket_connect_timeout": 2.0,
"reconnect_poll_timeout": 0.3,
},
}
(self.install_info.base_path / "etcd.config.json").write_text(json.dumps(data))
if halfstack.redis_password:
data["redis"]["password"] = halfstack.redis_password
(base_path / "etcd.config.json").write_text(json.dumps(data))
await self.put_etcd_json("config", data)

async def configure_agent(self) -> None:
Expand Down
1 change: 1 addition & 0 deletions src/ai/backend/manager/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ python_sources(
"src/ai/backend/cli:src", # not auto-inferred
"src/ai/backend/manager/cli:src", # not auto-inferred (due to lazy-loading cmdgroup)
"src/ai/backend/manager/api:src", # not auto-inferred (due to lazy-loading aiohttp app builder)
"src/ai/backend/manager/plugin:src", # not auto-inferred (due to lazy-loading plugins)
"src/ai/backend/manager/models/alembic:migrations", # not auto-inferred
":resources",
],
Expand Down

0 comments on commit 2caf7c6

Please sign in to comment.