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

Question: Including external libraries for cache filter plugins #9977

Closed
enozcan opened this issue Feb 8, 2020 · 8 comments
Closed

Question: Including external libraries for cache filter plugins #9977

enozcan opened this issue Feb 8, 2020 · 8 comments
Labels
question Questions that are neither investigations, bugs, nor enhancements stale stalebot believes this issue/PR has not been touched recently

Comments

@enozcan
Copy link

enozcan commented Feb 8, 2020

I'm about to contribute a plugin for the new cache filter (#9878) but not sure about the appropriate way of including external libraries in Envoy convention.

Currently I include the shared library (of Hazelcast Cpp Client) in my workspace via new_local_repository in BUILD file. However, it has a size of about 10 MB and of course it's not desirable to add it to Envoy repo. What I observed from the current includes in the repo is, envoy_http_archive and envoy_cmake_external (for a cmake project just as the one I use) rules are used and all the source code for a repository is compiled again during Envoy build, if I'm not wrong.

However, this makes me confused since in this manner, plugin dependencies are going to be compiled even if the plugin (and/or cache) is not used. Is that actually expected? If not, what is the proper way of doing that? If so, is there a dependency currently included in the repo that similar to my case and I can follow the same procedure? I have also read the doc for external dependencies here but couldn't decide if including such a big dependency in the repo is acceptable or not.

@mattklein123 mattklein123 added the question Questions that are neither investigations, bugs, nor enhancements label Feb 10, 2020
@mattklein123
Copy link
Member

What we need to do is making cache plugins use the standard extension build mechanism. See https://github.com/envoyproxy/envoy/blob/master/source/extensions/extensions_build_config.bzl. This will allow HTTP cache extensions to be explicitly compiled in (along with their dependencies).

@toddmgreer
Copy link
Contributor

Added this for SimpleHttpCache in #9974.

@toddmgreer
Copy link
Contributor

#9974 is now merged, and you should be able to use the same approach for HazelCache.

@toddmgreer
Copy link
Contributor

To be more specific:
Use envoy_cc_extension (with security_posture and status fields) in the plugin's BUILD file.
Add a line to source/extensions/extensions_build_config.bzl referencing the above BUILD rule (in the "CacheFilter plugins" section).
Use envoy_extension_cc_test (with extension_name field referencing the .bzl line) in the plugin's test BUILD file.

@enozcan
Copy link
Author

enozcan commented Feb 12, 2020

Thank you for the answers.

Then I will import the external dependency via http_archive following the bazel/EXTERNAL_DEPS.md steps and include it via external_deps in envoy_cc_extension rule.

Feel free to close the issue.

@stale
Copy link

stale bot commented Mar 13, 2020

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label Mar 13, 2020
@stale
Copy link

stale bot commented Mar 20, 2020

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

@stale stale bot closed this as completed Mar 20, 2020
@stale
Copy link

stale bot commented Mar 27, 2020

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions that are neither investigations, bugs, nor enhancements stale stalebot believes this issue/PR has not been touched recently
Projects
None yet
Development

No branches or pull requests

3 participants