Skip to content

Commit

Permalink
support redis ssl in feast-serving (#1092)
Browse files Browse the repository at this point in the history
* support redis ssl in feast-serving

Signed-off-by: Oleg Avdeev <oleg.v.avdeev@gmail.com>
  • Loading branch information
oavdeev authored Oct 23, 2020
1 parent c05d3d7 commit e426ab8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions infra/terraform/aws/helm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ locals {
config = {
host = module.redis.endpoint
port = 6379
ssl = true
}
subscriptions = [
{
Expand Down
2 changes: 2 additions & 0 deletions protos/feast/core/Store.proto
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ message Store {
int32 max_retries = 4;
// Optional. How often flush data to redis
int32 flush_frequency_seconds = 5;
// Optional. Connect over SSL.
bool ssl = 6;
}

message BigQueryConfig {
Expand Down
3 changes: 2 additions & 1 deletion sdk/python/requirements-ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ mypy
mypy-protobuf
avro==1.10.0
confluent_kafka
gcsfs
gcsfs
urllib3>=1.25.4
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ private RedisClient(StatefulRedisConnection<byte[], byte[]> connection) {
}

public static RedisClientAdapter create(Map<String, String> config) {

RedisURI uri = RedisURI.create(config.get("host"), Integer.parseInt(config.get("port")));

if (Boolean.parseBoolean(config.get("ssl"))) {
uri.setSsl(true);
}
StatefulRedisConnection<byte[], byte[]> connection =
io.lettuce.core.RedisClient.create(
RedisURI.create(config.get("host"), Integer.parseInt(config.get("port"))))
.connect(new ByteArrayCodec());
io.lettuce.core.RedisClient.create(uri).connect(new ByteArrayCodec());

return new RedisClient(connection);
}
Expand Down

0 comments on commit e426ab8

Please sign in to comment.