Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
slorello89 committed Jul 11, 2023
1 parent c3940a9 commit b4db839
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: ['main']
jobs:
tls:
runs-on: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install dependencies
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ Optionally you may configure your `user`/`password` via environment variables. T

### TLS

Transport Layer Security (TLS) can be enabled in Redis and within the Triton Redis Cache, to do so you will need a TLS
enabled version of Redis, e.g. [OSS Redis](https://redis.io/docs/management/security/encryption/) or
Transport Layer Security (TLS) can be enabled in Redis and within the Triton Redis Cache, to do so you will need a TLS
enabled version of Redis, e.g. [OSS Redis](https://redis.io/docs/management/security/encryption/) or
[Redis Enterprise](https://docs.redis.com/latest/rs/security/tls/enable-tls/). You will also need to configure Triton Server to use TLS with Redis
through the following `--cache-config` TLS options.

Expand Down
10 changes: 5 additions & 5 deletions examples/tls/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM nvcr.io/nvidia/tritonserver:23.03-py3-sdk
FROM nvcr.io/nvidia/tritonserver:23.06-py3-sdk

RUN apt install -y lsb-release curl gpg
RUN curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
RUN echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list
RUN apt-get update
RUN apt install -y lsb-release curl gpg
RUN curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
RUN echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list
RUN apt-get update
RUN apt-get install -y redis

CMD "/app/test.sh"
2 changes: 1 addition & 1 deletion examples/tls/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fi

numKeys=$(redis-cli -h triton-redis --tls --cert /certs/redis.crt --key /certs/redis.key --cacert /certs/ca.crt DBSIZE) # check that there's only one key

if [[ $numKeys -eq 1 ]]; then
if [[ $numKeys -eq 1 ]]; then
exit 0
else
echo "Redis did not have the expected number of keys."
Expand Down
7 changes: 4 additions & 3 deletions src/redis_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ RedisCache::Create(
poolOptions.wait_timeout = std::chrono::milliseconds(1000);
}

//tls options
if(document.HasMember("tls_enabled")){
options.tls.enabled = strcmp(document["tls_enabled"].GetString(), "true") == 0;
// tls options
if (document.HasMember("tls_enabled")) {
options.tls.enabled =
strcmp(document["tls_enabled"].GetString(), "true") == 0;
setOption("cert", options.tls.cert, document);
setOption("key", options.tls.key, document);
setOption("cacert", options.tls.cacert, document);
Expand Down

0 comments on commit b4db839

Please sign in to comment.