[SO] Release so 1.13.0 image
[so.git] / readme.md
1 # ONAP SO
2
3 ----
4 ----
5
6 # Introduction
7
8 SO (Service Orchestrator) project is mostly composed of java & groovy code along with camunda BPMN code flow.
9
10 SO consists of following sub-components:
11  - API Handler (*/mso-api-handlers*) set of REST services for incoming requests (northbound clients)
12  - BPMN Execution Engine (*/bpmn*) contains all business logic of service order execution  and interact with AAI, SDNC, requestdb, catalogdb etc. Exposes rest interface for Api Handler
13  - Set of adapters (*/adapters*) adapters that interact with ONAP components (SDNC, VFC, Request DB, Catalog DB) or external components (VNFM, Openstack)
14  - Data Stores: Catalog DB (configuration is here */mso-catalog-db*) to store service and resource models, recipes and workflows
15  - SDC Client and Controller (*/asdc-controller) to receive updated models from SDC and populate Catalog DB
16  - SO Monitoring (*/so-monitoring) service to monitor BPMN workflow execution status
17
18 # Compiling SO
19
20 SO can be compiled with `mvn clean install`. By default it executes:
21  - the standard unit tests
22  - the Spring integration tests
23  - javadoc and doclint creation
24  - BUT *does not build the docker images*
25
26 Integration tests are started with the following profile `-P with-integration-tests`
27
28 You can disable the integration tests by executing: `mvn clean install -DskipTests=true -Dmaven.test.skip=true`
29
30 You can disable the javadoc or doclint creation by executing `mvn clean install -Dmaven.javadoc.skip=true -Dadditionalparam=-Xdoclint:none`
31
32 # Code Formatting
33
34 Your build may fail if you don't follow Code Guidelines. In order to format files run `mvn process-sources -P format`
35
36 # Building Docker images
37
38 You can build docker images by executing profile "docker": `mvn clean install -P docker`
39
40 If you want to build docker images with out executing test and javadoc, then run the below command `mvn clean install -U -DskipTests=true -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dadditionalparam=-Xdoclint:none -P docker`
41
42 # Getting the containers
43
44 ONAP SO containers are stored on [here](https://nexus3.onap.org:10002) for the releases, and [here](https://nexus3.onap.org:10003) for the snapshots
45
46 The following Docker images are the actual deployment images used for running SO
47
48 | Name            | Tag     | Description                                                                                                                   |
49 |-----------------|---------|-------------------------------------------------------------------------------------------------------------------------------|
50 | onap/so/api-handler-infra | 1.4.4 | MSO Api handler for SO REST service entry point |
51 | onap/so/bpmn-infra | 1.4.4 | BPMN-Infra contains business logic of execution flow |
52 | onap/so/catalog-db-adapter | 1.4.4 | CatalogDB to interact with mariaDB catalogdb schema |
53 | onap/so/openstack-adapter | 1.4.4 | Adapter to interact with Openstack as a VIM |
54 | onap/so/request-db-adapter | 1.4.4 | RequestDB to interact with mariaDB requestdb schema |
55 | onap/so/sdc-controller | 1.4.4 | SDC-controller to interact with SDC module |
56 | onap/so/sdnc-adapter | 1.4.4 | SDNC Adapter to interacts with SDNC module |
57 | onap/so/so-monitoring | 1.4.4 | SO Monitoring for monitoring the SO workflows |
58 | onap/so/vfc-adapter | 1.4.4 | Adapter to interact with VFC module |
59 | onap/so/vnfm-adapter | 1.4.4 | Adapter to interact with external VNFMs through SOL003 interface |
60 | library/mariadb | 10.1.11 | MariaDB image from Docker.io, this image hosts the database and is preloaded with SO schema and configuration at startup |
61
62 # Starting SO
63
64 ### docker-compose
65
66 You can use docker-compose to start SO. For running docker-compose, you need to checkout docker-config project.
67
68 docker-config code is located in a single git repository named *so/docker-config*
69
70 To start SO:
71  - `cd docker-config`
72  - set up DOCKER_HOST env variable with your specific host+port i.e. `export DOCKER_HOST=tcp://127.0.0.1:2375`
73  - run helper script `./deploy.sh` (OR `docker-compose up -d`)
74
75 You can also run / restart independent docker, like to run bpmn-infra docker, use command `docker-compose up -d bpmn-infra`
76
77 **NOTE**: container *onap/so/vnfm-adapter* is not started via docker-compose script
78
79 ### Heat template
80
81 A heat template that can be used on RackSpace to spin up the SO Host VM and run docker-compose is currently being built by the Demo Team.
82
83 # Accessing SO
84
85 SO UIs are not really used for operating SO, but they provide information on what is currently happening and get an insight on the components.
86
87 ### Spring Boot Actuator Endpoints
88
89 Some of SO components (Api Handler, SO monitoring) use Embedded Tomcat from Spring boot to run application. 
90 To monitor the app, Actuator endpoint can be used:
91
92  - /manage/health - Shows application health information
93  - /manage/info - Displays arbitrary application info
94
95 ### SO Camunda Cockpit console
96
97 SO orchestration processes can be monitored with the [Camunda Engine cockpit UI](https://camunda.org/features/cockpit/). It gives an insight about the available processes, allows to trigger them manually and provides monitoring of the currently running processes
98
99 **IMPORTANT NOTE** : since ONAP SO only uses Camunda Community version, which don't show history of running processes - SO-Monitoring component was developed for that purpose.
100
101 #### Accessing the Cockpit
102
103 The cockpit is available at the following address : http://containerHostname:8080/cockpit
104
105 When the container is started it will create a default admin user (admin) with the password `placeholder` for UI
106
107 The cockpit gives an overview of the available BPMN (orchestration) processes (with a visual representation).
108 It is also possible to trigger them from the UI if you know the parameters that are needed.
109
110 ***screenshots to be uploaded when rrelease***
111
112 ### SO APIs
113
114 Most of the SO features within ONAP SO are triggered by using **RESTful interfaces**. SO supports both **HTTP** and **HTTPS**, but is configured on this release with HTTP only using Basic Authentification.
115
116 The SO APIs are configured to accept requests having a **basic auth. header** set with various **username and password** depending on which API is being triggered.
117
118 All API endpoints are exposed on port **8080**, it is possible to reach all SO subsystems directly with the proper query (see more information below on how to test SO functions)
119
120 ##### Main API endpoints
121
122 - ***to be completed*** APIHandler health checks
123 - ***to be completed*** VID API
124
125 VID endpoint : http://vm1.mso.simpledemo.onap.org:8080/ecomp/mso/infra/serviceInstances/v2
126
127 The typical easy way to trigger these endpoints is to use a RESTful client or automation framework.
128
129 # Configuration of SO
130
131 It is important to understand that the Docker containers are using a configuration file (JSON) in order to provision SO basic configuration, in the above Jenkins Job, Jenkins pulls that JSON file from the SO repository, any other mean to provide that JSON file (for specific environments) would also work.
132
133 Once the deployment of the docker images is done, you will need to configure your installation to be able to interact with all the components that SO needs.
134
135 Change the environment file located here : **/shared/mso-docker.json** then run the following command `chef-solo -c /var/berks-cookbooks/chef-repo/solo.rb -o recipe[mso-config::apih],recipe[mso-config::bpmn],recipe[mso-config::jra]`
136
137 **Important note:** The host SO is mapped automatically to c1.vm1.mso.simpledemo.onap.org in /etc/host of the docker image so you can keep mso:8080 when you want to mention the APIH, JRA or Camunda host.
138
139 Here are the main parameters you could change:
140
141 - mso_config_path: define the path where the configuration files for APIH, JRA and Camunda will be deployed. This parameter should not be changed.
142 - In the section mso-bpmn-urn-config, adaptersOpenecompDbEndpoint: This configuration must point to the APIH hostname. It should have this form: http://mso:8080/dbadapters/RequestsDbAdapter Do not change it if you are not sure.
143 - In the section mso-bpmn-urn-config, aaiEndpoint: This parameter should point to the A&AI component. It should be something like: https://c1.vm1.aai.simpledemo.opap.org:8443
144 - In the section mso-bpmn-urn-config, aaiAuth: This parameter is the encrypted value of login:password to access the A&AI server. The key used to encrypt is defined in the parameter msoKey.
145 - In the section asdc-connection, asdcAddresss: Change the values with the value provided by the ASDC team. Possible value: https://c2.vm1.sdc.simpledemo.onap.org:8443 The password field may be changed as well.
146 - In the section mso-sdnc-adapter-config, sdncurls: Change all the values with the value provided by the SDNC team. Possible value: https://c1.vm1.sdnc.simpledemo.onap.org:8443/... ? The sdncauth field may be changed as well.
147 - In the section mso-appc-adapter-config, appc_url: Change the value with the value provided by the APPC team. Possible value: http://c1.vm1.appc.simpledemo.onap.org:8080 ? The appc_auth field may be changed as well.
148 - In the section mso-po-adapter-config, identity_url: Change the values with the value provided by the PO team. Possible value: https://identity.api.rackspacecloud.com/v2.0 ?
149
150 The credentials are defined in 2 places:
151
152 - In the application.yaml in projects
153 - application.yaml can be overriden in two places: in *so/docker-config* repository and directories *so/docker-config/volumes/so/config/so-monitoring/onapheat/override.yaml*
154 - In *oom* repository (if intstallation is done via oom)
155
156 You can find default users there for specific so component.
157 **Note** that these default users should be changed.
158
159 You can replace the authentication in the environment by the value returned by the following API `GET on http://c1.vm1.mso.simpledemo.onap.org:8080/asdc/properties/encrypt/{value}/{cryptKey}` where {value} is the string login:password and cryptKey (also defined in the environment) is the key to use to encrypt the credentials
160
161 # Logging
162
163 ### EELF
164
165 EELF framework is used for **specific logs** (audit, metric and error logs). They are tracking inter component logs (request and response) and allow to follow a complete flow through the SO subsystem
166
167 Logs are located at the following locations in SO containers :
168
169 - /var/log/ecomp/MSO (each module has its own folder)
170
171 The DEBUG mode is enabled by module and has to be re-enabled if the application restart.
172
173 It can be enabled with a GET on the following APIs:
174 - Camunda (no authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/mso/logging/debug
175 - APIH Infra (use any user with role InfraPortal-Client for authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/ecomp/mso/infra/logging/debug
176 - ASDC (no authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/asdc/logging/debug
177 - DBAdapter (no authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/dbadapters/logging/debug
178 - Network adapter (no authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/networks/rest/logging/debug
179 - SDNC adapter (use any user with role MSO-Client for authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/adapters/rest/logging/debug
180 - VNF adapter (no authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/vnfs/rest/logging/debug
181 - Tenant adapter (no authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/tenants/rest/logging/debug
182 - APPC adapter (no authentication): http://c1.vm1.mso.simpledemo.onap.org:8080/appc/rest/logging/debug
183
184 # Testing SO Functionalities
185
186 For this first release of SO, the queries to start the various VNFs should come first through API Handler.
187
188 To help with the testing we are providing here a sample [SoapUI](https://www.soapui.org/) project [file](add link when rrealease) with the main queries that VID should send to SO
189
190 ### To simulate Loading of Artifacts & models (bypass ASDC)i
191
192 The MariaDB container can load up special SQL scripts that simulates the loading of ASDC components (as if they were received through the ASDC client)
193
194 Simply use the load ability embedded to run the 'preload SQL' script for vFirewall or vDNS
195
196 ### Once the HEAT artifacts are loaded into SO
197
198 It is also possible to simulate queries to the PO (platform orchestrator) adapter of SO (thus bypassing BPMN flows and API handler) to verify SO interaction with Rackspace and verify the behavior of the Adapter (so that it loads HEAT and connect to Rackspace and instantiate elements)
199
200 Below is a query used from FireFox RESTClient plugin to trigger SO adapter directly (replace values accordingly)
201
202 ```
203  POST http://<containername>:8080/vnfs/rest/v1/vnfs/5259ba4a-cf0d-4791-9c60-9117faa5cdea/vf-modules
204 Header: content-type: application/json
205 +Authorization
206 login/password BPELClient/password1$F
207
208  {"createVfModuleRequest":{"messageId":"ec9537bb-c837-477f-86a5-21c717be96f1-1479156376597","skipAAI":true,"notificationUrl":"http://bpmnhost:8080/mso/vnfAdapterRestNotify","cloudSiteId":"RACKSPACE","tenantId":"1015548","vnfId":"5259ba4a-cf0d-4791-9c60-9117faa5cdea","vnfType":"vfw-service/VFWResource-1","vnfVersion":"1.0","vfModuleId":"7d8412bb-b288-44ff-92ef-723018f940fc","vfModuleName":"MSO_VFW_TEST","vfModuleType":"VF_RI1_VFW::module-1","volumeGroupId":"","volumeGroupStackId":"","baseVfModuleId":"","baseVfModuleStackId":"","requestType":"","failIfExists":true,"backout":true,"vfModuleParams":{"vf_module_name":"MSO_VFW_TEST","vnf_name":"vfw-service/VFWResource-1","vnf_id":"5259ba4a-cf0d-4791-9c60-9117faa5cdea","vf_module_id":"7d8412bb-b288-44ff-92ef-723018f940fc"},"msoRequest":{"requestId":"ec9537bb-c837-477f-86a5-21c717be96f1","serviceInstanceId":"369cdf85-1b61-41ff-b637-c6b7dd020326"},"synchronous":false}}
209 ```
210
211 # Getting Help
212
213 Subscribe and post messages with SO tag in onap-discuss group at https://lists.onap.org/g/onap-discuss
214