Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing issue with bazel shutdown causing circleci hung #2203

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 16 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
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ build:asan --define tcmalloc=disabled
build:asan --build_tag_filters=-no_asan
build:asan --test_tag_filters=-no_asan
build:asan --define signal_trace=disabled
build:asan --test_env=ASAN_OPTIONS=detect_odr_violation=0

# Clang 5.0 ASAN
build:clang-asan --define ENVOY_CONFIG_ASAN=1
Expand All @@ -43,6 +44,8 @@ build:clang-tsan --copt -fsanitize=thread
build:clang-tsan --linkopt -fsanitize=thread
build:clang-tsan --define tcmalloc=disabled
build:clang-tsan --linkopt -fuse-ld=lld
# Needed due to https://github.com/libevent/libevent/issues/777
build:clang-tsan --copt -DEVENT__DISABLE_DEBUG_MODE

# Clang 5.0 MSAN - broken today since we need to rebuild lib[std]c++ and external deps with MSAN
# support (see https://github.com/envoyproxy/envoy/issues/443).
Expand Down
10 changes: 6 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,18 @@ jobs:
- /home/circleci/.cache/bazel
macos:
macos:
xcode: "9.3.0"
xcode: "9.3.1"
environment:
- BAZEL_STARTUP_ARGS: "--output_base /Users/distiller/.cache/bazel"
- BAZEL_BUILD_ARGS: "--local_resources=12288,5,1"
- BAZEL_TEST_ARGS: "--test_env=ENVOY_IP_TEST_VERSIONS=v4only --test_output=all --local_resources=12288,5,1 --local_test_jobs=8"
- BAZEL_BUILD_ARGS: "--local_resources=12288,5,1 --incompatible_bzl_disallow_load_after_statement=false"
- BAZEL_TEST_ARGS: "--test_env=ENVOY_IP_TEST_VERSIONS=v4only --test_output=all --local_resources=12288,5,1 --local_test_jobs=8 --incompatible_bzl_disallow_load_after_statement=false"
- CC: clang
- CXX: clang++
steps:
- run: sudo ntpdate -vu time.apple.com
- run: brew install bazel cmake coreutils go libtool ninja wget
- run: brew tap bazelbuild/tap
- run: brew tap-pin bazelbuild/tap
- run: brew install bazelbuild/tap/bazel cmake coreutils go libtool ninja wget
- checkout
- restore_cache:
keys:
Expand Down
8 changes: 1 addition & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,25 @@ CXX := clang++-7
endif
PATH := /usr/lib/llvm-7/bin:$(PATH)

# Removed '@bazel shutdown' as it is causing CircleCI to hang
build:
PATH=$(PATH) CC=$(CC) CXX=$(CXX) bazel $(BAZEL_STARTUP_ARGS) build $(BAZEL_BUILD_ARGS) $(BAZEL_TARGETS)
@bazel shutdown

# Build only envoy - fast
build_envoy:
PATH=$(PATH) CC=$(CC) CXX=$(CXX) bazel $(BAZEL_STARTUP_ARGS) build $(BAZEL_BUILD_ARGS) //src/envoy:envoy
@bazel shutdown

clean:
@bazel clean
@bazel shutdown

test:
PATH=$(PATH) CC=$(CC) CXX=$(CXX) bazel $(BAZEL_STARTUP_ARGS) test $(BAZEL_TEST_ARGS) $(BAZEL_TARGETS)
@bazel shutdown

test_asan:
PATH=$(PATH) CC=$(CC) CXX=$(CXX) bazel $(BAZEL_STARTUP_ARGS) test $(BAZEL_TEST_ARGS) --config=clang-asan -- $(BAZEL_TARGETS) $(SANITIZER_EXCLUSIONS)
@bazel shutdown

test_tsan:
PATH=$(PATH) CC=$(CC) CXX=$(CXX) bazel $(BAZEL_STARTUP_ARGS) test $(BAZEL_TEST_ARGS) --config=clang-tsan -- $(BAZEL_TARGETS) $(SANITIZER_EXCLUSIONS)
@bazel shutdown

check:
@script/check-license-headers
Expand All @@ -68,7 +63,6 @@ artifacts: build

deb:
CC=$(CC) CXX=$(CXX) bazel $(BAZEL_STARTUP_ARGS) build $(BAZEL_BUILD_ARGS) //tools/deb:istio-proxy
@bazel shutdown


.PHONY: build clean test check artifacts
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ bind(
# When updating envoy sha manually please update the sha in istio.deps file also
#
# Determine SHA256 `wget https://github.com/envoyproxy/envoy/archive/COMMIT.tar.gz && sha256sum COMMIT.tar.gz`
ENVOY_SHA = "5ea1a0c1cb506ed3e80d52b572b0f767f55f9f39"
ENVOY_SHA = "f35eea732cf64b19c7684c673580413840aad0ba"

ENVOY_SHA256 = "64beeb27f68ed644ff0bd37b193e5a85f49b883250940e292f6f150ec7173e38"
ENVOY_SHA256 = "a64ca9e3c313f879b569ecbd1eab9a845c04e600fbf05beb31621ebfcdf14d73"

http_archive(
name = "envoy",
Expand Down
4 changes: 2 additions & 2 deletions istio.deps
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"name": "ENVOY_SHA",
"repoName": "envoyproxy/envoy",
"file": "WORKSPACE",
"lastStableSHA": "5ea1a0c1cb506ed3e80d52b572b0f767f55f9f39"
"lastStableSHA": "f35eea732cf64b19c7684c673580413840aad0ba"
}
]
]
3 changes: 2 additions & 1 deletion test/integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package(default_visibility = ["//visibility:public"])

load(
"@envoy//bazel:envoy_build_system.bzl",
"envoy_cc_platform_dep",
"envoy_cc_test",
"envoy_cc_test_library",
)
Expand All @@ -36,7 +37,7 @@ envoy_cc_test_library(
deps = [
"@envoy//source/server:server_lib",
"@envoy//test/integration:http_protocol_integration_lib",
],
] + envoy_cc_platform_dep("@envoy//source/exe:platform_impl_lib"),
)

envoy_cc_test(
Expand Down
3 changes: 2 additions & 1 deletion test/integration/int_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ Client::Client(const std::string &name)
stats_(),
thread_(nullptr),
time_system_(),
api_(Envoy::Thread::ThreadFactorySingleton::get(), stats_, time_system_,
platform_impl_(),
api_(platform_impl_.threadFactory(), stats_, time_system_,
Envoy::Filesystem::fileSystemForTest()),
dispatcher_{api_.allocateDispatcher()} {}

Expand Down
4 changes: 3 additions & 1 deletion test/integration/int_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "envoy/http/codec.h"
#include "envoy/network/address.h"
#include "envoy/thread/thread.h"
#include "exe/platform_impl.h"
#include "fmt/printf.h"
#include "test/test_common/test_time.h"
#include "test/test_common/utility.h"
Expand Down Expand Up @@ -226,6 +227,7 @@ class Client : Envoy::Logger::Loggable<Envoy::Logger::Id::testing> {
Envoy::Stats::IsolatedStoreImpl stats_;
Envoy::Thread::ThreadPtr thread_;
Envoy::Event::TestRealTimeSystem time_system_;
Envoy::PlatformImpl platform_impl_;
Envoy::Api::Impl api_;
std::shared_ptr<Envoy::Event::Dispatcher> dispatcher_;

Expand Down Expand Up @@ -313,4 +315,4 @@ class LoadGenerator : Envoy::Logger::Loggable<Envoy::Logger::Id::testing> {
typedef std::unique_ptr<LoadGenerator> LoadGeneratorPtr;

} // namespace Integration
} // namespace Mixer
} // namespace Mixer
3 changes: 2 additions & 1 deletion test/integration/int_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,8 @@ Server::Server(const std::string &name,
: name_(name),
stats_(),
time_system_(),
api_(Envoy::Thread::ThreadFactorySingleton::get(), stats_, time_system_,
platform_impl_(),
api_(platform_impl_.threadFactory(), stats_, time_system_,
Envoy::Filesystem::fileSystemForTest()),
dispatcher_(api_.allocateDispatcher()),
connection_handler_(new Envoy::Server::ConnectionHandlerImpl(
Expand Down
2 changes: 2 additions & 0 deletions test/integration/int_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "common/http/codec_client.h"
#include "common/network/listen_socket_impl.h"
#include "common/stats/isolated_store_impl.h"
#include "exe/platform_impl.h"
#include "test/test_common/test_time.h"
#include "test/test_common/utility.h"

Expand Down Expand Up @@ -384,6 +385,7 @@ class Server : public Envoy::Network::FilterChainManager,
std::string name_;
Envoy::Stats::IsolatedStoreImpl stats_;
Envoy::Event::TestRealTimeSystem time_system_;
Envoy::PlatformImpl platform_impl_;
Envoy::Api::Impl api_;
Envoy::Event::DispatcherPtr dispatcher_;
Envoy::Network::ConnectionHandlerPtr connection_handler_;
Expand Down