Skip to content

Commit

Permalink
Chassisd to monitor cards in a modular chassis (#5523)
Browse files Browse the repository at this point in the history
HLD: sonic-net/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.
  • Loading branch information
mprabhu-nokia authored Dec 16, 2020
1 parent 182a809 commit 00cea08
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 2 deletions.
13 changes: 13 additions & 0 deletions dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ startsecs=0
dependent_startup=true
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 %}
[program:lm-sensors]
command=/usr/bin/lm-sensors.sh
Expand Down
8 changes: 7 additions & 1 deletion dockers/docker-platform-monitor/docker_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ mkdir -p /etc/supervisor/conf.d/

SENSORS_CONF_FILE="/usr/share/sonic/platform/sensors.conf"
FANCONTROL_CONF_FILE="/usr/share/sonic/platform/fancontrol"
MODULAR_CHASSISDB_CONF_FILE="/usr/share/sonic/platform/chassisdb.conf"

HAVE_SENSORS_CONF=0
HAVE_FANCONTROL_CONF=0
IS_MODULAR_CHASSIS=0

if [ -e $SENSORS_CONF_FILE ]; then
HAVE_SENSORS_CONF=1
Expand All @@ -17,7 +19,11 @@ if [ -e $FANCONTROL_CONF_FILE ]; then
HAVE_FANCONTROL_CONF=1
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 ];
then
Expand Down
5 changes: 4 additions & 1 deletion rules/docker-platform-monitor.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)_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_PY3)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SWSSSDK_PY2)
Expand All @@ -21,6 +22,8 @@ $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PSUD)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_SYSEEPROMD)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_THERMALCTLD)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_XCVRD)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_CHASSISD_PY3)

ifeq ($(PDDF_SUPPORT),y)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(PDDF_PLATFORM_API_BASE_PY2)
endif
Expand Down
10 changes: 10 additions & 0 deletions rules/sonic-chassisd.dep
Original file line number Diff line number Diff line change
@@ -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 changes: 8 additions & 0 deletions rules/sonic-chassisd.mk
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 00cea08

Please sign in to comment.