Skip to content

Commit

Permalink
feat: update deps for new image
Browse files Browse the repository at this point in the history
  • Loading branch information
Shouren committed Dec 11, 2024
1 parent ff80b35 commit 2263c25
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 41 deletions.
13 changes: 6 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,26 @@

FROM ubuntu:22.04

ARG ZETASQL_VERSION=0.3.4
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 /

RUN apt update -y && \
apt install -y build-essential python3-dev openjdk-11-jdk flex doxygen lcov git curl && \
apt clean cache && \
curl -Lo zookeeper.tar.gz https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz && \
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 && \
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 LD_LIBRARY_PATH=/deps/usr/lib:/deps/usr/lib64:$LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH="/deps/usr/lib:/deps/usr/lib64:$LD_LIBRARY_PATH"
ENV LANG=en_US.UTF-8
ENV ZETASQL_VERSION=$ZETASQL_VERSION
ENV THIRDPARTY_VERSION=$THIRDPARTY_VERSION
73 changes: 40 additions & 33 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,77 +23,85 @@ 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"
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 "downloaded 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}/ibzetasql-${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 "downloaded 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}/ibzetasql-${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 xf thirdparty.tar.gz -C /deps/usr --strip-components=1
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

0 comments on commit 2263c25

Please sign in to comment.