forked from TuGraph-family/tugraph-db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tugraph-runtime-centos7-Dockerfile
114 lines (102 loc) · 5.56 KB
/
tugraph-runtime-centos7-Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Docker hub image
# FROM centos:7.3.1611
# Alibaba Image
FROM reg.docker.alibaba-inc.com/fma/centos:7.3.1611
RUN yum -x filesystem update -y && yum install -y \
git \
gcc \
gcc-c++ \
make \
wget \
bzip2 \
unzip \
openssl-static \
java-1.8.0-openjdk* \
libcurl-devel.x86_64 \
unzip
# install g++ 8.4.0
# if it is not accessible, replace it with the link below
# http://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.gz
RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/gcc-8.4.0.tar.gz \
&& tar -xvf gcc-8.4.0.tar.gz && cd gcc-8.4.0 \
&& ./contrib/download_prerequisites && mkdir build && cd build \
&& ../configure CFLAGS=-fPIC CXXFLAGS=-fPIC -enable-checking=release -enable-languages=c,c++ -disable-multilib \
&& make -j4 && make install \
&& cp ./x86_64-*-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.25 /usr/lib64/ \
&& cd /usr/lib64 && ln -sf libstdc++.so.6.0.25 libstdc++.so.6 \
&& rm -rf /gcc-* && ln -s /usr/local/bin/gcc /usr/local/bin/cc
# install python3
# if it is not accessible, replace it with the link below
# https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz
RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/Python-3.6.9.tgz \
&& tar xf Python-3.6.9.tgz && cd Python-3.6.9 && ./configure --prefix=/usr/local \
&& make -j4 && make install \
&& python3 -m pip install --upgrade pip -i https://pypi.antfin-inc.com/simple/ --trusted-host pypi.antfin-inc.com \
&& python3 -m pip install nest_asyncio pexpect requests pytest httpx cython==3.0.0a11 sphinx myst_parser sphinx_panels sphinx_rtd_theme numpy==1.19.5 torch==1.10.2 dgl==1.0.0 ogb pandas==0.24.2 -i https://pypi.antfin-inc.com/simple/ --trusted-host pypi.antfin-inc.com \
&& rm -rf /Python*
# install cmake
# if it is not accessible, replace it with the link below
# https://cmake.org/files/v3.25/cmake-3.25.2.tar.gz
RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/cmake-3.25.2.tar.gz \
&& tar xf cmake-3.25.2.tar.gz && cd cmake-3.25.2 \
&& ./bootstrap && make -j4 && make install && rm -rf /cmake-3.*
# install boost-1.68
# if it is not accessible, replace it with the link below
# https://boostorg.jfrog.io/artifactory/main/release/1.68.0/source/boost_1_68_0.tar.gz
RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/boost_1_68_0.tar.gz \
&& wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/geometry-extensions.tar.gz \
&& tar xf boost_1_68_0.tar.gz && tar xf geometry-extensions.tar.gz \
&& cd boost_1_68_0 && ./bootstrap.sh --with-libraries=system,random,thread,filesystem,chrono,atomic,date_time,regex,stacktrace,log \
&& ./b2 ${JFLAG} cxxflags="-std=c++17 -fPIC" install \
&& sed -i '513s/BOOST_MPL_ASSERT_MSG((I < 1), INVALID_INDEX,/BOOST_MPL_ASSERT_MSG((I < 1), INVALID_INDEX_,/' /usr/local/include/boost/geometry/index/detail/predicates.hpp \
&& cp -r /extensions /usr/local/include/boost/geometry/ \
&& rm -rf /boost_* /extensions /geometry-extensions.tar.gz
#install maven
# if it is not accessible, replace it with the link below
# https://dlcdn.apache.org/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.tar.gz
RUN cd opt \
&& wget --no-check-certificate https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/apache-maven-3.8.7-bin.tar.gz \
&& tar xf apache-maven-3.8.7-bin.tar.gz \
&& rm apache-maven-*.tar.gz
# install tugraph
# specifies the path of the object storage where the installation package resides
ARG FILEPATH
# specifies installation package name for tugraph
ARG FILENAME
RUN wget ${FILEPATH}/${FILENAME}
RUN rpm -ivh ${FILENAME} && rm /${FILENAME}
# install tugraph demo
RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/tugraph-demo.tar.gz \
&& tar xf tugraph-demo.tar.gz && mkdir -p /var/lib/lgraph_demos \
&& cp -r tugraph-demo/movie /var/lib/lgraph_demos/movie \
&& cp -r tugraph-demo/the_three_body /var/lib/lgraph_demos/the_three_body \
&& cp -r tugraph-demo/three_kingdoms /var/lib/lgraph_demos/three_kingdoms \
&& cp -r tugraph-demo/wandering_earth /var/lib/lgraph_demos/wandering_earth \
&& cp tugraph-demo/setup.sh /setup.sh
# install node.js && pnpm
# if it is not accessible, replace it with the link below
# https://registry.npmmirror.com/-/binary/node/v16.6.0/node-v16.20.0-linux-x64.tar.gz
RUN wget https://tugraph-web.oss-cn-beijing.aliyuncs.com/tugraph/deps/node-v16.20.0-linux-x64.tar.gz \
&& tar xvf node-v16.20.0-linux-x64.tar.gz && cd node-v16.20.0-linux-x64/ \
&& ln -s /node-v16.20.0-linux-x64/bin/npm /usr/local/bin/ \
&& ln -s /node-v16.20.0-linux-x64/bin/node /usr/local/bin/ \
&& npm config set registry https://registry.npmmirror.com \
&& rm -rf /node-v16.20.0-linux-x64.tar.gz \
&& npm install --global yarn \
&& npm install --global pnpm \
&& ln -s /node-v16.20.0-linux-x64/lib/node_modules/yarn/bin/yarn /usr/local/bin/yarn \
&& ln -s /node-v16.20.0-linux-x64/bin/pnpm /usr/local/bin/pnpm \
&& yarn config set registry https://registry.npmmirror.com \
&& pnpm config set registry https://registry.npmmirror.com
# install tugraph-db-browser dependencies
RUN cd /usr/local/share/lgraph/tugraph-db-browser \
&& pnpm run boostrap \
&& pnpm run build
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk/jre/ \
LD_LIBRARY_PATH=/usr/local/lib64:/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server:$LD_LIBRARY_PATH \
PYTHONPATH=/usr/local/lib64:$PYTHONPATH \
PATH=/opt/apache-maven-3.8.7/bin:$PATH
# set locale
RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
ENV LANG zh_CN.utf8
ENV LC_ALL zh_CN.utf8