-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docker-saiserver]: build docker-saiserver (#2244)
* build docker-saiserver Signed-off-by: Guohan Lu <gulv@microsoft.com> * add docker saiserver mlnx/bfn/cavm * set nephos to 1.3.5 Signed-off-by: Guohan Lu <gulv@microsoft.com>
- Loading branch information
Showing
43 changed files
with
193 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# docker image for brcm saiserver | ||
|
||
DOCKER_SAISERVER_BRCM = docker-saiserver-brcm.gz | ||
$(DOCKER_SAISERVER_BRCM)_PATH = $(PLATFORM_PATH)/docker-saiserver-brcm | ||
$(DOCKER_SAISERVER_BRCM)_DEPENDS += $(SAISERVER) | ||
$(DOCKER_SAISERVER_BRCM)_FILES += $(DSSERVE) $(BCMCMD) | ||
$(DOCKER_SAISERVER_BRCM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) | ||
SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_BRCM) | ||
|
||
$(DOCKER_SAISERVER_BRCM)_CONTAINER_NAME = saiserver | ||
$(DOCKER_SAISERVER_BRCM)_RUN_OPT += --net=host --privileged -t | ||
$(DOCKER_SAISERVER_BRCM)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf | ||
$(DOCKER_SAISERVER_BRCM)_RUN_OPT += -v /var/run/docker-saiserver:/var/run/sswsyncd | ||
$(DOCKER_SAISERVER_BRCM)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro | ||
$(DOCKER_SAISERVER_BRCM)_RUN_OPT += -v /host/warmboot:/var/warmboot | ||
|
||
$(DOCKER_SAISERVER_BRCM)_BASE_IMAGE_FILES += bcmcmd:/usr/bin/bcmcmd | ||
$(DOCKER_SAISERVER_BRCM)_BASE_IMAGE_FILES += bcmsh:/usr/bin/bcmsh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM docker-config-engine | ||
|
||
ARG docker_container_name | ||
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf | ||
|
||
## Make apt-get non-interactive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update | ||
|
||
COPY \ | ||
{% for deb in docker_saiserver_brcm_debs.split(' ') -%} | ||
debs/{{ deb }}{{' '}} | ||
{%- endfor -%} | ||
debs/ | ||
|
||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ | ||
{% for deb in docker_saiserver_brcm_debs.split(' ') -%} | ||
dpkg_apt debs/{{ deb }}{{'; '}} | ||
{%- endfor %} | ||
|
||
## TODO: add kmod into Depends | ||
RUN apt-get install -yf kmod | ||
|
||
COPY ["files/dsserve", "files/bcmcmd", "start.sh", "bcmsh", "/usr/bin/"] | ||
RUN chmod +x /usr/bin/dsserve /usr/bin/bcmcmd | ||
|
||
COPY ["profile.ini", "portmap.ini", "/etc/sai/"] | ||
|
||
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] | ||
|
||
## Clean up | ||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y | ||
RUN rm -rf /debs | ||
|
||
ENTRYPOINT ["/usr/bin/supervisord"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
usage="$(basename "$0") [-h] [-q] [-t timeout] -- interactive shell for bcm service | ||
where: | ||
-h show this help text | ||
-t inactivity timeout in seconds (default 300 seconds, 0 for no timeout) | ||
-q quite, no banner (default: verbose)" | ||
|
||
banner="Press Enter to show prompt. | ||
Press Ctrl+C to exit. | ||
NOTICE: Only one bcmsh or bcmcmd can connect to the shell at same time. | ||
" | ||
|
||
# Default verbose | ||
quiet=false | ||
timeout=300 | ||
|
||
while getopts 'hqt:' option; do | ||
case "$option" in | ||
h) echo "$usage" | ||
exit | ||
;; | ||
q) quiet=true | ||
;; | ||
t) timeout=$OPTARG | ||
;; | ||
\?) printf "illegal option: -%s\n" "$OPTARG" >&2 | ||
echo "$usage" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
shift $((OPTIND - 1)) | ||
|
||
if [ "$quiet" = false ]; then | ||
echo "$banner" | ||
fi | ||
|
||
/usr/bin/socat -T$timeout readline UNIX-CONNECT:/var/run/sswsyncd/sswsyncd.socket | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
# libsaithrift-dev package | ||
|
||
LIBSAITHRIFT_DEV_BRCM = libsaithrift-dev_1.3.0_amd64.deb | ||
$(LIBSAITHRIFT_DEV_BRCM)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI | ||
$(LIBSAITHRIFT_DEV_BRCM)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(THRIFT_COMPILER) $(BRCM_SAI) $(BRCM_SAI_DEV) | ||
$(LIBSAITHRIFT_DEV_BRCM)_RDEPENDS += $(LIBTHRIFT) $(BRCM_SAI) | ||
SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV_BRCM) | ||
SAI_VER = 1.3.5 | ||
|
||
LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_amd64.deb | ||
$(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI | ||
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(BRCM_SAI) $(BRCM_SAI_DEV) | ||
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) $(BRCM_SAI) | ||
SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV) | ||
|
||
PYTHON_SAITHRIFT = python-saithrift_$(SAI_VER)_amd64.deb | ||
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(PYTHON_SAITHRIFT))) | ||
|
||
SAISERVER = saiserver_$(SAI_VER)_amd64.deb | ||
$(SAISERVER)_RDEPENDS += $(LIBTHRIFT) $(BRCM_SAI) | ||
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER))) | ||
|
||
SAISERVER_DBG = saiserver-dbg_$(SAI_VER)_amd64.deb | ||
$(SAISERVER_DBG)_RDEPENDS += $(SAISERVER) | ||
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER_DBG))) |
Empty file.
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# docker image for mlnx saiserver | ||
|
||
DOCKER_SAISERVER_MLNX = docker-saiserver-mlnx.gz | ||
$(DOCKER_SAISERVER_MLNX)_PATH = $(PLATFORM_PATH)/docker-saiserver-mlnx | ||
$(DOCKER_SAISERVER_MLNX)_DEPENDS += $(SAISERVER) $(PYTHON_SDK_API) $(MLNX_SFPD) $(CRIU) | ||
$(DOCKER_SAISERVER_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE) | ||
SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_MLNX) | ||
|
||
$(DOCKER_SAISERVER_MLNX)_CONTAINER_NAME = saiserver | ||
$(DOCKER_SAISERVER_MLNX)_RUN_OPT += --net=host --privileged -t | ||
$(DOCKER_SAISERVER_MLNX)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf | ||
$(DOCKER_SAISERVER_MLNX)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro | ||
$(DOCKER_SYNCD_MLNX)_RUN_OPT += --tmpfs /run/criu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM docker-config-engine | ||
|
||
ARG docker_container_name | ||
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf | ||
|
||
## Make apt-get non-interactive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update | ||
|
||
COPY \ | ||
{% for deb in docker_saiserver_mlnx_debs.split(' ') -%} | ||
debs/{{ deb }}{{' '}} | ||
{%- endfor -%} | ||
debs/ | ||
|
||
RUN apt-get install -y --no-install-recommends libxml2 iptables libbsd0 protobuf-c-compiler protobuf-compiler python-protobuf libprotobuf-c1 python-future python-ipaddr libnet1 pkg-config asciidoc xmlto | ||
|
||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ | ||
{% for deb in docker_saiserver_mlnx_debs.split(' ') -%} | ||
dpkg_apt debs/{{ deb }}{{'; '}} | ||
{%- endfor %} | ||
|
||
COPY ["start.sh", "/usr/bin/"] | ||
|
||
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] | ||
|
||
COPY ["profile.ini", "portmap.ini", "/etc/sai/"] | ||
|
||
COPY ["sai_2700.xml", "/usr/share/"] | ||
|
||
## Clean up | ||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y | ||
RUN rm -rf /debs | ||
|
||
ENTRYPOINT ["/usr/bin/supervisord"] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
# libsaithrift-dev package | ||
|
||
LIBSAITHRIFT_DEV_MLNX = libsaithrift-dev_1.3.0_amd64.deb | ||
$(LIBSAITHRIFT_DEV_MLNX)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI | ||
$(LIBSAITHRIFT_DEV_MLNX)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(THRIFT_COMPILER) $(MLNX_SAI) $(MLNX_SAI_DEV) | ||
$(LIBSAITHRIFT_DEV_MLNX)_RDEPENDS += $(LIBTHRIFT) $(MLNX_SAI) | ||
SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV_MLNX) | ||
SAI_VER = 1.3.5 | ||
|
||
LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_amd64.deb | ||
$(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI | ||
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(MLNX_SAI) $(MLNX_SAI_DEV) | ||
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) $(MLNX_SAI) | ||
SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV) | ||
|
||
PYTHON_SAITHRIFT = python-saithrift_$(SAI_VER)_amd64.deb | ||
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(PYTHON_SAITHRIFT))) | ||
|
||
SAISERVER = saiserver_$(SAI_VER)_amd64.deb | ||
$(SAISERVER)_RDEPENDS += $(LIBTHRIFT) $(MLNX_SAI) | ||
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER))) | ||
|
||
SAISERVER_DBG = saiserver-dbg_$(SAI_VER)_amd64.deb | ||
$(SAISERVER_DBG)_RDEPENDS += $(SAISERVER) | ||
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER_DBG))) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# python-saithrift package | ||
|
||
PYTHON_SAITHRIFT_NEPHOS = python-saithrift_1.3.0_amd64.deb | ||
PYTHON_SAITHRIFT_NEPHOS = python-saithrift_1.3.5_amd64.deb | ||
$(PYTHON_SAITHRIFT_NEPHOS)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI | ||
$(PYTHON_SAITHRIFT_NEPHOS)_DEPENDS += $(NEPHOS_SAI_DEV) $(THRIFT_COMPILER) $(PYTHON_THRIFT) $(LIBTHRIFT_DEV) | ||
SONIC_DPKG_DEBS += $(PYTHON_SAITHRIFT_NEPHOS) |
Submodule sonic-sairedis
updated
from 248a09 to 38deb1