[docker-ptf]: build docker ptf

- combine docker-ptf-saithrift into docker-ptf docker
- build docker-ptf under platform vs
- remove docker-ptf for other platforms

Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
Guohan Lu 2021-01-23 01:27:20 -08:00 committed by lguohan
parent 9ff56445c9
commit ca0e8cbe0e
34 changed files with 55 additions and 130 deletions

View File

@ -1,17 +0,0 @@
FROM docker-ptf
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
COPY \
{% for deb in docker_ptf_saithrift_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/
RUN dpkg -i \
{% for deb in docker_ptf_saithrift_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}
COPY ["*.ini", "/etc/ptf/"]

View File

@ -78,7 +78,7 @@ RUN rm -rf /debs \
&& apt-get -y autoclean \
&& apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/* \
&& wget --https-only https://bootstrap.pypa.io/get-pip.py \
&& wget --https-only https://bootstrap.pypa.io/2.7/get-pip.py \
&& python get-pip.py \
&& rm -f get-pip.py \
&& pip install setuptools \
@ -146,6 +146,18 @@ RUN git clone https://github.com/lguohan/gnxi.git \
&& cd gnmi_cli_py \
&& pip install -r requirements.txt
COPY \
{% for deb in docker_ptf_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/
RUN dpkg -i \
{% for deb in docker_ptf_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}
COPY ["*.ini", "/etc/ptf/"]
EXPOSE 22 8009
ENTRYPOINT ["/usr/local/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]

View File

@ -1,5 +0,0 @@
# docker image for docker-ptf
DOCKER_PTF_BFN = docker-ptf-bfn.gz
$(DOCKER_PTF_BFN)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift
$(DOCKER_PTF_BFN)_LOAD_DOCKERS += $(DOCKER_PTF)

View File

@ -10,7 +10,6 @@ include $(PLATFORM_PATH)/docker-syncd-bfn-rpc.mk
include $(PLATFORM_PATH)/one-aboot.mk
include $(PLATFORM_PATH)/one-image.mk
include $(PLATFORM_PATH)/libsaithrift-dev.mk
include $(PLATFORM_PATH)/docker-ptf-bfn.mk
include $(PLATFORM_PATH)/bfn-platform.mk
#include $(PLATFORM_PATH)/bfn-platform-wnc.mk
#include $(PLATFORM_PATH)/bfn-platform-ingrasys.mk

View File

@ -1,10 +0,0 @@
DPATH := $($(DOCKER_PTF_BRCM)_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/broadcom/docker-ptf-brcm.mk platform/broadcom/docker-ptf-brcm.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(DPATH))
$(DOCKER_PTF_BRCM)_CACHE_MODE := GIT_CONTENT_SHA
$(DOCKER_PTF_BRCM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(DOCKER_PTF_BRCM)_DEP_FILES := $(DEP_FILES)

View File

@ -1,8 +0,0 @@
# docker image for docker-ptf-brcm
DOCKER_PTF_BRCM = docker-ptf-brcm.gz
$(DOCKER_PTF_BRCM)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift
$(DOCKER_PTF_BRCM)_DEPENDS += $(PYTHON_SAITHRIFT)
$(DOCKER_PTF_BRCM)_LOAD_DOCKERS += $(DOCKER_PTF)
SONIC_DOCKER_IMAGES += $(DOCKER_PTF_BRCM)
SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_BRCM)

View File

@ -22,4 +22,3 @@ include $(PLATFORM_PATH)/one-pde-image.dep
include $(PLATFORM_PATH)/raw-image.dep
include $(PLATFORM_PATH)/one-aboot.dep
include $(PLATFORM_PATH)/libsaithrift-dev.dep
include $(PLATFORM_PATH)/docker-ptf-brcm.dep

View File

@ -19,7 +19,6 @@ include $(PLATFORM_PATH)/one-image.mk
include $(PLATFORM_PATH)/raw-image.mk
include $(PLATFORM_PATH)/one-aboot.mk
include $(PLATFORM_PATH)/libsaithrift-dev.mk
include $(PLATFORM_PATH)/docker-ptf-brcm.mk
BCMCMD = bcmcmd
$(BCMCMD)_URL = "https://sonicstorage.blob.core.windows.net/packages/20190307/bcmcmd?sv=2015-04-05&sr=b&sig=sUdbU7oVbh5exbXXHVL5TDFBTWDDBASHeJ8Cp0B0TIc%3D&se=2038-05-06T22%3A34%3A19Z&sp=r"

View File

@ -1,8 +0,0 @@
# docker image for docker-ptf-cavm
DOCKER_PTF_CAVM = docker-ptf-cavm.gz
$(DOCKER_PTF_CAVM)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift
$(DOCKER_PTF_CAVM)_DEPENDS += $(PYTHON_SAITHRIFT_CAVM)
$(DOCKER_PTF_CAVM)_LOAD_DOCKERS += $(DOCKER_PTF)
SONIC_DOCKER_IMAGES += $(DOCKER_PTF_CAVM)
SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_CAVM)

View File

@ -5,7 +5,6 @@ include $(PLATFORM_PATH)/cavm-platform-modules.mk
include $(PLATFORM_PATH)/cavm-xpnet.mk
include $(PLATFORM_PATH)/one-image.mk
include $(PLATFORM_PATH)/libsaithrift-dev.mk
include $(PLATFORM_PATH)/docker-ptf-cavm.mk
SONIC_ALL += $(SONIC_ONE_IMAGE) \
$(DOCKER_FPM) \

View File

@ -1,7 +0,0 @@
# docker image for docker-ptf-centec
DOCKER_PTF_CENTEC = docker-ptf-centec.gz
$(DOCKER_PTF_CENTEC)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift
$(DOCKER_PTF_CENTEC)_DEPENDS += $(PYTHON_SAITHRIFT)
$(DOCKER_PTF_CENTEC)_LOAD_DOCKERS += $(DOCKER_PTF)
SONIC_DOCKER_IMAGES += $(DOCKER_PTF_CENTEC)

View File

@ -3,7 +3,6 @@ include $(PLATFORM_PATH)/docker-syncd-centec.mk
include $(PLATFORM_PATH)/docker-syncd-centec-rpc.mk
include $(PLATFORM_PATH)/one-image.mk
include $(PLATFORM_PATH)/libsaithrift-dev.mk
include $(PLATFORM_PATH)/docker-ptf-centec.mk
include $(PLATFORM_PATH)/tsingma-bsp.mk
include $(PLATFORM_PATH)/platform-modules-centec-e530.mk

View File

@ -1,8 +0,0 @@
# docker image for docker-ptf-centec
DOCKER_PTF_CENTEC = docker-ptf-centec.gz
$(DOCKER_PTF_CENTEC)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift
$(DOCKER_PTF_CENTEC)_DEPENDS += $(PYTHON_SAITHRIFT)
$(DOCKER_PTF_CENTEC)_LOAD_DOCKERS += $(DOCKER_PTF)
SONIC_DOCKER_IMAGES += $(DOCKER_PTF_CENTEC)
SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_CENTEC)

View File

@ -5,7 +5,6 @@ include $(PLATFORM_PATH)/docker-syncd-centec.mk
include $(PLATFORM_PATH)/docker-syncd-centec-rpc.mk
include $(PLATFORM_PATH)/one-image.mk
include $(PLATFORM_PATH)/libsaithrift-dev.mk
include $(PLATFORM_PATH)/docker-ptf-centec.mk
SONIC_ALL += $(SONIC_ONE_IMAGE)

View File

@ -1,8 +0,0 @@
# docker image for docker-ptf-invm
DOCKER_PTF_INVM = docker-ptf-invm.gz
$(DOCKER_PTF_INVM)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift
$(DOCKER_PTF_INVM)_DEPENDS += $(PYTHON_SAITHRIFT_INVM)
$(DOCKER_PTF_INVM)_LOAD_DOCKERS += $(DOCKER_PTF)
SONIC_DOCKER_IMAGES += $(DOCKER_PTF_INVM)
SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_INVM)

View File

@ -6,7 +6,6 @@ include $(PLATFORM_PATH)/docker-syncd-invm-rpc.mk
include $(PLATFORM_PATH)/one-image.mk
include $(PLATFORM_PATH)/libsaithrift-dev.mk
include $(PLATFORM_PATH)/python-saithrift.mk
include $(PLATFORM_PATH)/docker-ptf-invm.mk
SONIC_ALL += $(SONIC_INVM_ONE_IMAGE) \
$(DOCKER_FPM) \

View File

@ -1,8 +0,0 @@
# docker image for docker-ptf-mrvl
DOCKER_PTF_MRVL = docker-ptf-mrvl.gz
$(DOCKER_PTF_MRVL)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift
$(DOCKER_PTF_MRVL)_DEPENDS += $(PYTHON_SAITHRIFT)
$(DOCKER_PTF_MRVL)_LOAD_DOCKERS += $(DOCKER_PTF)
SONIC_DOCKER_IMAGES += $(DOCKER_PTF_MRVL)
SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_MRVL)

View File

@ -4,7 +4,6 @@ include $(PLATFORM_PATH)/docker-syncd-mrvl.mk
include $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.mk
include $(PLATFORM_PATH)/docker-saiserver-mrvl.mk
include $(PLATFORM_PATH)/libsaithrift-dev.mk
include $(PLATFORM_PATH)/docker-ptf-mrvl.mk
include $(PLATFORM_PATH)/one-image.mk
include $(PLATFORM_PATH)/linux-kernel-arm64.mk
INCLUDE_SYSTEM_TELEMETRY = ""

View File

@ -1,8 +0,0 @@
# docker image for docker-ptf-mrvl
DOCKER_PTF_MRVL = docker-ptf-mrvl.gz
$(DOCKER_PTF_MRVL)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift
$(DOCKER_PTF_MRVL)_DEPENDS += $(PYTHON_SAITHRIFT)
$(DOCKER_PTF_MRVL)_LOAD_DOCKERS += $(DOCKER_PTF)
SONIC_DOCKER_IMAGES += $(DOCKER_PTF_MRVL)
SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_MRVL)

View File

@ -4,7 +4,6 @@ include $(PLATFORM_PATH)/docker-syncd-mrvl.mk
include $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.mk
include $(PLATFORM_PATH)/docker-saiserver-mrvl.mk
include $(PLATFORM_PATH)/libsaithrift-dev.mk
include $(PLATFORM_PATH)/docker-ptf-mrvl.mk
include $(PLATFORM_PATH)/one-image.mk
include $(PLATFORM_PATH)/linux-kernel-armhf.mk
include $(PLATFORM_PATH)/platform-et6448m.mk

View File

@ -1,10 +0,0 @@
# DPKG FRK
DPATH := $($(DOCKER_PTF_MLNX)_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-ptf-mlnx.mk $(PLATFORM_PATH)/docker-ptf-mlnx.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files -- $(DPATH))
$(DOCKER_PTF_MLNX)_CACHE_MODE := GIT_CONTENT_SHA
$(DOCKER_PTF_MLNX)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(DOCKER_PTF_MLNX)_DEP_FILES := $(DEP_FILES)

View File

@ -1,8 +0,0 @@
# docker image for docker-ptf-mlnx
DOCKER_PTF_MLNX = docker-ptf-mlnx.gz
$(DOCKER_PTF_MLNX)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift
$(DOCKER_PTF_MLNX)_DEPENDS += $(PYTHON_SAITHRIFT)
$(DOCKER_PTF_MLNX)_LOAD_DOCKERS += $(DOCKER_PTF)
SONIC_DOCKER_IMAGES += $(DOCKER_PTF_MLNX)
SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_MLNX)

View File

@ -11,7 +11,6 @@ include $(PLATFORM_PATH)/docker-syncd-mlnx-rpc.dep
include $(PLATFORM_PATH)/docker-saiserver-mlnx.dep
include $(PLATFORM_PATH)/one-image.dep
include $(PLATFORM_PATH)/libsaithrift-dev.dep
include $(PLATFORM_PATH)/docker-ptf-mlnx.dep
include $(PLATFORM_PATH)/mlnx-ffb.dep
include $(PLATFORM_PATH)/issu-version.dep
include $(PLATFORM_PATH)/mlnx-onie-fw-update.dep

View File

@ -9,7 +9,6 @@ include $(PLATFORM_PATH)/docker-syncd-mlnx-rpc.mk
include $(PLATFORM_PATH)/docker-saiserver-mlnx.mk
include $(PLATFORM_PATH)/one-image.mk
include $(PLATFORM_PATH)/libsaithrift-dev.mk
include $(PLATFORM_PATH)/docker-ptf-mlnx.mk
include $(PLATFORM_PATH)/mlnx-ffb.mk
include $(PLATFORM_PATH)/issu-version.mk
include $(PLATFORM_PATH)/mlnx-onie-fw-update.mk

View File

@ -1,8 +0,0 @@
# docker image for docker-ptf-nephos
DOCKER_PTF_NEPHOS = docker-ptf-nephos.gz
$(DOCKER_PTF_NEPHOS)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift
$(DOCKER_PTF_NEPHOS)_DEPENDS += $(PYTHON_SAITHRIFT_NEPHOS)
$(DOCKER_PTF_NEPHOS)_LOAD_DOCKERS += $(DOCKER_PTF)
SONIC_DOCKER_IMAGES += $(DOCKER_PTF_NEPHOS)
SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_NEPHOS)

View File

@ -7,7 +7,6 @@ include $(PLATFORM_PATH)/docker-syncd-nephos.mk
include $(PLATFORM_PATH)/docker-syncd-nephos-rpc.mk
include $(PLATFORM_PATH)/one-image.mk
include $(PLATFORM_PATH)/libsaithrift-dev.mk
include $(PLATFORM_PATH)/docker-ptf-nephos.mk
NPX_DIAG = npx_diag
$(NPX_DIAG)_URL = "https://github.com/NephosInc/SONiC/raw/master/sdk/npx_diag"

View File

@ -1,10 +1,10 @@
DPATH := $($(DOCKER_PTF)_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/docker-ptf.mk rules/docker-ptf.dep
DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/vs/docker-ptf.mk platform/vs/docker-ptf.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(DPATH))
$(DOCKER_PTF)_CACHE_MODE := GIT_CONTENT_SHA
$(DOCKER_PTF)_CACHE_MODE := GIT_CONTENT_SHA
$(DOCKER_PTF)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(DOCKER_PTF)_DEP_FILES := $(DEP_FILES)

View File

@ -1,7 +1,7 @@
# docker image for ptf
# docker image for docker-ptf
DOCKER_PTF = docker-ptf.gz
$(DOCKER_PTF)_PATH = $(DOCKERS_PATH)/docker-ptf
$(DOCKER_PTF)_DEPENDS += $(LIBTHRIFT) $(PYTHON_THRIFT) $(PTF)
$(DOCKER_PTF)_DEPENDS += $(LIBTHRIFT) $(PYTHON_THRIFT) $(PTF) $(PYTHON_SAITHRIFT)
SONIC_DOCKER_IMAGES += $(DOCKER_PTF)
SONIC_STRETCH_DOCKERS += $(DOCKER_PTF)

View File

@ -0,0 +1,13 @@
#DPKG FRK
SPATH := $($(LIBSAITHRIFT_DEV)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/broadcom/libsaithrift-dev.mk platform/broadcom/libsaithrift-dev.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
SMDEP_PATHS := $(SPATH) $(SPATH)/bm/behavioral-model $(SPATH)/test/ptf $(SPATH)/test/saithrift/ctypesgen
$(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/, $(shell cd $(path) && git ls-files | grep -Ev " " )))))
$(LIBSAITHRIFT_DEV)_CACHE_MODE := GIT_CONTENT_SHA
$(LIBSAITHRIFT_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(LIBSAITHRIFT_DEV)_DEP_FILES := $(DEP_FILES)
$(LIBSAITHRIFT_DEV)_SMDEP_FILES := $(foreach path, $(SMDEP_PATHS), $($(path)))
$(LIBSAITHRIFT_DEV)_SMDEP_PATHS := $(SMDEP_PATHS)

View File

@ -0,0 +1,21 @@
# libsaithrift-dev package
SAI_VER = 0.9.4
LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_$(CONFIGURED_ARCH).deb
$(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) \
$(LIBSAIVS) $(LIBSAIVS_DEV) $(LIBSAIMETADATA) $(LIBSAIMETADATA_DEV)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) $(LIBSAIVS) $(LIBSAIMETADATA)
SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV)
PYTHON_SAITHRIFT = python-saithrift_$(SAI_VER)_$(CONFIGURED_ARCH).deb
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(PYTHON_SAITHRIFT)))
SAISERVER = saiserver_$(SAI_VER)_$(CONFIGURED_ARCH).deb
$(SAISERVER)_RDEPENDS += $(LIBTHRIFT) $(LIBSAIVS)
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER)))
SAISERVER_DBG = saiserver-dbg_$(SAI_VER)_$(CONFIGURED_ARCH).deb
$(SAISERVER_DBG)_RDEPENDS += $(SAISERVER)
$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER_DBG)))

View File

@ -3,6 +3,8 @@ include $(PLATFORM_PATH)/sonic-version.dep
include $(PLATFORM_PATH)/docker-sonic-vs.dep
include $(PLATFORM_PATH)/docker-syncd-vs.dep
include $(PLATFORM_PATH)/docker-gbsyncd-vs.dep
include $(PLATFORM_PATH)/docker-ptf.dep
include $(PLATFORM_PATH)/libsaithrift-dev.dep
include $(PLATFORM_PATH)/one-image.dep
include $(PLATFORM_PATH)/onie.dep
include $(PLATFORM_PATH)/kvm-image.dep

View File

@ -3,6 +3,8 @@ include $(PLATFORM_PATH)/sonic-version.mk
include $(PLATFORM_PATH)/docker-sonic-vs.mk
include $(PLATFORM_PATH)/docker-syncd-vs.mk
include $(PLATFORM_PATH)/docker-gbsyncd-vs.mk
include $(PLATFORM_PATH)/docker-ptf.mk
include $(PLATFORM_PATH)/libsaithrift-dev.mk
include $(PLATFORM_PATH)/one-image.mk
include $(PLATFORM_PATH)/onie.mk
include $(PLATFORM_PATH)/kvm-image.mk