[DCAE] doc fixes for label
[dcaegen2.git] / docs / sections / design-components / DCAE-MOD / DCAE-MOD-User-Guide.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. _moduserguide:
4
5 ===================
6 DCAE MOD User Guide
7 ===================
8
9
10
11 -  `Types of Users and Usage
12    Instructions: <#DCAEMODUserGuide(draft)-TypesofUsersand>`__
13
14 -  `1.    Deployment of DCAE MOD components via Helm
15    charts <#DCAEMODUserGuide(draft)-1.DeploymentofD>`__
16
17    -  `Using DCAE MOD without an Ingress
18       Controller <#DCAEMODUserGuide(draft)-UsingDCAEMODwit>`__
19
20 -  `2.    Configuring DCAE
21    mod <#DCAEMODUserGuide(draft)-2.ConfiguringDC>`__
22
23 -  `3.    Design & Distribution
24    Flow <#DCAEMODUserGuide(draft)-3.Design&Distri>`__
25
26
27 Types of Users and Usage Instructions:
28 ======================================
29
30 +-------+-----------------------------+-----------------------------+
31 | Sr.No | User                        | Usage Instructions          |
32 +=======+=============================+=============================+
33 | 1.    | Developers who are looking  | -        Access the Nifi    |
34 |       | to onboard their mS         | Web UI url provided to you  |
35 |       |                             |                             |
36 |       |                             | -        Follow steps  2.c  |
37 |       |                             | to 2.f                      |
38 |       |                             |                             |
39 |       |                             | -        You should be able |
40 |       |                             | to see your microservices   |
41 |       |                             | in the Nifi Web UI by       |
42 |       |                             | clicking and dragging       |
43 |       |                             | ‘Processor’ on the canvas,  |
44 |       |                             | and searching for the name  |
45 |       |                             | of the                      |
46 |       |                             | micros                      |
47 |       |                             | ervice/component/processor. |
48 +-------+-----------------------------+-----------------------------+
49 | 2.    | Designers who are building  | -        Access the Nifi    |
50 |       | the flows through UI and    | Web UI url provided to you  |
51 |       | triggering distribution     |                             |
52 |       |                             | -        Follow steps 3 to  |
53 |       |                             | the end of the document     |
54 +-------+-----------------------------+-----------------------------+
55 | 3.    | Infrastructure/ Admins who  | -        Follow start to    |
56 |       | want to stand up DCAE Mod   | the end                     |
57 |       | and validate it             |                             |
58 +-------+-----------------------------+-----------------------------+
59
60
61 1.    Deployment of DCAE MOD components via Helm charts
62 =======================================================
63
64 The DCAE MOD components are deployed using the standard ONAP OOM
65 deployment process.   When deploying ONAP using the helm deploy command,
66 DCAE MOD components are deployed when the dcaemod.enabled flag is set to
67 true, either via a --set option on the command line or by an entry in an
68 overrides file.  In this respect, DCAE MOD is no different from any
69 other ONAP subsystem.
70
71 The default DCAE MOD deployment relies on an nginx ingress controller
72 being available in the Kubernetes cluster where DCAE MOD is being
73 deployed.   The Rancher RKE installation process sets up a suitable
74 ingress controller.   In order to enable the use of the ingress
75 controller, it is necessary to override the OOM default global settings
76 for ingress configuration.   Specifically, the installation needs to set
77 the following configuration in an override file::
78  
79   global:
80    ingress:
81     enabled: true
82     virtualhost:
83      enabled: false
84
85 When DCAE MOD is deployed with an ingress controller, several endpoints
86 are exposed outside the cluster at the ingress controller's external IP
87 address and port.   (In the case of a Rancher RKE installation, there is
88 an ingress controller on every worker node, listening at the the
89 standard HTTP port (80).)  These exposed endpoints are needed by users
90 using machines outside the Kubernetes cluster.
91
92 +--------------+--------------------------------------------------+--------------------------+
93 | **Endpoint** | ** Routes to (cluster                            | **Description**          |
94 |              | internal address)**                              |                          |
95 +==============+==================================================+==========================+
96 | /nifi        | http://dcaemod-designtool:8080/nifi              | Design tool Web UI       |
97 |              |                                                  |                          |
98 +--------------+--------------------------------------------------+--------------------------+
99 | /nifi-api    | http://dcaemod-designtool:8080/nifi-api          | Design tool API          |
100 |              |                                                  |                          |
101 +--------------+--------------------------------------------------+--------------------------+
102 | /nifi-jars   | http://dcaemod-nifi-registry:18080/nifi-jars     | Flow registry listing of |
103 |              |                                                  | JAR files built from     |
104 |              |                                                  | component specs          |
105 +--------------+--------------------------------------------------+--------------------------+
106 | /onboarding  | http://dcaemod-onboarding-api:8080/onboarding    | Onboarding API           |
107 |              |                                                  |                          |
108 +--------------+--------------------------------------------------+--------------------------+
109 | /distributor | http://dcaemod-distributor-api:8080/distributor  | Distributor API          |
110 |              |                                                  |                          |
111 +--------------+--------------------------------------------------+--------------------------+
112
113 | To access the design Web UI, for example, a user would use the URL :
114   http://*ingress_controller_address:ingress_controller_port*/nifi.
115 | *ingress_controller_address* is the the IP address or DNS FQDN of the
116   ingress controller and
117 | *ingress_controller_port* is the port on which the ingress controller
118   is listening for HTTP requests.  (If the port is 80, the HTTP default,
119   then there is no need to specify a port.)
120
121 There are two additional *internal* endpoints that users need to know,
122 in order to configure a registry client and a distribution target in the
123 design tool's controller settings.
124
125 +------------------------+--------------------------------------------+
126 | **Configuration Item** | **Endpoint URL**                           |
127 +========================+============================================+
128 | Registry client        | http://dcaemod-nifi-registry:18080         |
129 +------------------------+--------------------------------------------+
130 | Distribution target    | http://dcaemod-runtime-api:9090            |
131 +------------------------+--------------------------------------------+
132
133 Using DCAE MOD without an Ingress Controller
134
135
136 Not currently supported
137
138 2.    Configuring DCAE mod
139 ==========================
140
141 **a. Configure Nifi Registry url**
142
143 Next check Nifi settings by selecting the Hamburger button in the Nifi
144 UI. It should lead you to the Nifi Settings screen
145
146 |image16|
147
148 |image3|
149
150 Add a registry client. The Registry client url will be
151 http://dcaemod-nifi-registry:18080
152
153 |image4|
154
155
156 **b. Add distribution target which will be the runtime api url**
157
158 Set the distribution target in the controller settings
159
160 |image17|
161
162 Distribution target URL will be
163 `http://dcaemod-runtime-api:9090 <http://dcaemod-runtime-api:9090/>`__
164
165
166
167 Now let’s access the Nifi (DCAE designer) UI - http://<IPAddress>/nifi
168
169 IPAddress is the host address or the DNS FQDN, if there is one, for one of the Kubernetes nodes.
170
171 |image0|
172
173
174 **c. Get the artifacts to test and onboard.**
175
176 Let's fetch the artifacts/ spec files 
177
178 **Sample Component DCAE-VES-Collector :** https://git.onap.org/dcaegen2/collectors/ves/tree/dpo/spec/vescollector-componentspec.json
179
180 **Sample Data Format :** https://git.onap.org/dcaegen2/collectors/ves/tree/dpo/data-formats/VES-5.28.4-dataformat.json
181
182 For the purpose of onboarding, a Sample Request body should be of the type -::
183
184   { "owner": "<some value>", "spec": <some json object> }
185
186 where the json object inside the spec field can be a component spec json.
187
188 Request bodies of this type will be used in the onboarding requests you make using curl or the onboarding swagger interface.
189
190 **The prepared Sample Request body for a component dcae-ves-collector looks like
191 so –**
192
193 See :download:`VES Collector Spec <./Sample-Input-Files/Request-body-of-Sample-Component.json>`
194
195 **The prepared Sample request body for a sample data format  looks like so -**
196
197 See :download:`VES data Format <./Sample-Input-Files/Request-body-of-Sample-Data-Format.json>`
198
199
200
201 **d. To onboard a data format and a component**
202
203 Each component has a description that tells what it does.
204
205 These requests would be of the type
206
207 curl -X POST http://<onboardingapi host>/onboarding/dataformats     -H "Content-Type: application/json" -d
208 @<filepath to request>
209
210 curl -X POST http://<onboardingapi host>/onboarding/components     -H "Content-Type: application/json" -d
211 @<filepath to request>
212
213 In our case,
214
215 curl -X POST http://<IPAddress>/onboarding/dataformats     -H "Content-Type: application/json" -d @<filepath to request>
216
217 curl -X POST http://<IPAddress>/onboarding/components    -H "Content-Type: application/json" -d @<filepath to request>
218
219
220
221
222 **e. Verify the resources were created using**
223
224 curl -X GET http://<IPAddress>/onboarding/dataformats
225
226 curl -X GET http://<IPAddress>/onboarding/components
227
228 **f. Verify the genprocessor (which polls onboarding periodically to convert component specs to nifi processor), converted the component**
229
230 Open http://<IPAddress>/nifi-jars in a browser.
231
232 These jars should now be available for you to use in the nifi UI as
233 processors
234
235 |image1|
236
237 3.    Design & Distribution Flow
238 ================================
239
240
241 **a**. To start creating flows, we need to create a process group first. The
242 name of the process group will be the name of the flow. Drag and Drop on
243 the canvas, the ‘Processor Group’ icon from the DCAE Designer bar on the
244 top.
245
246 |image2|
247
248
249 Now enter the process group by double clicking it,
250
251 You can now drag and drop on the canvas ‘Processor’ icon from the top
252 DCAE Designer tab. You can search for a particular component in the
253 search box that appears when you attempt to drag the ‘Processor’ icon to
254 the canvas.
255
256 |image5|
257
258 If the Nifi registry linking worked, you should see the “Import” button
259 when you try to add a Processor or Process group to the Nifi canvas,
260 like so-
261
262 |image6|
263
264 By clicking on the import button, we can import already created saved
265 and version controlled flows from the Nifi registry, if they are
266 present.
267
268 |image7|
269
270 We can save created flows by version controlling them like so starting
271 with a 'right click' anywhere on the canvas-
272
273 |image8|
274
275 Ideally you would name the flow and process group the same, because
276 functionally they are similar.
277
278 |image9|
279
280 When the flow is checked in, the bar at the bottom shows a green
281 checkmark
282
283 |image10|
284
285 Note: Even if you move a component around on the canvas, and its
286 position on the canvas changes, it is recognized as a change, and it
287 will have to recommitted.
288
289 You can add additional components in your flow and connect them.
290
291 DcaeVesCollector connects to DockerTcagen2.
292
293 |image11|
294
295 |image12|
296
297 |image13|
298
299 Along the way you need to also provide topic names in the settings
300 section. These can be arbitrary names.
301
302 |image14|
303
304 To recap, see how DcaeVesCollector connects to DockerTcagen2. Look at
305 the connection relationships. Currently there is no way to validate
306 these relationships. Notice how it is required to name the topics by
307 going to Settings.
308
309 The complete flow after joining our components looks like so
310
311 |image15|
312
313
314 **b. Submit/ Distribute the flow:**
315
316 Once your flow is complete and saved in the Nifi registry, you can
317 choose to submit it for distribution.
318
319 |image18|
320
321 If the flow was submitted successfully to the runtime api, you should
322 get a pop up a success message like so -
323
324 |image19|
325
326 At this step, the design was packaged and sent to Runtime api.
327
328 The runtime is supposed to generate the blueprint out of the packaged
329 design/flow and push it to the DCAE inventory and the DCAE Dasboard.
330
331 **c. Checking the components in the DCAE Dashboard**
332
333 You should see the generated artifact/ blueprint in the DCAE Dashboard
334 dashboard at https://<IPAddress>:30418/ccsdk-app/login_external.htm in
335 our deployment. The name for each component will be appended by the flow
336 name followed by underscore followed by the component’s name.
337
338 The credentials to access the DCAE Dashboard 
339
340 Login: su1234
341 Password: fusion
342
343
344 |image20|
345
346 |image21|
347
348 |image22|
349
350 The generated Blueprint can be viewed.
351
352 |image23|
353
354 Finally, the generated Blueprint can be deployed.
355
356 |image24|
357
358 You can use/import the attached input configurations files to deploy. Drag and Drop these sample JSON files to fill in the configuration values.
359 See :download:`VES Collector Input Configuration <./Sample-Input-Files/ves-deploy.input.json>`
360 See :download:`Tcagen2 Input Configuration <./Sample-Input-Files/tca-deploy.input.json>`
361
362 |image25|
363
364 |image26|
365
366 .. |image0| image:: ../images/1.png
367    :width: 6.5in
368    :height: 1.08333in
369 .. |image1| image:: ../images/2.png
370    :width: 6.5in
371    :height: 1.58333in
372 .. |image2| image:: ../images/3.png
373    :width: 5.83333in
374    :height: 3.58333in
375 .. |image3| image:: ../images/4.png
376    :width: 4.91667in
377    :height: 2.16667in
378 .. |image4| image:: ../images/5.png
379    :width: 6.5in
380    :height: 2.66667in
381 .. |image5| image:: ../images/6.png
382    :width: 6.5in
383    :height: 3.33333in
384 .. |image6| image:: ../images/7.png
385    :width: 4.91667in
386    :height: 2.25in
387 .. |image7| image:: ../images/8.png
388    :width: 4.91667in
389    :height: 2.58333in
390 .. |image8| image:: ../images/9.png
391    :width: 6.5in
392    :height: 4.58333in
393 .. |image9| image:: ../images/10.png
394    :width: 6.5in
395    :height: 4in
396 .. |image10| image:: ../images/11.png
397    :width: 4.91667in
398    :height: 0.41667in
399 .. |image11| image:: ../images/12.png
400    :width: 6.33333in
401    :height: 3.16667in
402 .. |image12| image:: ../images/13.png
403    :width: 6in
404    :height: 2.66667in
405 .. |image13| image:: ../images/14.png
406    :width: 6.5in
407    :height: 3.41667in
408 .. |image14| image:: ../images/15.png
409    :width: 6.5in
410    :height: 3.58333in
411 .. |image15| image:: ../images/16.png
412    :width: 6.5in
413    :height: 2.25in
414 .. |image16| image:: ../images/17.png
415    :width: 6.5in
416    :height: 2.83333in
417 .. |image17| image:: ../images/18.png
418    :width: 6.5in
419    :height: 3.08333in
420 .. |image18| image:: ../images/19.png
421    :width: 4.91667in
422    :height: 1.91667in
423 .. |image19| image:: ../images/20.png
424    :width: 4.91667in
425    :height: 2.41667in
426 .. |image20| image:: ../images/21.png
427    :width: 6.5in
428    :height: 2.41667in
429 .. |image21| image:: ../images/22.png
430    :width: 6.5in
431    :height: 3in
432 .. |image22| image:: ../images/23.png
433    :width: 6.5in
434    :height: 2.16667in
435 .. |image23| image:: ../images/24.png
436    :width: 6.5in
437    :height: 2.83333in
438 .. |image24| image:: ../images/25.png
439    :width: 6.5in
440    :height: 3in
441 .. |image25| image:: ../images/26.png
442 .. |image26| image:: ../images/27.png
443
444