Skip to content

grpc client implementation for active-active dualtor#248

Merged
vdahiya12 merged 45 commits intosonic-net:masterfrom
vdahiya12:test-grpc
May 31, 2022
Merged

grpc client implementation for active-active dualtor#248
vdahiya12 merged 45 commits intosonic-net:masterfrom
vdahiya12:test-grpc

Conversation

@vdahiya12
Copy link
Contributor

@vdahiya12 vdahiya12 commented Mar 21, 2022

Description

This PR is to support the gRPC interaction with to the SoC/Nic-Simulator for link manager state machine ActiveActiveStateMachine to work if the port is configured as active-active cable type.
It supports the RPC's support for SONiC by creating channels/stubs when a cable is pulled in as well as when the ycabled is initialized from supervisord. The logic to treat a cable/port as "active-active" comes from minigraph/config_db and then this PR has the logic to take care of serving RPC's as requested by other daemons.

It does the RPC call when an appropriate request lands the ycabled as described below

The following Tables are served by ycabled for gRPC RPC by listening to changes in app DB request from linkmgr/orchagent and corresponding results are written to state DB.

HW_MUX_CABLE_TABLE

HW_MUX_TABLE_TABLE_PEER

This PR also adds logic to listening to the forwarding state command table and get the response back from gRPC and write to forwarding state response

FORWARDING_STATE_COMMAND -> FORWARDING_STATE_RESPONSE
for getting the forwarding state request/response using gRPC

This PR also has logic for gRPC library build using build_ext extension. The proto definition is present in
proto/proto_out/
The setup.py changes make sure that gRPC libs are generated correctly.

the corresponding gRPC libs are generated in proto_out directory in python packages directory and are imported by ycabled

Motivation and Context

DualToR active-active support for gRPC interface to support the state machine

How Has This Been Tested?

Unit-Tests and deploying changes on a DualToR testbed

Additional Information (Optional)

@vdahiya12 vdahiya12 marked this pull request as draft March 21, 2022 17:13
@lgtm-com
Copy link

lgtm-com bot commented Mar 21, 2022

This pull request introduces 8 alerts when merging 81753fe into f09bd31 - view on LGTM.com

new alerts:

  • 5 for Unused local variable
  • 3 for Unused import

@vdahiya12 vdahiya12 changed the title Test grpc grpc client implementation for active-active dualtor Mar 23, 2022
vdahiya12 pushed a commit to vdahiya12/sonic-platform-daemons that referenced this pull request Apr 4, 2022
Signed-off-by: vaibhav-dahiya <[email protected]>
@lgtm-com
Copy link

lgtm-com bot commented Apr 12, 2022

This pull request introduces 3 alerts when merging ffcaf35 into 9ac12bf - view on LGTM.com

new alerts:

  • 2 for Unused import
  • 1 for Syntax error

Signed-off-by: vaibhav-dahiya <[email protected]>
@lgtm-com
Copy link

lgtm-com bot commented Apr 21, 2022

This pull request introduces 38 alerts when merging 3a496fb into e0f8a35 - view on LGTM.com

new alerts:

  • 30 for Unused local variable
  • 4 for Unused import
  • 2 for Variable defined multiple times
  • 1 for Non-callable called
  • 1 for Unreachable code

Signed-off-by: vaibhav-dahiya <[email protected]>
@lgtm-com
Copy link

lgtm-com bot commented Apr 22, 2022

This pull request introduces 3 alerts when merging 67d9408 into e0f8a35 - view on LGTM.com

new alerts:

  • 2 for Unused import
  • 1 for Syntax error

Signed-off-by: vaibhav-dahiya <[email protected]>
@lgtm-com
Copy link

lgtm-com bot commented Apr 22, 2022

This pull request introduces 1 alert when merging 771ca40 into e0f8a35 - view on LGTM.com

new alerts:

  • 1 for Syntax error

@lgtm-com
Copy link

lgtm-com bot commented Apr 29, 2022

This pull request introduces 1 alert when merging 2d82162 into ce217c0 - view on LGTM.com

new alerts:

  • 1 for Syntax error

Signed-off-by: vaibhav-dahiya <[email protected]>
@lgtm-com
Copy link

lgtm-com bot commented Apr 29, 2022

This pull request introduces 1 alert when merging 812a768 into ce217c0 - view on LGTM.com

new alerts:

  • 1 for Syntax error

@lgtm-com
Copy link

lgtm-com bot commented Apr 30, 2022

This pull request introduces 1 alert when merging 8d1007f into ce217c0 - view on LGTM.com

new alerts:

  • 1 for Syntax error

Signed-off-by: vaibhav-dahiya <[email protected]>
@lgtm-com
Copy link

lgtm-com bot commented Apr 30, 2022

This pull request introduces 2 alerts when merging 51862c4 into ce217c0 - view on LGTM.com

new alerts:

  • 2 for Syntax error

vdahiya12 added 3 commits May 19, 2022 01:47
Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
@vdahiya12 vdahiya12 marked this pull request as ready for review May 19, 2022 22:33
vdahiya12 added 2 commits May 20, 2022 00:22
Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
@vdahiya12 vdahiya12 requested a review from lolyu May 20, 2022 01:47
vdahiya12 added 4 commits May 20, 2022 18:59
Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
lolyu
lolyu previously approved these changes May 24, 2022
Signed-off-by: vaibhav-dahiya <[email protected]>
lolyu
lolyu previously approved these changes May 25, 2022
vdahiya12 added 2 commits May 27, 2022 03:09
Signed-off-by: vaibhav-dahiya <[email protected]>
Signed-off-by: vaibhav-dahiya <[email protected]>
lolyu
lolyu previously approved these changes May 27, 2022
@vdahiya12 vdahiya12 merged commit 0d90023 into sonic-net:master May 31, 2022
vdahiya12 added a commit that referenced this pull request Jun 1, 2022
This PR is to support the gRPC interaction with to the SoC/Nic-Simulator for link manager state machine ActiveActiveStateMachine to work if the port is configured as active-active cable type.
It supports the RPC's support for SONiC by creating channels/stubs when a cable is pulled in as well as when the ycabled is initialized from supervisord. The logic to treat a cable/port as "active-active" comes from minigraph/config_db and then this PR has the logic to take care of serving RPC's as requested by other daemons.

It does the RPC call when an appropriate request lands the ycabled as described below

The following Tables are served by ycabled for gRPC RPC by listening to changes in app DB request from linkmgr/orchagent and corresponding results are written to state DB.

HW_MUX_CABLE_TABLE

HW_MUX_TABLE_TABLE_PEER

This PR also adds logic to listening to the forwarding state command table and get the response back from gRPC and write to forwarding state response

FORWARDING_STATE_COMMAND -> FORWARDING_STATE_RESPONSE
for getting the forwarding state request/response using gRPC

This PR also has logic for gRPC library build using build_ext extension. The proto definition is present in
proto/proto_out/
The setup.py changes make sure that gRPC libs are generated correctly.

the corresponding gRPC libs are generated in proto_out directory in python packages directory and are imported by ycabled

Motivation and Context
DualToR active-active support for gRPC interface to support the state machine

How Has This Been Tested?
Unit-Tests and deploying changes on a DualToR testbed
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.

2 participants