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

Add Jaeger exporter to CMake CI build #786

Merged
merged 9 commits into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from 6 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 .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ jobs:
sudo ./ci/setup_cmake.sh
sudo ./ci/setup_ci_environment.sh
- name: run cmake tests (without otlp-exporter)
run: ./ci/do_ci.sh cmake.test
run: |
sudo ./ci/setup_thrift.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need sudo, as github actions are run by default as root user.
Also, if we move thrift installation as part of do_ci.sh script, this script will remain usable outside of github workflow, without separately installing thrift ( similar to how it is done for prometheus). Probably setup_thrift.sh can expose a function to install thrift, and that function can be called from do_ci.sh for actual installation if called with "cmake.test" argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also believe sudo is not necessary, just follow other scripts invocation like setup_grpc.h.

I don't prefer moving the installation logic to do_ci.sh which would make do_ci.sh too complicated with the third-party dependence setup instructions, and also hard to share with non-CI environment. Expose a setup function in setup_thrift.sh looks good, but we still need include setup_thrift.sh to invoke the function. So it may be simpler to just invoke the script?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lalitb do all github action run as root by default? I just removed all the sudo in our ci.yml but got permission denied in the CI run.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought unless explicitly specified with --user options, all jobs run as root user. Probably revert it back if there is a permission denied error. Sorry for the confusion.

./ci/do_ci.sh cmake.test

cmake_gcc_48_test:
name: CMake gcc 4.8
Expand Down
1 change: 1 addition & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if [[ "$1" == "cmake.test" ]]; then
cmake -DCMAKE_BUILD_TYPE=Debug \
-DWITH_PROMETHEUS=ON \
-DWITH_ZIPKIN=ON \
-DWITH_JAEGER=ON \
-DWITH_ELASTICSEARCH=ON \
-DWITH_METRICS_PREVIEW=ON \
-DCMAKE_CXX_FLAGS="-Werror" \
Expand Down
42 changes: 42 additions & 0 deletions ci/setup_thrift.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

set -e
export DEBIAN_FRONTEND=noninteractive
export THRIFT_VERSION=0.14.1

if ! type cmake > /dev/null; then
#cmake not installed, exiting
exit 1
fi
export BUILD_DIR=/tmp/
export INSTALL_DIR=/usr/local/

apt install -y --no-install-recommends \
libboost-all-dev \
libevent-dev \
libssl-dev \
ninja-build

pushd $BUILD_DIR
wget https://github.com/apache/thrift/archive/refs/tags/v${THRIFT_VERSION}.tar.gz
tar -zxvf v${THRIFT_VERSION}.tar.gz
cd thrift-${THRIFT_VERSION}
mkdir -p out
pushd out
cmake -G Ninja .. \
-DBUILD_COMPILER=OFF \
-DBUILD_CPP=ON \
-DBUILD_LIBRARIES=ON \
-DBUILD_NODEJS=OFF \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the options turned off here are turned on by default in thrift repo. They are not used by our C++ build so turn them off explicitly would introducing more dependence to our CI build.

https://github.com/apache/thrift/blob/70992f1e74e525461121fb9e607000b19f31a4ca/build/cmake/DefineOptions.cmake#L115

-DBUILD_PYTHON=OFF \
-DBUILD_JAVASCRIPT=OFF \
-DBUILD_C_GLIB=OFF \
-DBUILD_JAVA=OFF \
-DBUILD_TESTING=OFF \
-DBUILD_TUTORIALS=OFF \
..

ninja -j $(nproc)
ninja install
popd
popd
2 changes: 1 addition & 1 deletion exporters/jaeger/src/thrift_sender.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#pragma once

#include <agent.h>
#include <Agent.h>
#include <atomic>
#include <memory>
#include <mutex>
Expand Down
2 changes: 1 addition & 1 deletion exporters/jaeger/src/udp_transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "TUDPTransport.h"
#include "transport.h"

#include <agent.h>
#include <Agent.h>
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/protocol/TCompactProtocol.h>
#include <thrift/protocol/TProtocol.h>
Expand Down