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

googlec2p: use the bootstrap parsing code to generate parsed bootstrap config instead of handcrafting it #7040

Merged
merged 7 commits into from
Mar 27, 2024

Conversation

clement2026
Copy link
Contributor

@clement2026 clement2026 commented Mar 16, 2024

Fixes: #6901

It looks like the test cases are failing because the bootstrap parsing code is populating fallback values that are not anticipated by the failed test cases. I’m unfamiliar with these fallback values and would appreciate everyone’s insight.

RELEASE NOTES: none

Copy link

linux-foundation-easycla bot commented Mar 16, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@clement2026 clement2026 marked this pull request as ready for review March 16, 2024 02:50
@arvindbr8 arvindbr8 self-requested a review March 18, 2024 22:09
@arvindbr8 arvindbr8 self-assigned this Mar 18, 2024
Copy link
Member

@arvindbr8 arvindbr8 left a comment

Choose a reason for hiding this comment

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

I've made a pass at the PR. I think the TestBuildXDS test also needs to be updated. But I need some clarity on what the expected behavior of the ClientListenerResourceNameTemplate is for c2p. I will get back to that in a bit.

cc: @apolcyn

xds/googledirectpath/googlec2p.go Show resolved Hide resolved
xds/googledirectpath/googlec2p.go Outdated Show resolved Hide resolved
xds/googledirectpath/googlec2p.go Show resolved Hide resolved
Copy link
Member

@arvindbr8 arvindbr8 left a comment

Choose a reason for hiding this comment

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

@proxfly Heads up - I'm merging a change that would cause a conflict with your branch.

There was a behavior regression in the resolver. I wanted to fix that as a different PR. So that this change looks cleaner. Please rebase your changes with master when you get a chance.

@arvindbr8 arvindbr8 removed their assignment Mar 19, 2024
@@ -106,25 +102,21 @@ func (c2pResolverBuilder) Build(t resolver.Target, cc resolver.ClientConn, opts
if balancerName == "" {
Copy link
Member

Choose a reason for hiding this comment

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

optional: i feel balancerName is a misnomer. This is the xDSServerURI

Suggested change
if balancerName == "" {
if balancerName == "" {

Comment on lines 106 to 108
node := newNode(<-zoneCh, <-ipv6CapableCh)
xdsServer := newXdsServer(balancerName)
authorities := newAuthorities(xdsServer)
Copy link
Member

Choose a reason for hiding this comment

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

optional: how about new(Whatever)Config? newXdsServer sounds to me like we are creating something new here. But essentially its only the config

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Good insight!

xds/googledirectpath/googlec2p.go Outdated Show resolved Hide resolved
@arvindbr8
Copy link
Member

The changes in #7048 should resolve the diff for ClientListenerResourceNameTemplate in the test. For the diff in server_features -- xds.config.resource-in-sotw is expected to be part of the config - So I would augment the test golden config to have that as well.

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

Merging #7040 (b09ebd0) into master (cce1632) will decrease coverage by 0.15%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7040      +/-   ##
==========================================
- Coverage   82.55%   82.40%   -0.15%     
==========================================
  Files         300      300              
  Lines       31351    31357       +6     
==========================================
- Hits        25881    25841      -40     
- Misses       4416     4454      +38     
- Partials     1054     1062       +8     
Files Coverage Δ
xds/googledirectpath/googlec2p.go 85.71% <100.00%> (+1.00%) ⬆️
xds/internal/xdsclient/bootstrap/bootstrap.go 74.48% <100.00%> (ø)
xds/internal/xdsclient/client_new.go 84.72% <100.00%> (ø)

... and 16 files with indirect coverage changes

Copy link
Member

@arvindbr8 arvindbr8 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Looks really good to me modulo one comment.

Per policy we need another pass from one of the maintainer. cc: @zasweq

Comment on lines 173 to 177
"user_agent_name": "%s",
"UserAgentVersionType": {
"userAgentVersion": "%s"
},
"client_features": ["%s", "%s"],
Copy link
Member

Choose a reason for hiding this comment

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

UserAgentVersionType is in camel case while the rest seem to be in snake case.

But this got me thinking newConfigFromContents overrides these values here

node.UserAgentName = gRPCUserAgentName
node.UserAgentVersionType = &v3corepb.Node_UserAgentVersion{UserAgentVersion: grpc.Version}
node.ClientFeatures = append(node.ClientFeatures, clientFeatureNoOverprovisioning, clientFeatureResourceWrapper)

I would prefer if we didnt set it here. Sorry about the back and forth on this.

Suggested change
"user_agent_name": "%s",
"UserAgentVersionType": {
"userAgentVersion": "%s"
},
"client_features": ["%s", "%s"],

@arvindbr8 arvindbr8 requested a review from zasweq March 20, 2024 22:48
@arvindbr8 arvindbr8 added the Type: Internal Cleanup Refactors, etc label Mar 20, 2024
@arvindbr8 arvindbr8 added this to the 1.64 Release milestone Mar 20, 2024
@@ -567,7 +565,7 @@ func newConfigFromContents(data []byte) (*Config, error) {
}
node.UserAgentName = gRPCUserAgentName
node.UserAgentVersionType = &v3corepb.Node_UserAgentVersion{UserAgentVersion: grpc.Version}
node.ClientFeatures = append(node.ClientFeatures, clientFeatureNoOverprovisioning, clientFeatureResourceWrapper)
node.ClientFeatures = AppendIfNotPresent(node.ClientFeatures, clientFeatureNoOverprovisioning, clientFeatureResourceWrapper)
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for making the change. I think with the last commit, this can also be reverted

Copy link
Contributor

@zasweq zasweq left a comment

Choose a reason for hiding this comment

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

LGTM.

@zasweq zasweq merged commit 57e4391 into grpc:master Mar 27, 2024
14 checks passed
@clement2026 clement2026 deleted the 6901 branch March 27, 2024 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

googlec2p: use the bootstrap parsing code to generate parsed bootstrap config instead of handcrafting it
3 participants