-
Notifications
You must be signed in to change notification settings - Fork 84
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
Simplify Envoy Config Generation #2498
Comments
I think it would be interesting to see how constructing the config from the C++ config compares to the current YAML code, I don't have a great sense of which one would scale better. Independently of this, looking into options for reducing the overall size of the config might help with startup times. Tis would make it possible to use a more ergonomic interface even if it might be slower than what we have or just a net gain if the new configuration scheme ends up being faster. What comes to mind here is using https://www.envoyproxy.io/docs/envoy/latest/configuration/security/secret#example-one-static-resource (it doesn't have to be files, can be inline) in order to define the secrets once and then refer to them by name. This avoids duplicating the long cert chains everywhere and might drastically cut down on the config processing time |
Expanding on @snowp's comments based on a Slack discussion, his idea is to create an instance of the C++ class OptionsImpl which has the bootstrap config passed in via setConfigProto. Then instead of having EnvoyEngineImpl construct a YAML config string and pass it down to This seems like it could a very attractive approach. |
(This is mostly a note for myself) I've read through the C++, Java, and Obj-C builders/configurations and attempted to enumerate all the different knobs we expose and which knobs apply to which languages.
|
Add a setPerTryIdleTimeoutSeconds method to EngineBuilder. Add tests for setPerTryIdleTimeoutSeconds and setStreamIdleTimeoutSeconds. Minor cleanup of envoy_config_test.cc. Part of #2498 Risk Level: Low Testing: Added unit tests Docs Changes: N/A Release Notes: Updated version_history.txt Signed-off-by: Ryan Hamilton <rch@google.com>
…he Java and Obj-C builders (#2603) Add various methods to C++ EngineBuilder to bring it to parity with the Java and Obj-C builders addStatsSinks() addDnsMinRefreshSeconds() addMaxConnectionsPerHost() enableAdminInterface() enableHappyEyeballs() enableHttp3() enableInterfaceBinding() enableDrainPostDnsRefresh() enableH2ExtendKeepaliveTimeout() enforceTrustChainVerification() Part of #2498 Risk Level: Low Testing: New unit tests Docs Changes: N/A Release Notes: Updated version_history.txt
Add support for String Accessors to the C++ engine builder Introduces a C++ StringAccessor interface and method to convert to an envoy_string_accessor. Minor cleanup of key_value_store handling in engine_builder.cc Part of: #2498 Risk Level: Low Testing: New unit tests Docs Changes: N/A Release Notes: Updated version_history.rst Signed-off-by: Ryan Hamilton <rch@google.com>
…y#2601) Add a setPerTryIdleTimeoutSeconds method to EngineBuilder. Add tests for setPerTryIdleTimeoutSeconds and setStreamIdleTimeoutSeconds. Minor cleanup of envoy_config_test.cc. Part of envoyproxy#2498 Risk Level: Low Testing: Added unit tests Docs Changes: N/A Release Notes: Updated version_history.txt Signed-off-by: Ryan Hamilton <rch@google.com> Signed-off-by: Chidera Olibie <colibie@google.com>
…he Java and Obj-C builders (envoyproxy#2603) Add various methods to C++ EngineBuilder to bring it to parity with the Java and Obj-C builders addStatsSinks() addDnsMinRefreshSeconds() addMaxConnectionsPerHost() enableAdminInterface() enableHappyEyeballs() enableHttp3() enableInterfaceBinding() enableDrainPostDnsRefresh() enableH2ExtendKeepaliveTimeout() enforceTrustChainVerification() Part of envoyproxy#2498 Risk Level: Low Testing: New unit tests Docs Changes: N/A Release Notes: Updated version_history.txt Signed-off-by: Chidera Olibie <colibie@google.com>
…y#2619) Add support for String Accessors to the C++ engine builder Introduces a C++ StringAccessor interface and method to convert to an envoy_string_accessor. Minor cleanup of key_value_store handling in engine_builder.cc Part of: envoyproxy#2498 Risk Level: Low Testing: New unit tests Docs Changes: N/A Release Notes: Updated version_history.rst Signed-off-by: Ryan Hamilton <rch@google.com> Signed-off-by: Chidera Olibie <colibie@google.com>
As discussed in the weekly meeting, this does not provide a C++ implementation of Platform filters, merely the ability to configure Envoy to use them. Part of: #2498 Risk Level: Low Testing: New unit tests Docs Changes: N/A Release Notes: Updated version_history.rst Signed-off-by: Ryan Hamilton <rch@google.com>
The system that Envoy Mobile uses to generate Envoy's config is fairly complicated. It involves snippets of YAML defined as C strings in library/common/config/config.cc. In order to avoid duplication, these snippets make use of YAML anchors and aliases. These YAML snippets are conditionally stitched together along with in Swift via EnvoyConfiguration.m and in Java via EnvoyConfiguration.java and in C++ via library/cc/engine_builder.h.
It seems undesirable to have 3 different builders with different functionality. The Alternate Protocols cache filter is only supported in Java. Custom filters are not supported in the C++ builder.
In addition, the use of YAML anchor and aliases interacts a bit poorly with the builders. Some of the anchors are used by aliases in
config_header
which prevents them from being overridden by builder-supplied values. Of course, other anchor are overrideable and some are currently overrideable in some places but not in others.I think we should simplify this. My strawman would be that config generation is implemented in a single place in (C or C++). The Java, Swift and C++ Builder would be responsible for calling into this single config generation method with whatever state is required to generate a valid config. (This includes numerous booleans and integers as well as a number of strings, lists and maps). However it is important that this not regress app startup so perhaps another approach would be warranted.
The text was updated successfully, but these errors were encountered: