Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: offline with git submodule #3787

Merged
merged 16 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "cmake-modules"]
path = cmake-modules
url = https://github.com/bilke/cmake-modules.git
[submodule "contrib/rapidjson"]
dl239 marked this conversation as resolved.
Show resolved Hide resolved
path = contrib/rapidjson
url = https://github.com/Tencent/rapidjson.git
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ endif()
# third party sources
include(FetchContent)
QiChenX marked this conversation as resolved.
Show resolved Hide resolved
set(FETCHCONTENT_QUIET OFF)
include(farmhash)
include(rapidjson)

# contrib libs
add_subdirectory(contrib EXCLUDE_FROM_ALL)
Expand Down Expand Up @@ -200,6 +198,7 @@ if (DEFINED ENV{CI})
endif()

add_subdirectory(hybridse)
add_subdirectory(farmhash)

set(Boost_NO_BOOST_CMAKE ON)
set(BOOST_ROOT "${CMAKE_PREFIX_PATH}")
Expand Down Expand Up @@ -281,6 +280,7 @@ include_directories(
${LLVM_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${CMAKE_PREFIX_PATH}/include
${PROJECT_SOURCE_DIR}/contrib/rapidjson/include
QiChenX marked this conversation as resolved.
Show resolved Hide resolved
)

link_directories(
Expand Down
17 changes: 0 additions & 17 deletions cmake/farmhash.cmake

This file was deleted.

9 changes: 0 additions & 9 deletions cmake/rapidjson.cmake

This file was deleted.

2 changes: 2 additions & 0 deletions contrib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ endfunction()

add_contrib(simdjson)

# rapidjson
add_contrib(rapidjson)
1 change: 1 addition & 0 deletions contrib/rapidjson
QiChenX marked this conversation as resolved.
Show resolved Hide resolved
Submodule rapidjson added at f54b0e
3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ RUN yum update -y && yum install -y centos-release-scl epel-release && \
tar xzf zookeeper.tar.gz -C /deps/src && \
rm -v ./*.tar.gz && \
/setup_deps.sh -a "$TARGETARCH" -z "$ZETASQL_VERSION" -t "$THIRDPARTY_VERSION" && \
rm -v /setup_deps.sh
QiChenX marked this conversation as resolved.
Show resolved Hide resolved
rm -v /setup_deps.sh && \
yum install -y rsync
QiChenX marked this conversation as resolved.
Show resolved Hide resolved

ENV THIRD_PARTY_DIR=/deps/usr
ENV THIRD_PARTY_SRC_DIR=/deps/src
Expand Down
25 changes: 25 additions & 0 deletions docker/Dockerfile_offline
QiChenX marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2021 4Paradigm
QiChenX marked this conversation as resolved.
Show resolved Hide resolved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Before building an offline image, copy this Dockerfile to the same directory as OpenMLDB firstly

# specify a base version of OpenMLDB docker image
ARG version=0.8
QiChenX marked this conversation as resolved.
Show resolved Hide resolved
FROM ghcr.io/4paradigm/hybridsql:${version}

COPY OpenMLDB/docker/setup_deps.sh /
QiChenX marked this conversation as resolved.
Show resolved Hide resolved
COPY OpenMLDB /root/OpenMLDB
QiChenX marked this conversation as resolved.
Show resolved Hide resolved

# current base image does not contain rsync
RUN yum install -y rsync
QiChenX marked this conversation as resolved.
Show resolved Hide resolved
12 changes: 12 additions & 0 deletions farmhash/CMakeLists.txt
QiChenX marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

QiChenX marked this conversation as resolved.
Show resolved Hide resolved
add_library(farmhash ${CMAKE_CURRENT_SOURCE_DIR}/src/farmhash.cc)
target_include_directories(farmhash SYSTEM PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src/")
set_target_properties(farmhash
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${farmhash_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${farmhash_BINARY_DIR}
)
target_compile_definitions(farmhash
PUBLIC NAMESPACE_FOR_HASH_FUNCTIONS=farmhash)

add_library(op_contrib::farmhash ALIAS farmhash)
19 changes: 19 additions & 0 deletions farmhash/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) 2014 Google, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
4 changes: 4 additions & 0 deletions farmhash/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src

dist_doc_DATA = README NEWS COPYING Understanding_Hash_Functions dev/basics.cc dev/builder.cc dev/cmake_m32 dev/create-self-test dev/do-in-parallel dev/farmhashcc.cc dev/farmhash.h dev/farmhashmk.cc dev/farmhashna.cc dev/farmhashns.cc dev/farmhashnt.cc dev/farmhashsa.cc dev/farmhashsu.cc dev/farmhashte.cc dev/farmhashuo.cc dev/farmhashxo.cc dev/f.cc dev/fix-copyright dev/INSTRUCTIONS dev/PATCH dev/platform.cc dev/remove-from-to dev/SELFTESTCityHash128WithSeed dev/SELFTESTFingerprint128 dev/SELFTESTHash32 dev/SELFTESTHash32WithSeed dev/SELFTESTHash64 dev/SELFTESTHash64WithSeed dev/SELFTESTHash64WithSeeds dev/self-test-skeleton.cc dev/TESTBOILERPLATEHash32 dev/TESTBOILERPLATEHash32WithSeed dev/TESTBOILERPLATEHash64 dev/TESTBOILERPLATEHash64WithSeed dev/TESTBOILERPLATEHash64WithSeeds dev/WRAPPERuint32tconstcharssizetlen dev/WRAPPERuint32tconstcharssizetlenuint32tseed dev/WRAPPERuint32tconstcharssizetlenuint64tseed dev/WRAPPERuint32tconstcharssizetlenuint64tseed0uint64tseed1 dev/WRAPPERuint64tconstcharssizetlen dev/WRAPPERuint64tconstcharssizetlenuint64tseed dev/WRAPPERuint64tconstcharssizetlenuint64tseed0uint64tseed1