Update INFO.yaml
[sdc.git] / README.md
1 # ONAP SDC
2
3 [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=onap_sdc&metric=bugs)](https://sonarcloud.io/summary/new_code?id=onap_sdc)
4 [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=onap_sdc&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=onap_sdc)
5 [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=onap_sdc&metric=coverage)](https://sonarcloud.io/summary/new_code?id=onap_sdc)
6 [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=onap_sdc&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=onap_sdc)
7 [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=onap_sdc&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=onap_sdc)
8 [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=onap_sdc&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=onap_sdc)
9 [![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=onap_sdc&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=onap_sdc)
10 [![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=onap_sdc&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=onap_sdc)
11 [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=onap_sdc&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=onap_sdc)
12 [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=onap_sdc&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=onap_sdc)
13 [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=onap_sdc&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=onap_sdc)
14
15 ## Introduction
16
17 SDC is the ONAP visual modeling and design tool. It creates internal metadata that describes assets used by all ONAP components, both at design time and run time.
18
19 The SDC manages the content of a catalog and logical assemblies of selected catalog items to completely define how and when VNFs are realized in a target environment.
20 A complete virtual assembly of specific catalog items, together with selected workflows and instance configuration data, completely defines how the deployment, activation, and life-cycle management of VNFs are accomplished.
21
22 SDC manages four levels of assets:
23
24 * Resource - A fundamental capability, implemented either entirely in software, or as software that interacts with a hardware device.
25 Each Resource is a combination of one or more Virtual Function Components (VFCs), along with all the information necessary to instantiate, update, delete and manage the Resource.
26 * Service - A well-formed object comprising one or more Resources. Service Designers create Services from Resources, and include all of the information about the Service needed to instantiate, update, delete and manage the Service.
27
28 The key output of SDC is a set of models containing descriptions of asset capabilities and instructions to manage them. These models are stored in the SDC Master Reference Catalog for the entire enterprise to use.
29
30 There are four major components of SDC:
31
32 * Catalog - The repository for assets at the Resource, Service and Product levels. Assets are added to the Catalog using the Design Studio.
33 * Design Studio - Used to create, modify and add Resource, Service and Product definitions in the Catalog.
34 * Certification Studio - Available in a future release, is used to test new assets at all levels. It will be used for sandbox experimentation, and will include support for automated testing.
35 * Distribution Studio - Used to deploy certified assets. From the Distribution studio, new Product assets, including their underlying Resources and Services, are deployed into lab environments for testing purposes, and into production after certification is complete. In a future release, there will be a way to export Product information to external Business Support Systems for customer ordering and billing.
36
37 ## Git Configuration
38
39 Note that if you're working on Windows, it's important to enable long paths for your machine; otherwise git won't be able to handle some files.
40
41 In order to do so just add this section to your global git.config file under the `[core]` key:
42
43     longpaths = true
44
45 ## Compiling the Project
46
47 SDC is built from several projects while the parent "sdc" contains the main pom.xml for all of them:
48 - asdctool              - set of utilities used for scheme creation and data migration in SDC
49 - catalog-be            - backend code
50 - catalog-fe            - frontend java code (servlet, proxy)
51 - catalog-dao           - database layer
52 - catalog-model         - data model of the application
53 - catalog-ui            - front end code (javascript, html, css)
54 - common                    - set of utilities used by the onboarding project
55 - common-app-api        - common code for frontend and backend
56 - common-be                 - utilities, datatypes and enums
57 - security-utils        - handle encryption/decryption of passwords
58 - onboarding-be         - onboarding backend code
59 - onboarding-ui         - onboarding frontend code
60 - integration-tests - The integration tests using the docker images to validate Backend API calls and FE with Selenium
61 - sdc-os-chef           - chefs scripts used for docker creation and startup
62 - utils                     - set of dev utils used for working with the project locally
63
64
65 In order to build all the projects, as mentioned in the onap wiki https://wiki.onap.org/display/DW/Setting+Up+Your+Development+Environment, the settings.xml (https://git.onap.org/oparent/plain/settings.xml) from the oparent project must be installed in your ~/.m2 folder and referenced by your IDE.
66 Once maven is set up properly, go to sdc project and run the command: `mvn clean install`
67
68 By default, the "all" maven profile will be executed but others exist:
69 * fast-build - A fast build skipping all tests and useless maven plugins (only builds the jars)
70 * start-sdc - Once docker containers have been build, triggering this profile starts SDC CS, BE, FE, simulator
71 * stop-sdc - Stop all SDC containers started by using the profile "start-sdc"
72 * run-integration-tests - This runs only the integration tests against a running SDC started by using "start-sdc" profile.
73 * docker - This enables the docker images build for each SDC module
74     **Note: If you're working on Windows, you'll need to define an environment variable on your machine with key `DOCKER_HOST` and value: `tcp://<ip_address>:2375` in order to build and upload local dockers to a local environment.**
75
76 More flags to use in the build process are:
77 * -DskipITs - Skips integration tests only
78 * -DskipTests - Skips unit tests execution and integration tests
79 * -DskipUICleanup=true - Skips deleting the UI folders
80 * -Djacoco.skip=true - Skips running jacoco tests
81 * -DskipPMD - Skips creating a PMD report
82
83 ## Accessing SDC
84
85 After having started SDC with the command `mvn clean install -P start-sdc`, you can access it by accessing this URL: `http://<ip_address>:8285/login`
86 As ONAP AAF is not present, the url provided uses the 8285 simulator ports, just click on the user you want to use for accessing SDC (i.e. Carlos Santana)
87 For more information regarding using the webseal_simulator please refer to the following guide: [SDC Simulator](https://wiki.onap.org/display/DW/SDC+Simulator)
88
89 ### SDC Containers
90
91 The following table shows the SDC containers found after a maven "start-sdc":
92
93     CONTAINER ID        IMAGE                                    COMMAND                  CREATED             STATUS                      PORTS                                                                              NAMES
94     968a8168e412        onap/sdc-backend-init:latest             "/bin/sh -c /home/${…"   9 minutes ago       Exited (0) 54 seconds ago                                                                                      sdc-backend-init-1
95     621c0fda1b0f        onap/sdc-backend-all-plugins:latest      "sh -c ${JETTY_BASE}…"   9 minutes ago       Up 9 minutes                0.0.0.0:4000->4000/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:8443->8443/tcp             sdc-backend-all-plugins-1
96     d823078776d8        onap/sdc-onboard-backend:latest          "sh -c ${JETTY_BASE}…"   9 minutes ago       Up 9 minutes                0.0.0.0:4001->4001/tcp, 0.0.0.0:8081->8081/tcp, 0.0.0.0:8445->8445/tcp, 8080/tcp   sdc-onboard-backend-1
97     4729b0b7f0fe        onap/sdc-simulator:latest                "sh -c ${JETTY_BASE}…"   9 minutes ago       Up 9 minutes                0.0.0.0:8285->8080/tcp, 0.0.0.0:8286->8443/tcp                                     sdc-simulator-1
98     583e0d7fa300        onap/sdc-onboard-cassandra-init:latest   "/home/sdc/startup.sh"   9 minutes ago       Exited (0) 9 minutes ago                                                                                       sdc-onboard-cassandra-init-1
99     92085524f19f        onap/sdc-cassandra-init:latest           "/home/sdc/startup.sh"   10 minutes ago      Exited (0) 9 minutes ago                                                                                       sdc-cassandra-init-1
100     c6e90dd7ddaf        selenium/standalone-firefox:2.53.1       "/opt/bin/entry_poin…"   10 minutes ago      Up 10 minutes               0.0.0.0:4444->4444/tcp                                                             standalone-firefox-1
101     e02139c0379b        onap/sdc-frontend:latest                 "sh -c ${JETTY_BASE}…"   10 minutes ago      Up 10 minutes               0.0.0.0:6000->6000/tcp, 0.0.0.0:8181->8181/tcp, 0.0.0.0:9443->9443/tcp, 8080/tcp   sdc-frontend-1
102     96843fae9e4c        onap/sdc-cassandra:latest                "/root/startup.sh"       10 minutes ago      Up 10 minutes               7000-7001/tcp, 7199/tcp, 9160/tcp, 0.0.0.0:9042->9042/tcp                          sdc-cassandra-1
103
104 For further information and an image explaining the containers dependency map please refer to the following page: [SDC Docker Diagram](https://wiki.onap.org/display/DW/SDC+Troubleshooting)
105
106
107 ### Accessing the logs
108
109 To access the logs, there are different options:
110 * Connect to the docker container you want to inspect by doing `docker exec -it -u root sdc-XXXXXXXX-1 sh` 
111     Then look at the logs generally in /var/lib/jetty/logs or /var/log/onap (that may differ !)
112 * A volume is shared between the BE, onboard-BE and FE containers, this volume is mapped to `/tmp/sdc-integration-tests`,
113     In that folder you can obtain the logs of the different containers 
114
115 ### Debugging SDC
116
117 After having started SDC with the command `mvn clean install -P start-sdc`, different java remote debug ports are opened by default:
118 * Onboard Backend - 4001 (jetty)
119 * Backend - 4000 (jetty)
120 * Frontend - 6000 (jetty)
121 It's therefore possible to connect your IDE to those debug ports remotely to walk through the code and add some breakpoints.
122
123 **Look at the pom.xml of the integration-tests module to have a better understanding of all the docker settings provided to start SDC.**
124
125 ### Integration tests
126 The integration are composed of 2 parts, one to test the BE Apis and another one to test the FE with selenium.
127 The selenium tests make use of the selenium/standalone-firefox:2.53.1 container.
128
129 About BE APIs tests, onboarding E2E flow :
130 Onboarding E2E flow cover following SDC functionality:
131
132     Onboard of VNF
133     Create VF from VSP
134     Certify VF 
135     Create Service
136     Add VF to service
137
138     Certify Service
139     Export TOSCA and validate it structure using external TOSCA parser
140
141 **as part of execution we open a connection to Titan and perform resources clean up both before and after tests execution (only resource with “ci” prefix will be deleted from the catalog)
142 List of VNFs/PNFs that proceed by onboarding flow, located in `integration-tests/src/test/resources/Files/`)
143
144     sample-signed-pnf-cms-includes-cert-1.0.1-SNAPSHOT.zip
145     sample-signed-pnf-1.0.1-SNAPSHOT.zip
146     sample-pnf-1.0.1-SNAPSHOT.csar
147     sample-pnf-custom-type.csar
148     base_vfw.zi
149     base_vvg.zip
150     database-substitution-mappings.csar
151     helm.zip
152     Huawei_vHSS.csar
153     Huawei_vMME.csar
154     infra.zip
155     resource-ZteEpcMmeVf-csar_fix.csar
156     vbng.zip
157     vbrgemu.zip
158     vfw.zip
159     vgmux.zip
160     vgw.zip
161     vLB.zip
162     vLBMS.zip
163     vSBC_update_v03.csar
164     vsp-vgw.csar
165     vvg.zip
166     ZteEpcMmeVf.csar
167
168 #### Start the integration tests manually
169
170 Those tests execute the following
171 There are 2 options to start them:
172 * After having started SDC with the command `mvn clean install -P start-sdc`, run the command `mvn clean install -P run-integration-tests`
173 * If you want to debug them and run them from your IDE, you must start them from the testNG Suites files, otherwise this won't work.
174   The test suites are located here:
175   * BE: `integration-tests/src/test/resources/ci/testSuites/backend`
176   * FE: `integration-tests/src/test/resources/ci/testSuites/frontend`
177
178 #### Integration tests with Helm Validator
179
180 Those tests use container built externally in other ONAP repository: [sdc/sdc-helm-validator](https://gerrit.onap.org/r/admin/repos/sdc/sdc-helm-validator)
181
182 You can run those tests same as default integration tests by adding additional profile to maven commands:
183 `integration-tests-with-helm-validator`
184 * To start SDC with Helm Validator run: `mvn clean install -P start-sdc,integration-tests-with-helm-validator`
185 * To execute tests that use Helm Validator use: `mvn clean install -P run-integration-tests,integration-tests-with-helm-validator`
186 ## Accessing SDC UI in Dev Mode (Legacy way)
187
188 In order to access the SDC UI from your dev environment you need to do the following:
189
190 1. Go to file `webpack.server.js` found under the catalog-ui folder in the main sdc project and update the "localhost" variable to be the ip of your local vagrant machine.
191 2. Navigate to the catalog-ui folder and run the command: `npm start -- --env.role <wanted_role>` with the wanted role to login to SDC as.
192
193 ## SDC on OOM
194
195 For more information regarding SDC on OOM please refer to the following page: [SDC on OOM](https://wiki.onap.org/display/DW/SDC+on+OOM)
196
197 ## Frontend Local Env - onboarding
198
199 ### Steps:
200
201 Install nodejs & gulp
202 1. download nodejs from here: https://nodejs.org/en/ (take the "current" version with latest features) & install it.
203 2. install gulp by running the following command: npm install --global gulp-cli
204
205 ### Install DOX-UI a:
206
207 1. pull for latest changes
208 2. go to folder dox-sequence-diagram-ui
209 3. run npm install
210 4. wait for it...
211 5. go to folder dox-ui
212 6. run npm install
213 7. create a copy of devConfig.defaults.json file and name it devConfig.json (we already configured git to ignore it so it will not be pushed)
214 8. in that file, populate the fields of the IP addresses of your BE machine you'd like to connect (pay attention, it is a JSON file): For example http://<host>:<port>
215 9. after everything is successful, run gulp
216 10. after server is up, your favorite UI will wait for you at: http://localhost:9000/sdc1/proxy-designer1#/onboardVendor
217
218 ### Troubleshooting:
219
220 | Problem                       |   Why is this happening | Solution                                                                                   |
221 |-------------------------------|-------------------------|--------------------------------------------------------------------------------------------|
222 | npm cannot reach destination  | onboarding proxy        | When within onboarding network, you should set onboarding proxy to NPM as the following:   |
223 |                               |                         | npm config set proxy http://genproxy:8080                                                  |
224 |                               |                         | npm config set https-proxy http://genproxy:8080                                            |
225 |                               |                         |                                                                                            |
226 | git protocol is blocked       | onboarding network      | When within onboarding network, you should set globally that when git                      |
227 | and cannot connect            | rules for protocols     | protocol is used, it will be replaced with "https"                                         |
228 |                               |                         | git config --global url."https://".insteadOf git://                                        |
229 --------------------------------------------------------------------------------------------------------------------------------------------------------
230
231 ## SDC Troubleshooting
232
233 In order to check the life state of SDC you can run the command `health` from inside the vagrant.
234 Alternatively you can run the following commands to check the FE and BE status:
235
236 FE - `curl http://<ip_address>:8181/sdc1/rest/healthCheck`
237
238 BE - `curl http://<ip_address>:8080/sdc2/rest/healthCheck`
239
240 Another method to check about problems in SDC is to look at the log files.
241
242 The jetty(Applicative) are found in the respective folder according to the wanted section
243 For example, the BE logs will found under the directory `/BE`.
244
245 For more information regarding SDC Troubleshooting please refer to the following guide: [SDC Troubleshooting](https://wiki.onap.org/display/DW/SDC+Troubleshooting)
246
247 ## Getting Help
248
249 #####  [Mailing list](mailto:onap-sdc@lists.onap.org)
250
251 ##### [JIRA](http://jira.onap.org)
252
253 ##### [WIKI](https://wiki.onap.org/display/DW/Service+Design+and+Creation+%28SDC%29+Portal)