sonic-buildimage
sonic-buildimage copied to clipboard
Add support for platform topology configuration service
This service invokes the platform plugin for platform specific topology
configuration.
The path for platform plugin script is:
/usr/share/sonic/device/$PLATFORM/plugins/config-topology.sh
If the platform plugin is not available, this service does nothing.
Signed-off-by: anamehra [email protected]
Why I did it
For the chassis, the platform requires to generate the chassis topology from the available inventory. Based on the inventory config files for the platform and ASICs are generated. Some configs are global as well as ASIC specific. This needs to be done on both RP and LC and requires the availability of database-chassis and database services. Adding this systemd dependency in platform side service unit files causes first boot issues as the database service is not known when rc.local starts the platform service. Secondly, sonic-systemd-generator generates the dependency on multi-instance services during boot based on num_asics and for that Sonic systemd generator needs to know about the platform services. For example, if a service defines: After=database.service sonic systemd generator creates the dependency for the global database and all namespace database instances After=database.service [email protected] [email protected]
This is not possible if the service is added as a platform-side service.
How I did it
Added a common service that defines the dependency on Sonic build side to handle the above limitations. The service calls a platform plugin, if present. If the platform plugin is not available, the service exits as successful and will do nothing for the platform.
How to verify it
- Load the image with changes.
- check systemctl status config-topology.service logs
- Validated that the services starts after database services and before config-setup service.
Which release branch to backport (provide reason below if selected)
- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [x] 202205
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)
Hi @abdosi , FYI-
Can we elaborate the advantage/reason of adding this? Thanks.
Can we elaborate the advantage/reason of adding this? Thanks.
@anamehra , reminder on this, thanks
@anamehra - all tests are failing
Can we elaborate the advantage/reason of adding this? Thanks.
@anamehra , reminder on this, thanks
Hi @rlhui , I added more details after the chassis group discussion.
@abdosi , the logs from the build are lost, could you please rerun the checks?
/azp run Azure.sonic-buildimage
Azure Pipelines successfully started running 1 pipeline(s).
Hi @SuvarnaMeenakshi , I have added explicit dependency in config-setup.service to prevent application service s from starting when config-topology fails. Please review.
@SuvarnaMeenakshi can you please review and sign-off for this PR ? There is some fix in systemd-generator also.
@SuvarnaMeenakshi can you please review again
Cherry-pick PR to 202205: https://github.com/sonic-net/sonic-buildimage/pull/13605
@anamehra @rlhui why is this change not needed for 202211 branch?