diff --git a/docker/Dockerfile b/docker/Dockerfile index 37027cd43cc..58d679763d3 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -12,42 +12,28 @@ # See the License for the specific language governing permissions and # limitations under the License. +FROM ubuntu:22.04 -FROM centos:7 - -ARG ZETASQL_VERSION=0.3.4 -ARG THIRDPARTY_VERSION=0.7.0 +ARG ZETASQL_VERSION=0.3.5 +ARG THIRDPARTY_VERSION=0.7.1 ARG TARGETARCH -LABEL org.opencontainers.image.source https://github.com/4paradigm/OpenMLDB - +LABEL org.opencontainers.image.source=https://github.com/4paradigm/OpenMLDB COPY ./*.sh / -# hadolint ignore=DL3031,DL3033 -RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo && \ - sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo && \ - sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo && \ - yum update -y && yum install -y centos-release-scl epel-release && \ - /patch_yum_repo.sh && \ - yum install -y devtoolset-8 rh-git227 devtoolset-8-libasan-devel flex doxygen java-1.8.0-openjdk-devel rh-python38-python-devel rh-python38-python-wheel rh-python38-python-requests rh-python38-python-pip && \ - curl -Lo lcov-1.15-1.noarch.rpm https://github.com/linux-test-project/lcov/releases/download/v1.15/lcov-1.15-1.noarch.rpm && \ - yum localinstall -y lcov-1.15-1.noarch.rpm && \ - yum clean all && rm -v lcov-1.15-1.noarch.rpm && \ - curl -Lo zookeeper.tar.gz https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz && \ + +RUN apt update -y && \ + apt clean cache && \ + apt install -y build-essential libicu-dev python3-dev python3-pip openjdk-11-jdk flex doxygen lcov git curl && \ + apt clean cache && \ mkdir -p /deps/src && \ - tar xzf zookeeper.tar.gz -C /deps/src && \ - rm -v ./*.tar.gz && \ - /setup_deps.sh -a "$TARGETARCH" -z "$ZETASQL_VERSION" -t "$THIRDPARTY_VERSION" && \ + curl -Lo zookeeper.tar.gz https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz && \ + tar xf zookeeper.tar.gz -C /deps/src && \ + /setup_deps.sh -z "$ZETASQL_VERSION" -t "$THIRDPARTY_VERSION" && \ rm -v /*.sh ENV THIRD_PARTY_DIR=/deps/usr ENV THIRD_PARTY_SRC_DIR=/deps/src -ENV PATH=/opt/rh/rh-git227/root/usr/bin:/opt/rh/rh-python38/root/usr/local/bin:/opt/rh/rh-python38/root/usr/bin:/opt/rh/devtoolset-8/root/usr/bin:/deps/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -ENV LD_LIBRARY_PATH=/deps/usr/lib:/deps/usr/lib64:/opt/rh/httpd24/root/usr/lib64:/opt/rh/rh-python38/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/devtoolset-8/root/usr/lib64/dyninst +ENV LD_LIBRARY_PATH="/deps/usr/lib:/deps/usr/lib64" ENV LANG=en_US.UTF-8 ENV ZETASQL_VERSION=$ZETASQL_VERSION ENV THIRDPARTY_VERSION=$THIRDPARTY_VERSION - -WORKDIR /root - -CMD [ "/bin/bash" ] - diff --git a/docker/centos-7.Dockerfile b/docker/centos-7.Dockerfile new file mode 100644 index 00000000000..37027cd43cc --- /dev/null +++ b/docker/centos-7.Dockerfile @@ -0,0 +1,53 @@ +# Copyright 2021 4Paradigm +# +# 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. + + +FROM centos:7 + +ARG ZETASQL_VERSION=0.3.4 +ARG THIRDPARTY_VERSION=0.7.0 +ARG TARGETARCH + +LABEL org.opencontainers.image.source https://github.com/4paradigm/OpenMLDB + +COPY ./*.sh / +# hadolint ignore=DL3031,DL3033 +RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo && \ + sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo && \ + sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo && \ + yum update -y && yum install -y centos-release-scl epel-release && \ + /patch_yum_repo.sh && \ + yum install -y devtoolset-8 rh-git227 devtoolset-8-libasan-devel flex doxygen java-1.8.0-openjdk-devel rh-python38-python-devel rh-python38-python-wheel rh-python38-python-requests rh-python38-python-pip && \ + curl -Lo lcov-1.15-1.noarch.rpm https://github.com/linux-test-project/lcov/releases/download/v1.15/lcov-1.15-1.noarch.rpm && \ + yum localinstall -y lcov-1.15-1.noarch.rpm && \ + yum clean all && rm -v lcov-1.15-1.noarch.rpm && \ + curl -Lo zookeeper.tar.gz https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz && \ + mkdir -p /deps/src && \ + 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 /*.sh + +ENV THIRD_PARTY_DIR=/deps/usr +ENV THIRD_PARTY_SRC_DIR=/deps/src +ENV PATH=/opt/rh/rh-git227/root/usr/bin:/opt/rh/rh-python38/root/usr/local/bin:/opt/rh/rh-python38/root/usr/bin:/opt/rh/devtoolset-8/root/usr/bin:/deps/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +ENV LD_LIBRARY_PATH=/deps/usr/lib:/deps/usr/lib64:/opt/rh/httpd24/root/usr/lib64:/opt/rh/rh-python38/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/devtoolset-8/root/usr/lib64/dyninst +ENV LANG=en_US.UTF-8 +ENV ZETASQL_VERSION=$ZETASQL_VERSION +ENV THIRDPARTY_VERSION=$THIRDPARTY_VERSION + +WORKDIR /root + +CMD [ "/bin/bash" ] + diff --git a/docker/setup_deps.sh b/docker/setup_deps.sh index 29b34296053..002a24eacd4 100755 --- a/docker/setup_deps.sh +++ b/docker/setup_deps.sh @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. - set -eE INPUT=$(arch) @@ -24,9 +23,8 @@ THIRDPARTY_VERSION= # NAME: usage # DESCRIPTION: Display usage information. #=============================================================================== -function usage () -{ - echo "Usage : $0 [options] [--] +function usage() { + echo "Usage : $0 [options] [--] Options: -h Display this message @@ -34,71 +32,80 @@ function usage () -t hybridsql thirdparty version, required -z Specify zetasql version, required" -} # ---------- end of function usage ---------- +} # ---------- end of function usage ---------- #----------------------------------------------------------------------- # Handle command line arguments #----------------------------------------------------------------------- -while getopts ":ha:z:t:" opt -do +while getopts ":ha:z:t:" opt; do case $opt in - h) usage; exit 0 ;; + h) + usage + exit 0 + ;; - a) INPUT=$OPTARG ;; + a) INPUT=$OPTARG ;; - t) THIRDPARTY_VERSION=$OPTARG ;; + t) THIRDPARTY_VERSION=$OPTARG ;; - z) ZETASQL_VERSION=$OPTARG ;; + z) ZETASQL_VERSION=$OPTARG ;; - *) echo -e "\n Option does not exist : $OPTARG\n" - usage; exit 1 ;; + *) + echo -e "\n Option does not exist : $OPTARG\n" + usage + exit 1 + ;; - esac # --- end of case --- + esac # --- end of case --- done -shift $((OPTIND-1)) +shift $((OPTIND - 1)) if [[ -z "$ZETASQL_VERSION" || -z "$THIRDPARTY_VERSION" ]]; then - echo "ZETASQL_VERSION and THIRDPARTY_VERSION number required" - exit 1 + echo "ZETASQL_VERSION and THIRDPARTY_VERSION number required" + exit 1 fi if [[ $INPUT = 'i386' || $INPUT = 'x86_64' || $INPUT = 'amd64' ]]; then - ARCH=x86_64 + ARCH=x86_64 elif [[ $INPUT = 'aarch64' || $INPUT = 'arm64' ]]; then - ARCH=aarch64 + ARCH=aarch64 else - echo "Unsupported arch: $INPUT" - exit 1 + echo "Unsupported arch: $INPUT" + exit 1 fi pushd "$(dirname "$0")" -curl -Lo cmake.tar.gz https://github.com/Kitware/CMake/releases/download/v3.21.0/cmake-3.21.0-linux-"$ARCH".tar.gz && \ - echo "downloaded cmake.tar.gz for $ARCH" -tar xzf cmake.tar.gz -C /usr/local/ --strip-components=1 +curl -Lo cmake.tar.gz https://github.com/Kitware/CMake/releases/download/v3.21.0/cmake-3.21.0-linux-"$ARCH".tar.gz && + echo "downloaded cmake.tar.gz for $ARCH" +tar xf cmake.tar.gz -C /usr/local/ --strip-components=1 rm -v cmake.tar.gz mkdir -p /deps/usr if [[ "$ARCH" = "x86_64" ]]; then - curl -Lo thirdparty.tar.gz "https://github.com/4paradigm/hybridsql-asserts/releases/download/v${THIRDPARTY_VERSION}/thirdparty-${THIRDPARTY_VERSION}-linux-gnu-x86_64-centos.tar.gz" && \ - echo "downloaded thirdparty.tar.gz version $THIRDPARTY_VERSION for $ARCH" - curl -Lo zetasql.tar.gz "https://github.com/4paradigm/zetasql/releases/download/v${ZETASQL_VERSION}/libzetasql-${ZETASQL_VERSION}-linux-gnu-x86_64-centos.tar.gz" && \ - echo "downloaed zetasql.tar.gz version $ZETASQL_VERSION for $ARCH" + # curl -Lo thirdparty.tar.gz "https://github.com/4paradigm/hybridsql-asserts/releases/download/v${THIRDPARTY_VERSION}/thirdparty-${THIRDPARTY_VERSION}-linux-gnu-x86_64-ubuntu.tar.gz" && + curl -Lo thirdparty.tar.gz "https://openmldb.ai/download/thirdparty/releases/download/v${THIRDPARTY_VERSION}/thirdparty-${THIRDPARTY_VERSION}-linux-gnu-${ARCH}-ubuntu.tar.gz" && + echo "downloaded thirdparty.tar.gz version $THIRDPARTY_VERSION for $ARCH" + # curl -Lo zetasql.tar.gz "https://github.com/4paradigm/zetasql/releases/download/v${ZETASQL_VERSION}/libzetasql-${ZETASQL_VERSION}-linux-gnu-${ARCH}-ubuntu.tar.gz" && + curl -Lo zetasql.tar.gz "https://openmldb.ai/download/zetasql/releases/download/v${ZETASQL_VERSION}/libzetasql-${ZETASQL_VERSION}-linux-gnu-${ARCH}-ubuntu.tar.gz" && + echo "downloaded zetasql.tar.gz version $ZETASQL_VERSION for $ARCH" elif [[ "$ARCH" = "aarch64" ]]; then - curl -Lo thirdparty.tar.gz "https://github.com/4paradigm/hybridsql-asserts/releases/download/v${THIRDPARTY_VERSION}/thirdparty-${THIRDPARTY_VERSION}-linux-gnu-${ARCH}.tar.gz" && \ - echo "downloaded thirdparty.tar.gz version $THIRDPARTY_VERSION for $ARCH" - curl -Lo zetasql.tar.gz "https://github.com/4paradigm/zetasql/releases/download/v${ZETASQL_VERSION}/libzetasql-${ZETASQL_VERSION}-linux-gnu-${ARCH}.tar.gz" && \ - echo "downloaed zetasql.tar.gz version $ZETASQL_VERSION for $ARCH" + # curl -Lo thirdparty.tar.gz "https://github.com/4paradigm/hybridsql-asserts/releases/download/v${THIRDPARTY_VERSION}/thirdparty-${THIRDPARTY_VERSION}-linux-gnu-${ARCH}.tar.gz" && + curl -Lo thirdparty.tar.gz "https://openmldb.ai/download/thirdparty/releases/download/v${THIRDPARTY_VERSION}/thirdparty-${THIRDPARTY_VERSION}-linux-gnu-${ARCH}-ubuntu.tar.gz" && + echo "downloaded thirdparty.tar.gz version $THIRDPARTY_VERSION for $ARCH" + # curl -Lo zetasql.tar.gz "https://github.com/4paradigm/zetasql/releases/download/v${ZETASQL_VERSION}/libzetasql-${ZETASQL_VERSION}-linux-gnu-${ARCH}.tar.gz" && + curl -Lo zetasql.tar.gz "https://openmldb.ai/download/zetasql/releases/download/v${ZETASQL_VERSION}/libzetasql-${ZETASQL_VERSION}-linux-gnu-${ARCH}-ubuntu.tar.gz" && + echo "downloaded zetasql.tar.gz version $ZETASQL_VERSION for $ARCH" else - echo "no pre-compiled deps for arch=$ARCH" - exit 1 + echo "no pre-compiled deps for arch=$ARCH" + exit 1 fi -tar xzf thirdparty.tar.gz -C /deps/usr --strip-components=1 -tar xzf zetasql.tar.gz -C /deps/usr --strip-components=1 +tar xf thirdparty.tar.gz -C /deps/usr --strip-components=1 +tar xf zetasql.tar.gz -C /deps/usr --strip-components=1 rm -v ./*.tar.gz popd diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index abf7ecdf727..e5e34febe36 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -56,6 +56,10 @@ function(compile_lib LIB_NAME DIR DEPEND_FILE_LIST) set(FILE_STR_LIST "${FILE_STR_LIST} ${DEPEND_FILE_LIST}") string(REPLACE " " ";" FILE_LIST ${FILE_STR_LIST}) add_library(${LIB_NAME} STATIC ${FILE_LIST} $) + target_compile_options(${LIB_NAME} PRIVATE + $<$:-Wno-error=nonnull> + $<$:-Wno-error=nonnull> + ) endfunction(compile_lib) set(TEST_LIBS diff --git a/src/client/ns_client.h b/src/client/ns_client.h index 1ddd50963bf..dc2a9848fb1 100644 --- a/src/client/ns_client.h +++ b/src/client/ns_client.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index fde8c086b71..5d8b4b4b2cd 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -76,7 +76,7 @@ set(MAKEOPTS "$ENV{MAKEOPTS}" CACHE STRING "Extra options to make") message(STATUS "Install bundled dependencies into ${DEPS_INSTALL_DIR}") set(HYBRIDSQL_ASSERTS_HOME https://github.com/4paradigm/hybridsql-asserts) -set(HYBRIDSQL_ASSERTS_VERSION 0.7.0) +set(HYBRIDSQL_ASSERTS_VERSION 0.7.1) function(get_linux_lsb_release_information) execute_process(COMMAND bash ${CMAKE_SOURCE_DIR}/get-lsb-release.sh diff --git a/third-party/cmake/FetchZetasql.cmake b/third-party/cmake/FetchZetasql.cmake index fa5e72514a1..4e27b9aac6b 100644 --- a/third-party/cmake/FetchZetasql.cmake +++ b/third-party/cmake/FetchZetasql.cmake @@ -13,7 +13,7 @@ # limitations under the License. set(ZETASQL_HOME https://github.com/4paradigm/zetasql) -set(ZETASQL_VERSION 0.3.4) +set(ZETASQL_VERSION 0.3.5) set(ZETASQL_HASH_DARWIN a8d18f1595fa6a78d09c5feca813e9a332cd4d156a95124165f7c1a1ebcb86b2) set(ZETASQL_HASH_LINUX_UBUNTU 11988ad45de027566386a8e832e7385755f9367d78243b8d2aa6ef3493c0ee3d) set(ZETASQL_HASH_LINUX_CENTOS 92c9eb4d1ffb7d96fcb33150366906c52f27db4cf8dfb442c06e5fe5c738cd4a)