From 872c85d8e75b35829c3e7bf782d6b21d5f110e56 Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Mon, 30 Nov 2020 10:44:40 -0800 Subject: [PATCH] [lldp]: Lldp docker to use python3 version of sonic-db-syncd package. (#6046) Made changes so that Lldp docker start using py3 of sonic-db-syncd submodule update sonic-db-syncd 5cc29a1b32d8d1f4dfbc967bfea2727c50a49c76 (HEAD -> master, origin/master, origin/HEAD) Changes to convert sonic-dbsyncd from python 2 to 3 Signed-off-by: Abhishek Dosi --- dockers/docker-lldp/base_image_files/monit_lldp | 2 +- dockers/docker-lldp/supervisord.conf.j2 | 2 +- rules/dbsyncd-py3.dep | 11 +++++++++++ rules/dbsyncd-py3.mk | 7 +++++++ rules/docker-lldp.mk | 4 ++-- src/sonic-dbsyncd | 2 +- 6 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 rules/dbsyncd-py3.dep create mode 100644 rules/dbsyncd-py3.mk diff --git a/dockers/docker-lldp/base_image_files/monit_lldp b/dockers/docker-lldp/base_image_files/monit_lldp index c522e5f224..d470972ace 100644 --- a/dockers/docker-lldp/base_image_files/monit_lldp +++ b/dockers/docker-lldp/base_image_files/monit_lldp @@ -8,7 +8,7 @@ check program lldp|lldpd_monitor with path "/usr/bin/process_checker lldp lldpd:" if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles -check program lldp|lldp_syncd with path "/usr/bin/process_checker lldp python2 -m lldp_syncd" +check program lldp|lldp_syncd with path "/usr/bin/process_checker lldp python3 -m lldp_syncd" if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles check program lldp|lldpmgrd with path "/usr/bin/process_checker lldp python3 /usr/bin/lldpmgrd" diff --git a/dockers/docker-lldp/supervisord.conf.j2 b/dockers/docker-lldp/supervisord.conf.j2 index 3abd847c4a..4692f7bf2a 100644 --- a/dockers/docker-lldp/supervisord.conf.j2 +++ b/dockers/docker-lldp/supervisord.conf.j2 @@ -69,7 +69,7 @@ dependent_startup=true dependent_startup_wait_for=lldpd:running [program:lldp-syncd] -command=/usr/bin/env python2 -m lldp_syncd +command=/usr/bin/env python3 -m lldp_syncd priority=4 autostart=false autorestart=false diff --git a/rules/dbsyncd-py3.dep b/rules/dbsyncd-py3.dep new file mode 100644 index 0000000000..42a31c2c49 --- /dev/null +++ b/rules/dbsyncd-py3.dep @@ -0,0 +1,11 @@ +SPATH := $($(DBSYNCD_PY3)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/dbsyncd-py3.mk rules/dbsyncd-py3.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) + +$(DBSYNCD_PY3)_CACHE_MODE := GIT_CONTENT_SHA +$(DBSYNCD_PY3)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DBSYNCD_PY3)_DEP_FILES := $(DEP_FILES) +$(DBSYNCD_PY3)_SMDEP_FILES := $(SMDEP_FILES) +$(DBSYNCD_PY3)_SMDEP_PATHS := $(SPATH) + diff --git a/rules/dbsyncd-py3.mk b/rules/dbsyncd-py3.mk new file mode 100644 index 0000000000..0f150c0c59 --- /dev/null +++ b/rules/dbsyncd-py3.mk @@ -0,0 +1,7 @@ +# sonic-dbsyncd python3 wheel + +DBSYNCD_PY3 = sonic_d-2.0.0-py3-none-any.whl +$(DBSYNCD_PY3)_SRC_PATH = $(SRC_PATH)/sonic-dbsyncd +$(DBSYNCD_PY3)_PYTHON_VERSION = 3 +$(DBSYNCD_PY3)_DEPENDS += $(SWSSSDK_PY3) +SONIC_PYTHON_WHEELS += $(DBSYNCD_PY3) diff --git a/rules/docker-lldp.mk b/rules/docker-lldp.mk index 36c8a3a353..b84ff6d7e4 100644 --- a/rules/docker-lldp.mk +++ b/rules/docker-lldp.mk @@ -6,14 +6,14 @@ DOCKER_LLDP_DBG = $(DOCKER_LLDP_STEM)-$(DBG_IMAGE_MARK).gz $(DOCKER_LLDP)_PATH = $(DOCKERS_PATH)/docker-lldp -$(DOCKER_LLDP)_DEPENDS += $(LLDPD) $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(PYTHON3_SWSSCOMMON) +$(DOCKER_LLDP)_DEPENDS += $(LLDPD) $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) $(DOCKER_LLDP)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS) $(DOCKER_LLDP)_DBG_DEPENDS += $(LLDPD_DBG) $(LIBSWSSCOMMON_DBG) $(DOCKER_LLDP)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_IMAGE_PACKAGES) -$(DOCKER_LLDP)_PYTHON_WHEELS += $(DBSYNCD_PY2) +$(DOCKER_LLDP)_PYTHON_WHEELS += $(DBSYNCD_PY3) $(DOCKER_LLDP)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER) SONIC_DOCKER_IMAGES += $(DOCKER_LLDP) diff --git a/src/sonic-dbsyncd b/src/sonic-dbsyncd index 95824a9a4b..5cc29a1b32 160000 --- a/src/sonic-dbsyncd +++ b/src/sonic-dbsyncd @@ -1 +1 @@ -Subproject commit 95824a9a4b0c2be3351f6a93f3f55327d10113c0 +Subproject commit 5cc29a1b32d8d1f4dfbc967bfea2727c50a49c76