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

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

Merged
merged 2 commits into from
Jun 9, 2021

Conversation

ngoc-do
Copy link
Contributor

@ngoc-do ngoc-do commented Oct 9, 2020

Signed-off-by: ngocdo [email protected]

- Why I did it

Fabric asic just needs very few processes in swss to run. Many of them should be disabled. The following should be disabled.

program:portsyncd
program:neighsyncd
program:fdbsyncd
program:vlanmgrd
program:intfmgrd
program:portmgrd
program:buffermgrd
program:vrfmgrd
program:nbrmgrd
program:vxlanmgrd
program:coppmgrd
program:tunnelmgrd

Fabric asic doesn't run portsyncd to turn its ports on because it doesn't have any ports. But orchagent is currently configured to not start if portsyncd. We need to break this dependency.

- How I did it

Creating critical_processes.j2 and supervisord.conf.j2 for different asics. Also disabled dependency of orchagent and portsyncd for fabric asic by modifying /etc/supervisor/conf.d/supervisord.conf.j2. We now can know asic type from CONFIG_DB. So it's possible to have custom critical_processes and supervisord.conf based on chip type.

- How to verify it

Tested on a fixed system with NPUs (BCM88690) and fabric asics (BCM88790) - worked great.

@anshuv-mfst
Copy link

@srikanth (Nokia) could you please take a look, thanks.

@lguohan lguohan requested a review from prsunny February 3, 2021 17:13
@skeesara-nokia
Copy link

@srikanth (Nokia) could you please take a look, thanks.

Will do


{% if is_fabric_asic == 0 %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concern with this approach is, if someone have to add a new process in the end, he may ignore this if is_fabric_asic. My suggestion is lets have one section for is_fabric_asic == 0 and else section for fabric processes (similar to critical_process.j2). This way priority can also be adjusted accordingly. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prsunny I addressed your comments. Thanks for reviewing. The new commit 1 overrided the previous commit when I resolved conflicts. Hope that it's clear to you. Also updated the title + description.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to have it properly listed in if-else. Currently the order/priority is not in order. This would be more confusing if we have to add new process later. please keep the original order for if not-fabric and add the fabric process in else part

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable. But some processes like orchagent is available in both fabric and not fabric part. So if we are doing that:

if not-fabric:
orchagent
portsyncd
else:
orchagent
end-if

orchagent will appear both, and seems redundant. Is this OK? All processes for fabric are also in not fabric

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main concern that having if and else requires to update orchagent at both parts if someone wants to update orchagent's configuration. That seems harder to manage and redundant. So having if may be better.

@prsunny
Copy link
Contributor

prsunny commented Feb 5, 2021

Can you also modify the description and title. From the changes, it doesn't look like only the portsyncd dependency changes but also some process are not even started in fabric.

@ngoc-do
Copy link
Contributor Author

ngoc-do commented Feb 5, 2021

Can you also modify the description and title. From the changes, it doesn't look like only the portsyncd dependency changes but also some process are not even started in fabric.

That makes sense too.

@ngoc-do ngoc-do requested a review from lguohan as a code owner February 6, 2021 20:29
@ngoc-do ngoc-do changed the title [fabric] Disable orchagent-portsyncd dependency for fabric asic [fabric] Disable unnecessary processes in swss and the orchagent-portsyncd dependency for fabric asic Feb 8, 2021
@anshuv-mfst
Copy link

@skeesara-nokia - please review/approve the PR, thanks.

skeesara-nokia
skeesara-nokia previously approved these changes Feb 24, 2021
@ngoc-do
Copy link
Contributor Author

ngoc-do commented Apr 7, 2021

Could we please merge this PR? It could cause conflicts if we keep it here for too long.

@ngoc-do
Copy link
Contributor Author

ngoc-do commented Apr 7, 2021

@prsunny Please review it.

@ngoc-do
Copy link
Contributor Author

ngoc-do commented Apr 22, 2021

Hello, could some one please approve and merge this PR?

@anshuv-mfst
Copy link

Hi @prsunny , @skeesara-nokia - Could you please review and approve.

@@ -13,6 +13,12 @@ CFGGEN_PARAMS=" \
"
VLAN=$(sonic-cfggen $CFGGEN_PARAMS)

mkdir -p /etc/supervisor/
sonic-cfggen -d -t /usr/share/sonic/templates/critical_processes.j2 > /etc/supervisor/critical_processes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tahmed-dev for feedback here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @prsunny. Can you please combine the above calls into a single call to sonic-cggen.

mkdir -p /etc/supervisor/
mkdir -p /etc/supervisor/conf.d/
sonic-cfggen -d -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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, those new sonic-cfggen calls need to be part of the above calls at line 12 above.

CFGGEN_PARAMS=" \
    -d \
    -y /etc/sonic/constants.yml \
    -t /usr/share/sonic/templates/switch.json.j2,/etc/swss/config.d/switch.json \
    -t /usr/share/sonic/templates/ipinip.json.j2,/etc/swss/config.d/ipinip.json \
    -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
"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tahmed-dev. That's a great suggestion. I updated with a new commit.

{%- endif %}
{%- endif %}

[program:orchagent]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern is, priorities are all jumbled up here. IMO, its harder to add a process. If you dont prefer to have duplicate, please have it in the order of priority and add the skip the ones for fabric within "if" case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorting based on priority makes sense.

For clarification, I will add the processes which do NOT run on fabric in "if" case.

@prsunny prsunny requested a review from tahmed-dev April 27, 2021 23:14
Disable the following for fabric asic:

program:portsyncd
program:neighsyncd
program:fdbsyncd
program:vlanmgrd
program:intfmgrd
program:portmgrd
program:buffermgrd
program:vrfmgrd
program:nbrmgrd
program:vxlanmgrd
program:coppmgrd
program:tunnelmgrd

Also, this removes orchagent-portsyncd dependency where orchagent will
start if portsyncd doesn't run.

Signed-off-by: ngocdo <[email protected]>
@ngoc-do
Copy link
Contributor Author

ngoc-do commented May 17, 2021

@prsunny Could you please review the updated code? Fabric code in swss merged, and so we need this one merge asap. Thanks.

@prsunny
Copy link
Contributor

prsunny commented May 17, 2021

@prsunny Could you please review the updated code? Fabric code in swss merged, and so we need this one merge asap. Thanks.

@ngoc-do , Sure will review. Kindly avoid force-push, thereby deleting commit history.

prsunny
prsunny previously approved these changes May 18, 2021
@@ -13,6 +13,12 @@ CFGGEN_PARAMS=" \
"
VLAN=$(sonic-cfggen $CFGGEN_PARAMS)

mkdir -p /etc/supervisor/
sonic-cfggen -d -t /usr/share/sonic/templates/critical_processes.j2 > /etc/supervisor/critical_processes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @prsunny. Can you please combine the above calls into a single call to sonic-cggen.

mkdir -p /etc/supervisor/
mkdir -p /etc/supervisor/conf.d/
sonic-cfggen -d -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

@ngoc-do
Copy link
Contributor Author

ngoc-do commented May 24, 2021

Addressed reviewer comments with latest commit.

@anshuv-mfst
Copy link

@tahmed-dev - can you please take a look at the earliest, review comments addressed.

@ngoc-do
Copy link
Contributor Author

ngoc-do commented Jun 4, 2021

Could we merge this PR? Seems it got approved and no conflicts.

@anshuv-mfst
Copy link

@tahmed-dev, @prsunny - Can you please help with merge.

@prsunny prsunny merged commit 710563f into sonic-net:master Jun 9, 2021
@saravanansv
Copy link

on a supervisor dockers/docker-orchagent/base_image_files/monit_swss needs to be a smaller version of what it is right ?

carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
…syncd dependency for fabric asic (sonic-net#5569)

* Disable unnecessary processes in swss for fabric asic
Signed-off-by: ngocdo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants