From 43eb5f06a25f7e7b0b1804c574fd674c5c1f27f2 Mon Sep 17 00:00:00 2001 From: Ehsan Saei <71217171+esigo@users.noreply.github.com> Date: Sat, 30 Jul 2022 17:39:02 +0200 Subject: [PATCH 1/7] Add CI jobs for new and deprecated metrics --- .github/workflows/ci.yml | 60 +++++++++++++++++++++++++++++++++++++++- ci/do_ci.sh | 45 ++++++++++++++++++++++++++++-- 2 files changed, 101 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 854741437d..70cfc259ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,22 @@ jobs: sudo ./ci/setup_thrift.sh ./ci/do_ci.sh cmake.test + cmake_deprecated_metrics_test: + name: CMake test (without otlp-exporter and deprecated metrics) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + - name: setup + run: | + sudo ./ci/setup_cmake.sh + sudo ./ci/setup_ci_environment.sh + - name: run cmake tests (without otlp-exporter) + run: | + sudo ./ci/setup_thrift.sh + ./ci/do_ci.sh cmake.deprecated_metrics.test + cmake_with_async_export_test: name: CMake test (without otlp-exporter and with async export) runs-on: ubuntu-latest @@ -98,6 +114,28 @@ jobs: CC: /usr/bin/gcc-4.8 CXX: /usr/bin/g++-4.8 + cmake_gcc_48_otlp_exporter_deprecated_metrics_test: + name: CMake gcc 4.8 (with otlp exporter and deprecated metrics) + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + - name: setup + run: | + sudo ./ci/setup_ci_environment.sh + sudo ./ci/install_gcc48.sh + - name: setup cmake + run: | + sudo CC=/usr/bin/gcc-4.8 CXX=/usr/bin/g++-4.8 ./ci/setup_cmake.sh + - name: setup grpc + run: | + sudo CC=/usr/bin/gcc-4.8 CXX=/usr/bin/g++-4.8 ./ci/setup_grpc.sh -v 4.8 + - name: run tests + run: ./ci/do_ci.sh cmake.legacy.exporter.otprotocol.deprecated_metrics.test + env: + CC: /usr/bin/gcc-4.8 + CXX: /usr/bin/g++-4.8 cmake_test_cxx20: name: CMake C++20 test runs-on: ubuntu-20.04 @@ -165,7 +203,27 @@ jobs: sudo ./ci/install_bazelisk.sh - name: run tests run: ./ci/do_ci.sh bazel.test - + bazel_deprecated_metrics_test: + name: Bazel deprecated metrics + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: 'recursive' + - name: Mount Bazel Cache + uses: actions/cache@v3 + env: + cache-name: bazel_cache + with: + path: /home/runner/.cache/bazel + key: bazel_test + - name: setup + run: | + sudo ./ci/setup_thrift.sh dependencies_only + sudo ./ci/setup_ci_environment.sh + sudo ./ci/install_bazelisk.sh + - name: run tests + run: ./ci/do_ci.sh bazel.deprecated_metrics.test bazel_test_async: name: Bazel with async export runs-on: ubuntu-latest diff --git a/ci/do_ci.sh b/ci/do_ci.sh index f8ec8934da..3928554c55 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -100,7 +100,7 @@ elif [[ "$1" == "cmake.with_async_export.test" ]]; then -DWITH_ZIPKIN=ON \ -DWITH_JAEGER=ON \ -DWITH_ELASTICSEARCH=ON \ - -DWITH_METRICS_PREVIEW=ON \ + -DWITH_METRICS_PREVIEW=OFF \ -DWITH_LOGS_PREVIEW=ON \ -DCMAKE_CXX_FLAGS="-Werror" \ -DWITH_ASYNC_EXPORT_PREVIEW=ON \ @@ -108,11 +108,27 @@ elif [[ "$1" == "cmake.with_async_export.test" ]]; then make make test exit 0 -elif [[ "$1" == "cmake.abseil.test" ]]; then +elif [[ "$1" == "cmake.deprecated_metrics.test" ]]; then cd "${BUILD_DIR}" rm -rf * cmake -DCMAKE_BUILD_TYPE=Debug \ + -DWITH_PROMETHEUS=ON \ + -DWITH_ZIPKIN=OFF \ + -DWITH_JAEGER=OFF \ + -DWITH_ELASTICSEARCH=OFF \ -DWITH_METRICS_PREVIEW=ON \ + -DWITH_LOGS_PREVIEW=OFF \ + -DCMAKE_CXX_FLAGS="-Werror" \ + -DWITH_ASYNC_EXPORT_PREVIEW=ON \ + "${SRC_DIR}" + make + make test + exit 0 +elif [[ "$1" == "cmake.abseil.test" ]]; then + cd "${BUILD_DIR}" + rm -rf * + cmake -DCMAKE_BUILD_TYPE=Debug \ + -DWITH_METRICS_PREVIEW=OFF \ -DWITH_LOGS_PREVIEW=ON \ -DCMAKE_CXX_FLAGS="-Werror" \ -DWITH_ASYNC_EXPORT_PREVIEW=ON \ @@ -136,7 +152,7 @@ elif [[ "$1" == "cmake.c++20.stl.test" ]]; then cd "${BUILD_DIR}" rm -rf * cmake -DCMAKE_BUILD_TYPE=Debug \ - -DWITH_METRICS_PREVIEW=ON \ + -DWITH_METRICS_PREVIEW=OFF \ -DWITH_LOGS_PREVIEW=ON \ -DCMAKE_CXX_FLAGS="-Werror" \ -DWITH_ASYNC_EXPORT_PREVIEW=ON \ @@ -158,6 +174,25 @@ elif [[ "$1" == "cmake.legacy.test" ]]; then make make test exit 0 +elif [[ "$1" == "cmake.legacy.exporter.otprotocol.deprecated_metrics.test" ]]; then + cd "${BUILD_DIR}" + rm -rf * + export BUILD_ROOT="${BUILD_DIR}" + ${SRC_DIR}/tools/build-gtest.sh + ${SRC_DIR}/tools/build-benchmark.sh + cmake -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_CXX_STANDARD=11 \ + -DWITH_OTLP=ON \ + -DWITH_PROMETHEUS=ON \ + -DWITH_METRICS_PREVIEW=ON \ + -DWITH_ASYNC_EXPORT_PREVIEW=ON \ + "${SRC_DIR}" + grpc_cpp_plugin=`which grpc_cpp_plugin` + proto_make_file="CMakeFiles/opentelemetry_proto.dir/build.make" + sed -i "s~gRPC_CPP_PLUGIN_EXECUTABLE-NOTFOUND~$grpc_cpp_plugin~" ${proto_make_file} #fixme + make -j $(nproc) + cd exporters/otlp && make test + exit 0 elif [[ "$1" == "cmake.legacy.exporter.otprotocol.test" ]]; then cd "${BUILD_DIR}" rm -rf * @@ -242,6 +277,10 @@ elif [[ "$1" == "bazel.test" ]]; then bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS //... bazel $BAZEL_STARTUP_OPTIONS test $BAZEL_TEST_OPTIONS //... exit 0 +elif [[ "$1" == "bazel.deprecated_metrics.test" ]]; then + bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS --copt=-DENABLE_METRICS_PREVIEW //... + bazel $BAZEL_STARTUP_OPTIONS test $BAZEL_TEST_OPTIONS --copt=-DENABLE_METRICS_PREVIEW //... + exit 0 elif [[ "$1" == "bazel.with_async_export.test" ]]; then bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS_ASYNC //... bazel $BAZEL_STARTUP_OPTIONS test $BAZEL_TEST_OPTIONS_ASYNC //... From 4ac0b9e2bbf7907931fb96a78b0a7866dad23434 Mon Sep 17 00:00:00 2001 From: Ehsan Saei <71217171+esigo@users.noreply.github.com> Date: Sat, 30 Jul 2022 20:23:35 +0200 Subject: [PATCH 2/7] review comment --- ci/do_ci.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 3928554c55..424ee30f23 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -60,10 +60,7 @@ mkdir -p "${BUILD_DIR}" mkdir -p "${PLUGIN_DIR}" BAZEL_OPTIONS="--copt=-DENABLE_LOGS_PREVIEW --copt=-DENABLE_TEST" -# Previous legacy metrics use virtual drive, which can not be used without RTTI -if [[ "$1" != "bazel.nortti" ]]; then - BAZEL_OPTIONS="$BAZEL_OPTIONS --copt=-DENABLE_METRICS_PREVIEW" -fi + BAZEL_TEST_OPTIONS="$BAZEL_OPTIONS --test_output=errors" BAZEL_OPTIONS_ASYNC="$BAZEL_OPTIONS --copt=-DENABLE_ASYNC_EXPORT" From 6ed0a9cf375cd5b0d0022bd6075f61e4c7af29b4 Mon Sep 17 00:00:00 2001 From: Oblivion Date: Thu, 11 Aug 2022 15:56:15 +0000 Subject: [PATCH 3/7] fix noexcept --- ci/do_ci.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 424ee30f23..abaf6f5bb2 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -298,8 +298,8 @@ elif [[ "$1" == "bazel.legacy.test" ]]; then elif [[ "$1" == "bazel.noexcept" ]]; then # there are some exceptions and error handling code from the Prometheus and Jaeger Clients # that make this test always fail. ignore Prometheus and Jaeger exporters in the noexcept here. - bazel $BAZEL_STARTUP_OPTIONS build --copt=-fno-exceptions --build_tag_filters=-jaeger $BAZEL_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//exporters/jaeger/... -//examples/prometheus/... - bazel $BAZEL_STARTUP_OPTIONS test --copt=-fno-exceptions --build_tag_filters=-jaeger $BAZEL_TEST_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//exporters/jaeger/... -//examples/prometheus/... + bazel $BAZEL_STARTUP_OPTIONS build --copt=-fno-exceptions --build_tag_filters=-jaeger $BAZEL_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//exporters/jaeger/... -//examples/prometheus/... -//sdk/test/metrics:attributes_hashmap_test + bazel $BAZEL_STARTUP_OPTIONS test --copt=-fno-exceptions --build_tag_filters=-jaeger $BAZEL_TEST_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//exporters/jaeger/... -//examples/prometheus/... -//sdk/test/metrics:attributes_hashmap_test exit 0 elif [[ "$1" == "bazel.nortti" ]]; then # there are some exceptions and error handling code from the Prometheus and Jaeger Clients From 114eb747f3304143451a9ee369777c810ad7b27a Mon Sep 17 00:00:00 2001 From: Ehsan Saei <71217171+esigo@users.noreply.github.com> Date: Thu, 11 Aug 2022 23:08:01 +0200 Subject: [PATCH 4/7] no gcc 4.8 for deprecated metrics --- .github/workflows/ci.yml | 22 ---------------------- ci/do_ci.sh | 19 ------------------- 2 files changed, 41 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70cfc259ff..b0cb1b720b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,28 +114,6 @@ jobs: CC: /usr/bin/gcc-4.8 CXX: /usr/bin/g++-4.8 - cmake_gcc_48_otlp_exporter_deprecated_metrics_test: - name: CMake gcc 4.8 (with otlp exporter and deprecated metrics) - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - name: setup - run: | - sudo ./ci/setup_ci_environment.sh - sudo ./ci/install_gcc48.sh - - name: setup cmake - run: | - sudo CC=/usr/bin/gcc-4.8 CXX=/usr/bin/g++-4.8 ./ci/setup_cmake.sh - - name: setup grpc - run: | - sudo CC=/usr/bin/gcc-4.8 CXX=/usr/bin/g++-4.8 ./ci/setup_grpc.sh -v 4.8 - - name: run tests - run: ./ci/do_ci.sh cmake.legacy.exporter.otprotocol.deprecated_metrics.test - env: - CC: /usr/bin/gcc-4.8 - CXX: /usr/bin/g++-4.8 cmake_test_cxx20: name: CMake C++20 test runs-on: ubuntu-20.04 diff --git a/ci/do_ci.sh b/ci/do_ci.sh index abaf6f5bb2..bf775fa564 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -171,25 +171,6 @@ elif [[ "$1" == "cmake.legacy.test" ]]; then make make test exit 0 -elif [[ "$1" == "cmake.legacy.exporter.otprotocol.deprecated_metrics.test" ]]; then - cd "${BUILD_DIR}" - rm -rf * - export BUILD_ROOT="${BUILD_DIR}" - ${SRC_DIR}/tools/build-gtest.sh - ${SRC_DIR}/tools/build-benchmark.sh - cmake -DCMAKE_BUILD_TYPE=Debug \ - -DCMAKE_CXX_STANDARD=11 \ - -DWITH_OTLP=ON \ - -DWITH_PROMETHEUS=ON \ - -DWITH_METRICS_PREVIEW=ON \ - -DWITH_ASYNC_EXPORT_PREVIEW=ON \ - "${SRC_DIR}" - grpc_cpp_plugin=`which grpc_cpp_plugin` - proto_make_file="CMakeFiles/opentelemetry_proto.dir/build.make" - sed -i "s~gRPC_CPP_PLUGIN_EXECUTABLE-NOTFOUND~$grpc_cpp_plugin~" ${proto_make_file} #fixme - make -j $(nproc) - cd exporters/otlp && make test - exit 0 elif [[ "$1" == "cmake.legacy.exporter.otprotocol.test" ]]; then cd "${BUILD_DIR}" rm -rf * From 817730659562134bbf144fc61662c201b80fb356 Mon Sep 17 00:00:00 2001 From: Ehsan Saei <71217171+esigo@users.noreply.github.com> Date: Fri, 12 Aug 2022 17:22:08 +0200 Subject: [PATCH 5/7] Update .github/workflows/ci.yml Co-authored-by: Lalit Kumar Bhasin --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0cb1b720b..b8c7c70507 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: ./ci/do_ci.sh cmake.test cmake_deprecated_metrics_test: - name: CMake test (without otlp-exporter and deprecated metrics) + name: CMake test (without otlp-exporter and with deprecated metrics) runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 77159baeea585177895105f699f7b94b600d99a0 Mon Sep 17 00:00:00 2001 From: Ehsan Saei <71217171+esigo@users.noreply.github.com> Date: Fri, 12 Aug 2022 17:24:16 +0200 Subject: [PATCH 6/7] review comment --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8c7c70507..a2d9349c0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,6 +181,7 @@ jobs: sudo ./ci/install_bazelisk.sh - name: run tests run: ./ci/do_ci.sh bazel.test + bazel_deprecated_metrics_test: name: Bazel deprecated metrics runs-on: ubuntu-latest @@ -202,6 +203,7 @@ jobs: sudo ./ci/install_bazelisk.sh - name: run tests run: ./ci/do_ci.sh bazel.deprecated_metrics.test + bazel_test_async: name: Bazel with async export runs-on: ubuntu-latest From c776b25707fefbc7b547ff47774e6f1bdd44c032 Mon Sep 17 00:00:00 2001 From: Ehsan Saei <71217171+esigo@users.noreply.github.com> Date: Fri, 12 Aug 2022 17:31:14 +0200 Subject: [PATCH 7/7] fix format --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2d9349c0c..15274be986 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -203,7 +203,7 @@ jobs: sudo ./ci/install_bazelisk.sh - name: run tests run: ./ci/do_ci.sh bazel.deprecated_metrics.test - + bazel_test_async: name: Bazel with async export runs-on: ubuntu-latest