Skip to content

Commit

Permalink
fix: Replace manager's shared redis config with the common redis conf…
Browse files Browse the repository at this point in the history
…ig (#1653)

Backported-from: main
Backported-to: 23.09
  • Loading branch information
achimnol committed Oct 25, 2023
1 parent 2ea9e6b commit 4ee4377
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
1 change: 1 addition & 0 deletions changes/1653.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replace the manager's shared redis config with the common's redis config, as this update is missed in #1586
16 changes: 14 additions & 2 deletions src/ai/backend/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,22 @@
}
).allow_extra("*")

redis_default_config = {
"addr": None,
"sentinel": None,
"service_name": None,
"password": None,
"redis_helper_config": redis_helper_default_config,
}

redis_config_iv = t.Dict(
{
t.Key("addr", default=None): t.Null | tx.HostPortPair,
t.Key("password", default=None): t.Null | t.String,
t.Key("addr", default=redis_default_config["addr"]): t.Null | tx.HostPortPair,
t.Key( # if present, addr is ignored and service_name becomes mandatory.
"sentinel", default=redis_default_config["sentinel"]
): t.Null | tx.DelimiterSeperatedList(tx.HostPortPair),
t.Key("service_name", default=redis_default_config["service_name"]): t.Null | t.String,
t.Key("password", default=redis_default_config["password"]): t.Null | t.String,
t.Key(
"redis_helper_config",
default=redis_helper_default_config,
Expand Down
20 changes: 2 additions & 18 deletions src/ai/backend/manager/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,7 @@
"api": {
"allow-origins": "*",
},
"redis": {
"addr": None,
"password": None,
"redis_helper_config": config.redis_helper_default_config,
},
"redis": config.redis_default_config,
"docker": {
"registry": {},
"image": {
Expand Down Expand Up @@ -414,19 +410,7 @@ def container_registry_serialize(v: dict[str, Any]) -> dict[str, str]:
t.Key("allow-origins", default=_config_defaults["api"]["allow-origins"]): t.String,
}
).allow_extra("*"),
t.Key("redis", default=_config_defaults["redis"]): t.Dict(
{
t.Key("addr", default=_config_defaults["redis"]["addr"]): t.Null | tx.HostPortPair,
t.Key("sentinel", default=None): t.Null | tx.DelimiterSeperatedList(
tx.HostPortPair
),
t.Key("service_name", default=None): t.Null | t.String,
t.Key("password", default=_config_defaults["redis"]["password"]): t.Null | t.String,
t.Key(
"redis_helper_config", default=_config_defaults["redis"]["redis_helper_config"]
): config.redis_helper_config_iv,
}
).allow_extra("*"),
t.Key("redis", default=_config_defaults["redis"]): config.redis_config_iv,
t.Key("docker", default=_config_defaults["docker"]): t.Dict(
{
t.Key("registry"): t.Mapping(t.String, container_registry_iv),
Expand Down

0 comments on commit 4ee4377

Please sign in to comment.