blob: 2c87492e65a674fccef7271e5a333949671a3e3e [file] [log] [blame] [view]
Chengyu Fan8b92f122015-03-09 22:13:36 -06001ndn-atmos
Chengyu Fan8b92f122015-03-09 22:13:36 -06002============
3
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -06004### This is pre-release software
susmit shannigrahi33e57252015-06-16 13:17:09 -06005####If you have trouble running it, subscribe to <a href=http://www.netsec.colostate.edu/mailman/listinfo/ndn-sci> ndn-sci mailing list </a> and send an email.
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -06006
7 This software is designed to support ongoing climate model research at Colorado State University,
8 Berkeley and other institutes. Future plan includes porting this tool to suite other scientific
9 community such as High Energy Particle Physics.
10
11 Currently, this software provides an API to publish, query and retrieve scientific datasets using
12 NDN.
13
14Dependencies
15---------------------
16
17**The ndn-atmos is built based on several libraries**
18
19 * boost (Minimum required boost version is 1.48.0)
20 * jsoncpp 1.6.0 (https://github.com/open-source-parsers/jsoncpp.git)
21 * mysql 5.6.23 (http://www.mysql.com/)
22 * ndn-cxx (https://github.com/named-data/ndn-cxx.git)
23 * ChronoSync (https://github.com/named-data/ChronoSync.git)
Chengyu Fan31737f12016-01-12 21:08:50 -070024 * libzdb (http://www.tildeslash.com/libzdb/)
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -060025
26**Dependency for tools and translator library**
27
28 * python3
29 * netcdf4-python3
30 * mysql-connector-python3
31
32**The ndn-cxx and ChronoSync need some other prerequisites.**
33
34 * For OSX, the prerequisites can be installed using Homebrew:
Tyler Scott08263852015-07-31 19:05:52 -060035
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -060036<pre>
Chengyu Fan31737f12016-01-12 21:08:50 -070037 brew install boost sqlite3 mysql jsoncpp hdf5 openssl cryptopp protobuf libzdb
Susmit Shannigrahicad29ca2015-06-17 10:10:01 -060038 pip3 install mysql-connector-python --allow-all-external
39 pip3 install netCDF4
40
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -060041</pre>
42
43 * For Ubuntu, use the command below to install the prerequisites:
Tyler Scott08263852015-07-31 19:05:52 -060044
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -060045<pre>
46 sudo apt-get install libboost-all-dev libssl-dev libcrypto++-dev \
47 libsqlite3-dev libmysqlclient-dev libjsoncpp-dev \
48 protobuf-compiler libprotobuf-dev netcdf4-python \
Susmit Shannigrahicad29ca2015-06-17 10:10:01 -060049 python3-mysql.connector python3-pip libhdf5-dev \
Chengyu Fan31737f12016-01-12 21:08:50 -070050 libnetcdf-dev python3-numpy libzdb-dev
Susmit Shannigrahicad29ca2015-06-17 10:10:01 -060051
Tyler Scott08263852015-07-31 19:05:52 -060052 sudo pip3 install netCDF4
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -060053</pre>
Susmit Shannigrahicad29ca2015-06-17 10:10:01 -060054
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -060055 * For Fedora, use the command below to install the prerequisites:
Tyler Scott08263852015-07-31 19:05:52 -060056
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -060057<pre>
58 sudo yum install boost-devel openssl-devel cryptopp-devel sqlite3x-devel \
59 mysql-devel jsoncpp-devel protobuf-compiler protobuf-devel \
Chengyu Fan31737f12016-01-12 21:08:50 -070060 netcdf4-python3 mysql-connector-python3 libzdb-devel
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -060061</pre>
62
63
64
65Installing ndn-cxx
66---------------------
67
68* Download ndn-cxx source code. Use the link below for ndn-cxx code:
Tyler Scott08263852015-07-31 19:05:52 -060069
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -060070<pre>
71 git clone https://github.com/named-data/ndn-cxx.git
72 cd ndn-cxx
73 git checkout -b shared_library 7ed294302beee4979e97ff338dee0eb3eef51142
74</pre>
75
76* In library folder, build from the source code
Tyler Scott08263852015-07-31 19:05:52 -060077
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -060078<pre>
79 ./waf configure --disable-static --enable-shared
80 ./waf
81 ./waf install
82</pre>
83
84Installing ChronoSync
85---------------------
86
87* Download ChronoSync source code. Use the link below for the ChronoSync code:
Tyler Scott08263852015-07-31 19:05:52 -060088
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -060089<pre>
90 git clone https://github.com/named-data/ChronoSync.git
91 cd ChronoSync
92</pre>
93
94* Build from the source code
Tyler Scott08263852015-07-31 19:05:52 -060095
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -060096<pre>
97 ./waf configure
98 ./waf
99 ./waf install
100</pre>
101
102
103Installing ndn-atmos
104---------------------
105
106Follow the steps below to compile and install ndn-atmos:
107
108* Download the ndn-atmos source code. Use the command below:
Tyler Scott08263852015-07-31 19:05:52 -0600109
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600110<pre>
111 git clone https://github.com/named-data/ndn-atmos.git
112 cd ndn-atmos
113</pre>
114
115* Build ndn-atmos in the project folder
Tyler Scott08263852015-07-31 19:05:52 -0600116
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600117<pre>
118 ./waf configure
119 ./waf
120 ./waf install
121</pre>
122
123* To test ndn-atmos, please use the steps below:
Tyler Scott08263852015-07-31 19:05:52 -0600124
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600125<pre>
126 ./waf configure --with-tests
127 ./waf
128 ./build/catalog/unit-tests
129</pre>
130
Chengyu Fan55ba0982015-06-17 14:09:37 -0600131* Note that if you are using Fedora or Ubuntu, you may need to create a configuration file for
132ndn-cxx in /etc/ld.so.conf.d to include the path where the libndn-cxx.so is installed. Then
Tyler Scott08263852015-07-31 19:05:52 -0600133update using `ldconfig`
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600134
Chengyu Fan55ba0982015-06-17 14:09:37 -0600135*For example, if the libndn-cxx.so is installed in /usr/local/lib64, you need to include
136this path in a "ndn-cxx.conf" file in /etc/ld.so.conf.d directory, and then run "ldconfig".
137
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600138
139Running ndn-atmos
140--------------------------
141
142Install translator library
143---------------------------
1441. For the translator, ndn_cmmap_translator library is required to be in PYTHONPATH
Tyler Scott08263852015-07-31 19:05:52 -0600145
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600146<pre>
Susmit Shannigrahicad29ca2015-06-17 10:10:01 -0600147 export PYTHONPATH="full path to /ndn-atmos/lib":$PYTHONPATH
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600148</pre>
149
150
151Initializing Database
152---------------------
153* Create a database using standard mysql tool.
154* You also need to create a user and set a password to connect to the database the database.
155* Note that you will need to have actual CMIP5 data to run the tool.
156* Run
Tyler Scott08263852015-07-31 19:05:52 -0600157
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600158<pre>
Tyler Scott08263852015-07-31 19:05:52 -0600159 python3 insert_names.py
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600160</pre>
Tyler Scott08263852015-07-31 19:05:52 -0600161
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600162* Input full path to the filename and config file to translate
163* A CMIP5 config file is located under
Tyler Scott08263852015-07-31 19:05:52 -0600164</pre> /ndn-atmos/lib/ndn_cmmap_translators/etc/cmip5/cmip5.conf ```
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600165* This will create a table named cmip5 and insert the names into the table
166
167
168Starting NFD
169------------
170NFD is the NDN forwarding daemon.
171
172* Download NFD source code. Use the link below for the NFD code:
Tyler Scott08263852015-07-31 19:05:52 -0600173
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600174<pre>
175 git clone https://github.com/named-data/NFD.git
176 cd NFD
177 git checkout NFD-0.3.2
178 git submodule init && git submodule update
179</pre>
180
181* Build NFD
Tyler Scott08263852015-07-31 19:05:52 -0600182
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600183<pre>
184 ./waf configure
185 ./waf
186 ./waf install
187</pre>
188
189* Run NFD
Tyler Scott08263852015-07-31 19:05:52 -0600190
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600191<pre>
192 nfd-start
193</pre>
194
Chengyu Fan55ba0982015-06-17 14:09:37 -0600195* Note that if you are using Fedora or Ubuntu, you may need to create a configuration file for
196ndn-cxx in /etc/ld.so.conf.d to include the path where the libndn-cxx.so is installed. Then
197update using command below:
Tyler Scott08263852015-07-31 19:05:52 -0600198
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600199<pre>
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600200 ldconfig
201</pre>
202
Chengyu Fan55ba0982015-06-17 14:09:37 -0600203*For example, if the libndn-cxx.so is installed in /usr/local/lib64, you need to include
204this path in a "ndn-cxx.conf" file in /etc/ld.so.conf.d directory, and then run "ldconfig".
205
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600206
207Launching atmos-catalog
208-----------------------
209
210* Make sure database is initialized and running
211
212* Create catalog configuration file
Tyler Scott08263852015-07-31 19:05:52 -0600213
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600214<pre>
215 cp /usr/local/etc/ndn-atmos/catalog.conf.sample /usr/local/etc/ndn-atmos/catalog.conf
216</pre>
217
218* Edit the configuration file /usr/local/etc/ndn-atmos/catalog.conf. Modify the database parameters
219in both the queryAdapter and publishAdapter sections.
220* Note that the database parameters in these two sections may be different to provide different
221privileges.
222
223
224* Run ndn-atmos
Tyler Scott08263852015-07-31 19:05:52 -0600225
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600226<pre>
227 atmos-catalog
228</pre>
229
230
231Starting front end
232------------------
233
234* Open the client folder in ndn-atmos
235
236* Checkout the ndn-js in the client folder. Use the link blow:
Tyler Scott08263852015-07-31 19:05:52 -0600237
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600238<pre>
239 git clone http://github.com/named-data/ndn-js.git
240 cd ndn-js
Susmit Shannigrahicad29ca2015-06-17 10:10:01 -0600241 git checkout v0.8.1
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600242</pre>
243
244* Start python simple server in the client folder (ndn-atmos/client)
Tyler Scott08263852015-07-31 19:05:52 -0600245
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600246<pre>
247 python -m SimpleHTTPServer
248</pre>
249
250* Open project query page in a web browser
Tyler Scott08263852015-07-31 19:05:52 -0600251
susmit shannigrahi4bc4ce82015-06-15 12:14:08 -0600252<pre>
253 http://localhost:8000/query/query.html
254</pre>