提交 952f3435 编写于 作者: Q quicksilver 提交者: Jin Hai

enable build milvus on centos7 (#769)

* enable build milvus on centos7

* Update build enviroment Centos7 dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* add centos7_build_deps.sh

* add centos7 build cpu version enviroment

* add centos7 on github actions

* fix bug

* fix bug

* fix bug

* update ci/docker/centos-7-core.dockerfile

* fix github actions bug

* update centos7 case on github actions

* update docker-compose.yml

* debug centos case on github actions

* debug centos case on github actions

* add centos7 deploy dockerfile
上级 21e986d1
......@@ -2,4 +2,5 @@ REPO=milvusdb/milvus-dev
MILVUS_INSTALL_PREFIX=/var/lib/milvus
ARCH=amd64
UBUNTU=18.04
CENTOS=7
CUDA=10.1
\ No newline at end of file
......@@ -40,3 +40,33 @@ jobs:
docker login -u ${{ secrets.DOCKERHUB_USER }} \
-p ${{ secrets.DOCKERHUB_TOKEN }}
docker-compose push ubuntu-core
centos:
name: AMD64 CentOS ${{ matrix.centos }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
centos: [7]
env:
CENTOS: ${{ matrix.centos }}
steps:
- name: Checkout Milvus
uses: actions/checkout@v1
- name: Docker Pull
shell: bash
run: |
docker-compose pull --ignore-pull-failures db
docker-compose pull --ignore-pull-failures centos-core
- name: Docker Build
run: |
docker-compose run --use-aliases -d db
docker-compose run centos-core
- name: Docker Push
if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus'
continue-on-error: true
shell: bash
run: |
docker login -u ${{ secrets.DOCKERHUB_USER }} \
-p ${{ secrets.DOCKERHUB_TOKEN }}
docker-compose push centos-core
ARG arch=amd64
FROM ${arch}/centos:7
# pipefail is enabled for proper error detection in the `wget`
# step
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN yum install -y epel-release centos-release-scl-rh && yum install -y wget curl which && \
wget -qO- "https://cmake.org/files/v3.14/cmake-3.14.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local && \
yum install -y ccache make automake git python3-pip libcurl-devel python3-devel boost-static mysql-devel \
devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-gcc-gfortran llvm-toolset-7.0-clang llvm-toolset-7.0-clang-tools-extra mysql lcov \
&& \
rm -rf /var/cache/yum/*
RUN echo "source scl_source enable devtoolset-7" >> /etc/profile.d/devtoolset-7.sh
RUN echo "source scl_source enable llvm-toolset-7.0" >> /etc/profile.d/llvm-toolset-7.sh
ENV CLANG_TOOLS_PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin"
#!/bin/bash
sudo yum install -y epel-release centos-release-scl-rh && sudo yum install -y wget curl which && \
sudo wget -qO- "https://cmake.org/files/v3.14/cmake-3.14.3-Linux-x86_64.tar.gz" | sudo tar --strip-components=1 -xz -C /usr/local && \
sudo yum install -y ccache make automake git python3-pip libcurl-devel python3-devel boost-static mysql-devel \
devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-gcc-gfortran llvm-toolset-7.0-clang llvm-toolset-7.0-clang-tools-extra lcov
echo "source scl_source enable devtoolset-7" | sudo tee -a /etc/profile.d/devtoolset-7.sh
echo "source scl_source enable llvm-toolset-7.0" | sudo tee -a /etc/profile.d/llvm-toolset-7.sh
echo "export CLANG_TOOLS_PATH=/opt/rh/llvm-toolset-7.0/root/usr/bin" | sudo tee -a /etc/profile.d/llvm-toolset-7.sh
......@@ -270,10 +270,10 @@ set(ARROW_PREFIX "${INDEX_BINARY_DIR}/arrow_ep-prefix/src/arrow_ep/cpp")
macro(build_arrow)
message(STATUS "Building Apache ARROW-${ARROW_VERSION} from source")
set(ARROW_STATIC_LIB_NAME arrow)
set(ARROW_LIB_DIR "${ARROW_PREFIX}/lib")
set(ARROW_STATIC_LIB
"${ARROW_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${ARROW_STATIC_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${ARROW_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${ARROW_STATIC_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}"
)
set(ARROW_LIB_DIR "${ARROW_PREFIX}/lib")
set(ARROW_INCLUDE_DIR "${ARROW_PREFIX}/include")
set(ARROW_CMAKE_ARGS
......@@ -282,6 +282,7 @@ macro(build_arrow)
-DARROW_BUILD_SHARED=OFF
-DARROW_USE_GLOG=OFF
-DCMAKE_INSTALL_PREFIX=${ARROW_PREFIX}
-DCMAKE_INSTALL_LIBDIR=${ARROW_LIB_DIR}
-DARROW_CUDA=OFF
-DARROW_FLIGHT=OFF
-DARROW_GANDIVA=OFF
......
......@@ -17,6 +17,7 @@
#include <gtest/gtest-death-test.h>
#include <gtest/gtest.h>
#include <cmath>
#include "config/YamlConfigMgr.h"
#include "server/Config.h"
......@@ -69,9 +70,9 @@ TEST_F(ConfigTest, CONFIG_TEST) {
server_config.SetValue("float_test", "2.5");
double dbl = server_config.GetDoubleValue("float_test");
ASSERT_LE(abs(dbl - 2.5), std::numeric_limits<double>::epsilon());
ASSERT_LE(std::fabs(dbl - 2.5), std::numeric_limits<double>::epsilon());
float flt = server_config.GetFloatValue("float_test");
ASSERT_LE(abs(flt - 2.5), std::numeric_limits<float>::epsilon());
ASSERT_LE(std::fabs(flt - 2.5), std::numeric_limits<float>::epsilon());
server_config.SetValue("bool_test", "true");
bool blt = server_config.GetBoolValue("bool_test");
......
......@@ -2,6 +2,7 @@ version: '3.5'
volumes:
amd64-ubuntu-18.04-cache:
amd64-centos-7-cache:
x-ccache: &ccache
CCACHE_COMPILERCHECK: content
......@@ -10,11 +11,6 @@ x-ccache: &ccache
CCACHE_MAXSIZE: 2G
CCACHE_DIR: /build/ccache
x-command: &cpp-command >
/bin/bash -c "
/milvus/ci/scripts/build.sh -o ${MILVUS_INSTALL_PREFIX} -l -u -c
/milvus/ci/scripts/coverage.sh -o ${MILVUS_INSTALL_PREFIX} -u root -p 123456 -t mysql"
services:
db:
image: mysql:5.6
......@@ -42,7 +38,32 @@ services:
- ${ARCH}-ubuntu-${UBUNTU}-cache:/build:delegated
networks:
- milvus
command: *cpp-command
command: &ubuntu-command >
/bin/bash -c "
/milvus/ci/scripts/build.sh -t Release -o ${MILVUS_INSTALL_PREFIX} -l -u -c
/milvus/ci/scripts/coverage.sh -o ${MILVUS_INSTALL_PREFIX} -u root -p 123456 -t mysql"
centos-core:
image: ${REPO}:${ARCH}-centos-${CENTOS}-core
build:
context: .
dockerfile: ci/docker/centos-${CENTOS}-core.dockerfile
cache_from:
- ${REPO}:${ARCH}-centos-${CENTOS}-core
shm_size: 2G
environment:
<<: *ccache
volumes: &centos-volumes
- .:/milvus:delegated
- ${ARCH}-centos-${CENTOS}-cache:/build:delegated
networks:
- milvus
command: &centos-command >
/bin/bash -c "
source scl_source enable devtoolset-7
source scl_source enable llvm-toolset-7.0
/milvus/ci/scripts/build.sh -t Release -o ${MILVUS_INSTALL_PREFIX} -l -u -c
/milvus/ci/scripts/coverage.sh -o ${MILVUS_INSTALL_PREFIX} -u root -p 123456 -t mysql"
networks:
milvus:
FROM centos:centos7
RUN yum install -y epel-release centos-release-scl-rh && yum install -y wget curl which && \
wget -qO- "https://cmake.org/files/v3.14/cmake-3.14.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local && \
yum install -y ccache make automake git python3-pip libcurl-devel python3-devel boost-static mysql-devel \
devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-gcc-gfortran llvm-toolset-7.0-clang llvm-toolset-7.0-clang-tools-extra mysql lcov \
&& \
rm -rf /var/cache/yum/*
RUN echo "source scl_source enable devtoolset-7" >> /etc/profile.d/devtoolset-7.sh
RUN echo "source scl_source enable llvm-toolset-7.0" >> /etc/profile.d/llvm-toolset-7.sh
ENV CLANG_TOOLS_PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin"
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
WORKDIR /root
ENTRYPOINT [ "/app/docker-entrypoint.sh" ]
CMD [ "start" ]
\ No newline at end of file
#!/bin/bash
set -e
if [ "$1" = 'start' ]; then
tail -f /dev/null
fi
exec "$@"
FROM nvidia/cuda:10.1-devel-centos7
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
RUN yum install -y epel-release centos-release-scl-rh && yum install -y wget curl which && \
wget -qO- "https://cmake.org/files/v3.14/cmake-3.14.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local && \
yum install -y ccache make automake git python3-pip libcurl-devel python3-devel boost-static mysql-devel \
devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-gcc-gfortran llvm-toolset-7.0-clang llvm-toolset-7.0-clang-tools-extra mysql lcov \
&& \
rm -rf /var/cache/yum/*
RUN echo "source scl_source enable devtoolset-7" >> /etc/profile.d/devtoolset-7.sh
RUN echo "source scl_source enable llvm-toolset-7.0" >> /etc/profile.d/llvm-toolset-7.sh
ENV CLANG_TOOLS_PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin"
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
WORKDIR /root
ENTRYPOINT [ "/app/docker-entrypoint.sh" ]
CMD [ "start" ]
#!/bin/bash
set -e
if [ "$1" = 'start' ]; then
tail -f /dev/null
fi
exec "$@"
FROM centos:centos7
RUN yum install -y epel-release && \
yum install -y libgomp libgfortran4 mysql-devel && \
rm -rf /var/cache/yum/*
COPY ./milvus /var/lib/milvus
COPY ./docker-entrypoint.sh /var/lib/milvus
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/var/lib/milvus/lib"
WORKDIR /var/lib/milvus
ENTRYPOINT [ "/var/lib/milvus/docker-entrypoint.sh" ]
CMD [ "start" ]
EXPOSE 19530
#!/bin/bash
set -e
if [ "$1" == 'start' ]; then
cd /var/lib/milvus/scripts && ./start_server.sh
fi
exec "$@"
FROM nvidia/cuda:10.1-devel-centos7
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
RUN yum install -y epel-release && \
yum install -y libgomp libgfortran4 mysql-devel && \
rm -rf /var/cache/yum/*
COPY ./milvus /var/lib/milvus
COPY ./docker-entrypoint.sh /var/lib/milvus
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/var/lib/milvus/lib"
WORKDIR /var/lib/milvus
ENTRYPOINT [ "/var/lib/milvus/docker-entrypoint.sh" ]
CMD [ "start" ]
EXPOSE 19530
#!/bin/bash
set -e
if [ "$1" == 'start' ]; then
cd /var/lib/milvus/scripts && ./start_server.sh
fi
exec "$@"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册