Skip to content

Commit

Permalink
To fix the issue: show_techsupport & saidump errors during testbed te…
Browse files Browse the repository at this point in the history
…sting by replacing redis-rdb-tool with rdb-cli (#19268)

* To fix the issue: show_techsupport & saidump errors during testbed testing
sonic-net/sonic-sairedis#1387

To use the Redis-db SAVE option to save the snapshot of DB each time and recover later, instead of looping through each entry in the table and saving it.

(1) Updated sonic-buildimage repo's platform/broadcom/docker-syncd-brcm-dnx/Dockerfile.j2, 
 install rdb-cli into the syncd containter.
(2) Updated sonic-sairedis repo's script file: files/scripts/saidump.sh, replace rdbtools with rdb-cli.
(3) Updated sonic-sairedis repo's saidump/saidump.cpp, to process the rdb-cli's ouput json file.
  • Loading branch information
JunhongMao authored and mssonicbld committed Nov 8, 2024
1 parent cf84847 commit 6799976
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 27 deletions.
12 changes: 0 additions & 12 deletions dockers/docker-base-bookworm/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,6 @@ RUN pip3 install supervisord-dependent-startup==1.4.0

RUN mkdir -p /var/log/supervisor /etc/supervisor/conf.d

# Install gcc, libc6-dev and python3-dev for compiling python-lzf
RUN apt-get -y install build-essential libc6-dev python3-dev

# Install python-lzf
RUN pip3 install 'python-lzf==0.2.4'

# Install rdbtools
RUN pip3 install 'rdbtools==0.1.15'

# Uninstall gcc, libc6-dev and python3-dev for compiling python-lzf
RUN apt-get -y purge build-essential libc6-dev python3-dev

# Uninstall unused dependencies
RUN apt autoremove -y --purge

Expand Down
12 changes: 0 additions & 12 deletions dockers/docker-base-bullseye/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,6 @@ RUN pip3 install supervisord-dependent-startup==1.4.0

RUN mkdir -p /var/log/supervisor /etc/supervisor/conf.d

# Install gcc, libc6-dev and python3-dev for compiling python-lzf
RUN apt-get -y install build-essential libc6-dev python3-dev

# Install python-lzf
RUN pip3 install 'python-lzf==0.2.4'

# Install rdbtools
RUN pip3 install 'rdbtools==0.1.15'

# Uninstall gcc, libc6-dev and python3-dev for compiling python-lzf
RUN apt-get -y purge build-essential libc6-dev python3-dev

# Uninstall unused dependencies
RUN apt autoremove -y --purge

Expand Down
2 changes: 1 addition & 1 deletion platform/broadcom/docker-syncd-brcm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include $(PLATFORM_PATH)/../template/docker-syncd-bullseye.mk

$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD)
$(DOCKER_SYNCD_BASE)_DEPENDS += $(BRCM_XGS_SAI)
$(DOCKER_SYNCD_BASE)_FILES += $(DSSERVE) $(BCMCMD)
$(DOCKER_SYNCD_BASE)_FILES += $(DSSERVE) $(BCMCMD) $(RDB-CLI)

$(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(SYNCD_DBG) \
$(LIBSWSSCOMMON_DBG) \
Expand Down
4 changes: 2 additions & 2 deletions platform/broadcom/docker-syncd-brcm/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ RUN apt-get install -yf kmod
## BRCM uses ethtool to set host interface speed
RUN apt-get install -y ethtool

COPY ["files/dsserve", "files/bcmcmd", "start.sh", "start_led.sh", "bcmsh", "/usr/bin/"]
RUN chmod +x /usr/bin/dsserve /usr/bin/bcmcmd
COPY ["files/dsserve", "files/bcmcmd", "start.sh", "start_led.sh", "bcmsh", "files/rdb-cli", "/usr/bin/"]
RUN chmod +x /usr/bin/dsserve /usr/bin/bcmcmd /usr/bin/rdb-cli

COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
Expand Down
9 changes: 9 additions & 0 deletions rules/rdb-cli.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

SPATH := $($(RDB-CLI)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/rdb-cli.mk rules/rdb-cli.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(SPATH))

$(RDB-CLI)_CACHE_MODE := GIT_CONTENT_SHA
$(RDB-CLI)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(RDB-CLI)_DEP_FILES := $(DEP_FILES)
14 changes: 14 additions & 0 deletions rules/rdb-cli.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# librdb package
#


RDB_CLI_VERSION_FULL = 0.1

export RDB_CLI_VERSION_FULL

RDB-CLI = rdb-cli

export RDB-CLI

$(RDB-CLI)_SRC_PATH = $(SRC_PATH)/rdb-cli
SONIC_MAKE_FILES += rdb-cli
14 changes: 14 additions & 0 deletions src/rdb-cli/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.ONESHELL:
SHELL = /bin/bash
.SHELLFLAGS += -e

MAIN_TARGET = rdb-cli

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
rm -rf ./librdb
git clone https://github.com/redis/librdb.git
pushd ./librdb/
git checkout 2fdfc0c2bc914d643fe3f86e6715aeb843d8966e
git submodule update --init --recursive
make -j$(SONIC_CONFIG_MAKE_JOBS)
mv bin/rdb-cli $(DEST)/

0 comments on commit 6799976

Please sign in to comment.