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: 2 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ build:rbe-toolchain-asan --linkopt -fuse-ld=lld
build:rbe-toolchain-asan --action_env=ENVOY_UBSAN_VPTR=1
build:rbe-toolchain-asan --copt=-fsanitize=vptr,function
build:rbe-toolchain-asan --linkopt=-fsanitize=vptr,function
build:rbe-toolchain-asan --linkopt=-L/opt/llvm/lib/clang/10.0.0/lib/linux
build:rbe-toolchain-asan --linkopt=-L/opt/llvm/lib/clang/11.0.1/lib/linux
build:rbe-toolchain-asan --linkopt=-l:libclang_rt.ubsan_standalone-x86_64.a
build:rbe-toolchain-asan --linkopt=-l:libclang_rt.ubsan_standalone_cxx-x86_64.a

Expand Down Expand Up @@ -257,7 +257,7 @@ build:remote-clang-cl --config=rbe-toolchain-clang-cl

# 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:c8fa4235714003ba0896287ee2f91cae06e0e407
build:docker-sandbox --experimental_docker_image=envoyproxy/envoy-build-ubuntu:e33c93e6d79804bf95ff80426d10bdcc9096c785
build:docker-sandbox --spawn_strategy=docker
build:docker-sandbox --strategy=Javac=docker
build:docker-sandbox --strategy=Closure=docker
Expand Down
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
references:
envoy-build-image: &envoy-build-image # November 10th, 2020
envoyproxy/envoy-build-ubuntu:19a268cfe3d12625380e7c61d2467c8779b58b56
envoy-build-image: &envoy-build-image # March 8th, 2021
envoyproxy/envoy-build-ubuntu:e33c93e6d79804bf95ff80426d10bdcc9096c785
version: 2
jobs:
build:
Expand Down
75 changes: 50 additions & 25 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,31 +221,56 @@
"id": "testTarget",
"description": "type",
"options": [
"//test:benchmark_http_client_test",
"//test:client_test",
"//test:client_worker_test",
"//test:factories_test",
"//test:frequency_test",
"//test:options_test",
"//test:output_formatter_test",
"//test:output_transform_main_test",
"//test:platform_util_test",
"//test:process_test",
"//test:python_test",
"//test:rate_limiter_test",
"//test:request_generator_test",
"//test:sequencer_test",
"//test:service_main_test",
"//test:service_test",
"//test:statistic_test",
"//test:stream_decoder_test",
"//test:termination_predicate_test",
"//test:utility_test",
"//test:worker_test",
"//test:sni_utility_test",
"//test/server:http_test_server_filter_integration_test",
"//test/server:http_dynamic_delay_filter_integration_test",
"//test/..."
"//test/sink:sink_test",
"//test/sink:nighthawk_sink_client_test",
"//test/server:http_time_tracking_filter_integration_test",
"//test/server:http_test_server_filter_integration_test",
"//test/server:http_filter_base_test",
"//test/server:http_dynamic_delay_filter_integration_test",
"//test/server:configuration_test",
"//test/request_source:request_source_plugin_test",
"//test/integration/unit_tests:test_nighthawk_test_server",
"//test/common:signal_handler_test",
"//test/common:nighthawk_service_client_test",
"//test/common:fake_time_source_test",
"//test/adaptive_load/fake_plugins/fake_step_controller:fake_step_controller_test",
"//test/adaptive_load/fake_plugins/fake_metrics_plugin:fake_metrics_plugin_test",
"//test/adaptive_load/fake_plugins/fake_input_variable_setter:fake_input_variable_setter_test",
"//test/adaptive_load:step_controller_test",
"//test/adaptive_load:session_spec_proto_helper_test",
"//test/adaptive_load:scoring_function_test",
"//test/adaptive_load:plugin_loader_test",
"//test/adaptive_load:metrics_plugin_test",
"//test/adaptive_load:metrics_evaluator_test",
"//test/adaptive_load:adaptive_load_controller_test",
"//test/adaptive_load:adaptive_load_client_main_test",
"//test:worker_test",
"//test:utility_test",
"//test:termination_predicate_test",
"//test:stream_decoder_test",
"//test:stopwatch_test",
"//test:statistic_test",
"//test:sni_utility_test",
"//test:service_test",
"//test:service_main_test",
"//test:sequencer_test",
"//test:request_stream_grpc_client_test",
"//test:request_generator_test",
"//test:rate_limiter_test",
"//test:python_test",
"//test/integration:integration_test",
"//test:process_test",
"//test:platform_util_test",
"//test:output_transform_main_test",
"//test:output_formatter_test",
"//test:options_test",
"//test:frequency_test",
"//test:flush_worker_test",
"//test:factories_test",
"//test:client_worker_test",
"//test:client_test",
"//test:benchmark_http_client_test",
"//test/..."
],
"default": "//test/..."
}
Expand Down
6 changes: 5 additions & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,19 @@ important maintenance task. When performing the update, follow this procedure:
```
INFO: SHA256 (https://github.com/envoyproxy/envoy/archive/9753819331d1547c4b8294546a6461a3777958f5.tar.gz) = f4d26c7e78c0a478d959ea8bc877f260d4658a8b44e294e3a400f20ad44d41a3
```
1. Update `ENVOY_SHA` in [bazel/repositories.bzl](bazel/repositories.bzl) to
1. Update `ENVOY_SHA` in [bazel/repositories.bzl](bazel/repositories.bzl) to
this value.
1. Sync (copy) [.bazelrc](.bazelrc) from
[Envoy's version](https://github.com/envoyproxy/envoy/blob/main/.bazelrc) to
update our build configurations. Be sure to retain our local modifications,
all lines that are unique to Nighthawk are marked with comment `# unique`.
1. In the updated [.bazelrc](.bazelrc) search for `experimental_docker_image`.
Copy the SHA and update `envoyproxy/envoy-build-ubuntu` over at the top of [.circleci/config.yml](.circleci/config.yml).
1. Sync (copy) [.bazelversion](.bazelversion) from
[Envoy's version](https://github.com/envoyproxy/envoy/blob/main/.bazelversion)
to ensure we are using the same build system version.
1. Sync (copy) [ci/run_envoy_docker.sh](ci/run_envoy_docker.sh) from
[Envoy's version](https://github.com/envoyproxy/envoy/blob/main/ci/run_envoy_docker.sh).
1. Run `ci/do_ci.sh test`. Sometimes the dependency update comes with changes
that break our build. Include any changes required to Nighthawk to fix that
in the same PR.
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ bazel build -c opt //:nighthawk
```
USAGE:

bazel-bin/nighthawk_client [--allow-envoy-deprecated-v2-api]
[--latency-response-header-name <string>]
bazel-bin/nighthawk_client [--latency-response-header-name <string>]
[--stats-flush-interval <uint32_t>]
[--stats-sinks <string>] ...
[--no-duration] [--simple-warmup]
Expand Down Expand Up @@ -84,10 +83,6 @@ format>

Where:

--allow-envoy-deprecated-v2-api
Set to allow usage of the v2 api. (Not recommended, support will stop
in Q1 2021). Default: false

--latency-response-header-name <string>
Set an optional header name that will be returned in responses, whose
values will be tracked in a latency histogram if set. Can be used in
Expand Down
12 changes: 2 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,11 @@ load("@envoy//bazel:dependency_imports.bzl", "envoy_dependency_imports")
envoy_dependency_imports()

# For PIP support:
load("@rules_python//python:pip.bzl", "pip3_import", "pip_repositories")

pip_repositories()
load("@rules_python//python:pip.bzl", "pip_install")

# This rule translates the specified requirements.txt into
# @my_deps//:requirements.bzl, which itself exposes a pip_install method.
pip3_import(
pip_install(
name = "python_pip_deps",
requirements = "//:requirements.txt",
)

# Load the pip_install symbol for my_deps, and create the dependencies'
# repositories.
load("@python_pip_deps//:requirements.bzl", "pip_install")

pip_install()
4 changes: 2 additions & 2 deletions api/client/options.proto
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ message CommandLineOptions {
// "emit_previous_request_delta_in_response_header" to record elapsed time between request
// arrivals.
google.protobuf.StringValue latency_response_header_name = 36;
// Set to allow usage of the v2 api. (Not recommended, support will stop in Q1 2021).
google.protobuf.BoolValue allow_envoy_deprecated_v2_api = 38 [deprecated = true];
// Provide an execution starting date and time. Optional, any value specified must be in the
// future.
google.protobuf.Timestamp scheduled_start = 105;

reserved 38; // deprecated
}
5 changes: 5 additions & 0 deletions api/client/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ syntax = "proto3";

package nighthawk.client;

import "google/protobuf/duration.proto";
import "google/rpc/status.proto";
import "validate/validate.proto";

Expand Down Expand Up @@ -32,6 +33,10 @@ message ExecutionRequest {
message ExecutionResponse {
Output output = 1;
google.rpc.Status error_detail = 7;
// Opaque identifier for lookup purposes. This will be taken from CommandLineOptions if set,
// if it is not set there it will be auto-generated. The format used for auto-generated
// identifiers may change at any time.
string execution_id = 8;
}

service NighthawkService {
Expand Down
32 changes: 32 additions & 0 deletions api/distributor/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("@envoy_api//bazel:api_build_system.bzl", "api_cc_py_proto_library")

licenses(["notice"]) # Apache 2

api_cc_py_proto_library(
name = "distributor",
srcs = [
"distributor.proto",
],
visibility = ["//visibility:public"],
deps = [
"//api/client:base",
"@envoy_api//envoy/config/core/v3:pkg",
],
)

cc_grpc_library(
name = "distributor_grpc_lib",
srcs = [
":distributor",
],
generate_mocks = True,
grpc_only = True,
proto_only = False,
use_external = False,
visibility = ["//visibility:public"],
well_known_protos = True,
deps = [
":distributor_cc_proto",
],
)
29 changes: 29 additions & 0 deletions api/distributor/distributor.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
syntax = "proto3";

package nighthawk;

import "envoy/config/core/v3/address.proto";

import "api/client/service.proto";

import "validate/validate.proto";

// Perform an execution request through an intermediate service that will in turn delegate to one or
// more other services Nighthawk load generator services.
message DistributedRequest {
client.ExecutionRequest execution_request = 1;
// Specify one or more services that will handle the inner message associated to this.
repeated envoy.config.core.v3.Address services = 3 [(validate.rules).repeated .min_items = 1];
}

// Carries responses associated with a DistributedRequest.
message DistributedResponse {
}

// Service which distributes messages to one or more other services for handling, and streams back
// response messages.
service NighthawkDistributor {
// Propagate the message wrapped in DistributedRequest to one or more other services for handling.
rpc DistributedRequestStream(stream DistributedRequest) returns (stream DistributedResponse) {
}
}
32 changes: 32 additions & 0 deletions api/sink/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("@envoy_api//bazel:api_build_system.bzl", "api_cc_py_proto_library")

licenses(["notice"]) # Apache 2

api_cc_py_proto_library(
name = "sink",
srcs = [
"sink.proto",
],
visibility = ["//visibility:public"],
deps = [
"//api/client:base",
"@envoy_api//envoy/config/core/v3:pkg",
],
)

cc_grpc_library(
name = "sink_grpc_lib",
srcs = [
":sink",
],
generate_mocks = True,
grpc_only = True,
proto_only = False,
use_external = False,
visibility = ["//visibility:public"],
well_known_protos = True,
deps = [
":sink_cc_proto",
],
)
37 changes: 37 additions & 0 deletions api/sink/sink.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
syntax = "proto3";

package nighthawk;

import "api/client/service.proto";
import "validate/validate.proto";

// Encapsulates an ExecutionResponse.
message StoreExecutionRequest {
// Response contains the effective execution id, which will serve as the lookup key.
nighthawk.client.ExecutionResponse execution_response = 1;
}

// Empty return value message, that serves as a future extension point.
message StoreExecutionResponse {
}

message SinkRequest {
// Unique id for lookup purposes. Required.
string execution_id = 1 [(validate.rules).string.min_len = 1];
}

message SinkResponse {
// Response associated to the requested execution id.
nighthawk.client.ExecutionResponse execution_response = 1;
}

service NighthawkSink {
// Accepts a stream of execution responses, which is the return value of
// NighthawkService.ExecutionStream. Workers can forward their results using this method.
rpc StoreExecutionResponseStream(stream StoreExecutionRequest) returns (StoreExecutionResponse) {
}

// Gets the stored responses associated to an execution, keyed by execution id.
rpc SinkRequestStream(stream SinkRequest) returns (stream SinkResponse) {
}
}
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 = "cfe0391ce24f7d11b3b125078ab77f6f4142e4ac" # Feb 5th, 2021
ENVOY_SHA = "5c9fbd5b95837ef409d85b6408bbb616452c164be5016c62e1c5055d3eeee268"
ENVOY_COMMIT = "031f75dd113e2f7be41b94a0365145e7bf1e6c12" # March 14th, 2021
ENVOY_SHA = "20f5f98cc9a5c1ddd2c3de434b019273e3dbe02afe52396b90d74fab38dba4ba"

HDR_HISTOGRAM_C_VERSION = "0.11.2" # October 12th, 2020
HDR_HISTOGRAM_C_SHA = "637f28b5f64de2e268131e4e34e6eef0b91cf5ff99167db447d9b2825eae6bad"
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ docker run -it --rm \
--env NH_DOCKER_IMAGE="envoyproxy/nighthawk-dev:latest" \
--env ENVOY_DOCKER_IMAGE_TO_TEST="envoyproxy/envoy-dev:f61b096f6a2dd3a9c74b9a9369a6ea398dbe1f0f" \
--env TMPDIR="${OUTDIR}" \
oschaaf/benchmark-dev:latest ./benchmarks --log-cli-level=info -vvvv
envoyproxy/nighthawk-benchmark-dev:latest ./benchmarks --log-cli-level=info -vvvv
```

# TODOs
Expand Down
8 changes: 5 additions & 3 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ function do_test() {
}

function do_clang_tidy() {
# TODO(#546): deflake clang tidy runs, and remove '|| true' here.
ci/run_clang_tidy.sh || true
# clang-tidy will warn on standard library issues with libc++
BAZEL_BUILD_OPTIONS=("--config=clang" "${BAZEL_BUILD_OPTIONS[@]}")
BAZEL_BUILD_OPTIONS="${BAZEL_BUILD_OPTIONS[*]}" NUM_CPUS=4 ci/run_clang_tidy.sh
}

function do_unit_test_coverage() {
export TEST_TARGETS="//test/... -//test:python_test"
export COVERAGE_THRESHOLD=94.3
export COVERAGE_THRESHOLD=94.2
echo "bazel coverage build with tests ${TEST_TARGETS}"
test/run_nighthawk_bazel_coverage.sh ${TEST_TARGETS}
exit 0
Expand Down Expand Up @@ -148,6 +149,7 @@ function do_docker() {
./ci/docker/docker_build.sh
./ci/docker/docker_push.sh
./ci/docker/benchmark_build.sh
./ci/docker/benchmark_push.sh
}

function do_fix_format() {
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/Dockerfile-nighthawk-benchmark
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /usr/local/bin/benchmarks

COPY benchmarks /usr/local/bin/benchmarks/

RUN apk add --no-cache docker=20.10.3-r0 openrc=0.42.1-r19 python3=3.8.7-r0
RUN apk add --no-cache docker=20.10.3-r0 openrc=0.42.1-r19 python3>=3.8.7-r0
RUN rc-update add docker boot

RUN if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python; fi && \
Expand Down
Loading