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

xds: add xDS transport custom Dialer support #7586

Merged
merged 10 commits into from
Sep 27, 2024

Conversation

danielzhaotongliu
Copy link
Contributor

@danielzhaotongliu danielzhaotongliu commented Sep 3, 2024

Design:

  • go/grpc-go-corp-to-prod-td-doc
  • Add a custom Dialer method that specifies how to dial the xDS server via the credentials bundle without introducing new public APIs.
  • No code change for existing users that do not need a custom Dialer for the xDS transport.

Tested:

  • ./scripts/vet.sh
  • go test -cpu 1,4 -timeout 7m ./...
  • go test -race -cpu 1,4 -timeout 7m ./...
  • Verified end-to-end by running a test gRPC client with a xDS client that used the custom Dialer for the xDS transport to successfully communicate with the xDS server and fetch configs.

RELEASE NOTES:

  • xds: add experimental feature to customize the Dialer used by the xDS transport

Copy link

codecov bot commented Sep 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.87%. Comparing base (5666049) to head (5ebc9a7).
Report is 21 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7586      +/-   ##
==========================================
+ Coverage   81.74%   81.87%   +0.12%     
==========================================
  Files         361      361              
  Lines       27813    27827      +14     
==========================================
+ Hits        22736    22783      +47     
+ Misses       3868     3848      -20     
+ Partials     1209     1196      -13     
Files with missing lines Coverage Δ
internal/xds/bootstrap/bootstrap.go 71.47% <100.00%> (+0.99%) ⬆️
xds/internal/xdsclient/transport/transport.go 93.30% <100.00%> (+0.05%) ⬆️

... and 39 files with indirect coverage changes

@danielzhaotongliu danielzhaotongliu marked this pull request as ready for review September 9, 2024 16:49
Copy link
Member

@dfawley dfawley left a comment

Choose a reason for hiding this comment

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

Could you add a test that works at an even higher level? I.e. registers the creds builder from outside of the xdsclient package and confirms that a grpc client created using grpc.NewClient will invoke the proper dialer?

EDIT: finished comments; oops!

internal/xds/bootstrap/bootstrap.go Outdated Show resolved Hide resolved
xds/internal/xdsclient/transport/transport.go Outdated Show resolved Hide resolved
xds/internal/xdsclient/transport/transport_test.go Outdated Show resolved Hide resolved
@dfawley
Copy link
Member

dfawley commented Sep 9, 2024

(Sorry, hit send too soon; updated comment above.)

@dfawley dfawley added the Type: Feature New features or improvements in behavior label Sep 9, 2024
@dfawley dfawley added this to the 1.67 Release milestone Sep 9, 2024
@purnesh42H purnesh42H modified the milestones: 1.67 Release, 1.68 Release Sep 10, 2024
@danielzhaotongliu
Copy link
Contributor Author

Could you add a test that works at an even higher level? I.e. registers the creds builder from outside of the xdsclient package and confirms that a grpc client created using grpc.NewClient will invoke the proper dialer?

Done.
In latest commit, I added a new e2e test test/xds/xds_client_custom_dialer_test.go that registers a creds builder (creds bundle with a custom Dialer method that simply acts as a pass-through), sets up a xDS management server, creates a new xDS bootstrap that specifies the creds builder name as part of the channel_creds, creates a xDS resolver that uses the bootstrap, creates a test backend, creates a ClientConn via grpc.NewClient, make a successful RPC call, finally verify the custom Dialer has been called. This works end-to-end as the custom Dialer is just a pass-through.

The test setup is inspired by other tests under test/xds/.

Copy link
Member

@dfawley dfawley left a comment

Choose a reason for hiding this comment

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

LGTM aside from the two small comments -- thanks!

test/xds/xds_client_custom_dialer_test.go Outdated Show resolved Hide resolved
test/xds/xds_client_custom_dialer_test.go Outdated Show resolved Hide resolved
@dfawley
Copy link
Member

dfawley commented Sep 13, 2024

+@easwars for a second review

internal/xds/bootstrap/bootstrap.go Outdated Show resolved Hide resolved
internal/xds/bootstrap/bootstrap.go Show resolved Hide resolved
test/xds/xds_client_custom_dialer_test.go Outdated Show resolved Hide resolved
test/xds/xds_client_custom_dialer_test.go Outdated Show resolved Hide resolved
internal/xds/bootstrap/bootstrap.go Show resolved Hide resolved
xds/internal/xdsclient/transport/transport_test.go Outdated Show resolved Hide resolved
internal/xds/bootstrap/bootstrap.go Show resolved Hide resolved
test/xds/xds_client_custom_dialer_test.go Outdated Show resolved Hide resolved
test/xds/xds_client_custom_dialer_test.go Outdated Show resolved Hide resolved
test/xds/xds_client_custom_dialer_test.go Outdated Show resolved Hide resolved
@easwars easwars merged commit 7aee163 into grpc:master Sep 27, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New features or improvements in behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants