Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.3.2
6.3.2
4 changes: 2 additions & 2 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dynamic_test/test_cds_churn_with_traffic.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _assignEndpointsToClusters(


def _run_benchmark(fixture,
rps=1000,
rps=500,
duration=_BENCHMARK_DURATION,
max_connections=1,
max_active_requests=100,
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/dynamic_test/test_eds_churn_with_traffic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/test/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


def _run_benchmark(fixture,
rps=1000,
rps=500,
duration=30,
max_connections=1,
max_active_requests=100,
Expand Down Expand Up @@ -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
Expand All @@ -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',
Expand Down
11 changes: 10 additions & 1 deletion ci/run_envoy_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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//\\//}"
Expand Down
11 changes: 5 additions & 6 deletions source/client/process_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ void ProcessImpl::maybeCreateTracingDriver(const envoy::config::trace::v3::Traci
Envoy::Tracing::DriverPtr zipkin_driver =
std::make_unique<Envoy::Extensions::Tracers::Zipkin::Driver>(
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<Envoy::Tracing::TracerImpl>(std::move(zipkin_driver), *local_info_);
#else
ENVOY_LOG(error, "Not build with any tracing support");
Expand Down Expand Up @@ -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::ScopedLoaderSingleton>(
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<Envoy::Extensions::TransportSockets::Tls::ContextManagerImpl>(
time_system_);

server_ = std::make_unique<NighthawkServerInstance>(
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<NighthawkServerFactoryContext>(*server_, scope_root_);
Expand All @@ -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<std::unique_ptr<Envoy::Stats::Sink>> stats_sinks;
setupStatsSinks(bootstrap_, stats_sinks);
Expand Down
2 changes: 1 addition & 1 deletion source/client/process_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class ProcessImpl : public Process, public Envoy::Logger::Loggable<Envoy::Logger

std::unique_ptr<ClusterManagerFactory> cluster_manager_factory_;
Envoy::Upstream::ClusterManagerPtr cluster_manager_{};
std::unique_ptr<Envoy::Runtime::ScopedLoaderSingleton> runtime_singleton_;
Envoy::Runtime::LoaderPtr runtime_loader_;
Envoy::Init::WatcherImpl init_watcher_;
Envoy::Tracing::TracerSharedPtr tracer_;
Envoy::Server::ValidationAdmin admin_;
Expand Down
2 changes: 0 additions & 2 deletions source/common/worker_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
20 changes: 10 additions & 10 deletions source/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ Node name
Cluster name

--hot-restart-version
hot restart compatibility version
Hot restart compatibility version

--restart-epoch <uint32_t>
hot restart epoch #
Hot restart epoch #

--log-path <string>
Path to logfile
Expand All @@ -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 <string>
Comma separated list of component log levels. For example
Comma-separated list of component log levels. For example
upstream:debug,config:trace

-l <string>, --log-level <string>
Expand All @@ -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 <string>
Inline YAML configuration, merges with the contents of --config-path
Expand All @@ -322,14 +322,14 @@ Path to configuration file
# of worker threads to run

--base-id-path <string>
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 <uint32_t>
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.
Expand Down
7 changes: 3 additions & 4 deletions test/client_worker_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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::ScopedLoaderSingleton>(
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();
Expand Down Expand Up @@ -95,7 +94,7 @@ class ClientWorkerTest : public Test {
MockRequestSource* request_generator_;
Envoy::Random::RandomGeneratorImpl rand_;
NiceMock<Envoy::Event::MockDispatcher> dispatcher_;
std::unique_ptr<Envoy::Runtime::ScopedLoaderSingleton> loader_;
Envoy::Runtime::LoaderPtr loader_;
NiceMock<Envoy::LocalInfo::MockLocalInfo> local_info_;
NiceMock<Envoy::ProtobufMessage::MockValidationVisitor> validation_visitor_;
Envoy::Upstream::ClusterManagerPtr cluster_manager_ptr_;
Expand Down
7 changes: 3 additions & 4 deletions test/flush_worker_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ class FlushWorkerTest : public Test {
Envoy::Random::RandomGeneratorImpl rand;
NiceMock<Envoy::LocalInfo::MockLocalInfo> local_info;
NiceMock<Envoy::ProtobufMessage::MockValidationVisitor> validation_visitor;
loader_ = std::make_unique<Envoy::Runtime::ScopedLoaderSingleton>(
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<Envoy::Stats::MockSink>();
stats_sinks_.emplace_back(sink_);

Expand Down Expand Up @@ -97,7 +96,7 @@ class FlushWorkerTest : public Test {
NiceMock<Envoy::ThreadLocal::MockInstance> tls_;
// owned by FlushWorkerImpl's dispatcher member variable.
NiceMock<Envoy::Event::MockDispatcher>* dispatcher_ = nullptr;
std::unique_ptr<Envoy::Runtime::ScopedLoaderSingleton> loader_;
Envoy::Runtime::LoaderPtr loader_;

// owned by FlushWorkerImpl's stat_flush_timer_ member variable.
NiceMock<Envoy::Event::MockTimer>* timer_;
Expand Down
5 changes: 2 additions & 3 deletions test/worker_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ TEST_F(WorkerTest, WorkerExecutesOnThread) {

TestWorker worker(*api_, tls_);
NiceMock<Envoy::Event::MockDispatcher> dispatcher;
std::unique_ptr<Envoy::Runtime::ScopedLoaderSingleton> loader =
std::make_unique<Envoy::Runtime::ScopedLoaderSingleton>(
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();

Expand Down
2 changes: 1 addition & 1 deletion tools/check_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down