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

Separate repository structure for Envoy core and extensions #14078

Closed
htuch opened this issue Nov 18, 2020 · 11 comments · Fixed by #17800
Closed

Separate repository structure for Envoy core and extensions #14078

htuch opened this issue Nov 18, 2020 · 11 comments · Fixed by #17800
Assignees
Labels
area/build area/security design proposal Needs design doc/proposal before implementation help wanted Needs help!

Comments

@htuch
Copy link
Member

htuch commented Nov 18, 2020

One of the significant contributors to Envoy’s continued dependency and SLOC growth is C++ extensions. Visualizations of this are provided in “Understanding, maintaining and securing Envoy's supply chain” EnvoyCon 2020 talk (slides, video).

Many of these extensions have limited support, maintenance and production use. Some are labeled alpha or have unknown security postures (see this list). One reason for the growth in C++ extensions is that Envoy has an unstable API internal C++ API, and upstreaming an extension ensures build maintenance as this API changes.

To structurally eliminate the dependencies implied by these extensions, we can ask that new external dependencies that are immature, not widely used or that are not in some sense “core” to Envoy, be added to either:

  1. An independent extension repository.
  2. A contrib/ directory tree in the Envoy repository that is distinct from the rest of the Envoy source.

This extension repository/directory will be validated for build/test by CI, but will not be covered by Envoy’s security policy or product security team. When an extension meets specified maturity criteria, it can graduate from the extension repository to the regular source tree. Proposed criteria:

  • The extension is stable (not alpha)
  • The extension’s dependencies meet all Envoy’s dependency criteria
  • The extension is known to be in production use by at least one known operator
  • The extension has active maintainers
  • The Envoy security team agrees that there is a compelling public interest in supporting the extension

There are also considerations and advantages around build time and binary size that might argue in favor of this approach.

A counter-argument to repository separation is that it is burdensome to work across multiple repositories for a typical git flow and we can effectively enforce extension support and dependency separation in a single repository with the above criteria being used to eliminate extensions and dependencies from security team consideration when unmet.

We might also have different standards for API and code review in the extension repository/directory, making maintainership more scalable.

Opening this issue to track discussion on pros/cons of this approach.

CC @envoyproxy/maintainers @envoyproxy/security-team

@htuch htuch added enhancement Feature requests. Not bugs or questions. triage Issue requires triage area/build area/security design proposal Needs design doc/proposal before implementation help wanted Needs help! and removed enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Nov 18, 2020
@lizan
Copy link
Member

lizan commented Nov 19, 2020

From CI perspective, IMO it is hard to support a separate repository and that reduces the product velocity, instead we might just do another directory (e.g. contrib) with different set of bazel workspace / build rules?

@htuch
Copy link
Member Author

htuch commented Nov 19, 2020

This makes sense to me; it's challenging as a developer flow as well to have multiple repos. I like the idea of contrib and then having a clear path to migration to source/extensions based on specific criteria. I think by default we would not include contrib in the Envoy binaries built, but optionally using something like #7582.

@mattklein123
Copy link
Member

Yeah +1 on contrib and we can generate 2 different images, one with contrib and one without? That should be really easy.

@htuch
Copy link
Member Author

htuch commented Nov 19, 2020

A couple of questions:

  • How do we structure things API wise? Do we have a contrib API, or place the extensions in the official Envoy API from the get go? I think there is a balance between API stability and API review overhead here.
  • Do we have differences in review policy in contrib? Pros are allowing faster experimentation and iteration (as you would have in a separate repo). The (very) big con is that this creates a very large step function to migration to core.

@ggreenway
Copy link
Contributor

A couple of questions:

  • How do we structure things API wise? Do we have a contrib API, or place the extensions in the official Envoy API from the get go? I think there is a balance between API stability and API review overhead here.
  • Do we have differences in review policy in contrib? Pros are allowing faster experimentation and iteration (as you would have in a separate repo). The (very) big con is that this creates a very large step function to migration to core.

I'd say have contrib API in a separate directory, but in the same proto namespace so it can be moved from contrib to core without changing on-the-wire format, or really any source changes except maybe include paths.

@antoniovicente
Copy link
Contributor

There has been the occasional issue of extensions that envoy core ends up having a tight dependency on, and build/test of Envoy core can't happen if the relevant extension is disabled and related code deleted. Having a separate directory for contrib and having an explicit goal of releasing with and without contrib sounds like a good step forward. Would it also make sense to have an envoy release without extensions? Granted, there are "extensions" like raw transport sockets and ssl transport sockets that Envoy does need in order to function.

@antoniovicente
Copy link
Contributor

Regarding API and extensions: Would it make sense to define config protos for extensions in that extension's extension source directory? Nothing outside the extension needs to understand their config proto.

@lizan
Copy link
Member

lizan commented Nov 20, 2020

There has been the occasional issue of extensions that envoy core ends up having a tight dependency on, and build/test of Envoy core can't happen if the relevant extension is disabled and related code deleted. Having a separate directory for contrib and having an explicit goal of releasing with and without contrib sounds like a good step forward. Would it also make sense to have an envoy release without extensions? Granted, there are "extensions" like raw transport sockets and ssl transport sockets that Envoy does need in order to function.

We tightened the dependency enforcement and only a few extensions that Envoy core can depend on. I don't think the goal is to move all extensions to contrib, we need to define tiers of the extensions and decide which gets to the default image / additional flavored image, and supported by security team or not, etc.

@phlax
Copy link
Member

phlax commented Nov 20, 2020

seems like there is consensus not to move to a separate repo, so perhaps this point is moot...

the downside i see with that is that we would need to separate examples that required extensions, and i guess then replicate the ci for that

@htuch htuch changed the title Separate repositories for Envoy core and extensions Separate repository structure for Envoy core and extensions Nov 20, 2020
@htuch
Copy link
Member Author

htuch commented Nov 20, 2020

These are all good points. I've updated the title/top-level description to capture the contrib/ alternative.

@mattklein123
Copy link
Member

I've put together a proposal for adding contrib/ to the Envoy repository. Please review! https://docs.google.com/document/d/1yl7GOZK1TDm_7vxQvt8UQEAu07UQFru1uEKXM6ZZg_g/edit#

@mattklein123 mattklein123 self-assigned this Jul 16, 2021
mattklein123 added a commit that referenced this issue Aug 17, 2021
Part of #14078

Signed-off-by: Matt Klein <mklein@lyft.com>
mattklein123 added a commit that referenced this issue Aug 18, 2021
Part of #14078

Signed-off-by: Matt Klein <mklein@lyft.com>
lizan pushed a commit to envoyproxy/data-plane-api that referenced this issue Aug 18, 2021
Part of envoyproxy/envoy#14078

Signed-off-by: Matt Klein <mklein@lyft.com>

Mirrored from https://github.com/envoyproxy/envoy @ 43311b95392c6216320b6f4125f094a773ced2b2
mattklein123 added a commit that referenced this issue Aug 20, 2021
Part of #14078

Signed-off-by: Matt Klein <mklein@lyft.com>
mattklein123 added a commit that referenced this issue Aug 21, 2021
Part of #14078

Signed-off-by: Matt Klein <mklein@lyft.com>
lizan pushed a commit to envoyproxy/data-plane-api that referenced this issue Aug 21, 2021
Part of envoyproxy/envoy#14078

Signed-off-by: Matt Klein <mklein@lyft.com>

Mirrored from https://github.com/envoyproxy/envoy @ 5b63ef4d5b8670977749a2f5a620d4b6d9f93a72
mattklein123 added a commit that referenced this issue Aug 22, 2021
Fixes #14078

Signed-off-by: Matt Klein <mklein@lyft.com>
mattklein123 added a commit that referenced this issue Aug 25, 2021
Fixes #14078

Signed-off-by: Matt Klein <mklein@lyft.com>
lizan pushed a commit to envoyproxy/data-plane-api that referenced this issue Aug 25, 2021
Fixes envoyproxy/envoy#14078

Signed-off-by: Matt Klein <mklein@lyft.com>

Mirrored from https://github.com/envoyproxy/envoy @ ef82a02bed0e6ab3de45e87b365cb18b55be6010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build area/security design proposal Needs design doc/proposal before implementation help wanted Needs help!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants