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

filters: add initial support for bridged filters #940

Merged
merged 12 commits into from
Jul 15, 2020
Merged

Conversation

goaway
Copy link
Contributor

@goaway goaway commented Jul 7, 2020

Description: Adds support for platform-bridged filter implementations at the common and bridge layers of the library. Includes a stub implementation hardcoded into configuration. Dynamic configuration and data support, with platform-specific presentations, to come.
Risk Level: Moderate
Testing: Local end-to-end

Signed-off-by: Mike Schore [email protected]

@goaway
Copy link
Contributor Author

goaway commented Jul 7, 2020

Note: this requires upstream Envoy update, and will need to be rebased when that merges. See: #923

@goaway
Copy link
Contributor Author

goaway commented Jul 7, 2020

Note: pending completed stub implementation.

Copy link
Contributor

@rebello95 rebello95 left a comment

Choose a reason for hiding this comment

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

LGTM overall, some comments (and it'd be great if we could add tests)

library/common/api/external.h Outdated Show resolved Hide resolved
Comment on lines 35 to 38
- name: envoy.filters.http.platform_extension
typed_config:
"@type": type.googleapis.com/envoymobile.extensions.filters.http.platform_extension.Bridging
name: PlatformStub
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment from #883 (comment) applies

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Same as below)
This particular part won't ever really be publicly exposed/used. But I do intend to make a documentation PR that fully describes how to create and use platform extensions.

Comment on lines 7 to 9
message Bridging {
string name = 1 [(validate.rules).string.min_bytes = 1];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we document how this works/is intended to be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This particular part won't ever really be publicly exposed/used. But I do intend to make a documentation PR that fully describes how to create and use platform extensions.

Copy link
Member

@junr03 junr03 left a comment

Choose a reason for hiding this comment

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

nice! Some comments

envoy_build_config/BUILD Outdated Show resolved Hide resolved
envoy_build_config/extensions_build_config.bzl Outdated Show resolved Hide resolved

namespace Envoy {
namespace Api {
namespace External {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
namespace External {
namespace PlatformExtension {

I think this meshes well with the rest of the PR, because it tells us that these function signatures allow us to register any platform extension api?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure - it may be obvious that I waffled a bit on naming and "external" was just a possibility I considered, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now that I've updated everything else to standardize on PlatformBridge, I actually think this should remain External. Any API external to the library could be registered here, but everything labeled PlatformBridge relates specifically to bridging up to a platform runtime environment.

library/common/api/external.cc Show resolved Hide resolved
library/common/api/external.h Show resolved Hide resolved
@goaway
Copy link
Contributor Author

goaway commented Jul 8, 2020

This update adds an optimized path for no-op filter callbacks, as well as allowing calloc to trivially create a no-op filter - utilized here as a PlatformStub implementation.

It also factors out common callback logic on the request and response path for headers.

@goaway
Copy link
Contributor Author

goaway commented Jul 8, 2020

With this the PR should be functionally green, once upstream can be updated.

rebello95
rebello95 previously approved these changes Jul 13, 2020
Copy link
Contributor

@rebello95 rebello95 left a comment

Choose a reason for hiding this comment

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

Great work! 2 small call outs, but feel free to merge so we can iterate on main!

library/common/types/c_types.h Show resolved Hide resolved
rebello95
rebello95 previously approved these changes Jul 13, 2020
@goaway goaway force-pushed the ms/bridge-filter branch from 6483bdd to 3af5dd4 Compare July 15, 2020 03:10
@goaway
Copy link
Contributor Author

goaway commented Jul 15, 2020

Finally rebased on upstream Envoy update.

goaway added 2 commits July 15, 2020 11:17
Signed-off-by: Mike Schore <[email protected]>
Signed-off-by: Mike Schore <[email protected]>
@goaway
Copy link
Contributor Author

goaway commented Jul 15, 2020

CI is green; proceeding with merge (with previous approvals).

@goaway goaway merged commit f87359c into main Jul 15, 2020
@goaway goaway deleted the ms/bridge-filter branch July 15, 2020 04:41
goaway added a commit that referenced this pull request Jul 17, 2020
Description: Missed this request from @junr03 on #940.
Risk Level: Low
Testing: Local and CI

Signed-off-by: Mike Schore <[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.

4 participants