Skip to content

Commit

Permalink
According to reivew comments, build librdb just like any other regula…
Browse files Browse the repository at this point in the history
…r application.
  • Loading branch information
JunhongMao committed Oct 21, 2024
1 parent 6b5dbc5 commit 5dc10e6
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 21 deletions.
Empty file modified dockers/docker-base-bookworm/Dockerfile.j2
100755 → 100644
Empty file.
Empty file modified dockers/docker-base-bullseye/Dockerfile.j2
100755 → 100644
Empty file.
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
22 changes: 2 additions & 20 deletions platform/broadcom/docker-syncd-brcm/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,13 @@ 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"]
COPY ["critical_processes", "/etc/supervisor/"]

# Install make and git for compiling librdb
RUN apt-get -y install build-essential git

# Obtain librdb source codes
RUN git clone https://github.com/redis/librdb.git

# Build librdb
RUN cd ./librdb/;git checkout b401df1e7025501c24f0c852aa32f6900fd888f7;git submodule update --init --recursive;make;cd ..

# Install rdb-cli
RUN install -p -D -m 0775 ./librdb/bin/rdb-cli /usr/bin/rdb-cli

# Clear librdb source codes
RUN rm -rf ./librdb

# Uninstall make and git for compiling librdb
RUN apt-get -y purge build-essential git

## Clean up
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs
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 5dc10e6

Please sign in to comment.