[fabric] Disable unnecessary processes in swss and the orchagent-portsyncd dependency for fabric asic (#5569)

* Disable unnecessary processes in swss for fabric asic
Signed-off-by: ngocdo <ngocdo@arista.com>
This commit is contained in:
ngoc-do 2021-06-09 10:53:47 -07:00 committed by GitHub
parent c7bc0f0fa2
commit 710563f83d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 63 additions and 17 deletions

View File

@ -68,9 +68,7 @@ COPY ["arp_update.conf", "files/arp_update_vars.j2", "/usr/share/sonic/templates
COPY ["ndppd.conf", "/usr/share/sonic/templates/"]
COPY ["enable_counters.py", "/usr/bin"]
COPY ["docker-init.sh", "orchagent.sh", "swssconfig.sh", "buffermgrd.sh", "/usr/bin/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["critical_processes", "/etc/supervisor/"]
# Copy all Jinja2 template files into the templates folder
COPY ["*.j2", "/usr/share/sonic/templates/"]

View File

@ -1,13 +0,0 @@
program:orchagent
program:portsyncd
program:neighsyncd
program:fdbsyncd
program:vlanmgrd
program:intfmgrd
program:portmgrd
program:buffermgrd
program:vrfmgrd
program:nbrmgrd
program:vxlanmgrd
program:coppmgrd
program:tunnelmgrd

View File

@ -0,0 +1,21 @@
{% set is_fabric_asic = 0 %}
{% if DEVICE_METADATA.localhost.switch_type %}
{% if DEVICE_METADATA.localhost.switch_type == "fabric" %}
{% set is_fabric_asic = 1 %}
{% endif %}
{% endif %}
program:orchagent
{% if is_fabric_asic == 0 %}
program:portsyncd
program:neighsyncd
program:fdbsyncd
program:vlanmgrd
program:intfmgrd
program:portmgrd
program:buffermgrd
program:vrfmgrd
program:nbrmgrd
program:vxlanmgrd
program:coppmgrd
program:tunnelmgrd
{%- endif %}

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bash
mkdir -p /etc/swss/config.d/
mkdir -p /etc/supervisor/
mkdir -p /etc/supervisor/conf.d/
CFGGEN_PARAMS=" \
-d \
@ -10,6 +12,8 @@ CFGGEN_PARAMS=" \
-t /usr/share/sonic/templates/ports.json.j2,/etc/swss/config.d/ports.json \
-t /usr/share/sonic/templates/vlan_vars.j2 \
-t /usr/share/sonic/templates/ndppd.conf.j2,/etc/ndppd.conf \
-t /usr/share/sonic/templates/critical_processes.j2,/etc/supervisor/critical_processes \
-t /usr/share/sonic/templates/supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf
"
VLAN=$(sonic-cfggen $CFGGEN_PARAMS)

View File

@ -28,6 +28,16 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
{% set is_fabric_asic = 0 %}
{% set orchagent_dependent_startup_wait_for = "portsyncd:running" %}
{% if DEVICE_METADATA.localhost.switch_type %}
{% if DEVICE_METADATA.localhost.switch_type == "fabric" %}
{% set is_fabric_asic = 1 %}
{% set orchagent_dependent_startup_wait_for = "rsyslogd:running" %}
{%- endif %}
{%- endif %}
{% if is_fabric_asic == 0 %}
[program:gearsyncd]
command=/usr/bin/gearsyncd -p /usr/share/sonic/hwsku/gearbox_config.json
priority=3
@ -39,7 +49,9 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running
{%- endif %}
{% if is_fabric_asic == 0 %}
[program:portsyncd]
command=/usr/bin/portsyncd
priority=3
@ -49,6 +61,7 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running
{%- endif %}
[program:orchagent]
command=/usr/bin/orchagent.sh
@ -58,7 +71,7 @@ autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=portsyncd:running
dependent_startup_wait_for={{ orchagent_dependent_startup_wait_for }}
[program:swssconfig]
command=/usr/bin/swssconfig.sh
@ -72,6 +85,7 @@ stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=orchagent:running
{% if is_fabric_asic == 0 %}
[program:restore_neighbors]
command=/usr/bin/restore_neighbors.py
priority=6
@ -83,7 +97,9 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=swssconfig:exited
{%- endif %}
{% if is_fabric_asic == 0 %}
[program:coppmgrd]
command=/usr/bin/coppmgrd
priority=6
@ -95,7 +111,9 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=orchagent:running
{%- endif %}
{% if is_fabric_asic == 0 %}
[program:neighsyncd]
command=/usr/bin/neighsyncd
priority=7
@ -105,7 +123,9 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=swssconfig:exited
{%- endif %}
{% if is_fabric_asic == 0 %}
[program:vlanmgrd]
command=/usr/bin/vlanmgrd
priority=8
@ -115,7 +135,9 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=swssconfig:exited
{%- endif %}
{% if is_fabric_asic == 0 %}
[program:intfmgrd]
command=/usr/bin/intfmgrd
priority=9
@ -125,7 +147,9 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=swssconfig:exited
{%- endif %}
{% if is_fabric_asic == 0 %}
[program:portmgrd]
command=/usr/bin/portmgrd
priority=10
@ -135,7 +159,9 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=swssconfig:exited
{%- endif %}
{% if is_fabric_asic == 0 %}
[program:buffermgrd]
command=/usr/bin/buffermgrd.sh
priority=11
@ -145,7 +171,9 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=swssconfig:exited
{%- endif %}
{% if is_fabric_asic == 0 %}
[program:vrfmgrd]
command=/usr/bin/vrfmgrd
priority=13
@ -155,7 +183,9 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=swssconfig:exited
{%- endif %}
{% if is_fabric_asic == 0 %}
[program:nbrmgrd]
command=/usr/bin/nbrmgrd
priority=15
@ -165,7 +195,9 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=swssconfig:exited
{%- endif %}
{% if is_fabric_asic == 0 %}
[program:vxlanmgrd]
command=/usr/bin/vxlanmgrd
priority=16
@ -175,7 +207,9 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=swssconfig:exited
{%- endif %}
{% if is_fabric_asic == 0 %}
[program:tunnelmgrd]
command=/usr/bin/tunnelmgrd
priority=17
@ -185,6 +219,7 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=swssconfig:exited
{%- endif %}
[program:enable_counters]
command=/usr/bin/enable_counters.py
@ -196,6 +231,7 @@ stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=swssconfig:exited
{% if is_fabric_asic == 0 %}
[program:fdbsyncd]
command=/usr/bin/fdbsyncd
priority=17
@ -205,4 +241,4 @@ stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=swssconfig:exited
{%- endif %}