Chassisd to monitor cards in a modular chassis (#5523)

HLD: Azure/SONiC#646

Introducing chassisd process to monitor status of the control, line and fabric cards in a modular chassis.

- Why I did it
Modular Chassis has control-cards, line-cards and fabric-cards along with other peripherals. Chassisd will be a central entity that has visibility of the entire chassis.

- How I did it
Chassisd process will monitor cards in the main thread. Another configuation_handling_task is created to listen to CONFIG_DB for admin_status up/down events. The monitored status is persisted in REDIS-DB.
This commit is contained in:
mprabhu-nokia 2020-12-15 19:28:58 -05:00 committed by GitHub
parent 182a809dc3
commit 00cea080af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 2 deletions

View File

@ -38,6 +38,19 @@ startsecs=0
dependent_startup=true dependent_startup=true
dependent_startup_wait_for=rsyslogd:running dependent_startup_wait_for=rsyslogd:running
{% if not skip_chassisd and IS_MODULAR_CHASSIS == 1 %}
[program:chassisd]
command=/usr/local/bin/chassisd
priority=3
autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog
startsecs=0
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running
{% endif %}
{% if not skip_sensors and HAVE_SENSORS_CONF == 1 %} {% if not skip_sensors and HAVE_SENSORS_CONF == 1 %}
[program:lm-sensors] [program:lm-sensors]
command=/usr/bin/lm-sensors.sh command=/usr/bin/lm-sensors.sh

View File

@ -5,9 +5,11 @@ mkdir -p /etc/supervisor/conf.d/
SENSORS_CONF_FILE="/usr/share/sonic/platform/sensors.conf" SENSORS_CONF_FILE="/usr/share/sonic/platform/sensors.conf"
FANCONTROL_CONF_FILE="/usr/share/sonic/platform/fancontrol" FANCONTROL_CONF_FILE="/usr/share/sonic/platform/fancontrol"
MODULAR_CHASSISDB_CONF_FILE="/usr/share/sonic/platform/chassisdb.conf"
HAVE_SENSORS_CONF=0 HAVE_SENSORS_CONF=0
HAVE_FANCONTROL_CONF=0 HAVE_FANCONTROL_CONF=0
IS_MODULAR_CHASSIS=0
if [ -e $SENSORS_CONF_FILE ]; then if [ -e $SENSORS_CONF_FILE ]; then
HAVE_SENSORS_CONF=1 HAVE_SENSORS_CONF=1
@ -17,7 +19,11 @@ if [ -e $FANCONTROL_CONF_FILE ]; then
HAVE_FANCONTROL_CONF=1 HAVE_FANCONTROL_CONF=1
fi fi
confvar="{\"HAVE_SENSORS_CONF\":$HAVE_SENSORS_CONF, \"HAVE_FANCONTROL_CONF\":$HAVE_FANCONTROL_CONF}" if [ -e $MODULAR_CHASSISDB_CONF_FILE ]; then
IS_MODULAR_CHASSIS=1
fi
confvar="{\"HAVE_SENSORS_CONF\":$HAVE_SENSORS_CONF, \"HAVE_FANCONTROL_CONF\":$HAVE_FANCONTROL_CONF, \"IS_MODULAR_CHASSIS\":$IS_MODULAR_CHASSIS}"
if [ -e /usr/share/sonic/platform/pmon_daemon_control.json ]; if [ -e /usr/share/sonic/platform/pmon_daemon_control.json ];
then then

View File

@ -6,7 +6,8 @@ DOCKER_PLATFORM_MONITOR_DBG = $(DOCKER_PLATFORM_MONITOR_STEM)-$(DBG_IMAGE_MARK).
$(DOCKER_PLATFORM_MONITOR)_PATH = $(DOCKERS_PATH)/$(DOCKER_PLATFORM_MONITOR_STEM) $(DOCKER_PLATFORM_MONITOR)_PATH = $(DOCKERS_PATH)/$(DOCKER_PLATFORM_MONITOR_STEM)
$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(LIBSENSORS) $(LM_SENSORS) $(FANCONTROL) $(SENSORD) $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(SMARTMONTOOLS) $(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(LIBSENSORS) $(LM_SENSORS) $(FANCONTROL) $(SENSORD) $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(PYTHON3_SWSSCOMMON) $(SMARTMONTOOLS)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY2) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY2)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY3) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY3)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SWSSSDK_PY2) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SWSSSDK_PY2)
@ -21,6 +22,8 @@ $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PSUD)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_SYSEEPROMD) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_SYSEEPROMD)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_THERMALCTLD) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_THERMALCTLD)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_XCVRD) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_XCVRD)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_CHASSISD_PY3)
ifeq ($(PDDF_SUPPORT),y) ifeq ($(PDDF_SUPPORT),y)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(PDDF_PLATFORM_API_BASE_PY2) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(PDDF_PLATFORM_API_BASE_PY2)
endif endif

10
rules/sonic-chassisd.dep Normal file
View File

@ -0,0 +1,10 @@
SPATH := $($(SONIC_CHASSISD_PY3)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-chassisd.mk rules/sonic-chassisd.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files))
$(SONIC_CHASSISD_PY3)_CACHE_MODE := GIT_CONTENT_SHA
$(SONIC_CHASSISD_PY3)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(SONIC_CHASSISD_PY3)_DEP_FILES := $(DEP_FILES)
$(SONIC_CHASSISD_PY3)_SMDEP_FILES := $(SMDEP_FILES)
$(SONIC_CHASSISD_PY3)_SMDEP_PATHS := $(SPATH)

8
rules/sonic-chassisd.mk Normal file
View File

@ -0,0 +1,8 @@
# sonic-chassisd (SONiC Chassis mgmt daemon) wheel package
SONIC_CHASSISD_PY3 = sonic_chassisd-1.0-py3-none-any.whl
$(SONIC_CHASSISD_PY3)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-chassisd
$(SONIC_CHASSISD_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3)
$(SONIC_CHASSISD_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON)
$(SONIC_CHASSISD_PY3)_PYTHON_VERSION = 3
SONIC_PYTHON_WHEELS += $(SONIC_CHASSISD_PY3)