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

Minimize the stock extension set for the test server #425

Merged
merged 12 commits into from
Aug 5, 2020
5 changes: 5 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ load("//bazel:repositories.bzl", "nighthawk_dependencies")

nighthawk_dependencies()

local_repository(
name = "envoy_build_config",
path = ".",
)

load("@envoy//bazel:api_binding.bzl", "envoy_api_binding")

envoy_api_binding()
Expand Down
9 changes: 9 additions & 0 deletions extensions_build_config.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See https://github.com/envoyproxy/envoy/blob/master/bazel/README.md#disabling-extensions for details on how this system works.
EXTENSIONS = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a complete list of extensions somewhere? I would like to take a look at what we are disabling and cross-check it with the functionality we are promising and using.

Copy link
Member Author

Choose a reason for hiding this comment

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

"envoy.filters.http.router": "//source/extensions/filters/http/router:config",
"envoy.filters.http.fault": "//source/extensions/filters/http/fault:config",
"envoy.filters.listener.tls_inspector": "//source/extensions/filters/listener/tls_inspector:config",
"envoy.filters.network.http_connection_manager": "//source/extensions/filters/network/http_connection_manager:config",
"envoy.tracers.zipkin": "//source/extensions/tracers/zipkin:config",
"envoy.transport_sockets.raw_buffer": "//source/extensions/transport_sockets/raw_buffer:config",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just my own ignorance of this, but why don't we need to include our test server filter 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.

It's a good question, that didn't occur to me before. Tests are passing, so I think it is safe to assume that "foreign" extensions don't play along with this feature. We could look into proposing a feature over at the Envoy repository if that is desired?

Copy link
Member Author

Choose a reason for hiding this comment

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

(with "foreign", I meant extensions not residing in Envoy's own code base)

Copy link
Contributor

Choose a reason for hiding this comment

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

My area of interest with this is partially on our own documentation around it. If others want to add in their own test server equivalent building on what we already have, how would they do that? But that's only tangentially related to this. So it's probably best to move on.

}
6 changes: 6 additions & 0 deletions source/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ bazel test -c dbg //test/server:http_test_server_filter_integration_test
bazel build -c opt :nighthawk_test_server
```

It is possible to
[enable additional envoy extension](https://github.com/envoyproxy/envoy/blob/master/source/extensions/extensions_build_config.bzl) by adding them [here](../../extensions_build_config.bzl) before the build.
By default, Nighthawk's test server is set up with the minimum extension set needed
for it to operate as documented.


## Configuring the test server

`test-server.yaml` sample content
Expand Down