From 8fa6d84d848f269d83c286251ea0175f090b0077 Mon Sep 17 00:00:00 2001 From: Karteekmurthys Date: Tue, 28 May 2024 21:41:24 -0700 Subject: [PATCH] [Native] Modify setup-adapters.sh to install prometheus-cpp --- .../scripts/setup-adapters.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/presto-native-execution/scripts/setup-adapters.sh b/presto-native-execution/scripts/setup-adapters.sh index e40080dd589d7..d25423323c810 100755 --- a/presto-native-execution/scripts/setup-adapters.sh +++ b/presto-native-execution/scripts/setup-adapters.sh @@ -28,13 +28,22 @@ function install_jwt_cpp { cmake_install -DBUILD_TESTS=OFF -DJWT_BUILD_EXAMPLES=OFF -DJWT_DISABLE_PICOJSON=ON -DJWT_CMAKE_FILES_INSTALL_DIR="${DEPENDENCY_DIR}/jwt-cpp" } +function install_prometheus_cpp() { + github_checkout jupp0r/prometheus-cpp v1.2.4 --depth 1 + git submodule init + git submodule update + cmake_install -DBUILD_SHARED_LIBS=ON -DENABLE_PUSH=OFF -DENABLE_COMPRESSION=OFF +} + cd "${DEPENDENCY_DIR}" || exit install_jwt=0 +install_prometheus_cpp=0 if [ "$#" -eq 0 ]; then # Install all adapters by default install_jwt=1 + install_prometheus_cpp=1 fi while [[ $# -gt 0 ]]; do @@ -43,10 +52,15 @@ while [[ $# -gt 0 ]]; do install_jwt=1 shift # past argument ;; + prometheus) + install_prometheus_cpp=1; + shift + ;; *) echo "ERROR: Unknown option $1! will be ignored!" shift ;; + esac done @@ -54,6 +68,10 @@ if [ $install_jwt -eq 1 ]; then install_jwt_cpp fi +if [ $install_prometheus_cpp -eq 1 ]; then + install_prometheus_cpp +fi + _ret=$? if [ $_ret -eq 0 ] ; then echo "All deps for Presto adapters installed!"