Skip to content

Commit

Permalink
grpc upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb committed Jul 28, 2021
1 parent 1f31341 commit b221f18
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
./ci/do_ci.sh cmake.abseil.test
cmake_gcc_48_test:
name: CMake gcc 4.8
name: CMake gcc 4.8 (without otlp exporter)
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
Expand All @@ -59,6 +59,28 @@ jobs:
CC: /usr/bin/gcc-4.8
CXX: /usr/bin/g++-4.8

cmake_gcc_48_otlp_exporter_test:
name: CMake gcc 4.8 (with otlp exporter)
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
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
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.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
Expand Down
14 changes: 14 additions & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ elif [[ "$1" == "cmake.legacy.test" ]]; then
make
make test
exit 0
elif [[ "$1" == "cmake.legacy.exporter.otprotocol.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-Werror" \
-DCMAKE_CXX_STANDARD=11 \
-DWITH_OTLP=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.exporter.otprotocol.test" ]]; then
cd "${BUILD_DIR}"
rm -rf *
Expand Down
26 changes: 25 additions & 1 deletion ci/setup_grpc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,39 @@

set -e
export DEBIAN_FRONTEND=noninteractive
old_grpc_version='v1.34.0'
new_grpc_version='v1.39.0'
gcc_version_for_new_grpc='5.1'
install_grpc_version=${new_grpc_version}
grpc_version='v1.39.0'
usage() { echo "Usage: $0 -v <gcc-version>" 1>&2; exit 1; }

while getopts ":v:" o; do
case "${o}" in
v)
gcc_version=${OPTARG}
;;
*)
usage
;;
esac
done
if [ -z "${gcc_version}" ]; then
gcc_version=`gcc --version | awk '/gcc/ {print $NF}'`
fi
if [[ "${gcc_version}" < "${gcc_version_for_new_grpc}" ]]; then
echo "less"
install_grpc_version=${old_grpc_version}
fi
if ! type cmake > /dev/null; then
#cmake not installed, exiting
exit 1
fi
export BUILD_DIR=/tmp/
export INSTALL_DIR=/usr/local/
pushd $BUILD_DIR
git clone --depth=1 -b v1.34.0 https://github.com/grpc/grpc
echo "installing grpc version: ${install_grpc_version}"
git clone --depth=1 -b ${install_grpc_version} https://github.com/grpc/grpc
cd grpc
git submodule init
git submodule update --depth 1
Expand Down

0 comments on commit b221f18

Please sign in to comment.