Skip to content

Commit

Permalink
build orchagent and syncd docker on broadcom platform (#118)
Browse files Browse the repository at this point in the history
* build orchagent and syncd docker on broadcom platform
  • Loading branch information
lguohan authored and Shuotian Cheng committed Dec 14, 2016
1 parent c199614 commit 98e3479
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 53 deletions.
29 changes: 0 additions & 29 deletions dockers/docker-syncd/Dockerfile

This file was deleted.

7 changes: 7 additions & 0 deletions platform/broadcom/docker-orchagent-brcm.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# docker image for orchagent

DOCKER_ORCHAGENT_BRCM = docker-orchagent-brcm.gz
$(DOCKER_ORCHAGENT_BRCM)_PATH = $(DOCKERS_PATH)/docker-orchagent
$(DOCKER_ORCHAGENT_BRCM)_DEPENDS += $(SWSS) $(REDIS_TOOLS)
$(DOCKER_ORCHAGENT_BRCM)_LOAD_DOCKERS += $(DOCKER_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_BRCM)
8 changes: 8 additions & 0 deletions platform/broadcom/docker-syncd-brcm.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# docker image for brcm syncd

DOCKER_SYNCD_BRCM = docker-syncd-brcm.gz
$(DOCKER_SYNCD_BRCM)_PATH = $(PLATFORM_PATH)/docker-syncd-brcm
$(DOCKER_SYNCD_BRCM)_DEPENDS += $(SYNCD)
$(DOCKER_SYNCD_BRCM)_FILES += $(BRCM_DSSERVE) $(BRCM_BCMCMD)
$(DOCKER_SYNCD_BRCM)_LOAD_DOCKERS += $(DOCKER_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_BRCM)
19 changes: 19 additions & 0 deletions platform/broadcom/docker-syncd-brcm/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM docker-base

RUN apt-get update

COPY deps /deps

SED_DPKG

## TODO: add kmod into Depends
RUN apt-get install -f kmod

COPY ["deps/dsserve", "deps/bcmcmd", "start.sh", "/usr/bin/"]

## Clean up
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /deps

ENTRYPOINT ["/bin/bash"]
CMD ["/usr/bin/start.sh"]
File renamed without changes.
26 changes: 13 additions & 13 deletions platform/broadcom/rules.mk
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
OPENNSL = libopennsl_6.4.11-1+0~20160719212144.23~1.gbp8ec2d1_amd64.deb
$(OPENNSL)_PATH = $(PLATFORM_PATH)/brcm_sdk
BRCM_SAI = libsaibcm_1.0.2~20160727172452.52_amd64.deb
$(BRCM_SAI)_PATH = $(PLATFORM_PATH)/brcm_sdk
BRCM_SAI_DBG = libsaibcm-dbg_1.0.2~20160727172452.52_amd64.deb
$(BRCM_SAI_DEV)_PATH = $(PLATFORM_PATH)/brcm_sdk
BRCM_SAI_DEV = libsaibcm-dev_1.0.2~20160727172452.52_amd64.deb
$(BRCM_SAI_DBG)_PATH = $(PLATFORM_PATH)/brcm_sdk
include $(PLATFORM_PATH)/sdk.mk
include $(PLATFORM_PATH)/sai.mk
include $(PLATFORM_PATH)/docker-orchagent-brcm.mk
include $(PLATFORM_PATH)/docker-syncd-brcm.mk

SONIC_COPY_DEBS += $(OPENNSL) $(BRCM_SAI) $(BRCM_SAI_DBG) $(BRCM_SAI_DEV)
BRCM_DSSERVE = dsserve
$(BRCM_DSSERVE)_PATH = $(PLATFORM_PATH)/sdk
BRCM_BCMCMD = bcmcmd
$(BRCM_BCMCMD)_PATH = $(PLATFORM_PATH)/sdk

# TODO: Put dependencies for SDK packages
SONIC_COPY_FILES += $(BRCM_DSSERVE) $(BRCM_BCMCMD)

SONIC_ALL += $(SONIC_GENERIC) $(DOCKER_SYNCD) $(DOCKER_ORCHAGENT) $(DOCKER_FPM)
SONIC_ALL += $(DOCKER_SYNCD_BRCM) \
$(DOCKER_ORCHAGENT_MLNX)

# Inject brcm sai into sairedis
$(LIBSAIREDIS)_DEPENDS += $(BRCM_LIBSAI)
$(LIBSAIREDIS)_DEPENDS += $(BRCM_OPENNSL) $(BRCM_SAI) $(BRCM_SAI_DEV)

# Runtime dependency on brcm sai is set only for syncd
$(SYNCD)_RDEPENDS += $(BRCM_LIBSAI)
$(SYNCD)_RDEPENDS += $(BRCM_OPENNSL) $(BRCM_SAI)
10 changes: 10 additions & 0 deletions platform/broadcom/sai.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
BRCM_SAI = libsaibcm_2.0.3.7~20161214010054.112_amd64.deb
$(BRCM_SAI)_PATH = $(PLATFORM_PATH)/sdk
BRCM_SAI_DEV = libsaibcm-dev_2.0.3.7~20161214010054.112_amd64.deb
$(BRCM_SAI_DEV)_PATH = $(PLATFORM_PATH)/sdk
$(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV)))

SONIC_COPY_DEBS += $(BRCM_SAI)

$(BRCM_SAI)_DEPENDS += $(BRCM_OPENNSL)
$(BRCM_SAI_DEV)_DEPENDS += $(BRCM_SAI)
4 changes: 4 additions & 0 deletions platform/broadcom/sdk.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
BRCM_OPENNSL = libopennsl_3.2.1.5+0~20161214000201.54~1.gbpb514c3_amd64.deb
$(BRCM_OPENNSL)_PATH = $(PLATFORM_PATH)/sdk

SONIC_COPY_DEBS += $(BRCM_OPENNSL)
37 changes: 26 additions & 11 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,31 @@ MAKEFLAGS += -j $(SONIC_CONFIG_BUILD_JOBS)
## All rules must go after includes for propper targets expansion
###############################################################################

###############################################################################
## Local targets
###############################################################################

# Copy debian packages from local directory
# Add new package for copy:
# SOME_NEW_DEB = some_new_deb.deb
# $(SOME_NEW_DEB)_PATH = path/to/some_new_deb.deb
# SONIC_COPY_DEBS += $(SOME_NEW_DEB)
$(addprefix $(DEBS_PATH)/, $(SONIC_COPY_DEBS)) : $(DEBS_PATH)/% : .platform
$(HEADER)
$(foreach deb,$* $($*_DERIVED_DEBS), \
{ cp $($(deb)_PATH)/$(deb) $(DEBS_PATH)/ $(LOG) || exit 1 ; } ; )
$(FOOTER)

# Copy regular files from local directory
# Add new package for copy:
# SOME_NEW_FILE = some_new_file
# $(SOME_NEW_FILE)_PATH = path/to/some_new_file
# SONIC_COPY_FILES += $(SOME_NEW_FILE)
$(addprefix $(DEBS_PATH)/, $(SONIC_COPY_FILES)) : $(DEBS_PATH)/% : .platform
$(HEADER)
cp $($*_PATH)/$* $(DEBS_PATH)/ $(LOG) || exit 1
$(FOOTER)

###############################################################################
## Online targets
###############################################################################
Expand All @@ -88,17 +113,6 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_ONLINE_FILES)) : $(DEBS_PATH)/% : .platform
wget -O $@ $($*_URL) $(LOG)
$(FOOTER)

# Copy debian packages from local directory
# Add new package for copy:
# SOME_NEW_DEB = some_new_deb.deb
# $(SOME_NEW_DEB)_PATH = path/to/some_new_deb.deb
# SONIC_COPY_DEBS += $(SOME_NEW_DEB)
$(addprefix $(DEBS_PATH)/, $(SONIC_COPY_DEBS)) : $(DEBS_PATH)/% : .platform
$(HEADER)
$(foreach deb,$* $($*_DERIVED_DEBS), \
{ cp $($(deb)_PATH) $(DEBS_PATH)/ $(LOG) || exit 1 ; } ; )
$(FOOTER)

###############################################################################
## Debian package related targets
###############################################################################
Expand Down Expand Up @@ -271,6 +285,7 @@ SONIC_CLEAN_DEBS = $(addsuffix -clean,$(addprefix $(DEBS_PATH)/, \
$(SONIC_ONLINE_DEBS) \
$(SONIC_ONLINE_FILES) \
$(SONIC_COPY_DEBS) \
$(SONIC_COPY_FILES) \
$(SONIC_MAKE_DEBS) \
$(SONIC_DPKG_DEBS) \
$(SONIC_PYTHON_STDEB_DEBS) \
Expand Down

0 comments on commit 98e3479

Please sign in to comment.