Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
Remove openssl dependency and associated code
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbaden committed Sep 14, 2023
1 parent 6fd1eec commit be5cb3b
Show file tree
Hide file tree
Showing 14 changed files with 3 additions and 533 deletions.
31 changes: 1 addition & 30 deletions omniscidb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ if(PREFER_STATIC_LIBS)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(Arrow_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_LIBS ON)
set(OPENSSL_USE_STATIC_LIBS ON)
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
endif()
Expand Down Expand Up @@ -302,16 +301,6 @@ if(XCODE)
add_definitions("-DXCODE")
endif()

# fixme: hack works for Homebrew, might not work for Conda
if(ENABLE_CONDA)
set(OPENSSL_ROOT_DIR "$ENV{CONDA_PREFIX}")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl/")
endif()

find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})

if(MSVC)
add_definitions(/bigobj)
endif()
Expand Down Expand Up @@ -535,17 +524,6 @@ if(WIN32)
endif()
add_subdirectory(ThirdParty/googlebenchmark)

# aws-sdk
option(ENABLE_AWS_S3 "Enable AWS S3 support" OFF)
if(ENABLE_AWS_S3)
find_package(LibAwsS3)
if(NOT LibAwsS3_FOUND)
set(ENABLE_AWS_S3 OFF CACHE BOOL "Enable AWS S3 support" FORCE)
else()
add_definitions("-DHAVE_AWS_S3")
endif()
endif()

# Arrow
find_package(Arrow REQUIRED)
add_definitions("-DARROW_NO_DEPRECATED_API")
Expand All @@ -554,9 +532,6 @@ include_directories(${Arrow_INCLUDE_DIRS})
find_package(Parquet REQUIRED)

list(APPEND Arrow_LIBRARIES ${Snappy_LIBRARIES})
if(ENABLE_AWS_S3)
list(INSERT Arrow_LIBRARIES 0 ${LibAwsS3_LIBRARIES})
endif()
if (ENABLE_CUDA)
list(INSERT Arrow_LIBRARIES 0 ${Arrow_GPU_CUDA_LIBRARIES})
endif()
Expand All @@ -578,12 +553,8 @@ endif()
find_package(SQLite3 REQUIRED)
include_directories(${SQLite3_INCLUDE_DIRS})

# TODO: required?
find_package(CURL REQUIRED QUIET)
if(CURL_FOUND)
if(ENABLE_AWS_S3)
set(CURL_LIBRARIES ${LibAwsS3_SUPPORT_LIBRARIES})
endif()
endif()

# PicoSHA2
include_directories(ThirdParty/PicoSHA2)
Expand Down
5 changes: 0 additions & 5 deletions omniscidb/DataMgr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ function(set_arrow_has_private_aws_sdk)
endif()
endfunction()

if(ENABLE_AWS_S3)
list(APPEND datamgr_source_files OmniSciAwsSdk.cpp)
set_arrow_has_private_aws_sdk()
endif()

add_library(DataMgr ${datamgr_source_files})

set(DataMgrLibs CudaMgr L0Mgr Shared SchemaMgr IR ${Boost_THREAD_LIBRARY} TBB::tbb ${CMAKE_DL_LIBS} ${CUDA_LIBRARIES})
Expand Down
91 changes: 0 additions & 91 deletions omniscidb/DataMgr/OmniSciAwsSdk.cpp

This file was deleted.

30 changes: 0 additions & 30 deletions omniscidb/DataMgr/OmniSciAwsSdk.h

This file was deleted.

1 change: 0 additions & 1 deletion omniscidb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ The following `cmake`/`ccmake` options can enable/disable different features:
- `-DCMAKE_BUILD_TYPE=release` - Build type and compiler options to use.
Options are `Debug`, `Release`, `RelWithDebInfo`, `MinSizeRel`, and unset.
- `-DENABLE_ASAN=off` - Enable address sanitizer. Default is `off`.
- `-DENABLE_AWS_S3=on` - Enable AWS S3 support, if available. Default is `on`.
- `-DENABLE_CUDA=off` - Disable CUDA. Default is `on`.
- `-DENABLE_CUDA_KERNEL_DEBUG=off` - Enable debugging symbols for CUDA kernels. Will dramatically reduce kernel performance. Default is `off`.
- `-DENABLE_DECODERS_BOUNDS_CHECKING=off` - Enable bounds checking for column decoding. Default is `off`.
Expand Down
4 changes: 1 addition & 3 deletions omniscidb/Shared/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,4 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/funcannotations.h
add_library(Shared ${shared_source_files} "cleanup_global_namespace.h"
"boost_stacktrace.hpp")
target_link_libraries(Shared OSDependent Logger ${Boost_LIBRARIES} TBB::tbb ${Folly_LIBRARIES})
if("${MAPD_EDITION_LOWER}" STREQUAL "ee")
target_link_libraries(Shared ${OPENSSL_LIBRARIES})
endif()

43 changes: 0 additions & 43 deletions omniscidb/Shared/file_path_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,47 +126,4 @@ std::vector<std::string> local_glob_filter_sort_files(
return result_files;
}

#ifdef HAVE_AWS_S3
namespace {

std::vector<arrow::fs::FileInfo> arrow_fs_regex_file_filter(
const std::string& pattern,
const std::vector<arrow::fs::FileInfo>& file_info_list) {
boost::regex regex_pattern(pattern);
std::vector<arrow::fs::FileInfo> matched_file_info_list;
for (const auto& file_info : file_info_list) {
if (boost::regex_match(file_info.path(), regex_pattern)) {
matched_file_info_list.emplace_back(file_info);
}
}
if (matched_file_info_list.empty()) {
throw_no_filter_match(pattern);
}
return matched_file_info_list;
}

} // namespace

std::vector<arrow::fs::FileInfo> arrow_fs_filter_sort_files(
const std::vector<arrow::fs::FileInfo>& file_paths,
const std::optional<std::string>& filter_regex,
const std::optional<std::string>& sort_by,
const std::optional<std::string>& sort_regex) {
auto result_files = filter_regex.has_value()
? arrow_fs_regex_file_filter(filter_regex.value(), file_paths)
: file_paths;
// initial lexicographical order ensures a determinisitc ordering for files not matching
// sort_regex
auto initial_file_order = FileOrderArrow(std::nullopt, PATHNAME_ORDER_TYPE);
auto lexi_comp = initial_file_order.getFileComparator();
std::stable_sort(result_files.begin(), result_files.end(), lexi_comp);

auto file_order = FileOrderArrow(sort_regex, sort_by);
auto comp = file_order.getFileComparator();
std::stable_sort(result_files.begin(), result_files.end(), comp);
return result_files;
}

#endif // HAVE_AWS_S3

} // namespace shared
59 changes: 0 additions & 59 deletions omniscidb/Shared/file_path_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
#include <string>
#include <vector>

#ifdef HAVE_AWS_S3
#include <arrow/filesystem/filesystem.h>
#endif // HAVE_AWS_S3
#include <boost/filesystem.hpp>
#include <boost/regex.hpp>

Expand All @@ -41,10 +38,6 @@
namespace shared {

using LocalFileComparator = std::function<bool(const std::string&, const std::string&)>;
#ifdef HAVE_AWS_S3
using ArrowFsComparator =
std::function<bool(const arrow::fs::FileInfo&, const arrow::fs::FileInfo&)>;
#endif // HAVE_AWS_S3

inline const std::string FILE_SORT_ORDER_BY_KEY = "FILE_SORT_ORDER_BY";
inline const std::string FILE_SORT_REGEX_KEY = "FILE_SORT_REGEX";
Expand Down Expand Up @@ -100,14 +93,6 @@ std::vector<std::string> local_glob_filter_sort_files(
const std::optional<std::string>& sort_by,
const std::optional<std::string>& sort_regex);

#ifdef HAVE_AWS_S3
std::vector<arrow::fs::FileInfo> arrow_fs_filter_sort_files(
const std::vector<arrow::fs::FileInfo>& file_paths,
const std::optional<std::string>& filter_regex,
const std::optional<std::string>& sort_by,
const std::optional<std::string>& sort_regex);
#endif // HAVE_AWS_S3

const std::function<bool(const std::string&, const std::string&)>
common_regex_date_comp_ = [](const std::string& lhs, const std::string& rhs) -> bool {
int64_t lhs_t;
Expand Down Expand Up @@ -212,48 +197,4 @@ class FileOrderLocal : public FileOrderBase<LocalFileComparator> {
}}};
};

#ifdef HAVE_AWS_S3

class FileOrderArrow : public FileOrderBase<ArrowFsComparator> {
public:
FileOrderArrow(const std::optional<std::string>& sort_regex,
const std::optional<std::string>& sort_by)
: FileOrderBase<ArrowFsComparator>(sort_regex, sort_by) {}

inline ArrowFsComparator getFileComparator() override {
auto comparator_pair = comparator_map_.find(getSortBy());
CHECK(comparator_pair != comparator_map_.end());
return comparator_pair->second;
}

protected:
const std::map<std::string, ArrowFsComparator> comparator_map_{
{PATHNAME_ORDER_TYPE,
[](const arrow::fs::FileInfo& lhs, const arrow::fs::FileInfo& rhs) -> bool {
return lhs.path() < rhs.path();
}},
{DATE_MODIFIED_ORDER_TYPE,
[](const arrow::fs::FileInfo& lhs, const arrow::fs::FileInfo& rhs) -> bool {
return lhs.mtime() < rhs.mtime();
}},
{REGEX_ORDER_TYPE,
[this](const arrow::fs::FileInfo& lhs, const arrow::fs::FileInfo& rhs) -> bool {
auto lhs_name = lhs.path();
auto rhs_name = rhs.path();
return this->concatCaptureGroups(lhs_name) < this->concatCaptureGroups(rhs_name);
}},
{REGEX_DATE_ORDER_TYPE,
[this](const arrow::fs::FileInfo& lhs, const arrow::fs::FileInfo& rhs) -> bool {
return common_regex_date_comp_(this->concatCaptureGroups(lhs.path()),
this->concatCaptureGroups(rhs.path()));
}},
{REGEX_NUMBER_ORDER_TYPE,
[this](const arrow::fs::FileInfo& lhs, const arrow::fs::FileInfo& rhs) -> bool {
return common_regex_number_comp_(this->concatCaptureGroups(lhs.path()),
this->concatCaptureGroups(rhs.path()));
}}};
};

#endif // HAVE_AWS_S3

} // namespace shared
Loading

0 comments on commit be5cb3b

Please sign in to comment.