-
Notifications
You must be signed in to change notification settings - Fork 658
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
Debug dump utility dash objects update #3387
base: master
Are you sure you want to change the base?
Conversation
@qiluo-msft Can you please approve the workflow for the pipeline? |
@Pterosaur Please review |
Is it possible to directly leverage or refer the utils from sonic-dash-api to serialize/deserialize the pb object to target json format? I don't think listing all protobuf message formats in the plugin forlder is maintainable. |
The .py files in the plugin folders are separate in order to maintain the current debug dump utility architecture of having a separate module for displaying the information separately for different modules (for example: the |
OK, I agree. I agree that there are some specific codes for some specific message types, but the most difference between the dash types are metadata or data name. Because I worry that it's hard to maintain if we keep two concrete type codes at the sonic-dash-api and here. |
the issue with this approach would be that there are some differences between the implemented plugins, so the debug dump utility provides a unified view across multiple DBs for a module in the plugin folder(For example DASH_VNET_TABLE in APPL_DB will have a corresponding SAI_OBJECT_TYPE_VNET in ASIC_DB) which can be matched using the vni obtained from DASH_VNET_TABLE and then matching it with a SAI_OBJECT_TYPE_VNET table which has the same vni SAI_VNET_ATTR_VNI field |
/azpw run Azure.sonic-utilities |
/AzurePipelines run Azure.sonic-utilities |
Azure Pipelines failed to run 1 pipeline(s). |
9710b48
try: | ||
importlib.import_module('.' + name, __package__) | ||
except ImportError as e: | ||
pass |
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.
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.
This is used to print the modules available for the dump utility :
admin@sonic:~$ dump state --show
Module Identifier
------------------ ---------------------
acl_rule acl_rule_name
acl_table acl_table_name
copp trap_id
evpn Remote VNI
fdb Vlan:fdb_entry
interface intf_name
port port_name
portchannel portchannel_name
portchannel_member portchannel_member
route destination_network
vlan vlan_name
vlan_member vlan_member_name
vxlan_tunnel vxlan_tunnel_name
vxlan_tunnel_map vxlan_tunnel_map_name
admin@sonic:~$
I did not want to add anything else here so that on platforms where the newly added dash modules are not present there is no indication of error
/azp run Azure.sonic-utilities |
Azure Pipelines failed to run 1 pipeline(s). |
What I did
Added support for the following DASH objects for the dump utility:
dash_acl_group
dash_acl_out
dash_acl_rule
dash_appliance
dash_prefix_tag
dash_eni
dash_qos
dash_route
dash_route_rule
dash_vnet_mapping
dash_vnet
This PR also adds Match infra update in order to consider Dash objects, so new match requests can be created with the fields present in the dash objects to obtain the fields/keys.
How I did it
Added
protobuf
library andlibdashapi
tosonic-utilities
, this is required as the dash objects are stored in the APPL_DB in protobuf format, and we need the .proto files which are available in thelibdashapi
package. We also useredis
package instead of theSonicV2Connector
sinceSonicV2Connector
get_all
function from the connector considers null terminated strings so the complete protobuf data is not obtained usingget_all
functionHow to verify it
dump state all <dash_object>
Examples:
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)