From de1f34b96d507817d821fa1097a8ef13d0542f24 Mon Sep 17 00:00:00 2001 From: Rama Date: Thu, 26 Oct 2017 13:22:20 +0530 Subject: [PATCH 1/5] initial commit Signed-off-by: Rama --- api/mds.proto | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 api/mds.proto diff --git a/api/mds.proto b/api/mds.proto new file mode 100644 index 000000000..73e4d98fc --- /dev/null +++ b/api/mds.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package envoy.api.v2; + +import "google/api/annotations.proto"; + +// While it is not a "true" discovery service, just named it as MetricsDiscoveryService to align with xDS paradigm. +service MetricsDiscoveryService { + rpc FetchProxyMetrics (MetricsRequest) returns (MetricsResponse) { + option (google.api.http) = { + post: "/v2/discovery:metrics" + body: "*" + }; + } +} + +message MetricsDiscoveryRequest { + +} + +message MetricsDiscoveryResponse { + + message ProxyStatistic { + string stat_name = 1; + uint32 stat_value = 2; + } + repeated ProxyStatistic proxy_stats = 1; +} + + + From b085af2c8485ba8525a128f466b1ec9ccf14574e Mon Sep 17 00:00:00 2001 From: Shriram Rajagopalan Date: Thu, 26 Oct 2017 12:51:14 -0400 Subject: [PATCH 2/5] Update xDS docs to clarify ordering (#206) Signed-off-by: Shriram Rajagopalan --- .travis.yml | 16 ---------------- XDS_PROTOCOL.md | 22 +++++++++++++++++----- ci/build_setup.sh | 6 +----- ci/ci_steps.sh | 17 ----------------- ci/run_envoy_docker.sh | 11 ----------- 5 files changed, 18 insertions(+), 54 deletions(-) delete mode 100644 .travis.yml delete mode 100755 ci/ci_steps.sh delete mode 100755 ci/run_envoy_docker.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1db9207f1..000000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: minimal -sudo: required -services: - - docker -install: - - gem install travis --no-rdoc --no-ri -matrix: - fast_finish: true -env: - - TEST_TYPE=bazel.test - - TEST_TYPE=bazel.docs -script: ./ci/ci_steps.sh - -branches: - only: - - master diff --git a/XDS_PROTOCOL.md b/XDS_PROTOCOL.md index f433072ad..c6ef39164 100644 --- a/XDS_PROTOCOL.md +++ b/XDS_PROTOCOL.md @@ -191,11 +191,23 @@ drop can't be tolerated, traffic drop could have been avoided by providing a CDS/EDS update with both __X__ and __Y__, then the RDS update repointing from __X__ to __Y__ and then a CDS/EDS update dropping __X__. -In general, to avoid traffic drop: -* Sequencing should be make before break. -* LDS and CDS updates should arrive before the respective RDS and EDS updates. -* CDS/EDS resources corresponding to routes in LDS/RDS should be available at - update. +In general, to avoid traffic drop, sequencing of updates should follow a +`make before break` model, wherein +* CDS updates (if any) must always be pushed first. +* EDS updates (if any) must arrive after CDS updates for the respective clusters. +* LDS updates must arrive after corresponding CDS/EDS updates. +* RDS updates related to the newly added listeners must arrive in the end. +* Stale CDS clusters and related EDS endpoints (ones no longer being + referenced) can then be removed. + +xDS updates can be pushed independently if no new clusters/routes/listeners +are added or if it's acceptable to temporarily drop traffic during +updates. Note that in case of LDS updates, the listeners will be warmed +before they receive traffic, i.e. the dependent routes are fetched through +RDS if configured. On the other hand, clusters are not warmed when +adding/removing/updating clusters. Similarly, routes are not warmed -- +i.e., the management plane must ensure that clusters referenced by a route +are in place, before pushing the updates for a rotue. ### Aggregated Discovery Services (ADS) diff --git a/ci/build_setup.sh b/ci/build_setup.sh index 4643f757d..2d0f5d9b4 100755 --- a/ci/build_setup.sh +++ b/ci/build_setup.sh @@ -9,11 +9,7 @@ NUM_CPUS=`grep -c ^processor /proc/cpuinfo` export ENVOY_SRCDIR=/source export BUILD_DIR=/build -if [[ ! -d "${BUILD_DIR}" ]] -then - echo "${BUILD_DIR} mount missing - did you forget -v :${BUILD_DIR}?" - exit 1 -fi +mkdir -p ${BUILD_DIR} # Create a fake home. Python site libs tries to do getpwuid(3) if we don't and # the CI Docker image gets confused as it has no passwd entry when running diff --git a/ci/ci_steps.sh b/ci/ci_steps.sh deleted file mode 100755 index cc18881e8..000000000 --- a/ci/ci_steps.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# Script that lists all the steps take by the CI system when doing Envoy builds. -set -e - -# We reuse the https://github.com/lyft/envoy/ CI image here to get Bazel. -ENVOY_BUILD_SHA=114e24c6fd05fc026492e9d2ca5608694e5ea59d - -# Lint travis file. -travis lint .travis.yml --skip-completion-check - -# Where the Envoy build takes place. -export ENVOY_API_BUILD_DIR=/tmp/envoy-api-docker-build - -# Do a build matrix with different types of builds docs, coverage, bazel.release, etc. -docker run -t -i -v "$ENVOY_API_BUILD_DIR":/build -v $TRAVIS_BUILD_DIR:/source \ - lyft/envoy-build:$ENVOY_BUILD_SHA /bin/bash -c "cd /source && ci/do_ci.sh $TEST_TYPE" diff --git a/ci/run_envoy_docker.sh b/ci/run_envoy_docker.sh deleted file mode 100755 index c14118709..000000000 --- a/ci/run_envoy_docker.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -[[ -z "${IMAGE_ID}" ]] && IMAGE_ID="latest" -[[ -z "${ENVOY_API_DOCKER_BUILD_DIR}" ]] && ENVOY_API_DOCKER_BUILD_DIR=/tmp/envoy-api-docker-build - -mkdir -p "${ENVOY_API_DOCKER_BUILD_DIR}" -docker pull lyft/envoy-build:"${IMAGE_ID}" -docker run -t -i -u $(id -u):$(id -g) -v "${ENVOY_API_DOCKER_BUILD_DIR}":/build \ - -v "$PWD":/source lyft/envoy-build:"${IMAGE_ID}" /bin/bash -c "cd source && $*" From a0425cf2bcbf64d34ac846a1f1becbaa4cd3faf2 Mon Sep 17 00:00:00 2001 From: Rama Date: Fri, 27 Oct 2017 10:37:18 +0530 Subject: [PATCH 3/5] used promotheus data model Signed-off-by: Rama --- api/mds.proto | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/api/mds.proto b/api/mds.proto index 73e4d98fc..fcdfe4b9d 100644 --- a/api/mds.proto +++ b/api/mds.proto @@ -3,28 +3,23 @@ syntax = "proto3"; package envoy.api.v2; import "google/api/annotations.proto"; +import "io/prometheus/client/metrics.proto"; -// While it is not a "true" discovery service, just named it as MetricsDiscoveryService to align with xDS paradigm. -service MetricsDiscoveryService { +service MetricsService { rpc FetchProxyMetrics (MetricsRequest) returns (MetricsResponse) { option (google.api.http) = { - post: "/v2/discovery:metrics" + post: "/v2/metrics" body: "*" }; } } -message MetricsDiscoveryRequest { +message MetricsRequest { } -message MetricsDiscoveryResponse { - - message ProxyStatistic { - string stat_name = 1; - uint32 stat_value = 2; - } - repeated ProxyStatistic proxy_stats = 1; +message MetricsResponse { + repeated MetricFamily proxy_metrics = 1; } From 0a8b74e7a3bff0837e95cb4f4b115e62474740d7 Mon Sep 17 00:00:00 2001 From: Rama Date: Thu, 26 Oct 2017 13:22:20 +0530 Subject: [PATCH 4/5] initial commit Signed-off-by: Rama --- api/mds.proto | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 api/mds.proto diff --git a/api/mds.proto b/api/mds.proto new file mode 100644 index 000000000..73e4d98fc --- /dev/null +++ b/api/mds.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package envoy.api.v2; + +import "google/api/annotations.proto"; + +// While it is not a "true" discovery service, just named it as MetricsDiscoveryService to align with xDS paradigm. +service MetricsDiscoveryService { + rpc FetchProxyMetrics (MetricsRequest) returns (MetricsResponse) { + option (google.api.http) = { + post: "/v2/discovery:metrics" + body: "*" + }; + } +} + +message MetricsDiscoveryRequest { + +} + +message MetricsDiscoveryResponse { + + message ProxyStatistic { + string stat_name = 1; + uint32 stat_value = 2; + } + repeated ProxyStatistic proxy_stats = 1; +} + + + From c72acfd00cdb5fe54aea2bb8222a06dec74750ee Mon Sep 17 00:00:00 2001 From: Rama Date: Fri, 27 Oct 2017 10:37:18 +0530 Subject: [PATCH 5/5] used promotheus data model Signed-off-by: Rama --- api/mds.proto | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/api/mds.proto b/api/mds.proto index 73e4d98fc..fcdfe4b9d 100644 --- a/api/mds.proto +++ b/api/mds.proto @@ -3,28 +3,23 @@ syntax = "proto3"; package envoy.api.v2; import "google/api/annotations.proto"; +import "io/prometheus/client/metrics.proto"; -// While it is not a "true" discovery service, just named it as MetricsDiscoveryService to align with xDS paradigm. -service MetricsDiscoveryService { +service MetricsService { rpc FetchProxyMetrics (MetricsRequest) returns (MetricsResponse) { option (google.api.http) = { - post: "/v2/discovery:metrics" + post: "/v2/metrics" body: "*" }; } } -message MetricsDiscoveryRequest { +message MetricsRequest { } -message MetricsDiscoveryResponse { - - message ProxyStatistic { - string stat_name = 1; - uint32 stat_value = 2; - } - repeated ProxyStatistic proxy_stats = 1; +message MetricsResponse { + repeated MetricFamily proxy_metrics = 1; }