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

fix(workflow): new image for github workflow #4001

Merged
merged 3 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 13 additions & 27 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]

53 changes: 53 additions & 0 deletions docker/centos-7.Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]

79 changes: 43 additions & 36 deletions docker/setup_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.


set -eE

INPUT=$(arch)
Expand All @@ -24,81 +23,89 @@ 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
-a Specify os architecture, default $(arch)
-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
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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_OBJECTS:openmldb_proto>)
target_compile_options(${LIB_NAME} PRIVATE
$<$<COMPILE_LANGUAGE:CXX>:-Wno-error=nonnull>
$<$<COMPILE_LANGUAGE:C>:-Wno-error=nonnull>
)
endfunction(compile_lib)

set(TEST_LIBS
Expand Down
1 change: 1 addition & 0 deletions src/client/ns_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <algorithm>
#include <map>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion third-party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion third-party/cmake/FetchZetasql.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading