Skip to content

Commit 1fdb638

Browse files
authored
Reconcile envoyproxy/data-plane-api and envoyproxy/envoy (#3036)
This PR implements the planned merge of envoyproxy/data-plane-api into envoyproxy/envoy as described in #2934 and https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/envoy-dev/KcVHFH-zQwQ. Risk Level: Medium (there might be unintentional breakage of dependent builds). Testing: CI passes. There is now an additional bazel.api do_ci.sh target to build and run API tests. Fixes #2934. Signed-off-by: Harvey Tuch <[email protected]>
1 parent 4745ead commit 1fdb638

File tree

381 files changed

+28242
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

381 files changed

+28242
-129
lines changed

.circleci/config.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ jobs:
3737
steps:
3838
- checkout
3939
- run: ci/do_circle_ci.sh bazel.tsan
40+
api:
41+
docker:
42+
- image: *envoy-build-image
43+
resource_class: xlarge
44+
working_directory: /source
45+
steps:
46+
- checkout
47+
- run: ci/do_circle_ci.sh bazel.api
48+
- run: ci/api_mirror.sh
4049
ipv6_tests:
4150
machine: true
4251
steps:
@@ -96,8 +105,11 @@ jobs:
96105
steps:
97106
- run: sleep 30 # workaround GH sync issue
98107
- checkout
99-
- add_ssh_keys
100108
- run: ci/do_circle_ci.sh docs
109+
- add_ssh_keys
110+
- run: docs/publish.sh
111+
- store_artifacts:
112+
path: generated/docs
101113
mac:
102114
macos:
103115
xcode: "9.3.0"
@@ -118,6 +130,7 @@ workflows:
118130
only: /^v.*/
119131
- asan
120132
- tsan
133+
- api
121134
- ipv6_tests
122135
- coverage
123136
- format

BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
licenses(["notice"]) # Apache 2
2+
3+
exports_files(["VERSION"])

CONTRIBUTING.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,8 @@ maximize the chances of your PR being merged.
6868
* PRs are expected to have 100% test coverage for added code. This can be verified with a coverage
6969
build. If your PR cannot have 100% coverage for some reason please clearly explain why when you
7070
open it.
71-
* Any PR that changes user-facing behavior **must** have associated documentation in
72-
[data-plane-api](https://github.com/envoyproxy/data-plane-api/tree/master/docs) as well as
73-
[release notes](https://github.com/envoyproxy/data-plane-api/blob/master/docs/root/intro/version_history.rst).
71+
* Any PR that changes user-facing behavior **must** have associated documentation in [docs](docs) as
72+
well as [release notes](docs/root/intro/version_history.rst).
7473
* All code comments and documentation are expected to have proper English grammar and punctuation.
7574
If you are not a fluent English speaker (or a bad writer ;-)) please let us know and we will try
7675
to find some help but there are no guarantees.

GOVERNANCE.md

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -69,33 +69,27 @@
6969
* We do releases approximately every 3 months as described in the
7070
[release cadence documentation](CONTRIBUTING.md#release-cadence).
7171
* Decide on the somewhat arbitrary time that a release will occur.
72-
* Begin marshalling the ongoing PR flow in both this repo and
73-
[data-plane-api](https://github.com/envoyproxy/data-plane-api). Ask maintainers to hold off
74-
merging any particularly risky PRs until after the release is tagged. This is because we currently
75-
don't use release branches and assume that master is RC quality at all times. At the same time,
76-
try to make sure that data-plane-api doc PRs are only merged *after* the Envoy PR so that we don't
77-
wind up with stale docs.
78-
* Do a final check of the [release notes](https://github.com/envoyproxy/data-plane-api/blob/master/docs/root/intro/version_history.rst)
79-
and make any needed corrections.
80-
* Switch the [data-plane-api VERSION](https://github.com/envoyproxy/data-plane-api/blob/master/VERSION) from a
81-
"dev" variant to a final variant. E.g., "1.6.0-dev" to "1.6.0". Get a review and merge.
82-
* Update the [data-plane-api SHA in Envoy](https://github.com/envoyproxy/envoy/blob/ed312500ec38876446ce8ee70a06f7cda4adc937/bazel/repository_locations.bzl#L79)
83-
to the final release SHA. Get the PR approved and merge.
72+
* Begin marshalling the ongoing PR flow in this repo. Ask maintainers to hold off merging any
73+
particularly risky PRs until after the release is tagged. This is because we currently don't use
74+
release branches and assume that master is RC quality at all times.
75+
* Do a final check of the [release notes](docs/root/intro/version_history.rst) and make any needed
76+
corrections.
77+
* Switch the [VERSION](VERSION) from a "dev" variant to a final variant. E.g., "1.6.0-dev" to
78+
"1.6.0". Get a review and merge.
8479
* **Wait for tests to pass on master.**
8580
* Create a [tagged release](https://github.com/envoyproxy/envoy/releases). The release should
86-
start with "v" and be followed by the version number. E.g., "v1.6.0". **This must match
87-
the [data-plane-api VERSION](https://github.com/envoyproxy/data-plane-api/blob/master/VERSION).**
81+
start with "v" and be followed by the version number. E.g., "v1.6.0". **This must match the
82+
[VERSION](VERSION).**
8883
* Monitor the CircleCI tag build to make sure that the final docker images get pushed along with
8984
the final docs. The final documentation will end up in the
9085
[envoyproxy.github.io repository](https://github.com/envoyproxy/envoyproxy.github.io/tree/master/docs/envoy).
9186
* Contact rdl@ on Slack so that the website can be updated for the new release.
9287
* Craft a witty/uplifting email and send it to all the email aliases including envoy-announce@.
9388
* If possible post on Twitter (either have Matt do it or contact caniszczyk@ on Slack and have the
9489
Envoy account post).
95-
* Do a new PR to update the [data-plane-api VERSION](https://github.com/envoyproxy/data-plane-api/blob/master/VERSION)
96-
to the next development release. E.g., "1.7.0-dev". At the same time, also add a new empty section
97-
to the [release notes](https://github.com/envoyproxy/data-plane-api/blob/master/docs/root/intro/version_history.rst)
98-
for the following version. E.g., "1.7.0".
90+
* Do a new PR to update [VERSION](VERSION) to the next development release. E.g., "1.7.0-dev". At
91+
the same time, also add a new empty section to the [release
92+
notes](docs/root/intro/version_history.rst) for the following version. E.g., "1.7.0".
9993
* Update [DEPRECATED.md](DEPRECATED.md) to remove the '(pending)' comment on the current version,
10094
replacing it with the release date. Add a placeholder for the next version.
10195

PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,17 @@ if you are unsure. A good rule of thumb is the riskier the change, the
3636
more comprehensive the testing should be.
3737

3838
*Docs Changes*:
39-
>Link to [Data Plane PR](https://github.com/envoyproxy/data-plane-api/pulls)]
40-
if your PR involves documentation changes. Please write in N/A if there were no
41-
documentation changes.
39+
Description of documentation changes. These should be made in [docs/root](docs/root) and/or inline
40+
with the API protos. Please write in N/A if there were no documentation changes.
4241

4342
*Release Notes*:
44-
>If this change is user impacting you **must** add a release note via a discrete PR to
45-
[version_history.rst](https://github.com/envoyproxy/data-plane-api/blob/master/docs/root/intro/version_history.rst).
46-
Please include any relevant links. Each release note should be prefixed with the relevant subsystem
47-
in alphabetical order (see existing examples as a guide) and include links to relevant parts of
48-
the documentation. Often times, this PR can be done concurrently with the main documentation PR
49-
for the feature. Thank you! Please write in N/A if there are no release notes.
43+
>If this change is user impacting you **must** add a release note to
44+
[version_history.rst](docs/root/intro/version_history.rst). Please include any relevant links. Each
45+
release note should be prefixed with the relevant subsystem in alphabetical order (see existing
46+
examples as a guide) and include links to relevant parts of the documentation. Thank you! Please
47+
write in N/A if there are no release notes.
5048

5149
[Optional Fixes #Issue]
5250

53-
[Optional *API Changes*:]
54-
>Link to [Data Plane PR](https://github.com/envoyproxy/data-plane-api/pulls)]
55-
5651
[Optional *Deprecated*:]
57-
>Description of what is deprecated.
52+
>Description of what is [deprecated](DEPRECATED.md).

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ to find out more about the origin story and design philosophy of Envoy
2222

2323
## Related
2424

25-
* [data-plane-api](https://github.com/envoyproxy/data-plane-api): v2 API definitions.
25+
* [data-plane-api](https://github.com/envoyproxy/data-plane-api): v2 API definitions as a standalone
26+
repository. This is a read-only mirror of [api](api/).
2627
* [envoy-perf](https://github.com/envoyproxy/envoy-perf): Performance testing framework.
2728
* [envoy-filter-example](https://github.com/envoyproxy/envoy-filter-example): Example of how to add new filters
2829
and link to the main repository.

REPO_LAYOUT.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ as well as to clearly specify how extensions are added to the repository. The to
55
are:
66

77
* [.circleci/](.circleci/): Configuration for [CircleCI](https://circleci.com/gh/envoyproxy).
8+
* [api/](api/): Envoy data plane API.
89
* [bazel/](bazel/): Configuration for Envoy's use of [Bazel](https://bazel.build/).
910
* [ci/](ci/): Scripts used both during CI as well as to build Docker containers.
1011
* [configs/](configs/): Example Envoy configurations.
11-
* [docs/](docs/): Project level documentation as well as scripts for publishing final docs during
12-
releases.
12+
* [docs/](docs/): End user facing Envoy proxy and data plane API documentation as well as scripts
13+
for publishing final docs during releases.
1314
* [examples/](examples/): Larger Envoy examples using Docker and Docker Compose.
1415
* [include/](include/): "Public" interface headers for "core" Envoy. In general,
1516
these are almost entirely 100% abstract classes. There are a few cases of not-abstract classes in

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.7.0-dev

api/API_OVERVIEW.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Envoy v2 APIs for developers
2+
3+
## Goals
4+
5+
This repository contains both the implemented and draft v2 JSON REST and gRPC
6+
[Envoy](https://github.com/envoyproxy/envoy/) APIs.
7+
8+
Version 2 of the Envoy API evolves existing APIs and introduces new APIs to:
9+
10+
* Allow for more advanced load balancing through load and resource utilization reporting to management servers.
11+
* Improve N^2 health check scalability issues by optionally offloading health checking to other Envoy instances.
12+
* Support Envoy deployment in edge, sidecar and middle proxy deployment models via changes to the listener model and CDS/SDS APIs.
13+
* Allow streaming updates from the management server on change, instead of polling APIs from Envoy. gRPC APIs will be supported
14+
alongside JSON REST APIs to provide for this.
15+
* Ensure all Envoy runtime configuration is dynamically discoverable via API
16+
calls, including listener configuration, certificates and runtime settings, which are today sourced from the filesystem. There
17+
will still remain a static bootstrap configuration file that will specify items
18+
unlikely to change during runtime, including the Envoy node identity, xDS
19+
management server addresses, administration interface and tracing
20+
configuration.
21+
* Revisit and where appropriate cleanup any v1 technical debt.
22+
23+
## Status
24+
25+
See
26+
[here](https://www.envoyproxy.io/docs/envoy/latest/configuration/overview/v2_overview.html#status)
27+
for the current status of the v2 APIs.
28+
29+
See [here](CONTRIBUTING.md#api-changes) for the v2 API change process.
30+
31+
## Principles
32+
33+
* [Proto3](https://developers.google.com/protocol-buffers/docs/proto3) will be
34+
used to specify the canonical API. This will provide directly the gRPC API and
35+
via gRPC-JSON transcoding the JSON REST API. A textual YAML input will be
36+
supported for filesystem configuration files (e.g. the bootstrap file), in
37+
addition to JSON, as a syntactic convenience. YAML file contents will be
38+
internally converted to JSON and then follow the standard JSON-proto3
39+
conversion during Envoy config ingestion.
40+
41+
* xDS APIs should support eventual consistency. For example, if RDS references a
42+
cluster that has not yet been supplied by CDS, it should be silently ignored
43+
and traffic not forwarded until the CDS update occurs. Stronger consistency
44+
guarantees are possible if the management server is able to sequence the xDS
45+
APIs carefully (for example by using the ADS API below). By following the
46+
`[CDS, EDS, LDS, RDS]` sequence for all pertinent resources, it will be
47+
possible to avoid traffic outages during configuration update.
48+
49+
* The API is primarily intended for machine generation and consumption. It is
50+
expected that the management server is responsible for mapping higher level
51+
configuration concepts to API responses. Similarly, static configuration
52+
fragments may be generated by templating tools, etc. The APIs and tools
53+
used to generate xDS configuration are beyond the scope of the definitions in
54+
this repository.
55+
56+
* REST-JSON API equivalents will be provided for the basic singleton xDS
57+
subscription services CDS/EDS/LDS/RDS/SDS. Advanced APIs such as HDS, ADS and
58+
EDS multi-dimensional LB will be gRPC only. This avoids having to map
59+
complicated bidirectional stream semantics onto REST.
60+
61+
* Listeners will be immutable. Any updates to a listener via LDS will require
62+
the draining of existing connections for the specific bound IP/port. As a
63+
result, new requests will only be guaranteed to observe the new configuration
64+
after existing connections have drained or the drain timeout.
65+
66+
* Versioning will be expressed via [proto3 package
67+
namespaces](https://developers.google.com/protocol-buffers/docs/proto3#packages),
68+
i.e. `package envoy.api.v2;`.
69+
70+
* Custom components (e.g. filters, resolvers, loggers) will use a reverse DNS naming scheme,
71+
e.g. `com.google.widget`, `com.lyft.widget`.
72+
73+
## APIs
74+
75+
Unless otherwise stated, the APIs with the same names as v1 APIs have a similar role.
76+
77+
* [Cluster Discovery Service (CDS)](envoy/api/v2/cds.proto).
78+
* [Endpoint Discovery Service (EDS)](envoy/api/v2/eds.proto). This has the same role as SDS in the [v1 API](https://www.envoyproxy.io/docs/envoy/latest/api-v1/cluster_manager/sds),
79+
the new name better describes what the API does in practice. Advanced global load balancing capable of utilizing N-dimensional upstream metrics is now supported.
80+
* [Health Discovery Service (HDS)](envoy/service/discovery/v2/hds.proto). This new API supports efficient endpoint health discovery by the management server via the Envoy instances it manages. Individual Envoy instances
81+
will typically receive HDS instructions to health check a subset of all
82+
endpoints. The health check subset may not be a subset of the Envoy instance's
83+
EDS endpoints.
84+
* [Listener Discovery Service (LDS)](envoy/api/v2/lds.proto). This new API supports dynamic discovery of the listener configuration (which ports to bind to, TLS details, filter chains, etc.).
85+
* [Metric Service (MS)](envoy/service/metrics/v2/metrics_service.proto). This new API allows Envoy to push (stream) metrics forever for servers to consume.
86+
* [Rate Limit Service (RLS)](envoy/service/ratelimit/v2/rls.proto)
87+
* [Route Discovery Service (RDS)](envoy/api/v2/rds.proto).
88+
* [Secret Discovery Service (SDS)](envoy/service/discovery/v2/sds.proto).
89+
90+
In addition to the above APIs, an aggregation API will be provided to allow for
91+
fine grained control over the sequencing of API updates across discovery
92+
services:
93+
94+
* [Aggregated Discovery Service (ADS)](envoy/api/v2/discovery.proto). See
95+
the [ADS overview](https://www.envoyproxy.io/docs/envoy/latest/configuration/overview/v2_overview#aggregated-discovery-service).
96+
97+
A protocol description for the xDS APIs is provided [here](XDS_PROTOCOL.md).
98+
99+
## Terminology
100+
101+
Some relevant [existing terminology](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/terminology.html) is
102+
repeated below and some new v2 terms introduced.
103+
104+
* Cluster: A cluster is a group of logically similar endpoints that Envoy
105+
connects to. In v2, RDS routes points to clusters, CDS provides cluster configuration and
106+
Envoy discovers the cluster members via EDS.
107+
108+
* Downstream: A downstream host connects to Envoy, sends requests, and receives responses.
109+
110+
* Endpoint: An endpoint is an upstream host that is a member of one or more clusters. Endpoints are discovered via EDS.
111+
112+
* Listener: A listener is a named network location (e.g., port, unix domain socket, etc.) that can be connected to by downstream clients. Envoy exposes one or more listeners that downstream hosts connect to.
113+
114+
* Locality: A location where an Envoy instance or an endpoint runs. This includes
115+
region, zone and sub-zone identification.
116+
117+
* Management server: A logical server implementing the v2 Envoy APIs. This is not necessarily a single physical machine since it may be replicated/sharded and API serving for different xDS APIs may be implemented on different physical machines.
118+
119+
* Region: Geographic region where a zone is located.
120+
121+
* Sub-zone: Location within a zone where an Envoy instance or an endpoint runs.
122+
This allows for multiple load balancing targets within a zone.
123+
124+
* Upstream: An upstream host receives connections and requests from Envoy and returns responses.
125+
126+
* xDS: CDS/EDS/HDS/LDS/RLS/RDS/SDS APIs.
127+
128+
* Zone: Availability Zone (AZ) in AWS, Zone in GCP.

api/BUILD

Whitespace-only changes.

api/CONTRIBUTING.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Contributing guide
2+
3+
## API changes
4+
5+
All API changes should follow the [style guide](STYLE.md).
6+
7+
API changes are regular PRs in https://github.com/envoyproxy/envoy for the API/configuration
8+
changes. They may be as part of a larger implementation PR. Please follow the standard Bazel and CI
9+
process for validating build/test sanity of `api/` before submitting a PR.
10+
11+
*Note: New .proto files should be also included to [build.sh](https://github.com/envoyproxy/envoy/blob/master/docs/build.sh) and
12+
[BUILD](https://github.com/envoyproxy/envoy/blob/master/api/docs/BUILD) in order to get the RSTs generated.*
13+
14+
## Documentation changes
15+
16+
The Envoy project takes documentation seriously. We view it as one of the reasons the project has
17+
seen rapid adoption. As such, it is required that all features have complete documentation. This is
18+
generally going to be a combination of API documentation as well as architecture/overview
19+
documentation.
20+
21+
### Building documentation locally
22+
23+
The documentation can be built locally in the root of https://github.com/envoyproxy/envoy via:
24+
25+
```
26+
docs/build.sh
27+
```
28+
29+
Or to use a hermetic docker container:
30+
31+
```
32+
./ci/run_envoy_docker.sh './ci/do_ci.sh docs'
33+
```
34+
35+
This process builds RST documentation directly from the proto files, merges it with the static RST
36+
files, and then runs [Sphinx](http://www.sphinx-doc.org/en/stable/rest.html) over the entire tree to
37+
produce the final documentation. The generated RST files are not committed as they are regenerated
38+
every time the documentation is built.
39+
40+
### Viewing documentation
41+
42+
Once the documentation is built, it is available rooted at `generated/docs/index.html`. The
43+
generated RST files are also viewable in `generated/rst`.
44+
45+
Note also that the generated documentation can be viewed in CI:
46+
47+
1. Open docs job in CircleCI.
48+
2. Navigate to "artifacts" tab.
49+
3. Expand files and click on `index.html`.
50+
51+
If you do not see an artifacts tab this is a bug in CircleCI. Try logging out and logging back in.
52+
53+
### Documentation guidelines
54+
55+
The following are some general guidelines around documentation.
56+
57+
* Cross link as much as possible. Sphinx is fantastic at this. Use it! See ample examples with the
58+
existing documentation as a guide.
59+
* Please use a **single space** after a period in documentation so that all generated text is
60+
consistent.
61+
* Comments can be left inside comments if needed (that's pretty deep, right?) via the `[#comment:]`
62+
special tag. E.g.,
63+
64+
```
65+
// This is a really cool field!
66+
// [#comment:TODO(mattklein123): Do something cooler]
67+
string foo_field = 3;
68+
```
69+
70+
* Prefer *italics* for emphasis as `backtick` emphasis is somewhat jarring in our Sphinx theme.
71+
* All documentation is expected to use proper English grammar with proper punctuation. If you are
72+
not a fluent English speaker please let us know and we will help out.
73+
* Tag messages/enum/files with `[#proto-status: draft|experimental|frozen]` to
74+
reflect their [API
75+
status](https://www.envoyproxy.io/docs/envoy/latest/configuration/overview/v2_overview#status).
76+
Frozen entities do not need to be tagged except when overriding an outer scope
77+
draft or experimental status.

0 commit comments

Comments
 (0)