From 7d4f348c09b7c59b05047da1ebadc8088c1d0497 Mon Sep 17 00:00:00 2001 From: Ze Gan Date: Wed, 6 Dec 2023 09:51:14 +0800 Subject: [PATCH] [submodule]: Update submodule sonic-swss/sonic-dash-api/protobuf (#17413) ### Why I did it 1. Protobuf 3.21 has been released in the Debian bookworm 2. Update submodule sonic-swss and sonic-dash-api because they include related updates. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it 1. In the protobuf.mk, If it isn't bullseye, ignore to compile the protobuf package 2. Move sonic-swss commits: ``` fd852084 (HEAD, origin/master, origin/HEAD) [dashrouteorch]: Rename dash route namespace (#2966) ``` 3. Move sonic-dash-api and move build chain to its submodule ``` d4448c7 (HEAD, origin/master, origin/HEAD, master) [azp]: Add multi-platform artifacts (#11) 8a5e5cc [debian]: Add debian package (#10) d96163a [misc]: Add dash utils and its tests (#9) ``` #### How to verify it Check Azp --- .gitmodules | 4 +-- rules/protobuf.mk | 51 +++++++++++++++------------- rules/sonic-dash-api.mk | 6 ++-- sonic-slave-bookworm/Dockerfile.j2 | 7 ++-- src/sonic-dash-api | 1 + src/sonic-dash-api/.gitignore | 2 -- src/sonic-dash-api/Makefile | 47 ------------------------- src/sonic-dash-api/debian/changelog | 6 ---- src/sonic-dash-api/debian/compat | 1 - src/sonic-dash-api/debian/control | 13 ------- src/sonic-dash-api/debian/rules | 8 ----- src/sonic-dash-api/pypkg/__init__.py | 5 --- src/sonic-dash-api/sonic-dash-api | 1 - src/sonic-swss | 2 +- 14 files changed, 38 insertions(+), 116 deletions(-) create mode 160000 src/sonic-dash-api delete mode 100644 src/sonic-dash-api/.gitignore delete mode 100644 src/sonic-dash-api/Makefile delete mode 100644 src/sonic-dash-api/debian/changelog delete mode 100644 src/sonic-dash-api/debian/compat delete mode 100644 src/sonic-dash-api/debian/control delete mode 100755 src/sonic-dash-api/debian/rules delete mode 100644 src/sonic-dash-api/pypkg/__init__.py delete mode 160000 src/sonic-dash-api/sonic-dash-api diff --git a/.gitmodules b/.gitmodules index ccd3674cb0..e9b57673b2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -112,8 +112,8 @@ [submodule "src/dhcpmon"] path = src/dhcpmon url = https://github.com/sonic-net/sonic-dhcpmon.git -[submodule "src/sonic-dash-api/sonic-dash-api"] - path = src/sonic-dash-api/sonic-dash-api +[submodule "src/sonic-dash-api"] + path = src/sonic-dash-api url = https://github.com/sonic-net/sonic-dash-api.git [submodule "platform/marvell-arm64/mrvl-prestera"] path = platform/marvell-arm64/mrvl-prestera diff --git a/rules/protobuf.mk b/rules/protobuf.mk index 5e50eac862..866eb6b99f 100644 --- a/rules/protobuf.mk +++ b/rules/protobuf.mk @@ -1,32 +1,37 @@ # protobuf package +# Protobuf 3.21.12 has been released in bookworm, So we only need to build it +# in the bullseye environment. +ifeq ($(BLDENV),bullseye) -PROTOBUF_VERSION = 3.21.12 -PROTOBUF_VERSION_FULL = $(PROTOBUF_VERSION)-3 + PROTOBUF_VERSION = 3.21.12 + PROTOBUF_VERSION_FULL = $(PROTOBUF_VERSION)-3 -export PROTOBUF_VERSION -export PROTOBUF_VERSION_FULL + export PROTOBUF_VERSION + export PROTOBUF_VERSION_FULL -PROTOBUF = libprotobuf32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(PROTOBUF)_SRC_PATH = $(SRC_PATH)/protobuf -SONIC_MAKE_DEBS += $(PROTOBUF) + PROTOBUF = libprotobuf32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PROTOBUF)_SRC_PATH = $(SRC_PATH)/protobuf + SONIC_MAKE_DEBS += $(PROTOBUF) -PROTOBUF_DEV = libprotobuf-dev_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(PROTOBUF_DEV)_DEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) -$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_DEV))) + PROTOBUF_DEV = libprotobuf-dev_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PROTOBUF_DEV)_DEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) + $(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_DEV))) -PROTOBUF_LITE = libprotobuf-lite32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_LITE))) + PROTOBUF_LITE = libprotobuf-lite32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_LITE))) -PROTOC32 = libprotoc32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(PROTOC32)_RDEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) -$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOC32))) + PROTOC32 = libprotoc32_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PROTOC32)_RDEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) + $(eval $(call add_derived_package,$(PROTOBUF),$(PROTOC32))) -PROTOBUF_COMPILER = protobuf-compiler_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(PROTOBUF_COMPILER)_DEPENDS = $(PROTOC32) -$(PROTOBUF_COMPILER)_RDEPENDS = $(PROTOC32) -$(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_COMPILER))) + PROTOBUF_COMPILER = protobuf-compiler_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PROTOBUF_COMPILER)_DEPENDS = $(PROTOC32) + $(PROTOBUF_COMPILER)_RDEPENDS = $(PROTOC32) + $(eval $(call add_derived_package,$(PROTOBUF),$(PROTOBUF_COMPILER))) -PYTHON3_PROTOBUF = python3-protobuf_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(PYTHON3_PROTOBUF)_DEPENDS = $(PROTOBUF_DEV) $(PROTOBUF) -$(PYTHON3_PROTOBUF)_RDEPENDS = $(PROTOBUF) -$(eval $(call add_derived_package,$(PROTOBUF),$(PYTHON3_PROTOBUF))) + PYTHON3_PROTOBUF = python3-protobuf_$(PROTOBUF_VERSION_FULL)_$(CONFIGURED_ARCH).deb + $(PYTHON3_PROTOBUF)_DEPENDS = $(PROTOBUF_DEV) $(PROTOBUF) + $(PYTHON3_PROTOBUF)_RDEPENDS = $(PROTOBUF) + $(eval $(call add_derived_package,$(PROTOBUF),$(PYTHON3_PROTOBUF))) + +endif diff --git a/rules/sonic-dash-api.mk b/rules/sonic-dash-api.mk index e6d9e34c03..742b2c3f9c 100644 --- a/rules/sonic-dash-api.mk +++ b/rules/sonic-dash-api.mk @@ -5,8 +5,10 @@ LIB_SONIC_DASH_API_VERSION = 1.0.0 LIB_SONIC_DASH_API = libdashapi_$(LIB_SONIC_DASH_API_VERSION)_$(CONFIGURED_ARCH).deb $(LIB_SONIC_DASH_API)_SRC_PATH = $(SRC_PATH)/sonic-dash-api -$(LIB_SONIC_DASH_API)_DEPENDS += $(PROTOBUF) $(PROTOBUF_LITE) $(PROTOBUF_DEV) $(PROTOBUF_COMPILER) -$(LIB_SONIC_DASH_API)_RDEPENDS += $(PROTOBUF) $(PROTOBUF_LITE) $(PYTHON3_PROTOBUF) +ifeq ($(BLDENV),bullseye) + $(LIB_SONIC_DASH_API)_DEPENDS += $(PROTOBUF) $(PROTOBUF_LITE) $(PROTOBUF_DEV) $(PROTOBUF_COMPILER) + $(LIB_SONIC_DASH_API)_RDEPENDS += $(PROTOBUF) $(PROTOBUF_LITE) $(PYTHON3_PROTOBUF) +endif SONIC_DPKG_DEBS += $(LIB_SONIC_DASH_API) diff --git a/sonic-slave-bookworm/Dockerfile.j2 b/sonic-slave-bookworm/Dockerfile.j2 index 95af2bd82e..ef29115b0e 100644 --- a/sonic-slave-bookworm/Dockerfile.j2 +++ b/sonic-slave-bookworm/Dockerfile.j2 @@ -417,11 +417,8 @@ RUN apt-get update && apt-get install -y \ libauparse-dev \ auditd \ # For protobuf - dh-elpa \ - xmlto \ - rake-compiler \ - default-jdk \ - libgoogle-gson-java + protobuf-compiler \ + libprotobuf-dev {%- if CROSS_BUILD_ENVIRON == "y" %} # Arm vs. amd64 versions conflict - remove amd64 packages diff --git a/src/sonic-dash-api b/src/sonic-dash-api new file mode 160000 index 0000000000..d4448c78b4 --- /dev/null +++ b/src/sonic-dash-api @@ -0,0 +1 @@ +Subproject commit d4448c78b4e0afd1ec6dfaa390aef5c650cee4b3 diff --git a/src/sonic-dash-api/.gitignore b/src/sonic-dash-api/.gitignore deleted file mode 100644 index ff64e429bd..0000000000 --- a/src/sonic-dash-api/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -build -debian/sonic-dash-api diff --git a/src/sonic-dash-api/Makefile b/src/sonic-dash-api/Makefile deleted file mode 100644 index 0031800cce..0000000000 --- a/src/sonic-dash-api/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -.ONESHELL: -SHELL = /bin/bash -.SHELLFLAGS += -e - -RM := rm -rf -CP := cp -rf -MKDIR := mkdir -MV := mv -LIBDASHAPI := libdashapi.so -BUILD_DIR := build -PYPKG_DIR := pypkg -DESTDIR := -DASH_API_PROTO_DIR := sonic-dash-api/proto -INSTALLED_HEADER_DIR := $(DESTDIR)/usr/include/dash_api -INSTALLED_LIB_DIR := $(DESTDIR)/usr/lib -INSTALLED_PYTHON_DIR := $(DESTDIR)/usr/lib/python3/dist-packages/dash_api - -all: compile_cpp_proto dashapi.so compile_py_proto - -compile_cpp_proto: - $(MKDIR) -p $(BUILD_DIR) - protoc -I=$(DASH_API_PROTO_DIR) --cpp_out=$(BUILD_DIR) $(DASH_API_PROTO_DIR)/*.proto - -dashapi.so: compile_cpp_proto - g++ -std=c++14 -fPIC -shared -o $(BUILD_DIR)/$(LIBDASHAPI) $(wildcard $(BUILD_DIR)/*.pb.cc) -lprotobuf - -compile_py_proto: - protoc -I=$(DASH_API_PROTO_DIR) --python_out=$(PYPKG_DIR) $(DASH_API_PROTO_DIR)/*.proto - -clean: - $(RM) $(BUILD_DIR) - $(RM) $(PYPKG_DIR)/*_pb2.py - -install: - $(MKDIR) -p $(INSTALLED_HEADER_DIR) - $(CP) $(BUILD_DIR)/*.pb.h $(INSTALLED_HEADER_DIR) - $(MKDIR) -p $(INSTALLED_LIB_DIR) - $(CP) $(BUILD_DIR)/$(LIBDASHAPI) $(INSTALLED_LIB_DIR) - $(MKDIR) -p $(INSTALLED_PYTHON_DIR) - $(CP) $(PYPKG_DIR)/* $(INSTALLED_PYTHON_DIR) - -uninstall: - $(RM) $(INSTALLED_HEADER_DIR) - $(RM) $(INSTALLED_LIB_DIR)/$(LIBDASHAPI) - $(RM) $(INSTALLED_PYTHON_DIR) - -.PHONY: uninstall clean diff --git a/src/sonic-dash-api/debian/changelog b/src/sonic-dash-api/debian/changelog deleted file mode 100644 index e5cb52398c..0000000000 --- a/src/sonic-dash-api/debian/changelog +++ /dev/null @@ -1,6 +0,0 @@ -sonic (1.0.0) stable; urgency=medium - - * Initial release. - - -- Ze Gan Wed, 14 Jun 2023 12:00:00 -0800 - diff --git a/src/sonic-dash-api/debian/compat b/src/sonic-dash-api/debian/compat deleted file mode 100644 index 9d607966b7..0000000000 --- a/src/sonic-dash-api/debian/compat +++ /dev/null @@ -1 +0,0 @@ -11 \ No newline at end of file diff --git a/src/sonic-dash-api/debian/control b/src/sonic-dash-api/debian/control deleted file mode 100644 index 545204fbe7..0000000000 --- a/src/sonic-dash-api/debian/control +++ /dev/null @@ -1,13 +0,0 @@ -Source: sonic -Maintainer: Ze Gan -Section: net -Priority: optional -Build-Depends: dh-exec (>=0.3), debhelper (>= 12), autotools-dev, -Standards-Version: 1.0.0 - -Package: libdashapi -Architecture: any -Build-Depends: protobuf-compiler (>=3.21.12), libprotobuf-dev (>=3.21.12) -Depends: libprotobuf32 (>=3.21.12), libprotobuf-lite32 (>=3.21.12) -Section: libs -Description: DASH API definition for the SONiC project. diff --git a/src/sonic-dash-api/debian/rules b/src/sonic-dash-api/debian/rules deleted file mode 100755 index e661a7acd0..0000000000 --- a/src/sonic-dash-api/debian/rules +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/make -f -#export DH_VERBOSE = 1 - -%: - dh $@ - -override_dh_auto_build: - make all diff --git a/src/sonic-dash-api/pypkg/__init__.py b/src/sonic-dash-api/pypkg/__init__.py deleted file mode 100644 index ade95c521a..0000000000 --- a/src/sonic-dash-api/pypkg/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -import sys -import os - - -sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) diff --git a/src/sonic-dash-api/sonic-dash-api b/src/sonic-dash-api/sonic-dash-api deleted file mode 160000 index 3f728d1bbf..0000000000 --- a/src/sonic-dash-api/sonic-dash-api +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3f728d1bbf65d2e8c41bdc023d5c07702a7f848b diff --git a/src/sonic-swss b/src/sonic-swss index d839eec3c0..fd852084d4 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit d839eec3c02a5911645dbfc93aa5bb474bbff38f +Subproject commit fd852084d49f54bb15fa414eff4b2eab546ed64a