Skip to content

Commit

Permalink
Update Dockerfile to include Faiss library (#825)
Browse files Browse the repository at this point in the history
* Update field_extractor.cpp

* Update field_extractor.cpp

* Update field_extractor.cpp

* Update field_extractor.cpp

* Add faiss to Dockerfile

* Fix dockerfile

---------

Co-authored-by: Jingxuan Su <[email protected]>
Co-authored-by: lipanpan03 <[email protected]>
Co-authored-by: Jant1L <[email protected]>
  • Loading branch information
4 people authored Dec 20, 2024
1 parent 7197c9b commit 5a22d93
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ci/images/tugraph-compile-centos7-Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,18 @@ 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*

# 安装 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 ${JFLAG} && make install && cd .. \
&& rm -rf swig-4.0.2 swig-4.0.2.tar.gz

# 安装 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=generic -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 && \
Expand Down
14 changes: 14 additions & 0 deletions ci/images/tugraph-compile-centos8-Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,20 @@ 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*

# 安装 SWIG
RUN yum install -y pcre-devel \
&& 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 ${JFLAG} && make install && cd .. \
&& rm -rf swig-4.0.2 swig-4.0.2.tar.gz \
&& yum clean all

# 安装 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=generic -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 && \
Expand Down
20 changes: 20 additions & 0 deletions ci/images/tugraph-compile-ubuntu18.04-Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,26 @@ 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*

# install SWIG
RUN apt-get update \
&& apt-get install -y libpcre3-dev libgfortran5 \
&& 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 ${JFLAG} && make install && cd .. \
&& rm -rf swig-4.0.2 swig-4.0.2.tar.gz \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# 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 \
&& dpkg --purge gfortran gfortran-7 libgfortran-7-dev libgfortran4 libgfortran5 && ldconfig \
&& make ${JFLAG} && make install \
&& cd /tmp/openblas-faiss/faiss && cmake -B build -DCMAKE_BUILD_TYPE=Release -DFAISS_ENABLE_GPU=OFF -DFAISS_OPT_LEVEL=generic -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/lib/x86_64-linux-gnu/libgomp.so.1" -DBLAS_LIBRARIES=/opt/OpenBLAS/lib/libopenblas.so . -DPYTHON_EXECUTABLE=/usr/bin/python3 . \
&& make -C build ${JFLAG} && make -C build install \
&& apt update && apt install -y gfortran && apt-get clean && rm -rf /var/lib/apt/lists/* \
&& 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

Expand Down

0 comments on commit 5a22d93

Please sign in to comment.