7 AAI Developer Environment Setup
8 ================================
10 This guide will illustrate setting up an A&AI development environment in
13 For this exercise, I set up a new instance of Ubuntu in Virtualbox and
14 gave it 16G RAM, 200GB dynamically allocated storage, and 3 processors.
21 sudo apt install openjdk-8-jdk
23 Install single node hadoop/titan
24 --------------------------------
28 wget http://s3.thinkaurelius.com/downloads/titan/titan-1.0.0-hadoop1.zip
30 unzip titan-1.0.0-hadoop1.zip
32 cd titan-1.0.0-hadoop1
34 sudo ./bin/titan.sh start
41 sudo apt-get -y install haproxy
44 HA-Proxy version 1.6.3 2015/12/25
45 Copyright 2000-2015 Willy Tarreau
46 willy@haproxy.org http://haproxy.org/
48 - Install this haproxy.cfg file in /etc/haproxy
50 `haproxy.cfg <https://wiki.onap.org/download/attachments/10782088/haproxy.cfg?version=2&modificationDate=1501018863000&api=v2>`__
54 sudo cp aai.pem /etc/ssl/private/aai.pem
56 sudo chmod 640 /etc/ssl/private/aai.pem
58 sudo chown root:ssl-cert /etc/ssl/private/aai.pem
60 `aai.pem <https://wiki.onap.org/download/attachments/10782088/aai.pem?version=1&modificationDate=1501019585000&api=v2>`__
64 sudo mkdir /usr/local/etc/haproxy
66 - Add these hostnames to the loopback interface in /etc/hosts
70 127.0.0.1 localhost aai-traversal.api.simpledemo.openecomp.org aai-resouces.api.simpledemo.openecomp.org
76 sudo service haproxy restart
81 - First, follow the initial setup instructions in
82 `Setting Up Your Development Environment <https://wiki.onap.org/display/DW/Setting+Up+Your+Development+Environment>`__
90 git clone ssh://<username>@gerrit.onap.org:29418/aai/aai-common
92 git clone ssh://<username>@gerrit.onap.org:29418/aai/traversal
94 git clone ssh://<username>@gerrit.onap.org:29418/aai/resources
96 git clone ssh://<username>@gerrit.onap.org:29418/aai/logging-service
98 - If you did not originally create a settings.xml file when setting
99 up the dev environment, you may get an error on some of the repos
100 saying that oparent is unresolvable. Using the example
101 settings.xml file should solve this problem:
102 `Setting Up Your Development Environment#MavenExamplesettings.xml <https://wiki.onap.org/display/DW/Setting+Up+Your+Development+Environment#SettingUpYourDevelopmentEnvironment-MavenExamplesettings.xml>`__
104 Build aai-common, traversal, and resources
105 ------------------------------------------
109 cd ~/LF/AAI/aai-common
111 mvn clean install # Should result in BUILD SUCCESS
113 cd ~/LF/AAI/resources
115 mvn clean install # Should result in BUILD SUCCESS
117 cd ~/LF/AAI/logging-service
119 mvn clean install # Should result in BUILD SUCCESS
121 cd ~/LF/AAI/traversal
123 You might need to add the following to traversal/pom.xml to get traversal to build:
127 <repositories><repository><id>maven-restlet</id><name>Restlet repository</name><url>https://maven.restlet.com</url></repository></repositories>
131 mvn clean install # Should result in BUILD SUCCESS
136 1. Modify both titan-cached.properties and
137 titan-realtime.properties to the following (for all MS’s that
138 will connect to the local Cassandra backend)
142 storage.backend=\ *cassandra*
143 storage.hostname=\ *localhost*
146 ~/LF/AAI/resources/aai-resources/bundleconfig-local/etc/appprops/titan-cached.properties
149 ~/LF/AAI/resources/aai-resources/bundleconfig-local/etc/appprops/titan-realtime.properties
152 ~/LF/AAI/traversal/aai-traversal/bundleconfig-local/etc/appprops/titan-cached.properties
155 ~/LF/AAI/traversal/aai-traversal/bundleconfig-local/etc/appprops/titan-realtime.properties
157 6. The following property can be added to specify the keyspace
158 name, each time you do this step (g) should be done. If not
159 specified Titan will try to create/use a defaulted keyspace
164 storage.cassandra.keyspace=<keyspace name>
166 7. From the resources MS run the create db schema standalone program.
168 8. ***NOTE***: The first thing that would need to be done is adding
169 the schema to the local instance. (this will need to be done
170 whenever using a new keyspace or after wiping the data).
172 Runnable class org.onap.aai.dbgen.GenTester with the following vm
177 -DAJSC_HOME=~/LF/AAI/resources -DBUNDLECONFIG\_DIR="bundleconfig-local"
179 9. Here's the command I used, and it worked:
183 cd ~/LF/AAI; java -DAJSC_HOME=/home/jimmy/LF/AAI/resources/aai-resources
184 -DBUNDLECONFIG_DIR="bundleconfig-local" -cp
185 aai-common/aai-core/target/aai-core-1.1.0-SNAPSHOT.jar:resources/aai-resources/target/aai-resources.jar:resources/aai-resources/target/userjars/\*
186 org.onap.aai.dbgen.GenTester
188 Start the "resources" microservice
189 ----------------------------------
191 1. Resources runs on port 8446. Go to the resources directory
195 $ cd ~/LF/AAI/resources
197 2. Set the debug port to 9446
201 export MAVEN_OPTS="-Xms1024m -Xmx5120m -XX:PermSize=2024m
202 -Xdebug -Xnoagent -Djava.compiler=NONE
203 -Xrunjdwp:transport=dt_socket,address=9446,server=y,suspend=n"
205 3. Start the microservice
211 Verify the resources microservice (this example uses Postman utility for Google Chrome)
212 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
214 1. Use basic auth, user = AAI, pw = AAI
216 2. Set the X-TransactionId header (in the example below, the value is
219 3. Set the X-FromAppId header (in the example below, the value is
222 4. Perform a GET of https://127.0.0.1:8443/aai/v11/network/vces
224 5. You should see an error as below, 404 Not Found, ERR.5.4.6114.
225 This indicates that the service is functioning normally:
227 +------------------------------------------+
229 +------------------------------------------+
231 Start the "traversal" microservice
232 ----------------------------------
234 1. Traversal runs on port 8447. Go to the traversal directory:
238 $ cd ~/LF/AAI/traversal
240 2. Set the debug port to 9447
242 $ export MAVEN_OPTS="-Xms1024m -Xmx5120m -XX:PermSize=2024m
243 -Xdebug -Xnoagent -Djava.compiler=NONE
244 -Xrunjdwp:transport=dt_socket,address=9447,server=y,suspend=n"
246 3. Start the microservice
252 You should see something like this:
257 12:46:35.524:INFO:oejs.Server:com.att.ajsc.runner.Runner.main():
260 Verify the traversal microservice
261 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
263 1. Set up the widget models
264 This will set up the postman to add widget models: `Add Widget Models.postman_collection.json <https://wiki.onap.org/download/attachments/10782088/Add%20Widget%20Models.postman_collection.json?version=2&modificationDate=1501102559000&api=v2>`__ `NamedQuery.postman_collection.json <https://wiki.onap.org/download/attachments/10782088/NamedQuery.postman_collection.json?version=2&modificationDate=1501102582000&api=v2>`__
266 2. Create a runner using this file:
267 `models.csv <https://wiki.onap.org/download/attachments/10782088/models.csv?version=1&modificationDate=1501100140000&api=v2>`__
269 3. Run the test runner
272 4. Add a named query called "getComponentList" (this named query is used by VID):
274 `NamedQuery.postman_collection.json <ificationDate=1501102582000&api=v2>`__
280 `Add Instances for Named Query.postman_collection.json <https://wiki.onap.org/download/attachments/10782088/Add%20Instances%20for%20Named%20Query.postman_collection.json?version=1&modificationDate=1501102617000&api=v2>`__
282 6. Execute named-query:
283 `Execute Named Query.postman_collection.json <https://wiki.onap.org/download/attachments/10782088/Execute%20Named%20Query.postman_collection.json?version=1&modificationDate=1501102658000&api=v2>`__
284 You should see something like the following:
287 - Your A&AI instance is now running, both the resources and traversal microservices are working properly with a local titan graph.
289 - Next: `Tutorial: Making and Testing a Schema Change in A&AI <https://wiki.onap.org/pages/viewpage.action?pageId=10783023>`__
291 .. |image1| image:: media/image1.png
294 .. |image2| image:: media/image2.png
297 .. |image3| image:: media/image3.png
300 .. |image4| image:: media/image4.png