Skip to content

[y_cable] Support for initialization of new daemon ycable to support ycables #9902

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

Merged
merged 1 commit into from
Feb 3, 2022
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
3 changes: 2 additions & 1 deletion device/virtual/x86_64-kvm_x86_64-r0/pmon_daemon_control.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"skip_pcied": true,
"skip_psud": true,
"skip_syseepromd": true,
"skip_thermalctld": true
"skip_thermalctld": true,
"skip_ycabled": false
}
27 changes: 23 additions & 4 deletions dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,29 @@ dependent_startup=true
dependent_startup_wait_for=rsyslogd:running
{% endif %}

{% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %}
{% if not skip_ycabled %}
[program:ycabled]
{% if delay_ycabled %}
command=bash -c "sleep 30 && nice -n -20 python3 /usr/local/bin/ycabled"
{% else %}
command=nice -n -20 python3 /usr/local/bin/ycabled
{% endif %}
priority=7
autostart=false
autorestart=unexpected
stdout_logfile=syslog
stderr_logfile=syslog
startsecs=10
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running
{% endif %}
{% endif %}

{% if not skip_psud %}
[program:psud]
command={% if API_VERSION == 3 and 'psud' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/psud
priority=7
priority=8
autostart=false
autorestart=unexpected
stdout_logfile=syslog
Expand All @@ -113,7 +132,7 @@ dependent_startup_wait_for=rsyslogd:running
{% if not skip_syseepromd %}
[program:syseepromd]
command={% if API_VERSION == 3 and 'syseepromd' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/syseepromd
priority=8
priority=9
autostart=false
autorestart=unexpected
stdout_logfile=syslog
Expand All @@ -126,7 +145,7 @@ dependent_startup_wait_for=rsyslogd:running
{% if not skip_thermalctld %}
[program:thermalctld]
command={% if API_VERSION == 3 and 'thermalctld' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/thermalctld
priority=9
priority=10
autostart=false
autorestart=unexpected
stdout_logfile=syslog
Expand All @@ -140,7 +159,7 @@ dependent_startup_wait_for=rsyslogd:running
{% if not skip_pcied %}
[program:pcied]
command={% if API_VERSION == 3 and 'pcied' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/pcied
priority=10
priority=11
autostart=false
autorestart=unexpected
stdout_logfile=syslog
Expand Down
4 changes: 2 additions & 2 deletions dockers/docker-platform-monitor/docker_init.j2
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ confvar="{\"HAVE_SENSORS_CONF\":$HAVE_SENSORS_CONF, \"HAVE_FANCONTROL_CONF\":$HA

if [ -e $PMON_DAEMON_CONTROL_FILE ];
then
sonic-cfggen -j $PMON_DAEMON_CONTROL_FILE -a "$confvar" -t $SUPERVISOR_CONF_TEMPLATE > $SUPERVISOR_CONF_FILE
sonic-cfggen -d -j $PMON_DAEMON_CONTROL_FILE -a "$confvar" -t $SUPERVISOR_CONF_TEMPLATE > $SUPERVISOR_CONF_FILE
else
sonic-cfggen -a "$confvar" -t $SUPERVISOR_CONF_TEMPLATE > $SUPERVISOR_CONF_FILE
sonic-cfggen -d -a "$confvar" -t $SUPERVISOR_CONF_TEMPLATE > $SUPERVISOR_CONF_FILE
fi

exec /usr/local/bin/supervisord
1 change: 1 addition & 0 deletions rules/docker-platform-monitor.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PSUD_PY3)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_SYSEEPROMD_PY3)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_THERMALCTLD_PY3)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_XCVRD_PY3)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_YCABLED_PY3)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_CHASSISD_PY3)

ifeq ($(PDDF_SUPPORT),y)
Expand Down
10 changes: 10 additions & 0 deletions rules/sonic-ycabled.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SPATH := $($(SONIC_YCABLED_PY3)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-ycabled.mk rules/sonic-ycabled.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files))

$(SONIC_YCABLED_PY3)_CACHE_MODE := GIT_CONTENT_SHA
$(SONIC_YCABLED_PY3)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(SONIC_YCABLED_PY3)_DEP_FILES := $(DEP_FILES)
$(SONIC_YCABLED_PY3)_SMDEP_FILES := $(SMDEP_FILES)
$(SONIC_YCABLED_PY3)_SMDEP_PATHS := $(SPATH)
10 changes: 10 additions & 0 deletions rules/sonic-ycabled.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# sonic-ycabled (SONiC Y-Cable daemon) Debian package

# SONIC_YCABLED_PY3 package

SONIC_YCABLED_PY3 = sonic_ycabled-1.0-py3-none-any.whl
$(SONIC_YCABLED_PY3)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-ycabled
$(SONIC_YCABLED_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_PLATFORM_COMMON_PY3)
$(SONIC_YCABLED_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON)
$(SONIC_YCABLED_PY3)_PYTHON_VERSION = 3
SONIC_PYTHON_WHEELS += $(SONIC_YCABLED_PY3)
2 changes: 1 addition & 1 deletion src/sonic-platform-daemons