diff --git a/.circleci/config.yml b/.circleci/config.yml index 290475d9b52a1..93d74d757170c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,7 +22,8 @@ jobs: - run: ci/docker_push.sh - run: ci/docker_tag.sh - store_artifacts: - path: /build/envoy/generated/failed-testlogs + path: /build/envoy/generated + destination: / asan: executor: ubuntu-build steps: @@ -33,7 +34,8 @@ jobs: - checkout - run: ci/do_circle_ci.sh bazel.asan - store_artifacts: - path: /build/envoy/generated/failed-testlogs + path: /build/envoy/generated + destination: / tsan: executor: ubuntu-build steps: @@ -41,7 +43,9 @@ jobs: - checkout - run: ci/do_circle_ci.sh bazel.tsan - store_artifacts: - path: /build/envoy/generated/failed-testlogs + path: /build/envoy/generated + destination: / + compile_time_options: executor: ubuntu-build steps: @@ -49,7 +53,8 @@ jobs: - checkout - run: ci/do_circle_ci.sh bazel.compile_time_options - store_artifacts: - path: /build/envoy/generated/failed-testlogs + path: /build/envoy/generated + destination: / api: executor: ubuntu-build steps: @@ -61,7 +66,8 @@ jobs: - "fb:f3:fe:be:1c:b2:ec:b6:25:f9:7b:a6:87:54:02:8c" - run: ci/api_mirror.sh - store_artifacts: - path: /build/envoy/generated/failed-testlogs + path: /build/envoy/generated + destination: / filter_example_mirror: executor: ubuntu-build steps: @@ -105,7 +111,8 @@ jobs: no_output_timeout: 60m - run: ci/coverage_publish.sh - store_artifacts: - path: /build/envoy/generated/coverage + path: /build/envoy/generated + destination: / clang_tidy: executor: ubuntu-build diff --git a/ci/build_setup.sh b/ci/build_setup.sh index ac65f1da4fabd..e586191606967 100755 --- a/ci/build_setup.sh +++ b/ci/build_setup.sh @@ -64,7 +64,7 @@ BAZEL_OPTIONS="--package_path %workspace%:${ENVOY_SRCDIR}" export BAZEL_QUERY_OPTIONS="${BAZEL_OPTIONS}" export BAZEL_BUILD_OPTIONS="--strategy=Genrule=standalone --spawn_strategy=standalone \ --verbose_failures ${BAZEL_OPTIONS} --action_env=HOME --action_env=PYTHONUSERBASE \ - --jobs=${NUM_CPUS} --show_task_finish ${BAZEL_BUILD_EXTRA_OPTIONS}" + --jobs=${NUM_CPUS} --show_task_finish --experimental_generate_json_trace_profile ${BAZEL_BUILD_EXTRA_OPTIONS}" export BAZEL_TEST_OPTIONS="${BAZEL_BUILD_OPTIONS} --test_env=HOME --test_env=PYTHONUSERBASE \ --test_env=UBSAN_OPTIONS=print_stacktrace=1 \ --cache_test_results=no --test_output=all ${BAZEL_EXTRA_TEST_OPTIONS}" @@ -109,6 +109,10 @@ mkdir -p "${ENVOY_COVERAGE_DIR}" export ENVOY_FAILED_TEST_LOGS="${ENVOY_BUILD_DIR}"/generated/failed-testlogs mkdir -p "${ENVOY_FAILED_TEST_LOGS}" +# This is where we copy the build profile to. +export ENVOY_BUILD_PROFILE="${ENVOY_BUILD_DIR}"/generated/build-profile +mkdir -p "${ENVOY_BUILD_PROFILE}" + # This is where we build for bazel.release* and bazel.dev. export ENVOY_CI_DIR="${ENVOY_SRCDIR}"/ci diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 5a8085a46fa11..f31ae0d30ff55 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -16,6 +16,10 @@ fi echo "building using ${NUM_CPUS} CPUs" +function collect_build_profile() { + cp -f "$(bazel info output_base)/command.profile" "${ENVOY_BUILD_PROFILE}/$1.profile" || true +} + function bazel_with_collection() { declare -r BAZEL_OUTPUT="${ENVOY_SRCDIR}"/bazel.output.txt bazel $* | tee "${BAZEL_OUTPUT}" @@ -30,12 +34,14 @@ function bazel_with_collection() { done exit "${BAZEL_STATUS}" fi + collect_build_profile $1 } function bazel_release_binary_build() { echo "Building..." cd "${ENVOY_CI_DIR}" bazel build ${BAZEL_BUILD_OPTIONS} -c opt //source/exe:envoy-static + collect_build_profile release_build # Copy the envoy-static binary somewhere that we can access outside of the # container. cp -f \ @@ -54,6 +60,7 @@ function bazel_debug_binary_build() { echo "Building..." cd "${ENVOY_CI_DIR}" bazel build ${BAZEL_BUILD_OPTIONS} -c dbg //source/exe:envoy-static + collect_build_profile debug_build # Copy the envoy-static binary somewhere that we can access outside of the # container. cp -f \ @@ -248,6 +255,7 @@ elif [[ "$1" == "bazel.coverage" ]]; then # directory. Wow. cd "${ENVOY_BUILD_DIR}" SRCDIR="${GCOVR_DIR}" "${ENVOY_SRCDIR}"/test/run_envoy_bazel_coverage.sh + collect_build_profile coverage exit 0 elif [[ "$1" == "bazel.clang_tidy" ]]; then setup_clang_toolchain