diff --git a/.bazelrc b/.bazelrc index 04158c127..fb2ea4529 100644 --- a/.bazelrc +++ b/.bazelrc @@ -105,6 +105,8 @@ build:asan --config=sanitizer # ASAN install its signal handler, disable ours so the stacktrace will be printed by ASAN build:asan --define signal_trace=disabled build:asan --define ENVOY_CONFIG_ASAN=1 +build:asan --build_tag_filters=-no_san +build:asan --test_tag_filters=-no_san # The following two lines were manually edited due to #593. # unique # Flag undefined was dropped from both the lines to allow CI/ASAN to pass. # unique build:asan --copt -fsanitize=address # unique @@ -352,7 +354,7 @@ build:compile-time-options --@envoy//source/extensions/filters/http/kill_request # Docker sandbox # NOTE: Update this from https://github.com/envoyproxy/envoy-build-tools/blob/main/toolchains/rbe_toolchains_config.bzl#L8 -build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:41c5a05d708972d703661b702a63ef5060125c33 +build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:1f2f7ee78f894859de0fa7a415b0bedde1f6c560@sha256:6a6a64be3f4e3c4380531ad1624f9419d1fe99dde4e5eeb04e2d538a92f27205 build:docker-sandbox --spawn_strategy=docker build:docker-sandbox --strategy=Javac=docker build:docker-sandbox --strategy=Closure=docker diff --git a/.bazelversion b/.bazelversion index f9da12e11..91e4a9f26 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.3.2 \ No newline at end of file +6.3.2 diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index f530e4efc..594de3721 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -1,7 +1,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -ENVOY_COMMIT = "29c2a5c49f7ba81a738db018b21c032b578a5069" -ENVOY_SHA = "b467c5b3e54958f08a07c04b71620ed1e4dbf1536cc64079150ee3d3f206626f" +ENVOY_COMMIT = "0546512d1f2962b9c418f1ce462e9033f079d884" +ENVOY_SHA = "efc9ee2adde9c2da02a595178895614319ac1d652421ab60db3018d8ee32b1c7" HDR_HISTOGRAM_C_VERSION = "0.11.2" # October 12th, 2020 HDR_HISTOGRAM_C_SHA = "637f28b5f64de2e268131e4e34e6eef0b91cf5ff99167db447d9b2825eae6bad" diff --git a/benchmarks/dynamic_test/test_cds_churn_with_traffic.py b/benchmarks/dynamic_test/test_cds_churn_with_traffic.py index 2fbaf088b..3776a0a8f 100644 --- a/benchmarks/dynamic_test/test_cds_churn_with_traffic.py +++ b/benchmarks/dynamic_test/test_cds_churn_with_traffic.py @@ -42,7 +42,7 @@ def _assignEndpointsToClusters( def _run_benchmark(fixture, - rps=1000, + rps=500, duration=_BENCHMARK_DURATION, max_connections=1, max_active_requests=100, diff --git a/benchmarks/dynamic_test/test_eds_churn_with_traffic.py b/benchmarks/dynamic_test/test_eds_churn_with_traffic.py index 1f21d535d..c7c38d95c 100644 --- a/benchmarks/dynamic_test/test_eds_churn_with_traffic.py +++ b/benchmarks/dynamic_test/test_eds_churn_with_traffic.py @@ -26,7 +26,7 @@ def _base_eds_config( def _run_benchmark(fixture, - rps=1000, + rps=500, duration=_BENCHMARK_DURATION, max_connections=1, max_active_requests=100, diff --git a/benchmarks/test/test_discovery.py b/benchmarks/test/test_discovery.py index a90200ef7..2cea505d0 100644 --- a/benchmarks/test/test_discovery.py +++ b/benchmarks/test/test_discovery.py @@ -14,7 +14,7 @@ def _run_benchmark(fixture, - rps=1000, + rps=500, duration=30, max_connections=1, max_active_requests=100, @@ -72,7 +72,7 @@ def test_http_h1_small_request_small_reply_via(inject_envoy_http_proxy_fixture, ["nighthawk/test/integration/configurations/nighthawk_http_origin.yaml"]) def test_http_h1_small_request_small_reply_via_multiple_workers(inject_envoy_http_proxy_fixture, proxy_config): # noqa - _run_benchmark(inject_envoy_http_proxy_fixture, rps=250, concurrency=4) + _run_benchmark(inject_envoy_http_proxy_fixture, rps=125, concurrency=4) # Test the origin directly, using a stock fixture @@ -87,7 +87,7 @@ def test_http_h1_small_request_small_reply_direct(http_test_server_fixture): # ["nighthawk/test/integration/configurations/nighthawk_http_origin.yaml"]) def test_http_h1_small_request_small_reply_direct_multiple_workers( http_test_server_fixture): # noqa - _run_benchmark(http_test_server_fixture, rps=250, concurrency=4) + _run_benchmark(http_test_server_fixture, rps=125, concurrency=4) @pytest.mark.parametrize('server_config', diff --git a/ci/run_envoy_docker.sh b/ci/run_envoy_docker.sh index ac6216726..870ce01bb 100755 --- a/ci/run_envoy_docker.sh +++ b/ci/run_envoy_docker.sh @@ -19,6 +19,10 @@ export GOPROXY="${go_proxy:-}" if is_windows; then [[ -z "${IMAGE_NAME}" ]] && IMAGE_NAME="envoyproxy/envoy-build-windows2019" + # Container networking is unreliable in the most recently built images, pin Windows to a known + # good container. This can create a mismatch between the host environment, and the toolchain + # environment. + ENVOY_BUILD_SHA=41c5a05d708972d703661b702a63ef5060125c33 # TODO(sunjayBhatia): Currently ENVOY_DOCKER_OPTIONS is ignored on Windows because # CI sets it to a Linux-specific value. Undo this once https://github.com/envoyproxy/envoy/issues/13272 # is resolved. @@ -71,7 +75,12 @@ fi # The IMAGE_ID defaults to the CI hash but can be set to an arbitrary image ID (found with 'docker # images'). -[[ -z "${IMAGE_ID}" ]] && IMAGE_ID="${ENVOY_BUILD_SHA}" +if [[ -z "${IMAGE_ID}" ]]; then + IMAGE_ID="${ENVOY_BUILD_SHA}" + if ! is_windows && [[ -n "$ENVOY_BUILD_CONTAINER_SHA" ]]; then + IMAGE_ID="${ENVOY_BUILD_SHA}@sha256:${ENVOY_BUILD_CONTAINER_SHA}" + fi +fi [[ -z "${ENVOY_DOCKER_BUILD_DIR}" ]] && ENVOY_DOCKER_BUILD_DIR="${DEFAULT_ENVOY_DOCKER_BUILD_DIR}" # Replace backslash with forward slash for Windows style paths ENVOY_DOCKER_BUILD_DIR="${ENVOY_DOCKER_BUILD_DIR//\\//}" diff --git a/source/client/process_impl.cc b/source/client/process_impl.cc index fa85b02b5..98c5ed640 100644 --- a/source/client/process_impl.cc +++ b/source/client/process_impl.cc @@ -743,7 +743,7 @@ void ProcessImpl::maybeCreateTracingDriver(const envoy::config::trace::v3::Traci Envoy::Tracing::DriverPtr zipkin_driver = std::make_unique( zipkin_config, *cluster_manager_, scope_root_, tls_, - Envoy::Runtime::LoaderSingleton::get(), *local_info_, generator_, time_system_); + *runtime_loader_.get(), *local_info_, generator_, time_system_); tracer_ = std::make_unique(std::move(zipkin_driver), *local_info_); #else ENVOY_LOG(error, "Not build with any tracing support"); @@ -793,17 +793,16 @@ bool ProcessImpl::runInternal(OutputCollector& collector, const UriPtr& tracing_ } tls_.registerThread(*dispatcher_, true); store_root_.initializeThreading(*dispatcher_, tls_); - runtime_singleton_ = std::make_unique( - Envoy::Runtime::LoaderPtr{new Envoy::Runtime::LoaderImpl( + runtime_loader_ = Envoy::Runtime::LoaderPtr{new Envoy::Runtime::LoaderImpl( *dispatcher_, tls_, {}, *local_info_, store_root_, generator_, - Envoy::ProtobufMessage::getStrictValidationVisitor(), *api_)}); + Envoy::ProtobufMessage::getStrictValidationVisitor(), *api_)}; ssl_context_manager_ = std::make_unique( time_system_); server_ = std::make_unique( admin_, *api_, *dispatcher_, access_log_manager_, envoy_options_, - runtime_singleton_->instance(), *singleton_manager_, tls_, *local_info_, + *runtime_loader_.get(), *singleton_manager_, tls_, *local_info_, validation_context_, grpc_context_, router_context_); server_factory_context_ = std::make_unique(*server_, scope_root_); @@ -826,7 +825,7 @@ bool ProcessImpl::runInternal(OutputCollector& collector, const UriPtr& tracing_ cluster_manager_->setInitializedCb( [this]() -> void { init_manager_.initialize(init_watcher_); }); - Envoy::Runtime::LoaderSingleton::get().initialize(*cluster_manager_); + runtime_loader_->initialize(*cluster_manager_); std::list> stats_sinks; setupStatsSinks(bootstrap_, stats_sinks); diff --git a/source/client/process_impl.h b/source/client/process_impl.h index d5dfc14a3..72a225278 100644 --- a/source/client/process_impl.h +++ b/source/client/process_impl.h @@ -205,7 +205,7 @@ class ProcessImpl : public Process, public Envoy::Logger::Loggable cluster_manager_factory_; Envoy::Upstream::ClusterManagerPtr cluster_manager_{}; - std::unique_ptr runtime_singleton_; + Envoy::Runtime::LoaderPtr runtime_loader_; Envoy::Init::WatcherImpl init_watcher_; Envoy::Tracing::TracerSharedPtr tracer_; Envoy::Server::ValidationAdmin admin_; diff --git a/source/common/worker_impl.cc b/source/common/worker_impl.cc index ce8d1fbd3..ee90b7c3c 100644 --- a/source/common/worker_impl.cc +++ b/source/common/worker_impl.cc @@ -25,8 +25,6 @@ void WorkerImpl::start() { started_ = true; shutdown_ = false; thread_ = std::thread([this]() { - RELEASE_ASSERT(Envoy::Runtime::LoaderSingleton::getExisting() != nullptr, - "Couldn't get runtime"); dispatcher_->run(Envoy::Event::Dispatcher::RunType::NonBlock); work(); complete_.set_value(); diff --git a/source/server/README.md b/source/server/README.md index 0eb76b006..d641b3c4b 100644 --- a/source/server/README.md +++ b/source/server/README.md @@ -264,10 +264,10 @@ Node name Cluster name --hot-restart-version -hot restart compatibility version +Hot restart compatibility version --restart-epoch -hot restart epoch # +Hot restart epoch # --log-path Path to logfile @@ -285,7 +285,7 @@ https://github.com/gabime/spdlog/wiki/3.-Custom-formatting) Default is "[%Y-%m-%d %T.%e][%t][%l][%n] [%g:%#] %v" --component-log-level -Comma separated list of component log levels. For example +Comma-separated list of component log levels. For example upstream:debug,config:trace -l , --log-level @@ -301,16 +301,16 @@ The local IP address version (v4 or v6). Admin address path --ignore-unknown-dynamic-fields -ignore unknown fields in dynamic configuration +Ignore unknown fields in dynamic configuration --reject-unknown-dynamic-fields -reject unknown fields in dynamic configuration +Reject unknown fields in dynamic configuration --allow-unknown-static-fields -allow unknown fields in static configuration +Allow unknown fields in static configuration --allow-unknown-fields -allow unknown fields in static configuration (DEPRECATED) +Allow unknown fields in static configuration (DEPRECATED) --config-yaml Inline YAML configuration, merges with the contents of --config-path @@ -322,14 +322,14 @@ Path to configuration file # of worker threads to run --base-id-path -path to which the base ID is written +Path to which the base ID is written --use-dynamic-base-id -the server chooses a base ID dynamically. Supersedes a static base ID. +The server chooses a base ID dynamically. Supersedes a static base ID. May not be used when the restart epoch is non-zero. --base-id -base ID so that multiple envoys can run on the same host if needed +Base ID so that multiple envoys can run on the same host if needed --, --ignore_rest Ignores the rest of the labeled arguments following this flag. diff --git a/test/client_worker_test.cc b/test/client_worker_test.cc index 455cf3615..7de52a3b0 100644 --- a/test/client_worker_test.cc +++ b/test/client_worker_test.cc @@ -37,9 +37,8 @@ class ClientWorkerTest : public Test { public: ClientWorkerTest() : api_(Envoy::Api::createApiForTest()), thread_id_(std::this_thread::get_id()) { - loader_ = std::make_unique( - Envoy::Runtime::LoaderPtr{new Envoy::Runtime::LoaderImpl( - dispatcher_, tls_, {}, local_info_, store_, rand_, validation_visitor_, *api_)}); + loader_ = Envoy::Runtime::LoaderPtr{new Envoy::Runtime::LoaderImpl( + dispatcher_, tls_, {}, local_info_, store_, rand_, validation_visitor_, *api_)}; benchmark_client_ = new MockBenchmarkClient(); sequencer_ = new MockSequencer(); request_generator_ = new MockRequestSource(); @@ -95,7 +94,7 @@ class ClientWorkerTest : public Test { MockRequestSource* request_generator_; Envoy::Random::RandomGeneratorImpl rand_; NiceMock dispatcher_; - std::unique_ptr loader_; + Envoy::Runtime::LoaderPtr loader_; NiceMock local_info_; NiceMock validation_visitor_; Envoy::Upstream::ClusterManagerPtr cluster_manager_ptr_; diff --git a/test/flush_worker_test.cc b/test/flush_worker_test.cc index 80014efca..67b8de227 100644 --- a/test/flush_worker_test.cc +++ b/test/flush_worker_test.cc @@ -36,9 +36,8 @@ class FlushWorkerTest : public Test { Envoy::Random::RandomGeneratorImpl rand; NiceMock local_info; NiceMock validation_visitor; - loader_ = std::make_unique( - Envoy::Runtime::LoaderPtr{new Envoy::Runtime::LoaderImpl( - *dispatcher_, tls_, {}, local_info, store_, rand, validation_visitor, api_)}); + loader_ = Envoy::Runtime::LoaderPtr{new Envoy::Runtime::LoaderImpl( + *dispatcher_, tls_, {}, local_info, store_, rand, validation_visitor, api_)}; sink_ = new StrictMock(); stats_sinks_.emplace_back(sink_); @@ -97,7 +96,7 @@ class FlushWorkerTest : public Test { NiceMock tls_; // owned by FlushWorkerImpl's dispatcher member variable. NiceMock* dispatcher_ = nullptr; - std::unique_ptr loader_; + Envoy::Runtime::LoaderPtr loader_; // owned by FlushWorkerImpl's stat_flush_timer_ member variable. NiceMock* timer_; diff --git a/test/worker_test.cc b/test/worker_test.cc index 8eb86a46f..2ad271271 100644 --- a/test/worker_test.cc +++ b/test/worker_test.cc @@ -50,10 +50,9 @@ TEST_F(WorkerTest, WorkerExecutesOnThread) { TestWorker worker(*api_, tls_); NiceMock dispatcher; - std::unique_ptr loader = - std::make_unique( + Envoy::Runtime::LoaderPtr loader = Envoy::Runtime::LoaderPtr{new Envoy::Runtime::LoaderImpl( - dispatcher, tls_, {}, local_info_, test_store_, rand_, validation_visitor_, *api_)}); + dispatcher, tls_, {}, local_info_, test_store_, rand_, validation_visitor_, *api_)}; worker.start(); worker.waitForCompletion(); diff --git a/tools/check_format.sh b/tools/check_format.sh index 98bd7266f..4fd02b56c 100755 --- a/tools/check_format.sh +++ b/tools/check_format.sh @@ -12,7 +12,7 @@ FULL_CHECK="./../$CURRENT_DIRECTORY" TO_CHECK="${2:-$FULL_CHECK}" # TODO(https://github.com/envoyproxy/nighthawk/issues/165): fully excluding everything # from the build fixer isn't ideal. -bazel run @envoy//tools/code_format:check_format.py -- \ +bazel run @envoy//tools/code_format:check_format -- \ --skip_envoy_build_rule_check --namespace_check Nighthawk \ --build_fixer_check_excluded_paths=$TO_CHECK \ $1 $TO_CHECK