From 2558dd94f1f80979be787b7d60b5a6b7bee6d828 Mon Sep 17 00:00:00 2001 From: Wang Zhiyong Date: Sat, 30 Nov 2024 10:43:48 +0000 Subject: [PATCH] fix dockerfile --- ci/images/tugraph-compile-centos7-Dockerfile | 24 ++--------- ci/images/tugraph-compile-centos8-Dockerfile | 43 ++++++++++--------- .../tugraph-compile-ubuntu18.04-Dockerfile | 14 ------ 3 files changed, 25 insertions(+), 56 deletions(-) diff --git a/ci/images/tugraph-compile-centos7-Dockerfile b/ci/images/tugraph-compile-centos7-Dockerfile index 16e9b7dd43..51278907c4 100644 --- a/ci/images/tugraph-compile-centos7-Dockerfile +++ b/ci/images/tugraph-compile-centos7-Dockerfile @@ -340,34 +340,16 @@ RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/tabulate-3 && tar zxf tabulate-3a5830.tar.gz && cp -rf tabulate/include/tabulate /usr/local/include \ && rm -rf /tabulate* -RUN sed -i '3 s/-lgomp/-l:libgomp.a/' /usr/local/lib64/libgomp.spec - -# install epel -RUN yum install -y epel-release && yum makecache - -# install openblas -RUN yum install -y openblas-devel - -# install swig -RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/swig-4.0.2.tar.gz \ - && tar -xzvf swig-4.0.2.tar.gz && cd swig-4.0.2 && ./configure \ - && make && make install && cd .. \ - && rm -rf swig-4.0.2 swig-4.0.2.tar.gz - -# install faiss -RUN wget -O /tmp/openblas-faiss.tar.gz https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/openblas-faiss.tar.gz \ - && tar -xzvf /tmp/openblas-faiss.tar.gz -C /tmp && cd /tmp/openblas-faiss/OpenBLAS && make ${JFLAG} && make install \ - && cd /tmp/openblas-faiss/faiss && cmake -B build -DCMAKE_BUILD_TYPE=Release -DFAISS_ENABLE_GPU=OFF -DFAISS_OPT_LEVEL=avx2 -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR=lib -DOpenMP_CXX_FLAGS="-fopenmp" -DOpenMP_CXX_LIB_NAMES="gomp" -DOpenMP_gomp_LIBRARY="/usr/lib64/libgomp.so.1" -DBLAS_LIBRARIES=/opt/OpenBLAS/lib/libopenblas.so . && make -C build ${JFLAG} && make -C build install \ - && rm -rf /tmp/openblas-faiss /tmp/openblas-faiss.tar.gz && ldconfig - # install vsag RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/vsag-0.11.5.tar.gz -O /tmp/vsag.tar.gz && \ cd /tmp && mkdir vsag && tar -xzf vsag.tar.gz --strip-components=1 -C vsag && cd vsag && \ yum install -y libgfortran5.x86_64 && ln -s /usr/lib64/libgfortran.so.5.0.0 /usr/local/lib/libgfortran.so && ldconfig && \ mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_INTEL_MKL=OFF -DDISABLE_AVX2_FORCE=ON -DDISABLE_AVX512_FORCE=ON .. && \ - make -j10 && make install && \ + make ${JFLAG} && make install && \ cd / && rm -rf /tmp/vsag* +RUN sed -i '3 s/-lgomp/-l:libgomp.a/' /usr/local/lib64/libgomp.spec + ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk \ LD_LIBRARY_PATH=/usr/local/lib64/lgraph:/usr/local/lib64:/usr/local/lib:/usr/lib/jvm/java-11-openjdk/lib/server:$LD_LIBRARY_PATH \ PYTHONPATH=/usr/local/lib64/lgraph:/usr/local/lib64:$PYTHONPATH \ diff --git a/ci/images/tugraph-compile-centos8-Dockerfile b/ci/images/tugraph-compile-centos8-Dockerfile index 7e5cf651a3..5c69b5f948 100644 --- a/ci/images/tugraph-compile-centos8-Dockerfile +++ b/ci/images/tugraph-compile-centos8-Dockerfile @@ -6,9 +6,11 @@ FROM reg.docker.alibaba-inc.com/fma/centos:8.4.2105 ARG JFLAG=-j8 ARG PYPI="-i https://pypi.antfin-inc.com/simple/ --trusted-host pypi.antfin-inc.com" -RUN rm -rf /etc/yum.repos.d \ - && curl -O https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/yum.repos.d.tar.gz \ - && tar -xf yum.repos.d.tar.gz && mv yum.repos.d /etc/yum.repos.d && rm yum.repos.d.tar.gz +RUN sed -e "s|^mirrorlist=|#mirrorlist=|g" \ + -e "s|^#baseurl=http://mirror.centos.org/centos/\$releasever|baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/8.4.2105|g" \ + -e "s|^#baseurl=http://mirror.centos.org/\$contentdir/\$releasever|baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/8.4.2105|g" \ + -i.bak \ + /etc/yum.repos.d/CentOS-*.repo && yum clean all && yum makecache RUN yum update -y && yum install -y \ git \ @@ -243,6 +245,19 @@ RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/rocksdb-v7 && tar zxf rocksdb-v7.8.3.tar.gz && cd rocksdb-7.8.3 && cmake -DCMAKE_BUILD_TYPE=Release -DPORTABLE=ON -DFORCE_SSE42=ON -DWITH_JEMALLOC=ON \ && make ${JFLAG} && make install && rm -rf /rocksdb* +# set maven mirror +RUN mkdir -p ~/.m2 \ + && echo '' > ~/.m2/settings.xml \ + && echo ' ' >> ~/.m2/settings.xml \ + && echo ' ' >> ~/.m2/settings.xml \ + && echo ' alimaven' >> ~/.m2/settings.xml \ + && echo ' central' >> ~/.m2/settings.xml \ + && echo ' https://maven.aliyun.com/nexus/content/groups/public/' >> ~/.m2/settings.xml \ + && echo ' ' >> ~/.m2/settings.xml \ + && echo ' ' >> ~/.m2/settings.xml \ + && echo '' >> ~/.m2/settings.xml \ + && cat ~/.m2/settings.xml + # install antlr4-4.13.0 # if it is not accessible, replace it with the link below # https://github.com/antlr/antlr4/archive/refs/tags/4.13.0.tar.gz @@ -328,30 +343,16 @@ RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/tabulate-3 && tar zxf tabulate-3a5830.tar.gz && cp -rf tabulate/include/tabulate /usr/local/include \ && rm -rf /tabulate* -RUN sed -i '3 s/-lgomp/-l:libgomp.a/' /usr/local/lib64/libgomp.spec - -RUN yum install -y epel-release pcre-devel yum-utils - -# install swig -RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/swig-4.0.2.tar.gz \ - && tar -xzvf swig-4.0.2.tar.gz && cd swig-4.0.2 && ./configure \ - && make && make install && cd .. \ - && rm -rf swig-4.0.2 swig-4.0.2.tar.gz - -# install faiss -RUN wget -O /tmp/openblas-faiss.tar.gz https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/openblas-faiss.tar.gz \ - && tar -xzvf /tmp/openblas-faiss.tar.gz -C /tmp && cd /tmp/openblas-faiss/OpenBLAS && make && make install \ - && cd /tmp/openblas-faiss/faiss && cmake -B build -DCMAKE_BUILD_TYPE=Release -DFAISS_ENABLE_GPU=OFF -DFAISS_OPT_LEVEL=avx2 -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR=lib -DOpenMP_CXX_FLAGS="-fopenmp" -DOpenMP_CXX_LIB_NAMES="gomp" -DOpenMP_gomp_LIBRARY="/usr/lib64/libgomp.so.1" -DBLAS_LIBRARIES=/opt/OpenBLAS/lib/libopenblas.so . && make -C build && make -C build install \ - && rm -rf /tmp/openblas-faiss /tmp/openblas-faiss.tar.gz && ldconfig - # install vsag RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/vsag-0.11.5.tar.gz -O /tmp/vsag.tar.gz && \ cd /tmp && mkdir vsag && tar -xzf vsag.tar.gz --strip-components=1 -C vsag && cd vsag && \ - yum install -y libgfortran5.x86_64 && ln -s /usr/lib64/libgfortran.so.5.0.0 /usr/local/lib/libgfortran.so && ldconfig && \ + yum install -y libgfortran.x86_64 && ln -s /usr/lib64/libgfortran.so.5.0.0 /usr/local/lib/libgfortran.so && ldconfig && \ mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_INTEL_MKL=OFF -DDISABLE_AVX2_FORCE=ON -DDISABLE_AVX512_FORCE=ON .. && \ - make -j10 && make install && \ + make ${JFLAG} && make install && \ cd / && rm -rf /tmp/vsag* +RUN sed -i '3 s/-lgomp/-l:libgomp.a/' /usr/local/lib64/libgomp.spec + ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk \ LD_LIBRARY_PATH=/usr/local/lib64/lgraph:/usr/lib64:/usr/local/lib64:/usr/local/lib:/usr/lib/jvm/java-11-openjdk/lib/server:$LD_LIBRARY_PATH \ PYTHONPATH=/usr/local/lib64/lgraph:/usr/local/lib64:$PYTHONPATH \ diff --git a/ci/images/tugraph-compile-ubuntu18.04-Dockerfile b/ci/images/tugraph-compile-ubuntu18.04-Dockerfile index 072b52db01..3b3df93386 100644 --- a/ci/images/tugraph-compile-ubuntu18.04-Dockerfile +++ b/ci/images/tugraph-compile-ubuntu18.04-Dockerfile @@ -339,20 +339,6 @@ RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/tabulate-3 && tar zxf tabulate-3a5830.tar.gz && cp -rf tabulate/include/tabulate /usr/local/include \ && rm -rf /tabulate* -RUN apt-get install -y libpcre3-dev libgomp1 - -# install swig -RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/swig-4.0.2.tar.gz \ - && tar -xzvf swig-4.0.2.tar.gz && cd swig-4.0.2 && ./configure \ - && make && make install && cd .. \ - && rm -rf swig-4.0.2 swig-4.0.2.tar.gz - -# install faiss -RUN wget -O /tmp/openblas-faiss.tar.gz https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/openblas-faiss.tar.gz \ - && tar -xzvf /tmp/openblas-faiss.tar.gz -C /tmp && cd /tmp/openblas-faiss/OpenBLAS && make ${JFLAG} && make install \ - && cd /tmp/openblas-faiss/faiss && cmake -B build -DCMAKE_BUILD_TYPE=Release -DFAISS_ENABLE_GPU=OFF -DFAISS_OPT_LEVEL=avx2 -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR=lib -DBLAS_LIBRARIES=/opt/OpenBLAS/lib/libopenblas.so . && make -C build ${JFLAG} && make -C build install \ - && rm -rf /tmp/openblas-faiss /tmp/openblas-faiss.tar.gz && ldconfig - # install vsag RUN apt-get install -y gfortran && ln -s /usr/lib/x86_64-linux-gnu/libgfortran.so.4 /usr/local/lib/libgfortran.so