From 2d26a0cbcecd4e3da67635c7697c4d07ecb1fd71 Mon Sep 17 00:00:00 2001 From: Pablo Marcos Date: Wed, 20 Nov 2024 09:34:15 +0000 Subject: [PATCH] Revert "Add GCP KMS example POC to test the CI" This reverts commit e0bf6ec7e4b25babf3fe82566f9d7aa5a68fd3f5. --- CMakeLists.txt | 2 +- src/IO/examples/CMakeLists.txt | 3 -- src/IO/examples/gcp_kms.cpp | 57 ---------------------------------- 3 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 src/IO/examples/gcp_kms.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index a267509c9b3..a165be799c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,7 +157,7 @@ endif() no_warning(enum-constexpr-conversion) # breaks Protobuf in clang-16 option(ENABLE_TESTS "Provide unit_test_dbms target with Google.Test unit tests" ON) -option(ENABLE_EXAMPLES "Build all example programs in 'examples' subdirectories" ON) +option(ENABLE_EXAMPLES "Build all example programs in 'examples' subdirectories" OFF) option(ENABLE_BENCHMARKS "Build all benchmark programs in 'benchmarks' subdirectories" OFF) if (OS_LINUX AND (ARCH_AMD64 OR ARCH_AARCH64) AND NOT USE_MUSL) diff --git a/src/IO/examples/CMakeLists.txt b/src/IO/examples/CMakeLists.txt index 8ddd1480a3c..8dea3a84cc4 100644 --- a/src/IO/examples/CMakeLists.txt +++ b/src/IO/examples/CMakeLists.txt @@ -73,9 +73,6 @@ target_link_libraries (snappy_read_buffer PRIVATE clickhouse_common_io clickhous clickhouse_add_executable (hadoop_snappy_read_buffer hadoop_snappy_read_buffer.cpp) target_link_libraries (hadoop_snappy_read_buffer PRIVATE clickhouse_common_io clickhouse_common_config) -clickhouse_add_executable (gcp_kms gcp_kms.cpp) -target_link_libraries (gcp_kms PRIVATE dbms) - if (TARGET ch_contrib::hdfs) clickhouse_add_executable (read_buffer_from_hdfs read_buffer_from_hdfs.cpp) target_link_libraries (read_buffer_from_hdfs PRIVATE dbms ch_contrib::hdfs) diff --git a/src/IO/examples/gcp_kms.cpp b/src/IO/examples/gcp_kms.cpp deleted file mode 100644 index 3404e20bf88..00000000000 --- a/src/IO/examples/gcp_kms.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "google/cloud/kms/v1/key_management_client.h" -#include "google/cloud/location.h" -#include "google/cloud/status.h" - -using namespace DB; -using namespace S3; - -int main(int argc, char * argv[]) -{ - auto shared_context = Context::createShared(); - auto global_context = Context::createGlobal(shared_context.get()); - global_context->makeGlobalContext(); - - Poco::AutoPtr channel(new Poco::ConsoleChannel(std::cerr)); - Poco::Logger::root().setChannel(channel); - Poco::Logger::root().setLevel("debug"); - - auto logger = getLogger("PMO"); - LOG_DEBUG(logger, "GCP KMS testing..."); - - if (argc != 3) - { - std::cerr << "Usage: " << argv[0] << " project-id location-id\n"; - return 1; - } - - auto const location = google::cloud::Location(argv[1], argv[2]); - - namespace kms = ::google::cloud::kms_v1; - auto client = kms::KeyManagementServiceClient( - kms::MakeKeyManagementServiceConnection()); - - for (auto kr : client.ListKeyRings(location.FullName())) - { - if (!kr) throw std::runtime_error(std::move(kr).status().message()); - std::cout << kr->DebugString() << "\n"; - } - - return 0; -}