From fec838246cf8aae2325ec4f04dff74542a6785e3 Mon Sep 17 00:00:00 2001 From: Flier Lu Date: Thu, 4 May 2017 15:40:57 +0800 Subject: [PATCH 01/13] add jenkins pipeline script --- Jenkinsfile | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..55f97ef --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,57 @@ +#!groovy + +pipeline { + agent any + + tools { + cmake 'cmake-3' + } + + triggers { + cron('H 4/* 0 0 1-5') + } + + stages { + def build_dir = "${env.WORKSPACE}/build" + def dist_dir = "${env.WORKSPACE}/dist" + + stage('Checkout') { + steps { + echo "Checkout branch `${env.GIT_BRANCH}` @ ${env.GIT_URL}" + + checkout scm + } + } + + stage('Build') { + steps { + echo "Build ${env.JOB_NAME} #${env.BUILD_ID} on ${env.JENKINS_URL}" + + sh "mkdir -p ${build_dir} && cd ${build_dir}" + sh "cmake .. -DCMAKE_INSTALL_PREFIX=${dist_dir} && make" + } + } + + stage('Test') { + steps { + echo "Test ${env.JOB_NAME} #${env.BUILD_ID}" + + sh 'make test' + } + } + + stage('Deploy') { + steps { + echo "Deploy ${env.JOB_NAME} #${env.BUILD_ID}" + + sh 'make install' + } + } + + stage('Cleanup') { + steps { + echo "Cleanup ${env.JOB_NAME} #${env.BUILD_ID}" + } + } + } +} \ No newline at end of file From b0f38860c5bada807b9f2ad90b2d0f424e38fbea Mon Sep 17 00:00:00 2001 From: Flier Lu Date: Thu, 4 May 2017 15:41:08 +0800 Subject: [PATCH 02/13] ignore IDEA project files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8dfd65c..904c8ca 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .sconf_temp .vscode +.idea bin build dist From 6a9c12fc86df83b6bcbda1453808a848c046b78e Mon Sep 17 00:00:00 2001 From: Flier Lu Date: Thu, 4 May 2017 15:46:38 +0800 Subject: [PATCH 03/13] remove local variables --- Jenkinsfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 55f97ef..627f82e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,9 +12,6 @@ pipeline { } stages { - def build_dir = "${env.WORKSPACE}/build" - def dist_dir = "${env.WORKSPACE}/dist" - stage('Checkout') { steps { echo "Checkout branch `${env.GIT_BRANCH}` @ ${env.GIT_URL}" @@ -27,8 +24,8 @@ pipeline { steps { echo "Build ${env.JOB_NAME} #${env.BUILD_ID} on ${env.JENKINS_URL}" - sh "mkdir -p ${build_dir} && cd ${build_dir}" - sh "cmake .. -DCMAKE_INSTALL_PREFIX=${dist_dir} && make" + sh 'mkdir -p build && cd build' + sh "cmake .. -DCMAKE_INSTALL_PREFIX=${env.WORKSPACE}/dist && make" } } From c1d35208356c324323b848a63ad520359ea3acb8 Mon Sep 17 00:00:00 2001 From: Flier Lu Date: Thu, 4 May 2017 15:50:58 +0800 Subject: [PATCH 04/13] remove cmake tool --- Jenkinsfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 627f82e..34d6939 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,10 +3,6 @@ pipeline { agent any - tools { - cmake 'cmake-3' - } - triggers { cron('H 4/* 0 0 1-5') } From dacf182c3bd6759231b94de9ba6a9d606c79d50c Mon Sep 17 00:00:00 2001 From: Flier Lu Date: Thu, 4 May 2017 15:55:59 +0800 Subject: [PATCH 05/13] remove triggers --- Jenkinsfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 34d6939..a4d0211 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,10 +3,6 @@ pipeline { agent any - triggers { - cron('H 4/* 0 0 1-5') - } - stages { stage('Checkout') { steps { From 2cf3514e4425ae24504da2095bdd92d89f337fc6 Mon Sep 17 00:00:00 2001 From: Flier Lu Date: Thu, 4 May 2017 16:11:50 +0800 Subject: [PATCH 06/13] run make command in build directory --- Jenkinsfile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a4d0211..e1ecdf2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,8 +16,12 @@ pipeline { steps { echo "Build ${env.JOB_NAME} #${env.BUILD_ID} on ${env.JENKINS_URL}" - sh 'mkdir -p build && cd build' - sh "cmake .. -DCMAKE_INSTALL_PREFIX=${env.WORKSPACE}/dist && make" + sh 'mkdir -p build' + + dir('build') { + sh "cmake .. -DCMAKE_INSTALL_PREFIX=${env.WORKSPACE}/dist" + sh 'make' + } } } @@ -25,7 +29,9 @@ pipeline { steps { echo "Test ${env.JOB_NAME} #${env.BUILD_ID}" - sh 'make test' + dir('build') { + sh 'make test' + } } } @@ -33,7 +39,9 @@ pipeline { steps { echo "Deploy ${env.JOB_NAME} #${env.BUILD_ID}" - sh 'make install' + dir('build') { + sh 'make install' + } } } From d3238ec3d8edd3d928e3c8c8a08f25341f8e62ad Mon Sep 17 00:00:00 2001 From: Flier Lu Date: Thu, 4 May 2017 16:18:08 +0800 Subject: [PATCH 07/13] remove static linked boost --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 696ca1f..18a795a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,9 +34,7 @@ endif() set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) -set(Boost_USE_STATIC_LIBS ON) # only find static libs set(Boost_USE_MULTITHREADED ON) -set(Boost_USE_STATIC_RUNTIME OFF) find_package(Boost REQUIRED COMPONENTS regex system thread) if(Boost_FOUND) From 1690d8ab052591a9789494878b9299b164a14bd6 Mon Sep 17 00:00:00 2001 From: Flier Lu Date: Thu, 29 Jun 2017 10:46:32 +0800 Subject: [PATCH 08/13] use folly::toStdString instead of old method --- src/HttpCollector.cpp | 4 ++-- src/KafkaCollector.cpp | 8 ++++---- src/ScribeCollector.cpp | 6 +++--- src/XRayCollector.cpp | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/HttpCollector.cpp b/src/HttpCollector.cpp index 7d14239..506f66e 100644 --- a/src/HttpCollector.cpp +++ b/src/HttpCollector.cpp @@ -51,7 +51,7 @@ HttpConf::HttpConf(folly::Uri &uri) { if (param.first == "format") { - message_codec = MessageCodec::parse(param.second.toStdString()); + message_codec = MessageCodec::parse(folly::toStdString(param.second)); } else if (param.first == "batch_size") { @@ -318,4 +318,4 @@ int HttpCollector::debug_callback(CURL *handle, return 0; } -} // namespace zipkin \ No newline at end of file +} // namespace zipkin diff --git a/src/KafkaCollector.cpp b/src/KafkaCollector.cpp index 29c363d..393242d 100644 --- a/src/KafkaCollector.cpp +++ b/src/KafkaCollector.cpp @@ -93,7 +93,7 @@ KafkaConf::KafkaConf(folly::Uri &uri) } else { - initial_brokers = uri.host().toStdString(); + initial_brokers = folly::toStdString(uri.host()); } folly::split("/", uri.path(), parts); @@ -105,11 +105,11 @@ KafkaConf::KafkaConf(folly::Uri &uri) { if (param.first == "compression") { - compression_codec = parse_compression_codec(param.second.toStdString()); + compression_codec = parse_compression_codec(folly::toStdString(param.second)); } else if (param.first == "format") { - message_codec = MessageCodec::parse(param.second.toStdString()); + message_codec = MessageCodec::parse(folly::toStdString(param.second)); } else if (param.first == "batch_num_messages") { @@ -274,4 +274,4 @@ KafkaCollector *KafkaConf::create(void) const return new KafkaCollector(producer, topic, std::move(reporter), std::move(partitioner), topic_partition, message_codec); } -} // namespace zipkin \ No newline at end of file +} // namespace zipkin diff --git a/src/ScribeCollector.cpp b/src/ScribeCollector.cpp index 6300cf1..a6fe633 100644 --- a/src/ScribeCollector.cpp +++ b/src/ScribeCollector.cpp @@ -12,7 +12,7 @@ ScribeConf::ScribeConf(folly::Uri &uri) { std::vector parts; - host = uri.host().toStdString(); + host = folly::toStdString(uri.host()); if (uri.port()) port = uri.port(); @@ -26,7 +26,7 @@ ScribeConf::ScribeConf(folly::Uri &uri) { if (param.first == "format") { - message_codec = MessageCodec::parse(param.second.toStdString()); + message_codec = MessageCodec::parse(folly::toStdString(param.second)); } else if (param.first == "batch_size") { @@ -96,4 +96,4 @@ bool ScribeCollector::reconnect(void) return m_socket->isOpen(); } -} // namespace zipkin \ No newline at end of file +} // namespace zipkin diff --git a/src/XRayCollector.cpp b/src/XRayCollector.cpp index 01d6fad..b3c5e91 100644 --- a/src/XRayCollector.cpp +++ b/src/XRayCollector.cpp @@ -79,7 +79,7 @@ size_t XRayCodec::encode(boost::shared_ptr Date: Thu, 29 Jun 2017 10:49:35 +0800 Subject: [PATCH 09/13] upgrade folly to v2017.06.26.01 --- cmake/InstallFolly.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/InstallFolly.cmake b/cmake/InstallFolly.cmake index d79e65d..d10725f 100644 --- a/cmake/InstallFolly.cmake +++ b/cmake/InstallFolly.cmake @@ -1,7 +1,7 @@ if (NOT FOLLY_FOUND OR USE_BUNDLED_FOLLY) if (NOT FOLLY_VERSION OR USE_BUNDLED_FOLLY) - set (FOLLY_VERSION 2017.03.13.00) - set (FOLLY_URL_MD5 3ba9d455edcf6e930b6f43e93e9f99f7) + set (FOLLY_VERSION 2017.06.26.01) + set (FOLLY_URL_MD5 cf7a05081adb16913b5d7039ac62d46b) endif() ExternalProject_Add(Folly From 15afa6d036af6b03ef622c8a372ba8c6d0df949b Mon Sep 17 00:00:00 2001 From: Flier Lu Date: Thu, 29 Jun 2017 11:13:25 +0800 Subject: [PATCH 10/13] ignore linux clang build --- .travis.yml | 102 ++++++++++++++++++++------------ .travis/install-dependencies.sh | 4 +- cmake/InstallFolly.cmake | 10 +++- 3 files changed, 74 insertions(+), 42 deletions(-) diff --git a/.travis.yml b/.travis.yml index 45eb8b5..cfc7c96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,32 +1,51 @@ sudo: required + dist: trusty -os: - - linux - - osx -osx_image: xcode8.2 addons: apt: packages: &default_packages - - automake - autoconf + - automake + - binutils-dev - bison - - flex - - libtool - - libc++-dev - build-essential + - flex - libboost-all-dev - - libevent-dev - - libssl-dev + - libc++-dev - libcurl4-openssl-dev - libdouble-conversion-dev - - thrift-compiler + - libdwarf-dev + - libelf-dev + - libevent-dev + - libgflags-dev + - libgoogle-glog-dev + - libiberty-dev + - libjemalloc-dev + - liblz4-dev + - liblzma-dev + - libsnappy-dev + - libssl-dev + - libtool + - libunwind8-dev - make - pkg-config + - thrift-compiler - tree + - zlib1g-dev + sources: &sources + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.5 + - llvm-toolchain-precise-3.6 + - llvm-toolchain-precise-3.7 + - llvm-toolchain-precise-3.8 + - llvm-toolchain-precise language: cpp -cache: ccache + +cache: + directories: + - cmake-$CMAKE_VERSION-Linux-x86_64 python: - "2.7" @@ -36,31 +55,45 @@ env: - CMAKE_VERSION=3.7.2 matrix: - include: - - os: osx - - os: linux - env: COMPILER_NAME=gcc CXX=g++-5 CC=gcc-5 - addons: - apt: - packages: - - *default_packages - - g++-5 - sources: &sources - - llvm-toolchain-precise-3.8 - - ubuntu-toolchain-r-test - - os: linux - env: COMPILER_NAME=clang CXX=clang++-3.8 CC=clang-3.8 - addons: - apt: - packages: - - *default_packages - - clang-3.8 - sources: *sources + fast_finish: true + include: + - + os: osx + osx_image: xcode8 + + - + os: linux + addons: + apt: + sources: *sources + packages: + - *default_packages + - g++-5 + env: + - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5" + + # - + # os: linux + # addons: + # apt: + # sources: *sources + # packages: + # - *default_packages + # - clang-3.8 + # env: + # - MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8 && CMAKE_CXX_FLAGS=-stdlib=libc++" before_script: - .travis/install-dependencies.sh +before_install: + - eval "${MATRIX_EVAL}" + script: + - which $CC + - which $CXX + - $CC --version + - $CXX --version - mkdir build && cd build && rm -rf * - echo travis_fold:start:cmake CMake configure - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ../cmake-$CMAKE_VERSION-Linux-x86_64/bin/cmake .. ;fi @@ -73,8 +106,3 @@ after_failure: - cat externals/src/Folly/folly/config.log - cat externals/src/Thrift/config.log - tree -h - -cache: - ccache: true - directories: - - cmake-$CMAKE_VERSION-Linux-x86_64 diff --git a/.travis/install-dependencies.sh b/.travis/install-dependencies.sh index f7f7356..ac7778c 100755 --- a/.travis/install-dependencies.sh +++ b/.travis/install-dependencies.sh @@ -3,11 +3,11 @@ set -e if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew update - brew install ccache curl double-conversion gflags glog google-benchmark gperftools rapidjson folly thrift librdkafka grpc doxygen + brew install ccache curl double-conversion gflags glog google-benchmark gperftools rapidjson folly thrift librdkafka grpc doxygen tree jemalloc else if [[ ! -f "cmake-$CMAKE_VERSION-Linux-x86_64/bin/cmake" ]] then wget --no-check-certificate https://cmake.org/files/v3.7/cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz tar -xvf cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz fi -fi \ No newline at end of file +fi diff --git a/cmake/InstallFolly.cmake b/cmake/InstallFolly.cmake index d10725f..500933f 100644 --- a/cmake/InstallFolly.cmake +++ b/cmake/InstallFolly.cmake @@ -10,18 +10,22 @@ if (NOT FOLLY_FOUND OR USE_BUNDLED_FOLLY) URL_MD5 ${FOLLY_URL_MD5} CONFIGURE_COMMAND cd /folly && autoreconf -vi && + /folly/configure + --prefix= + --with-pic + --with-jemalloc + ${WITH_OPENSSL} LD_LIBRARY_PATH=/lib + LD_RUN_PATH=/lib LIBRARY_PATH=/lib LDFLAGS=-L/lib PKG_CONFIG_PATH=/lib/pkgconfig CFLAGS=-I/include CXXFLAGS=-I/include + CPPFLAGS=-I/include LIBS=${CMAKE_THREAD_LIBS_INIT} OPENSSL_CFLAGS=-I${OPENSSL_INCLUDE_DIR} OPENSSL_LIBS=-L${OPENSSL_LIBRARY_DIR} - /folly/configure - --prefix= - ${WITH_OPENSSL} BUILD_COMMAND cd /folly && make INSTALL_COMMAND cd /folly && From 924bc620baa908efbacc8a4cb40c723a6d62e95f Mon Sep 17 00:00:00 2001 From: Flier Lu Date: Thu, 29 Jun 2017 17:25:58 +0800 Subject: [PATCH 11/13] upgrade curl/glog/librdkafka --- cmake/InstallCURL.cmake | 6 +++--- cmake/InstallGLog.cmake | 6 +++--- cmake/InstallLibRDKafka.cmake | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmake/InstallCURL.cmake b/cmake/InstallCURL.cmake index c65a8fa..d91cad9 100644 --- a/cmake/InstallCURL.cmake +++ b/cmake/InstallCURL.cmake @@ -1,7 +1,7 @@ if (NOT CURL_FOUND OR USE_BUNDLED_CURL) if (NOT CURL_VERSION_STRING OR USE_BUNDLED_CURL) - set (CURL_VERSION_STRING 7.53.1) - set (CURL_URL_MD5 9e49bb4cb275bf4464e7b69eb48613c0) + set (CURL_VERSION_STRING 7.54.1) + set (CURL_URL_MD5 21a6e5658fd55103a90b11de7b2a8a8c) endif () ExternalProject_Add(CURL @@ -28,4 +28,4 @@ if (NOT CURL_FOUND OR USE_BUNDLED_CURL) mark_as_advanced(CURL_LIBRARIES CURL_INCLUDE_DIRS) message(STATUS "Use bundled curl v${CURL_VERSION_STRING}") -endif () \ No newline at end of file +endif () diff --git a/cmake/InstallGLog.cmake b/cmake/InstallGLog.cmake index 86d8e7e..16fe0e7 100644 --- a/cmake/InstallGLog.cmake +++ b/cmake/InstallGLog.cmake @@ -1,7 +1,7 @@ if (NOT GLOG_FOUND OR USE_BUNDLED_GLOG) if (NOT GLOG_VERSION OR USE_BUNDLED_GLOG) - set (GLOG_VERSION 0.3.4) - set (GLOG_URL_MD5 df92e05c9d02504fb96674bc776a41cb) + set (GLOG_VERSION 0.3.5) + set (GLOG_URL_MD5 5df6d78b81e51b90ac0ecd7ed932b0d4) endif () ExternalProject_Add(GLog @@ -26,4 +26,4 @@ if (NOT GLOG_FOUND OR USE_BUNDLED_GLOG) mark_as_advanced(GLOG_LIBRARY GLOG_INCLUDE_PATH) message(STATUS "Use bundled glog v${GLOG_VERSION}") -endif () \ No newline at end of file +endif () diff --git a/cmake/InstallLibRDKafka.cmake b/cmake/InstallLibRDKafka.cmake index be7bcdc..a8dca29 100644 --- a/cmake/InstallLibRDKafka.cmake +++ b/cmake/InstallLibRDKafka.cmake @@ -1,7 +1,7 @@ if (NOT LIBRDKAFKA_FOUND OR USE_BUNDLED_LIBRDKAFKA) if (NOT LibRDKafka_VERSION OR USE_BUNDLED_LIBRDKAFKA) - set (LibRDKafka_VERSION 0.9.4) - set (LibRDKafka_URL_MD5 6f40198e6068475c34ae8c9faafa6e8a) + set (LibRDKafka_VERSION 0.9.5) + set (LibRDKafka_URL_MD5 8e5685baa01554108ae8c8e9c97dc495) endif () ExternalProject_Add(LibRDKafka @@ -47,4 +47,4 @@ if (NOT LIBRDKAFKA_FOUND OR USE_BUNDLED_LIBRDKAFKA) mark_as_advanced(LibRDKafka_LIBRARIES LibRDKafka_C_LIBRARIES LibRDKafka_INCLUDE_DIR) message(STATUS "Use bundled librdkafka v${LibRDKafka_VERSION}") -endif () \ No newline at end of file +endif () From daa2a621df3f30d00d4f68861212a9fc8bbeaa09 Mon Sep 17 00:00:00 2001 From: Flier Lu Date: Thu, 29 Jun 2017 17:35:08 +0800 Subject: [PATCH 12/13] upgrade cmake to v3.8.2 --- .travis.yml | 2 +- .travis/install-dependencies.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index cfc7c96..e05fb98 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,7 +52,7 @@ python: env: global: - - CMAKE_VERSION=3.7.2 + - CMAKE_VERSION=3.8.2 matrix: fast_finish: true diff --git a/.travis/install-dependencies.sh b/.travis/install-dependencies.sh index ac7778c..85457c5 100755 --- a/.travis/install-dependencies.sh +++ b/.travis/install-dependencies.sh @@ -7,7 +7,7 @@ if [[ $TRAVIS_OS_NAME == 'osx' ]]; then else if [[ ! -f "cmake-$CMAKE_VERSION-Linux-x86_64/bin/cmake" ]] then - wget --no-check-certificate https://cmake.org/files/v3.7/cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz + wget --no-check-certificate https://cmake.org/files/v3.8/cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz tar -xvf cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz fi fi From ead8073bbca6eb716ba0ca4167af0524bdd6c1f8 Mon Sep 17 00:00:00 2001 From: Flier Lu Date: Thu, 29 Jun 2017 17:57:34 +0800 Subject: [PATCH 13/13] bump version to 0.3.1 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18a795a..bd9f2cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 3.0.0) project(zipkin-cpp - VERSION 0.3.0 + VERSION 0.3.1 LANGUAGES C CXX) include(CTest) @@ -215,4 +215,4 @@ add_subdirectory(docs) add_subdirectory(src) add_subdirectory(test) add_subdirectory(bench) -add_subdirectory(examples) \ No newline at end of file +add_subdirectory(examples)