diff --git a/changes/1653.fix.md b/changes/1653.fix.md new file mode 100644 index 0000000000..1d175c3753 --- /dev/null +++ b/changes/1653.fix.md @@ -0,0 +1 @@ +Replace the manager's shared redis config with the common's redis config, as this update is missed in #1586 diff --git a/src/ai/backend/common/config.py b/src/ai/backend/common/config.py index 942aae5db8..942996978b 100644 --- a/src/ai/backend/common/config.py +++ b/src/ai/backend/common/config.py @@ -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, diff --git a/src/ai/backend/manager/config.py b/src/ai/backend/manager/config.py index 9f3a3f9a3f..cc6c9fc157 100644 --- a/src/ai/backend/manager/config.py +++ b/src/ai/backend/manager/config.py @@ -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": { @@ -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),