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

Replace Redis with Valkey #21915

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0a8e906
Replace redis with valkey
liuh-80 Mar 4, 2025
87147de
Update docker-database.mk
liuh-80 Mar 4, 2025
ecf7e00
Update socket path in Dockerfile.j2
liuh-80 Mar 5, 2025
e764029
Add redis-cli to Docker database base image
liuh-80 Mar 5, 2025
4fca8d2
Update Dockerfile.j2 configuration paths and settings
liuh-80 Mar 5, 2025
10078f8
Replace valkey with redis in Docker setup
liuh-80 Mar 5, 2025
400329b
Fix syntax errors in Dockerfile.j2
liuh-80 Mar 6, 2025
385fbfa
Remove redundant symbolic link for redis-cli
liuh-80 Mar 6, 2025
40c7127
Replace redis-cli with valkey-cli in Dockerfile
liuh-80 Mar 6, 2025
be1a099
Update Redis configuration and symbolic links
liuh-80 Mar 6, 2025
7d1834c
Remove redis-tools and update symlinks
liuh-80 Mar 6, 2025
94fa1d6
Replace redis with valkey
liuh-80 Mar 14, 2025
3c98b89
Remove valkey-tools installation from Dockerfiles
liuh-80 Mar 14, 2025
ee0ab73
Add redis-tools to Dockerfiles
liuh-80 Mar 14, 2025
abb163b
Update Dockerfile.j2
liuh-80 Mar 17, 2025
91d2f5a
Add 'redis' user and configure permissions
liuh-80 Mar 18, 2025
cfac11d
Fix incorrect chmod paths in Dockerfile
liuh-80 Mar 18, 2025
0fb4553
Update ownership and permissions in Dockerfiles
liuh-80 Mar 18, 2025
cba7e22
Add missing directories in Dockerfiles
liuh-80 Mar 19, 2025
cd758ce
Update Dockerfile.j2
liuh-80 Mar 19, 2025
ff25ee1
Update Dockerfile.j2
liuh-80 Mar 19, 2025
b631eca
Fix `chown` command syntax in Dockerfiles
liuh-80 Mar 19, 2025
0ec8bb6
Update Dockerfile.j2
liuh-80 Mar 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 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,20 @@ 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/"]

# Setup user 'redis' for compatibility, valkey will run with 'redis' account
RUN mkdir -p /var/lib/redis
RUN adduser --system --home /var/lib/redis --quiet --group redis || true
RUN chown -R redis:redis /var/lib/redis
RUN chmod 750 /var/lib/redis

RUN mkdir -p /var/log/redis
RUN chown -R redis:adm /var/log/redis
RUN chmod 2750 /var/log/redis

RUN mkdir -p /etc/redis
RUN chown -R redis:redis /etc/redis
RUN chmod 2770 /etc/redis
16 changes: 11 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,17 @@ 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 cp /etc/valkey/valkey.conf /etc/redis/redis.conf
RUN chown -R redis:redis /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
16 changes: 11 additions & 5 deletions platform/vs/docker-sonic-vs/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ RUN apt-get install -y net-tools \
libasan6 \
{%- endif %}
dbus \
redis-server \
valkey-server \
# For libkrb5-dev
comerr-dev \
libgssrpc4 \
Expand Down Expand Up @@ -117,11 +117,17 @@ RUN sed -ri 's/^# save ""$/save ""/g; \
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/^notify-keyspace-events ""$/notify-keyspace-events AKE/; \
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 cp /etc/valkey/valkey.conf /etc/redis/redis.conf
RUN chown -R redis:redis /etc/redis/redis.conf
RUN ln -s /usr/bin/valkey-check-rdb /usr/bin/redis-server

COPY ["50-default.conf", "/etc/rsyslog.d/"]
COPY ["start.sh", "orchagent.sh", "files/update_chassisdb_config", "/usr/bin/"]
Expand Down
Loading