Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test syncd with sai ptf v2 #12619

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3da8760
support sai-ptf-v2 in libsaithrift vs
richardyu-ms Jul 27, 2022
4a3f166
add build target docker-ptf-sai syncd-rpcv2 and saiserverv2
richardyu-ms Aug 2, 2022
255f416
add docker ptf sai
richardyu-ms Aug 2, 2022
f05d082
add build condition for broadcom
richardyu-ms Aug 2, 2022
30d1a31
add docker syncd dbg and add debug symbol to docker-saiserverv2
richardyu-ms Aug 28, 2022
1fb3730
correct the build option
richardyu-ms Aug 28, 2022
2f31a1b
change the azure pipeline build template
richardyu-ms Aug 30, 2022
9d37f8e
change build option for docker-ptf-sai
richardyu-ms Sep 19, 2022
14f7327
enable ptf-sai docker build
richardyu-ms Sep 19, 2022
9d8a66c
remove the build for syncd-rpcv2
richardyu-ms Sep 19, 2022
13dbc6a
fix issue in build tempalte
richardyu-ms Nov 3, 2022
987d835
ignore useless package build when build sai-ptf
richardyu-ms Nov 4, 2022
c7b3892
remove scapy version contraint
richardyu-ms Nov 4, 2022
5278e7b
remove duplicated target docker-ptf
richardyu-ms Nov 5, 2022
549ddfc
change template for testing the pipeline
richardyu-ms Nov 5, 2022
fb999e7
remove duplicated target
richardyu-ms Nov 5, 2022
6b59e96
fix error in make script
richardyu-ms Nov 5, 2022
c624066
add shel to setup env
richardyu-ms Nov 5, 2022
a7c6a27
replace with certain platform name
richardyu-ms Nov 5, 2022
2baab22
disable cache for syncd-rpcv2
richardyu-ms Nov 5, 2022
3ef4a3d
test without cache
richardyu-ms Nov 5, 2022
5628ecb
disable cache
richardyu-ms Nov 6, 2022
0d15eb4
testing: disable the cache for build syncd-rpcv2
richardyu-ms Nov 6, 2022
84721fc
add cache back and get the code ready for testing
richardyu-ms Nov 6, 2022
c77e3fc
refactor code
richardyu-ms Nov 6, 2022
8b0aa2f
add workaround for git files-ls issue
richardyu-ms Nov 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .azure-pipelines/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,28 @@ jobs:
mv target/docker-sonic-vs.gz target/docker-sonic-vs-asan.gz
fi
make $BUILD_OPTIONS target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz
make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y SAITHRIFT_V2=y target/docker-ptf-sai.gz
if [ $(Build.Reason) != 'PullRequest' ];then
gzip -kd target/sonic-vs.img.gz
SONIC_RUN_CMDS="qemu-img convert target/sonic-vs.img -O vhdx -o subformat=dynamic target/sonic-vs.vhdx" make sonic-slave-run
rm target/sonic-vs.img
fi
else
if [ $(GROUP_NAME) == broadcom ]; then
make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y SAITHRIFT_V2=y target/docker-saiserverv2-brcm.gz
pushd ./src/sonic-sairedis/SAI
git ls-files
git stash
git ls-files
popd
echo BUILD_OPTIONS $BUILD_OPTIONS
make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y SAITHRIFT_V2=y target/docker-syncd-brcm-rpcv2.gz
pushd ./src/sonic-sairedis/SAI
git ls-files
git stash
git ls-files
popd
fi
if [ $(dbg_image) == yes ]; then
make $BUILD_OPTIONS INSTALL_DEBUG_TOOLS=y target/sonic-$(GROUP_NAME).bin
mv target/sonic-$(GROUP_NAME).bin target/sonic-$(GROUP_NAME)-dbg.bin
Expand All @@ -139,8 +155,23 @@ jobs:
fi
if [ $(docker_syncd_rpc_image) == yes ]; then
make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y target/docker-syncd-$(platform_rpc)-rpc.gz
pushd ./src/sonic-sairedis/SAI
git stash
popd
if [ $(GROUP_NAME) == broadcom ]; then
make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y target/docker-syncd-$(platform_rpc)-dnx-rpc.gz
pushd ./src/sonic-sairedis/SAI
git stash
popd
make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y SAITHRIFT_V2=y target/docker-saiserverv2-brcm.gz
pushd ./src/sonic-sairedis/SAI
git stash
popd
echo BUILD_OPTIONS $BUILD_OPTIONS
make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y SAITHRIFT_V2=y target/docker-syncd-brcm-rpcv2.gz
pushd ./src/sonic-sairedis/SAI
git stash
popd
fi
fi
if [ $(syncd_rpc_image) == yes ]; then
Expand Down
24 changes: 24 additions & 0 deletions .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,18 @@ jobs:
fi

make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_SYNCD_RPC=y SAITHRIFT_V2=y target/docker-ptf-sai.gz
else
if [ ${{ parameters.platform }} == broadcom ]; then
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) SAITHRIFT_V2=y ENABLE_SYNCD_RPC=y target/docker-syncd-brcm-rpcv2.gz
pushd ./src/sonic-sairedis/SAI
git stash
popd
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_SYNCD_RPC=y SAITHRIFT_V2=y target/docker-saiserverv2-brcm.gz
pushd ./src/sonic-sairedis/SAI
git stash
popd
fi
if [ ${{ parameters.dbg_image }} == true ]; then
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) INSTALL_DEBUG_TOOLS=y target/sonic-${{ parameters.platform }}.bin && \
mv target/sonic-${{ parameters.platform }}.bin target/sonic-${{ parameters.platform }}-dbg.bin
Expand All @@ -105,6 +116,19 @@ jobs:
fi
if [ ${{ parameters.sync_rpc_image }} == true ]; then
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_SYNCD_RPC=y target/docker-syncd-${{ parameters.platform_short }}-rpc.gz
pushd ./src/sonic-sairedis/SAI
git stash
popd
if [ ${{ parameters.platform }} == broadcom ]; then
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) SAITHRIFT_V2=y ENABLE_SYNCD_RPC=y target/docker-syncd-brcm-rpcv2.gz
pushd ./src/sonic-sairedis/SAI
git stash
popd
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_SYNCD_RPC=y SAITHRIFT_V2=y target/docker-saiserverv2-brcm.gz
pushd ./src/sonic-sairedis/SAI
git stash
popd
fi
fi

make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.bin
Expand Down
7 changes: 6 additions & 1 deletion dockers/docker-ptf-sai/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN pip3 install crc16 \
getmac \
packet_helper \
psutil \
scapy==2.4.4 \
scapy \
scapy_helper \
pysubnettree \
xmlrunner
Expand All @@ -39,3 +39,8 @@ RUN dpkg -r python-ptf
RUN git clone https://github.com/p4lang/ptf.git \
&& cd ptf \
&& python3.7 setup.py install --single-version-externally-managed --record /tmp/ptf_install.txt

run echo "declare -x LANG=\"C.UTF-8\"" >> /root/.bashrc
run echo "declare -x LC_ALL=\"C.UTF-8\"" >> /root/.bashrc
run echo "declare -x PYTHONIOENCODING=\"UTF-8\"" >> /root/.bashrc
run echo "declare -x VIRTUAL_ENV=\"/root/env-python3\"" >> /root/.bashrc
2 changes: 1 addition & 1 deletion platform/broadcom/docker-saiserver-brcm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

DOCKER_SAISERVER_BRCM = docker-saiserver$(SAITHRIFT_VER)-brcm.gz
$(DOCKER_SAISERVER_BRCM)_PATH = $(PLATFORM_PATH)/docker-saiserver-brcm
$(DOCKER_SAISERVER_BRCM)_DEPENDS += $(SAISERVER)
$(DOCKER_SAISERVER_BRCM)_DEPENDS += $(SAISERVER) $(SAISERVER_DBG)
$(DOCKER_SAISERVER_BRCM)_FILES += $(DSSERVE) $(BCMCMD)
$(DOCKER_SAISERVER_BRCM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE)
SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_BRCM)
Expand Down
21 changes: 20 additions & 1 deletion platform/broadcom/docker-syncd-brcm-rpc.mk
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
# docker image for brcm syncd with rpc

DOCKER_SYNCD_BRCM_RPC = docker-syncd-brcm-rpc.gz
DOCKER_SYNCD_BRCM_RPC = docker-syncd-brcm-rpc$(SAITHRIFT_VER).gz
DOCKER_SYNCD_BRCM_RPC_DBG = docker-syncd-brcm-rpc$(SAITHRIFT_VER)-$(DBG_IMAGE_MARK).gz
$(DOCKER_SYNCD_BRCM_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-brcm-rpc


#Support two different versions of thrift
ifeq ($(SAITHRIFT_V2),y)
$(DOCKER_SYNCD_BRCM_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT_0_14_1) $(LIBTHRIFT_0_14_1_DEV) $(PYTHON3_THRIFT_0_14_1) $(THRIFT_0_14_1_COMPILER) $(PTF)
else
$(DOCKER_SYNCD_BRCM_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(PTF)
endif

ifeq ($(INSTALL_DEBUG_TOOLS), y)
$(DOCKER_SYNCD_BRCM_RPC)_DEPENDS += $(SYNCD_RPC_DBG) \
$(LIBSWSSCOMMON_DBG) \
$(LIBSAIMETADATA_DBG) \
$(LIBSAIREDIS_DBG)
endif
$(DOCKER_SYNCD_BRCM_RPC)_FILES += $(DSSERVE) $(BCMCMD) $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)

$(DOCKER_SYNCD_BRCM_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BASE)
$(DOCKER_SYNCD_BRCM_RPC)_DBG_DEPENDS += $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS)
$(DOCKER_SYNCD_BRCM_RPC)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES)

SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_BRCM_RPC)
ifeq ($(ENABLE_SYNCD_RPC),y)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_BRCM_RPC)
endif

SONIC_DOCKER_DBG_IMAGES += $(DOCKER_SYNCD_BRCM_RPC_DBG)
ifneq ($(ENABLE_SYNCD_RPC),y)
SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_SYNCD_BRCM_RPC_DBG)
endif

$(DOCKER_SYNCD_BRCM_RPC)_CONTAINER_NAME = syncd
$(DOCKER_SYNCD_BRCM_RPC)_VERSION = 1.0.0+rpc
$(DOCKER_SYNCD_BRCM_RPC)_PACKAGE_NAME = syncd
Expand All @@ -30,3 +48,4 @@ $(DOCKER_SYNCD_BRCM_RPC)_BASE_IMAGE_FILES += bcmsh:/usr/bin/bcmsh
$(DOCKER_SYNCD_BRCM_RPC)_MACHINE = broadcom

SONIC_BULLSEYE_DOCKERS += $(DOCKER_SYNCD_BRCM_RPC)
SONIC_BULLSEYE_DBG_DOCKERS += $(DOCKER_SYNCD_BRCM_RPC_DBG)
1 change: 1 addition & 0 deletions platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ RUN apt-get update \
cmake \
libqt5core5a \
libqt5network5 \
gdb \
libboost-atomic1.74.0

RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \
Expand Down
2 changes: 1 addition & 1 deletion platform/vs/docker-ptf-sai.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
DOCKER_PTF_SAI = docker-ptf-sai.gz
DOCKER_PTF_BASE = docker-ptf.gz
$(DOCKER_PTF_SAI)_PATH = $(DOCKERS_PATH)/docker-ptf-sai
$(DOCKER_PTF_SAI)_DEPENDS += $(LIBTHRIFT_2) $(PYTHON3_THRIFT_2)
$(DOCKER_PTF_SAI)_DEPENDS += $(LIBTHRIFT_0_14_1) $(PYTHON3_THRIFT_0_14_1)
$(DOCKER_PTF_SAI)_LOAD_DOCKERS += $(DOCKER_PTF_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_PTF_SAI)
SONIC_BUSTER_DOCKERS += $(DOCKER_PTF_SAI)
8 changes: 7 additions & 1 deletion platform/vs/docker-ptf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
DOCKER_PTF = docker-ptf.gz
$(DOCKER_PTF)_PYTHON_WHEELS += $(PTF_PY3)
$(DOCKER_PTF)_PATH = $(DOCKERS_PATH)/docker-ptf
$(DOCKER_PTF)_DEPENDS += $(LIBTHRIFT) $(PYTHON_THRIFT) $(PTF) $(PYTHON_SAITHRIFT)
$(DOCKER_PTF)_DEPENDS += $(LIBTHRIFT) $(PYTHON_THRIFT) $(PTF)
#Don't need PYTHON_SAITHRIFT in SAITHRIFT_V2 environment
ifeq ($(SAITHRIFT_V2),)
$(DOCKER_PTF)_DEPENDS += $(PYTHON_SAITHRIFT)
else
$(info "SAITHRIFT_V2: $(SAITHRIFT_V2):skip install $(PYTHON_SAITHRIFT).")
endif
SONIC_DOCKER_IMAGES += $(DOCKER_PTF)
SONIC_BUSTER_DOCKERS += $(DOCKER_PTF)
10 changes: 9 additions & 1 deletion platform/vs/libsaithrift-dev.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@

SAI_VER = 0.9.4

LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_$(CONFIGURED_ARCH).deb
LIBSAITHRIFT_DEV = libsaithrift$(SAITHRIFT_VER)-dev_$(SAI_VER)_$(CONFIGURED_ARCH).deb
$(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI
#Support two different versions of thrift
ifeq ($(SAITHRIFT_V2),y)
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT_0_14_1) $(LIBTHRIFT_0_14_1_DEV) $(PYTHON3_THRIFT_0_14_1) $(THRIFT_0_14_1_COMPILER) \
$(LIBSAIVS) $(LIBSAIVS_DEV) $(LIBSAIMETADATA) $(LIBSAIMETADATA_DEV)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT_0_14_1) $(LIBSAIVS) $(LIBSAIMETADATA)
$(LIBSAITHRIFT_DEV)_BUILD_ENV = SAITHRIFTV2=true SAITHRIFT_VER=v2 platform=vs
else
$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) \
$(LIBSAIVS) $(LIBSAIVS_DEV) $(LIBSAIMETADATA) $(LIBSAIMETADATA_DEV)
$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) $(LIBSAIVS) $(LIBSAIMETADATA)
$(LIBSAITHRIFT_DEV)_BUILD_ENV = platform=vs
endif
SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV)

PYTHON_SAITHRIFT = python-saithrift_$(SAI_VER)_$(CONFIGURED_ARCH).deb
Expand Down
8 changes: 7 additions & 1 deletion rules/syncd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ $(SYNCD_RPC)_RDEPENDS += $(LIBSAIREDIS) $(LIBSAIMETADATA)
$(eval $(call add_derived_package,$(SYNCD),$(SYNCD_RPC)))

# Inject libthrift build dependency for RPC build
$(SYNCD)_DEPENDS += $(LIBSWSSCOMMON_DEV) $(LIBTHRIFT_DEV)
# Support two different versions of thrift
ifeq ($(SAITHRIFT_V2),y)
$(SYNCD)_DEPENDS += $(LIBTHRIFT_0_14_1_DEV)
else
$(SYNCD)_DEPENDS += $(LIBTHRIFT_DEV)
endif
$(SYNCD)_DEPENDS += $(LIBSWSSCOMMON_DEV)
$(SYNCD)_DPKG_TARGET = binary-syncd-rpc
endif

Expand Down