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

[pull] master from Azure:master #1224

Merged
merged 3 commits into from
Dec 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions dockers/docker-database/database_config.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@
"id" : 12,
"separator": "|",
"instance" : "redis_chassis"
},
"CHASSIS_STATE_DB" : {
"id" : 13,
"separator": "|",
"instance" : "redis_chassis"
}
},
"VERSION" : "1.0"
Expand Down
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
22 changes: 12 additions & 10 deletions files/scripts/update_chassisdb_config
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import syslog

database_config_file = "/var/run/redis/sonic-db/database_config.json"
redis_chassis = 'redis_chassis'
chassis_db = 'CHASSIS_APP_DB'
chassis_db_list = ['CHASSIS_APP_DB', 'CHASSIS_STATE_DB']


def main():
Expand Down Expand Up @@ -47,15 +47,17 @@ def main():
'config file {} does notexist'.format(jsonfile))
return
if 'INSTANCES' in data and redis_chassis in data['INSTANCES']:
data_keep['INSTANCES'] = {}
data_keep['INSTANCES'][redis_chassis] = data['INSTANCES'][redis_chassis]
if delete_config:
del data['INSTANCES'][redis_chassis]
if 'DATABASES' in data and chassis_db in data['DATABASES']:
data_keep['DATABASES'] = {}
data_keep['DATABASES'][chassis_db] = data['DATABASES'][chassis_db]
if delete_config:
del data['DATABASES'][chassis_db]
data_keep['INSTANCES'] = {}
data_keep['INSTANCES'][redis_chassis] = data['INSTANCES'][redis_chassis]
if delete_config:
del data['INSTANCES'][redis_chassis]
for chassis_db in chassis_db_list:
if 'DATABASES' in data and chassis_db in data['DATABASES']:
data_keep['DATABASES'] = {}
data_keep['DATABASES'][chassis_db] = data['DATABASES'][chassis_db]
if delete_config:
del data['DATABASES'][chassis_db]

with open(jsonfile, "w") as write_file:
data_publish = data_keep if keep_config else data
if port_number:
Expand Down
4 changes: 2 additions & 2 deletions platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
}
thermal_api_handler_gearbox = {
THERMAL_API_GET_TEMPERATURE:"gearbox{}_temp_input",
THERMAL_API_GET_HIGH_THRESHOLD:None,
THERMAL_API_GET_HIGH_CRITICAL_THRESHOLD:None
THERMAL_API_GET_HIGH_THRESHOLD:"mlxsw-gearbox{}/temp_trip_hot",
THERMAL_API_GET_HIGH_CRITICAL_THRESHOLD:"mlxsw-gearbox{}/temp_trip_crit"
}
thermal_ambient_apis = {
THERMAL_DEV_ASIC_AMBIENT : thermal_api_handler_asic,
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)