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

dynamic_modules: scaffolds config API & HTTP Filter #36448

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mathetake
Copy link
Member

@mathetake mathetake commented Oct 4, 2024

Commit Message: dynamic_modules: scaffolds config API & HTTP Filter
Additional Description:

This scaffolds the configuration API marked as work-in-progress, and
the skeleton HTTP filter implementation based on the configuration.

The real implementations will follow after this commit.

Risk Level: low
Testing: done
Docs Changes: n/a
Release Notes: n/a (not enabled yet)
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #36448 was opened by mathetake.

see: more, trace.

Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @markdroth
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #36448 was opened by mathetake.

see: more, trace.

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
@mathetake
Copy link
Member Author

/retest

@mathetake mathetake marked this pull request as ready for review October 5, 2024 16:48
@mathetake
Copy link
Member Author

cc @marc-barry

ps the flaky CI failure is nothing to do with this PR

ERROR: /source/test/extensions/load_balancing_policies/client_side_weighted_round_robin/BUILD:40:24: Compiling test/extensions/load_balancing_policies/client_side_weighted_round_robin/integration_test.cc failed: (Killed): clang-14 failed: error executing command (from target //test/extensions/load_balancing_policies/client_side_weighted_round_robin:integration_test)

envoy.extensions.dynamic_modules.v3.DynamicModuleConfig dynamic_module_config = 1;

// The name for this filter configuration. This can be used to distinguish between different filter implementations
// inside a dynamic module. For example, a module can have completely different filter implementations.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this level of indirection useful? Why not just have multiple modules in this case?

Copy link
Member Author

@mathetake mathetake Oct 8, 2024

Choose a reason for hiding this comment

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

The reason is that each module must have its own copy of language runtime which is an unnecessary overhead (~a few MB) in the memory space as well as some languages do not support multiple language runtime existence in one process such as Go.

// For example, if a module has two filter implementations, one for logging and one for header manipulation,
// filter_name is used to choose either logging or header manipulation. The filter_config can be used to
// configure the logging level or the header manipulation behavior.
string filter_config = 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this a string instead of a google.protobuf.Any?

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 q and this choice of string is intentional - this config will go across the C ABI boundary as-is, hence we need a plain binary representation, otherwise this will end up forcing all dynamic modules to be able to understand protobuf which is unnecessary. For example, each module would need a copy of protobuf dependency.

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
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.

3 participants