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

config: ADS implementation. #1658

Merged
merged 11 commits into from
Sep 20, 2017
Merged

config: ADS implementation. #1658

merged 11 commits into from
Sep 20, 2017

Conversation

htuch
Copy link
Member

@htuch htuch commented Sep 15, 2017

This patch introduces a GrpcMux implementation, loosely based on GrpcSubscriptionImpl, but
generalized to encompass the case of both a single xDS API channel (e.g. EDS) and a multiplex
channel (ADS).

Signed-off-by: Harvey Tuch [email protected]

This patch introduces a GrpcMux implementation, loosely based on GrpcSubscriptionImpl, but
generalized to encompass the case of both a single xDS API channel (e.g. EDS) and a multiplex
channel (ADS).
@htuch
Copy link
Member Author

htuch commented Sep 15, 2017

@mattklein123 this is now ready for review. There are some additional unit/integration tests that I plan, as well as a full writeup on the ADS (and regular xDS) message sequencing in envoy-api, but this is basically it.

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

loving the merge/cleanup here. Overall looks great. Will fully review when ready.

/**
* Constant Type URLs.
*/
class TypeUrlValues {
Copy link
Member

Choose a reason for hiding this comment

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

Should this go in the "well known" file? Don't care just a thought.

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer to draw a line between the actual config and the delivery vehicle constants, so resources.h seems a better choice I think.

return MessageUtil::anyConvert<envoy::api::v2::ClusterLoadAssignment>(resource).cluster_name();
}
ASSERT(false);
return "";
Copy link
Member

Choose a reason for hiding this comment

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

should we throw exception here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, I think I originally didn't think this was in the scope of a try block, but it is.

@htuch
Copy link
Member Author

htuch commented Sep 19, 2017

@mattklein123 this is now ready for final review.

@mattklein123
Copy link
Member

@htuch looks like having some test issues. Ping me when passing and I can take a look.

@htuch
Copy link
Member Author

htuch commented Sep 20, 2017

@mattklein123 should be fixed now.

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

looks good. 2 questions.

stats_.update_attempt_.inc();
}

const std::string versionInfo() const override { NOT_IMPLEMENTED; }
const std::string versionInfo() const override { return version_info_; }
Copy link
Member

Choose a reason for hiding this comment

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

As I understand it, the version here will be the last returned version from a discovery response, regardless of MUXd resource, right? I think that's fine but might be worth a comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

This will be for the specific type URL of the resource. There is one GrpcMuxSubscriptionImpl per type URL.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry where is that setup? (Just trying to understand)

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see: https://github.com/envoyproxy/envoy/pull/1658/files#diff-1adb93ed0d49e43e5ed44c13ff6ea6cbR78

OK got it. Makes sense. This is neat. It came together really well.

envoy::api::v2::DiscoveryRequest request_;
SubscriptionStats stats_;
GrpcMuxImpl grpc_mux_;
GrpcMuxSubscriptionImpl<ResourceType> ads_subscription_;
Copy link
Member

Choose a reason for hiding this comment

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

I'm a little confused here. For a singleton gRPC subscription, how does this work? Does this somehow go to the null ADS?

Copy link
Member

Choose a reason for hiding this comment

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

Or we are just using same code? If so rename grpc_subscription_?

Copy link
Member Author

Choose a reason for hiding this comment

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

It uses its own instance of GrpcMuxImpl, with jut a single subscription on the channel. Will update variable name as suggested.

@htuch htuch closed this Sep 20, 2017
@htuch htuch reopened this Sep 20, 2017
@mattklein123 mattklein123 merged commit d49bb3e into envoyproxy:master Sep 20, 2017
jpsim pushed a commit that referenced this pull request Nov 28, 2022
It turns out that removing Kotlin from Envoy Mobile is not really needed at this point. In reality, the Kotlin classes are a layer on top of the Java classes, and Cronvoy is a layer too: one level of indirection for the callbacks is enough. So instead Cronvoy uses the java classes directly. The main drawback is the CronvoyConfiguration - there is some duplication.

Description: Have Cronvoy to only use the Envoy Mobile Java classes for its implementation
Risk Level: None
Testing: CI
Docs Changes: N/A
Release Notes: N/A
Fixes #1658
Signed-off-by: Charles Le Borgne <[email protected]>
Signed-off-by: JP Simard <[email protected]>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
It turns out that removing Kotlin from Envoy Mobile is not really needed at this point. In reality, the Kotlin classes are a layer on top of the Java classes, and Cronvoy is a layer too: one level of indirection for the callbacks is enough. So instead Cronvoy uses the java classes directly. The main drawback is the CronvoyConfiguration - there is some duplication.

Description: Have Cronvoy to only use the Envoy Mobile Java classes for its implementation
Risk Level: None
Testing: CI
Docs Changes: N/A
Release Notes: N/A
Fixes #1658
Signed-off-by: Charles Le Borgne <[email protected]>
Signed-off-by: JP Simard <[email protected]>
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