Skip to content

Commit

Permalink
Merge pull request #11 from envoyproxy/master
Browse files Browse the repository at this point in the history
Sync Fork from Upstream Repo
  • Loading branch information
sthagen authored Aug 28, 2019
2 parents 7349490 + d99e7f6 commit cb077ad
Show file tree
Hide file tree
Showing 97 changed files with 1,639 additions and 298 deletions.
5 changes: 4 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ build --action_env=BAZEL_LINKOPTS=-lm:-static-libgcc
build --host_javabase=@bazel_tools//tools/jdk:remote_jdk11
build --javabase=@bazel_tools//tools/jdk:remote_jdk11

# We already have absl in the build, define absl=1 to tell googletest to use absl for backtrace.
build --define absl=1

# Pass PATH, CC and CXX variables from the environment.
build --action_env=CC
build --action_env=CXX
Expand Down Expand Up @@ -147,4 +150,4 @@ build:asan-fuzzer --define=FUZZING_ENGINE=libfuzzer
build:asan-fuzzer --copt=-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
build:asan-fuzzer --copt=-fsanitize-coverage=trace-pc-guard
# Remove UBSAN halt_on_error to avoid crashing on protobuf errors.
build:asan-fuzzer --test_env=UBSAN_OPTIONS=print_stacktrace=1
build:asan-fuzzer --test_env=UBSAN_OPTIONS=print_stacktrace=1
2 changes: 2 additions & 0 deletions .zuul/playbooks/envoy-build/run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
roles:
- role: config-gcc
gcc_version: 7
- role: config-bazel
bazel_version: 0.28.1
tasks:
- name: Build envoy
shell:
Expand Down
8 changes: 4 additions & 4 deletions api/bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ BAZEL_SKYLIB_SHA256 = "2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc70
GOGOPROTO_RELEASE = "1.2.1"
GOGOPROTO_SHA256 = "99e423905ba8921e86817607a5294ffeedb66fdd4a85efce5eb2848f715fdb3a"

OPENCENSUS_PROTO_RELEASE = "0.2.1"
OPENCENSUS_PROTO_SHA256 = "bfcefa6093fc2ecdf5c9effea86e6982d0d6f9a5178b17fcf73a62e0f3fb43d0"
OPENCENSUS_PROTO_GIT_SHA = "5cec5ea58c3efa81fa808f2bd38ce182da9ee731" # Jul 25, 2019
OPENCENSUS_PROTO_SHA256 = "faeb93f293ff715b0cb530d273901c0e2e99277b9ed1c0a0326bca9ec5774ad2"

PGV_GIT_SHA = "2feaabb13a5d697b80fcb938c0ce37b24c9381ee" # Jul 26, 2018
PGV_SHA256 = "ddefe3dcbb25d68a2e5dfea67d19c060959c2aecc782802bd4c1a5811d44dd45"
Expand Down Expand Up @@ -54,8 +54,8 @@ REPOSITORY_LOCATIONS = dict(
),
opencensus_proto = dict(
sha256 = OPENCENSUS_PROTO_SHA256,
strip_prefix = "opencensus-proto-" + OPENCENSUS_PROTO_RELEASE + "/src",
urls = ["https://github.com/census-instrumentation/opencensus-proto/archive/v" + OPENCENSUS_PROTO_RELEASE + ".tar.gz"],
strip_prefix = "opencensus-proto-" + OPENCENSUS_PROTO_GIT_SHA + "/src",
urls = ["https://github.com/census-instrumentation/opencensus-proto/archive/" + OPENCENSUS_PROTO_GIT_SHA + ".tar.gz"],
),
kafka_source = dict(
sha256 = KAFKA_SOURCE_SHA,
Expand Down
6 changes: 4 additions & 2 deletions api/envoy/admin/v2alpha/server_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ message ServerInfo {
// Uptime since the start of the first epoch.
google.protobuf.Duration uptime_all_epochs = 4;

// Hot restart version.
string hot_restart_version = 5;

// Command line options the server is currently running with.
CommandLineOptions command_line_options = 6;
}
Expand Down Expand Up @@ -82,8 +85,7 @@ message CommandLineOptions {
// See :option:`--log-path` for details.
string log_path = 11;

// See :option:`--hot-restart-version` for details.
bool hot_restart_version = 12;
reserved 12;

// See :option:`--service-cluster` for details.
string service_cluster = 13;
Expand Down
2 changes: 2 additions & 0 deletions api/envoy/api/v2/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ api_proto_library_internal(
"//envoy/api/v2/core:address",
"//envoy/api/v2/core:base",
"//envoy/api/v2/listener",
"//envoy/api/v2/listener:udp_listener_config",
],
)

Expand All @@ -120,6 +121,7 @@ api_go_grpc_library(
"//envoy/api/v2/core:address_go_proto",
"//envoy/api/v2/core:base_go_proto",
"//envoy/api/v2/listener:listener_go_proto",
"//envoy/api/v2/listener:udp_listener_config_go_proto",
],
)

Expand Down
11 changes: 10 additions & 1 deletion api/envoy/api/v2/lds.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import "envoy/api/v2/core/address.proto";
import "envoy/api/v2/core/base.proto";
import "envoy/api/v2/discovery.proto";
import "envoy/api/v2/listener/listener.proto";
import "envoy/api/v2/listener/udp_listener_config.proto";

import "google/api/annotations.proto";
import "google/protobuf/duration.proto";
Expand Down Expand Up @@ -44,7 +45,7 @@ service ListenerDiscoveryService {
}
}

// [#comment:next free field: 18]
// [#comment:next free field: 19]
message Listener {
// The unique name by which this listener is known. If no name is provided,
// Envoy will allocate an internal UUID for the listener. If the listener is to be dynamically
Expand Down Expand Up @@ -194,4 +195,12 @@ message Listener {

// Specifies the intended direction of the traffic relative to the local Envoy.
core.TrafficDirection traffic_direction = 16;

// If the protocol in the listener socket address in :ref:`protocol
// <envoy_api_field_core.SocketAddress.protocol>` is :ref:'UDP
// <envoy_api_field_core.Protocol.UDP>`, this field specifies the actual udp listener to create,
// i.e. :ref:`udp_listener_name
// <envoy_api_field_listener.UdpListenerConfig.udp_listener_name>` = "raw_udp_listener" for
// creating a packet-oriented UDP listener. If not present, treat it as "raw_udp_listener".
listener.UdpListenerConfig udp_listener_config = 18;
}
17 changes: 17 additions & 0 deletions api/envoy/api/v2/listener/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,20 @@ api_go_proto_library(
"//envoy/api/v2/core:base_go_proto",
],
)

api_proto_library_internal(
name = "udp_listener_config",
srcs = ["udp_listener_config.proto"],
visibility = ["//envoy/api/v2:friends"],
deps = [
"//envoy/api/v2/core:base",
],
)

api_go_proto_library(
name = "udp_listener_config",
proto = ":udp_listener_config",
deps = [
"//envoy/api/v2/core:base_go_proto",
],
)
31 changes: 31 additions & 0 deletions api/envoy/api/v2/listener/udp_listener_config.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
syntax = "proto3";

package envoy.api.v2.listener;

option java_outer_classname = "ListenerProto";
option java_multiple_files = true;
option java_package = "io.envoyproxy.envoy.api.v2.listener";
option go_package = "listener";
option csharp_namespace = "Envoy.Api.V2.ListenerNS";
option ruby_package = "Envoy::Api::V2::ListenerNS";

import "google/protobuf/struct.proto";
import "google/protobuf/any.proto";

// [#protodoc-title: Udp Listener Config]
// Listener :ref:`configuration overview <config_listeners>`

message UdpListenerConfig {
// Used to look up UDP listener factory, matches "raw_udp_listener" or
// "quic_listener" to create a specific udp listener.
// If not specified, treat as "raw_udp_listener".
string udp_listener_name = 1;

// Used to create a specific listener factory. To some factory, e.g.
// "raw_udp_listener", config is not needed.
oneof config_type {
google.protobuf.Struct config = 2;

google.protobuf.Any typed_config = 3;
}
}
1 change: 0 additions & 1 deletion api/envoy/config/accesslog/v2/als.proto
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ message HttpGrpcAccessLogConfig {

// Configuration for the built-in *envoy.tcp_grpc_access_log* type. This configuration will
// populate *StreamAccessLogsMessage.tcp_logs*.
// [#not-implemented-hide:]
message TcpGrpcAccessLogConfig {
CommonGrpcAccessLogConfig common_config = 1 [(validate.rules).message.required = true];
}
Expand Down
9 changes: 8 additions & 1 deletion api/envoy/config/bootstrap/v2/bootstrap.proto
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,14 @@ message Bootstrap {
// performance reasons Envoy latches counters and only flushes counters and
// gauges at a periodic interval. If not specified the default is 5000ms (5
// seconds).
google.protobuf.Duration stats_flush_interval = 7 [(gogoproto.stdduration) = true];
// Duration must be at least 1ms and at most 5 min.
google.protobuf.Duration stats_flush_interval = 7 [
(validate.rules).duration = {
lt: {seconds: 300},
gte: {nanos: 1000000}
},
(gogoproto.stdduration) = true
];

// Optional watchdog configuration.
Watchdog watchdog = 8;
Expand Down
3 changes: 3 additions & 0 deletions api/envoy/config/filter/accesslog/v2/accesslog.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ message AccessLog {
//
// #. "envoy.file_access_log"
// #. "envoy.http_grpc_access_log"
// #. "envoy.tcp_grpc_access_log"
string name = 1;

// Filter which is used to determine if the access log needs to be written.
Expand All @@ -36,6 +37,8 @@ message AccessLog {
// <envoy_api_msg_config.accesslog.v2.FileAccessLog>`
// #. "envoy.http_grpc_access_log": :ref:`HttpGrpcAccessLogConfig
// <envoy_api_msg_config.accesslog.v2.HttpGrpcAccessLogConfig>`
// #. "envoy.tcp_grpc_access_log": :ref:`TcpGrpcAccessLogConfig
// <envoy_api_msg_config.accesslog.v2.TcpGrpcAccessLogConfig>`
oneof config_type {
google.protobuf.Struct config = 3;

Expand Down
8 changes: 8 additions & 0 deletions api/envoy/config/trace/v2/trace.proto
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ message OpenCensusConfig {
// The URL to Zipkin, e.g. "http://127.0.0.1:9411/api/v2/spans"
string zipkin_url = 6;

// Enables the OpenCensus Agent exporter if set to true. The address must also
// be set.
bool ocagent_exporter_enabled = 11;

// The address of the OpenCensus Agent, if its exporter is enabled, in gRPC
// format: https://github.com/grpc/grpc/blob/master/doc/naming.md
string ocagent_address = 12;

reserved 7; // Formerly zipkin_service_name.

enum TraceContext {
Expand Down
13 changes: 12 additions & 1 deletion api/envoy/data/accesslog/v2/accesslog.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ option (gogoproto.stable_marshaler_all) = true;
// Fields describing *upstream* interaction will explicitly include ``upstream``
// in their name.

// [#not-implemented-hide:]
message TCPAccessLogEntry {
// Common properties shared by all Envoy access logs.
AccessLogCommon common_properties = 1;

// Properties of the TCP connection.
ConnectionProperties connection_properties = 2;
}

message HTTPAccessLogEntry {
Expand All @@ -54,6 +56,15 @@ message HTTPAccessLogEntry {
HTTPResponseProperties response = 4;
}

// Defines fields for a connection
message ConnectionProperties {
// Number of bytes received from downstream.
uint64 received_bytes = 1;

// Number of bytes sent to downstream.
uint64 sent_bytes = 2;
}

// Defines fields that are shared by all Envoy access logs.
message AccessLogCommon {
// [#not-implemented-hide:]
Expand Down
2 changes: 0 additions & 2 deletions api/envoy/service/accesslog/v2/als.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ message StreamAccessLogsMessage {
[(validate.rules).repeated .min_items = 1];
}

// [#not-implemented-hide:]
// Wrapper for batches of TCP access log entries.
message TCPAccessLogEntries {
repeated envoy.data.accesslog.v2.TCPAccessLogEntry log_entry = 1
Expand All @@ -67,7 +66,6 @@ message StreamAccessLogsMessage {

HTTPAccessLogEntries http_logs = 2;

// [#not-implemented-hide:]
TCPAccessLogEntries tcp_logs = 3;
}
}
78 changes: 78 additions & 0 deletions bazel/grpc-rename-gettid.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
From d1d017390b799c59d6fdf7b8afa6136d218bdd61 Mon Sep 17 00:00:00 2001
From: Benjamin Peterson <[email protected]>
Date: Fri, 3 May 2019 08:11:00 -0700
Subject: [PATCH] Rename gettid() functions.

glibc 2.30 will declare its own gettid; see https://sourceware.org/git/?p=glibc.git;a=commit;h=1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92. Rename the grpc versions to avoid naming conflicts.
---
src/core/lib/gpr/log_linux.cc | 4 ++--
src/core/lib/gpr/log_posix.cc | 4 ++--
src/core/lib/iomgr/ev_epollex_linux.cc | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/core/lib/gpr/log_linux.cc b/src/core/lib/gpr/log_linux.cc
index 561276f0c20..8b597b4cf2f 100644
--- a/src/core/lib/gpr/log_linux.cc
+++ b/src/core/lib/gpr/log_linux.cc
@@ -40,7 +40,7 @@
#include <time.h>
#include <unistd.h>

-static long gettid(void) { return syscall(__NR_gettid); }
+static long sys_gettid(void) { return syscall(__NR_gettid); }

void gpr_log(const char* file, int line, gpr_log_severity severity,
const char* format, ...) {
@@ -70,7 +70,7 @@ void gpr_default_log(gpr_log_func_args* args) {
gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
struct tm tm;
static __thread long tid = 0;
- if (tid == 0) tid = gettid();
+ if (tid == 0) tid = sys_gettid();

timer = static_cast<time_t>(now.tv_sec);
final_slash = strrchr(args->file, '/');
diff --git a/src/core/lib/gpr/log_posix.cc b/src/core/lib/gpr/log_posix.cc
index b6edc14ab6b..2f7c6ce3760 100644
--- a/src/core/lib/gpr/log_posix.cc
+++ b/src/core/lib/gpr/log_posix.cc
@@ -31,7 +31,7 @@
#include <string.h>
#include <time.h>

-static intptr_t gettid(void) { return (intptr_t)pthread_self(); }
+static intptr_t sys_gettid(void) { return (intptr_t)pthread_self(); }

void gpr_log(const char* file, int line, gpr_log_severity severity,
const char* format, ...) {
@@ -86,7 +86,7 @@ void gpr_default_log(gpr_log_func_args* args) {
char* prefix;
gpr_asprintf(&prefix, "%s%s.%09d %7" PRIdPTR " %s:%d]",
gpr_log_severity_string(args->severity), time_buffer,
- (int)(now.tv_nsec), gettid(), display_file, args->line);
+ (int)(now.tv_nsec), sys_gettid(), display_file, args->line);

fprintf(stderr, "%-70s %s\n", prefix, args->message);
gpr_free(prefix);
diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc
index 08116b3ab53..76f59844312 100644
--- a/src/core/lib/iomgr/ev_epollex_linux.cc
+++ b/src/core/lib/iomgr/ev_epollex_linux.cc
@@ -1102,7 +1102,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker,
}

#ifndef NDEBUG
-static long gettid(void) { return syscall(__NR_gettid); }
+static long sys_gettid(void) { return syscall(__NR_gettid); }
#endif

/* pollset->mu lock must be held by the caller before calling this.
@@ -1122,7 +1122,7 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
#define WORKER_PTR (&worker)
#endif
#ifndef NDEBUG
- WORKER_PTR->originator = gettid();
+ WORKER_PTR->originator = sys_gettid();
#endif
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
gpr_log(GPR_INFO,
6 changes: 6 additions & 0 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,10 @@ def _io_opencensus_cpp():
name = "opencensus_trace_trace_context",
actual = "@io_opencensus_cpp//opencensus/trace:trace_context",
)
native.bind(
name = "opencensus_exporter_ocagent",
actual = "@io_opencensus_cpp//opencensus/exporters/trace/ocagent:ocagent_exporter",
)
native.bind(
name = "opencensus_exporter_stdout",
actual = "@io_opencensus_cpp//opencensus/exporters/trace/stdout:stdout_exporter",
Expand Down Expand Up @@ -613,6 +617,8 @@ def _com_github_grpc_grpc():
"@envoy//bazel:grpc-protoinfo-2.patch",
# Pre-integration of https://github.com/grpc/grpc/pull/19860
"@envoy//bazel:grpc-protoinfo-3.patch",
# Pre-integration of https://github.com/grpc/grpc/pull/18950
"@envoy//bazel:grpc-rename-gettid.patch",
],
patch_args = ["-p1"],
)
Expand Down
8 changes: 4 additions & 4 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,10 @@ REPOSITORY_LOCATIONS = dict(
urls = ["https://files.pythonhosted.org/packages/b3/b2/238e2590826bfdd113244a40d9d3eb26918bd798fc187e2360a8367068db/six-1.10.0.tar.gz"],
),
io_opencensus_cpp = dict(
sha256 = "8d6016e47c2e19e7acbadb6f905b8c422748c64299d71101ac8f28151677e195",
strip_prefix = "opencensus-cpp-cad0d03ff3474cf14389fc249e16847ab7b6895f",
# 2019-07-31
urls = ["https://github.com/census-instrumentation/opencensus-cpp/archive/cad0d03ff3474cf14389fc249e16847ab7b6895f.tar.gz"],
sha256 = "b5fcc36a994a4ecb6e53c901e33579ed1ac238cff9975807db760918a15f43ff",
strip_prefix = "opencensus-cpp-8058a1b8efe6a63bd18673abc51223917d12d45d",
# 2019-08-22
urls = ["https://github.com/census-instrumentation/opencensus-cpp/archive/8058a1b8efe6a63bd18673abc51223917d12d45d.tar.gz"],
),
com_github_curl = dict(
sha256 = "4376ac72b95572fb6c4fbffefb97c7ea0dd083e1974c0e44cd7e49396f454839",
Expand Down
2 changes: 1 addition & 1 deletion ci/envoy_build_sha.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ENVOY_BUILD_SHA=$(grep envoyproxy/envoy-build .circleci/config.yml | sed -e 's#.*envoyproxy/envoy-build:\(.*\)#\1#' | uniq)
ENVOY_BUILD_SHA=$(grep envoyproxy/envoy-build $(dirname $0)/../.circleci/config.yml | sed -e 's#.*envoyproxy/envoy-build:\(.*\)#\1#' | uniq)
[[ $(wc -l <<< "${ENVOY_BUILD_SHA}" | awk '{$1=$1};1') == 1 ]] || (echo ".circleci/config.yml hashes are inconsistent!" && exit 1)
2 changes: 1 addition & 1 deletion ci/run_envoy_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

. ci/envoy_build_sha.sh
. $(dirname $0)/envoy_build_sha.sh

# We run as root and later drop permissions. This is required to setup the USER
# in useradd below, which is need for correct Python execution in the Docker
Expand Down
Loading

0 comments on commit cb077ad

Please sign in to comment.