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

Add enable_xcvrd_sff_mgr flag support for xcvrd startup command #18054

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

longhuan-cisco
Copy link
Contributor

@longhuan-cisco longhuan-cisco commented Feb 7, 2024

This PR is a dependency of sonic-net/sonic-platform-daemons#383
HLD of sff_mgr: sonic-net/SONiC#1371

Why I did it

Add enable_xcvrd_sff_mgr flag support for sff_mgr

Work item tracking
  • Microsoft ADO (number only):

How I did it

In docker-pmon.supervisord.conf.j2 file, add logic to append enable_sff_mgr flag to xcvrd startup command based on the enable_xcvrd_sff_mgr flag defined in pmon_daemon_control.json

Also did clean-up on the corresponding j2 logic to make it more read-able and easier to extend.

How to verify it

Verified with different combinations of flags for the output of j2, matched with the original and correct output.

sonic-cfggen -a '{"skip_xcvrd_cmis_mgr": false, "enable_xcvrd_sff_mgr": false, "delay_xcvrd": false}' -t /usr/share/sonic/templates/docker-pmon.supervisord.conf.j2 | grep "program:xcvrd" -A 1
[program:xcvrd]
command=python3 /usr/local/bin/xcvrd

sonic-cfggen -a '{"skip_xcvrd_cmis_mgr": true, "enable_xcvrd_sff_mgr": false, "delay_xcvrd": false}' -t /usr/share/sonic/templates/docker-pmon.supervisord.conf.j2 | grep "program:xcvrd" -A 1
[program:xcvrd]
command=python3 /usr/local/bin/xcvrd --skip_cmis_mgr

sonic-cfggen -a '{"skip_xcvrd_cmis_mgr": false, "enable_xcvrd_sff_mgr": true, "delay_xcvrd": false}' -t /usr/share/sonic/templates/docker-pmon.supervisord.conf.j2 | grep "program:xcvrd" -A 1
[program:xcvrd]
command=python3 /usr/local/bin/xcvrd --enable_sff_mgr

sonic-cfggen -a '{"skip_xcvrd_cmis_mgr": false, "enable_xcvrd_sff_mgr": false, "delay_xcvrd": true}' -t /usr/share/sonic/templates/docker-pmon.supervisord.conf.j2 | grep "program:xcvrd" -A 1
[program:xcvrd]
command=bash -c "sleep 30 && python3 /usr/local/bin/xcvrd"

sonic-cfggen -a '{"skip_xcvrd_cmis_mgr": true, "enable_xcvrd_sff_mgr": true, "delay_xcvrd": false}' -t /usr/share/sonic/templates/docker-pmon.supervisord.conf.j2 | grep "program:xcvrd" -A 1
[program:xcvrd]
command=python3 /usr/local/bin/xcvrd --skip_cmis_mgr --enable_sff_mgr

sonic-cfggen -a '{"skip_xcvrd_cmis_mgr": true, "enable_xcvrd_sff_mgr": false, "delay_xcvrd": true}' -t /usr/share/sonic/templates/docker-pmon.supervisord.conf.j2 | grep "program:xcvrd" -A 1
[program:xcvrd]
command=bash -c "sleep 30 && python3 /usr/local/bin/xcvrd --skip_cmis_mgr"

sonic-cfggen -a '{"skip_xcvrd_cmis_mgr": false, "enable_xcvrd_sff_mgr": true, "delay_xcvrd": true}' -t /usr/share/sonic/templates/docker-pmon.supervisord.conf.j2 | grep "program:xcvrd" -A 1
[program:xcvrd]
command=bash -c "sleep 30 && python3 /usr/local/bin/xcvrd --enable_sff_mgr"

sonic-cfggen -a '{"skip_xcvrd_cmis_mgr": true, "enable_xcvrd_sff_mgr": true, "delay_xcvrd": true}' -t /usr/share/sonic/templates/docker-pmon.supervisord.conf.j2 | grep "program:xcvrd" -A 1
[program:xcvrd]
command=bash -c "sleep 30 && python3 /usr/local/bin/xcvrd --skip_cmis_mgr --enable_sff_mgr"

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

  • 202305

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@longhuan-cisco longhuan-cisco changed the title Add enable_xcvrd_sff_mgr flag support for sff_mgr Add enable_xcvrd_sff_mgr flag support for xcvrd startup command Feb 7, 2024
@prgeor
Copy link
Contributor

prgeor commented Feb 12, 2024

@longhuan-cisco please add the link to HLD in PR description

@longhuan-cisco
Copy link
Contributor Author

@longhuan-cisco please add the link to HLD in PR description

@prgeor sure added on both sides.

Copy link
Contributor

@prgeor prgeor left a comment

Choose a reason for hiding this comment

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

@longhuan-cisco nice refactoring. thanks.

@prgeor
Copy link
Contributor

prgeor commented Feb 23, 2024

@rlhui @lguohan can you help merge

@longhuan-cisco
Copy link
Contributor Author

@rlhui @lguohan can you help merge

@rlhui @lguohan could you please help on the merge?
This PR is needed to enable sff_mgr (whose PR was already merged).

@rlhui rlhui merged commit c022066 into sonic-net:master Mar 12, 2024
19 checks passed
saksarav-nokia pushed a commit to saksarav-nokia/sonic-buildimage that referenced this pull request Mar 12, 2024
This PR is a dependency of sonic-net/sonic-platform-daemons#383
HLD of sff_mgr: sonic-net/SONiC#1371

Why I did it
Add enable_xcvrd_sff_mgr flag support for sff_mgr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants