-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[frr] Reduce Calls to SONiC Cfggen #5176
[frr] Reduce Calls to SONiC Cfggen #5176
Conversation
22d39a7
to
84ef3b3
Compare
Calls to sonic-cfggen is CPU expensive. This PR reduces calls to sonic-cfggen to two calls during startup when starting frr service. singed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
84ef3b3
to
a5f2de0
Compare
@pavel-shirshov to review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have couple questions
CFGGEN_PARAMS=" \ | ||
-d \ | ||
-y /etc/sonic/constants.yml \ | ||
-t /usr/share/sonic/templates/supervisord/frr_vars.j2 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need frr_vars?
Also why you have only source after -t?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the frr_vars is a template file that pulls information about the config_type. This variable later decides if BGP service is integrate into vtysh or not. The content of the frr_vars is retreiving single variable for now:
{{ DEVICE_METADATA["localhost"]["docker_routing_config_mode"] }}
Lack of destination after the first argument, means this template is going to be rendered to stdout.
In comparison, commit a5f2de does docker initialization with two calls to cfggen. The time difference between the two approaches is about 1sec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Calls to sonic-cfggen is CPU expensive. This PR reduces calls to sonic-cfggen to two calls during startup when starting frr service. singed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
Calls to sonic-cfggen is CPU expensive. This PR reduces calls to sonic-cfggen to two calls during startup when starting frr service. singed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
Calls to sonic-cfggen is CPU expensive. This PR reduces calls to sonic-cfggen to two calls during startup when starting frr service. singed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
Calls to sonic-cfggen is CPU expensive. This PR reduces calls to sonic-cfggen to two calls during startup when starting frr service. singed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
Calls to sonic-cfggen is CPU expensive. This PR reduces calls to sonic-cfggen to two calls during startup when starting frr service. singed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
Calls to sonic-cfggen is CPU expensive. This PR reduces calls to
sonic-cfggen to two calls during startup when starting frr service.
singed-off-by: Tamer Ahmed tamer.ahmed@microsoft.com
- Why I did it
Reduce time required when invoking frr
- How I did it
Used template batch mode to batch together three calls into one call to sonic-cfggen
- How to verify it
Update for the case when just once call is placed t sonic-cfggen:
- Which release branch to backport (provide reason below if selected)