-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathOpenCogServices
174 lines (153 loc) · 5.17 KB
/
OpenCogServices
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
FROM singularitynet/opencog-deps:release-20200129
ARG snetd_version
ARG network
ARG ethereum_json_rpc_endpoint
ARG free_call_signer_address
ARG pvt_key_for_metering
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y \
nlohmann-json-dev \
libcurl4-gnutls-dev \
cxxtest \
build-essential \
autoconf \
libtool \
pkg-config \
libgflags-dev \
libgtest-dev \
clang \
libc++-dev \
git \
curl \
nano \
wget \
libudev-dev \
libusb-1.0-0-dev \
nodejs \
npm \
python3 \
python3-pip \
libboost-all-dev
RUN cd / && \
git clone https://github.com/singnet/cogutil.git && \
cd cogutil && \
git checkout release-20200129 && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
ldconfig
RUN cd / && \
git clone https://github.com/singnet/atomspace.git && \
cd atomspace && \
git checkout release-20200129 && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
ldconfig
RUN cd / && \
git clone https://github.com/singnet/ure.git && \
cd ure && \
git checkout release-20200129 && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
ldconfig
RUN cd / && \
git clone https://github.com/singnet/cogserver.git && \
cd cogserver && \
git checkout release-20200129 && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
ldconfig
RUN cd / && \
git clone https://github.com/singnet/attention.git && \
cd attention && \
git checkout release-20200129 && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
ldconfig
RUN cd / && \
git clone https://github.com/aconchillo/guile-json.git && \
cd /guile-json && \
apt-get install -y dh-autoreconf && \
autoreconf -vif && \
./configure --prefix=/usr --libdir=/usr/lib && \
make && \
make install && \
ldconfig
RUN cd / && \
git clone https://github.com/singnet/opencog.git && \
cd /opencog && \
git checkout release-20200129 && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
ldconfig
RUN cd / && \
git clone https://github.com/singnet/miner.git && \
cd /miner && \
git checkout release-20200129 && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
ldconfig
RUN cd / && \
git clone https://github.com/singnet/agi-bio.git && \
cd /agi-bio && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
ldconfig
RUN git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc /var/local/git/grpc && \
cd /var/local/git/grpc && \
git submodule update --init && \
make -j$(nproc) && make install && ldconfig && \
cd third_party/protobuf && \
make install && make clean && ldconfig && \
cd /var/local/git/grpc && make clean && \
cd / && \
rm -rf /var/local/git/grpc
COPY . /opencog-services
# install snet daemon
RUN export SNETD_GIT_VERSION=`curl -s https://api.github.com/repos/singnet/snet-daemon/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")' || echo "v2.0.2"` \
export SNETD_VERSION=${snetd_version:-${SNETD_GIT_VERSION}} && \
mkdir snet-daemon && \
cd snet-daemon && \
wget -q https://github.com/singnet/snet-daemon/releases/download/${SNETD_VERSION}/snet-daemon-${SNETD_VERSION}-linux-amd64.tar.gz && \
tar -xvzf snet-daemon-${SNETD_VERSION}-linux-amd64.tar.gz && \
mv ./snet-daemon-${SNETD_VERSION}-linux-amd64/snetd /usr/bin/snetd && \
cd .. && \
rm -rf snet-daemon*
# configure library path for opencog
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/opencog:/usr/local/lib/opencog/modules
ENV GUILE_AUTO_COMPILE=0
# set working directory
WORKDIR /opencog-services
# set private key for metering and etcd end-point
# RUN cat ./snetd_configs/snetd.mainnet.json | sed "s/__FREE_CALL_SIGNER_ADDRESS__/${free_call_signer_address}/g" > ./snetd_configs/snetd.mainnet.json.tmp && mv ./snetd_configs/snetd.mainnet.json.tmp ./snetd_configs/snetd.mainnet.json
RUN cat ./snetd_configs/snetd.mainnet.json | sed "s/__ETHEREUM_JSON_RPC_ENDPOINT__/${ethereum_json_rpc_endpoint}/g" > ./snetd_configs/snetd.mainnet.json.tmp && mv ./snetd_configs/snetd.mainnet.json.tmp ./snetd_configs/snetd.mainnet.json
RUN cat ./snetd_configs/snetd.mainnet.json | sed "s/__NETWORK__/${network}/g" > ./snetd_configs/snetd.mainnet.json.tmp && mv ./snetd_configs/snetd.mainnet.json.tmp ./snetd_configs/snetd.mainnet.json
RUN cat ./snetd_configs/snetd.mainnet.json | sed "s/__PVT_KEY_FOR_METERING__/${pvt_key_for_metering}/g" > ./snetd_configs/snetd.mainnet.json.tmp && mv ./snetd_configs/snetd.mainnet.json.tmp ./snetd_configs/snetd.mainnet.json
# compile source
RUN cd src && \
make
# set default workdir
WORKDIR /opencog-services