Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POC] Replace redis with valkey #21915

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft
5 changes: 3 additions & 2 deletions dockers/docker-base-bookworm/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ RUN apt update && \
python-is-python3 \
vim-tiny \
rsyslog \
# Install redis-tools
redis-tools \
# Install valkey-tools
valkey-tools \
# common dependencies
libdaemon0 \
libdbus-1-3 \
Expand Down Expand Up @@ -110,5 +110,6 @@ COPY ["etc/rsyslog.d/*", "/etc/rsyslog.d/"]
COPY ["root/.vimrc", "/root/.vimrc"]

RUN ln /usr/bin/vim.tiny /usr/bin/vim
RUN ln -s /usr/bin/valkey-cli /usr/bin/redis-cli

COPY ["etc/supervisor/supervisord.conf", "/etc/supervisor/"]
17 changes: 12 additions & 5 deletions dockers/docker-database/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ ENV DEBIAN_FRONTEND=noninteractive
# Update apt's cache of available packages
RUN apt-get update

# Install redis-server
RUN apt-get install -y redis-tools redis-server
# Install valkey-server, redis deprecated
RUN apt-get install -y valkey-server

# Install click for CLI
RUN pip3 install click
Expand All @@ -33,11 +33,18 @@ RUN apt-get clean -y && \
s/^logfile .*$/logfile ""/; \
s/^# syslog-enabled no$/syslog-enabled no/; \
s/^# unixsocket/unixsocket/; \
s/redis-server.sock/redis.sock/g; \
s/\/run\/valkey\/valkey-server.sock/\/run\/redis\/redis.sock/g; \
s/^client-output-buffer-limit pubsub [0-9]+mb [0-9]+mb [0-9]+/client-output-buffer-limit pubsub 0 0 0/; \
s/^notify-keyspace-events ""$/notify-keyspace-events AKE/; \
s/^databases [0-9]+$/databases 100/ \
' /etc/redis/redis.conf
s/^databases [0-9]+$/databases 100/; \
s/^unixsocketgroup wheel/# unixsocketgroup wheel/; \
s/^dir \/var\/lib\/valkey/dir \/var\/lib\/redis/ \
' /etc/valkey/valkey.conf

RUN mkdir -p /var/lib/redis
RUN mkdir -p /etc/redis
RUN cp /etc/valkey/valkey.conf /etc/redis/redis.conf
RUN ln -s /usr/bin/valkey-check-rdb /usr/bin/redis-server

COPY ["supervisord.conf.j2", "/usr/share/sonic/templates/"]
COPY ["critical_processes.j2", "/usr/share/sonic/templates/"]
Expand Down
Loading