Enable debug mode in BE
[sdc.git] / README.md
1 # OpenECOMP SDC
2
3 ---
4 ---
5
6
7 # Introduction
8
9 OpenECOMP SDC is delivered with 5 Docker containers:
10 1. sdc-FE       - frontend SDC application running on jetty server
11 2. sdc-BE       - backend SDC application running on jetty server
12 3. sdc-kbn      - hosting kibana application
13 4. sdc-cs       - hosting cassandra
14 5. sdc-es       - hosting elastic search
15
16 All containers runs on the same machine and can be started by runnin the command:
17 /data/scripts/docker_run.sh -e <environment name> -r <release> -p <docker-hub-port>
18 Example: /data/scripts/docker_run.sh -e OS-ETE-DFW -p 51220
19
20
21 # Compiling SDC
22
23 SDC is built from several projects, while "sdc-main" contains the main pom.xml for all project:
24 - catalog-be            - backend code
25 - catalog-fe            - frontend java code (servlet, proxy)
26 - catalog-dao           - database layer
27 - catalog-model         - data model of the application
28 - catalog-ui            - front end code (javascript, html, css)
29 - common-app-api        - common code for frontend and backend
30 - common-be                     - utilities, datatypes and enums
31 - security-utils        - handle encryption/decryption of passwords
32
33 SDC projects can be compiled easily using maven command: `mvn clean install`. 
34 In order to build all projects, enter to sdc-main project and run the command: `mvn clean install`.
35 By default unit test will run when compiling
36
37 ** igor **
38 Docker containers are build with the following profile 
39 `-P docker -Ddocker.buildArg.chef_repo_branch_name=bugfix/external_adress -Ddocker.buildArg.chef_repo_git_username=git -Ddocker.buildArg.chef_repo_address=23.253.149.175/SDC -Ddocker.buildArg.chef_repo_git_name=chef-repo`
40
41
42 # Getting the containers
43
44 ***to be changed for rrelease*** OpenECOMP SDC containers are stored on the Rackspace Nexus Docker Registry
45
46 The following Docker images are the actual deployment images used for running SDC
47
48 | Name    | Tag       | Description                                                                                                                   |
49 |---------|-----------|-------------------------------------------------------------------------------------------------------------------------------|
50 | sdc-FE  | 1610.2.16 | Contains Jetty + OpenJDK + SDC frontend code + **3rd party jars**                                                             |
51 | sdc-BE  | 1610.2.16 | Contains Jetty + OpenJDK + SDC backend code + **3rd party jars**                                                              |
52 | sdc-kbn | 1610.2.16 | Contains nodeJs + Kibana application                                                                                          |
53 | sdc-cs  | 1610.2.16 | OpenJDK + Contains cassandra application                                                                                      |
54 | sdc-es  | 1610.2.16 | Elastic search application                                                                                                    |
55
56
57 *********************** Israel ************************
58 # Starting SDC
59 There are several ways to start OpenECOMP SDC:
60 TBD - Israel
61
62 # Accessing SDC
63 SDC UI can be accessed from:
64
65 ### Ecomp portal
66 Login to ecomp portal URL with user that has permission for SDC application.
67 Define in your hosts file the following:
68 <ip address of SDC application> sdc.api.simpledemo.openecomp.org
69 <ip address of Ecomp portal URL> portal.api.simpledemo.openecomp.org
70 Open browser and navigate to: http://portal.api.simpledemo.openecomp.org:8989/ECOMPPORTAL/login.htm
71
72 ### Webseal/SDC simulator
73 This options is for developers to run locally SDC
74
75 # SDC Simulator
76
77 This options is for developers to run locally SDC
78 SDC Simulator is a project that enables emulation of web server that provides security policy and sign-on to the SDC component in dev environments.
79
80   - Provides sign on to the basic user roles/functionalities
81   - Creation of basic user accounts
82
83 # Docker compilation - Docker Maven Build Profile (io.fabric8 maven Plugin)
84
85 If you are using onap vagrant you can deploy the simulator by:
86
87 Set up the DOCKER_HOST environmental variable
88
89 To set environmental variable in Windows (the docker engine environment):
90 - Run `cmd`
91 -- Issue command `set NAME=VAL
92 Example: set DOCKER_HOST=tcp://127.0.0.1:2375
93 --To check if the variable set succeeded issue `echo %DOCKER_HOST%`
94
95 - To compile sdc-simulator docker:
96 1. Run `mvn clean install -Ddocker.buildArg.http_proxy=<http_proxy> -Ddocker.buildArg.https_proxy=<https_proxy> -P docker`
97 -- The proxy arguments are passed and used as environmental variables in Dockerfiles 
98 2. Copy the script /webseal-simulator/scripts/simulator_docker_run.sh to the docker engine environment and run:
99 `simulator_docker_run.sh -r 1.1-STAGING-latest`
100 3. Run `docker ps` to verify that sdc-simulator docker is up and running.
101 4. Enter to UI: `http://<ip address>:8285/login`
102
103 # Docker compilation - Docker Engine
104
105 1. Build web simulator WAR file: run `mvn clean install` on project â€œwebseal simulatorâ€�. This will generate war file (WSSimulator.war) in the target folder.
106 2. Ftp war file: webseal-simulator/sdc-simulator folder to your localhost vagrant machine which runs docker engine daemon.
107 -- Check that WSSimulator.war exists after first step No.1 in webseal-simulator/sdc-simulator folder.
108 3. Run `docker build -t openecomp/sdc-simulator:1.1-STAGING-latest <PATH/sdc-simulator>`
109 Example: docker build -t openecomp/sdc-simulator:1.1-STAGING-latest /tmp/docker/sdc-simulator/
110 -- If running behind a proxy:
111 `docker build --build-arg http_proxy=http://URL:PORT --build-arg https_proxy=http://URL:PORT -t openecomp/sdc-simulator:1.1-STAGING-latest /tmp/docker/sdc-simulator/`
112 4. Validate that images pushed to the local repo by executing `docker images`
113 5. Copy the script /webseal-simulator/scripts/simulator_docker_run.sh to the docker engine environment and run: `simulator_docker_run.sh -r 1.1-STAGING-latest`
114 6. Run `docker ps` to verify that sdc-simulator docker is up and running.
115 7. Enter to UI: `http://<ip address>:8285/login`
116
117 # WAR compilation
118
119   - To compile WSSimulator.war:
120 1. Build web simulator WAR file: run `mvn clean install` on project "webseal simulator". This will generate war file (WSSimulator.war) in the target folder.
121 2. Ftp war file: webseal-simulator\target\WSSimulator.war to your localhost vagrant machine: /home/vagrant/webseal-simulator/webapps folder
122 3. Ftp configuration file: webseal-simulator\src\main\resources\webseal.conf to your localhost vagrant machine: /home/vagrant/webseal-simulator/config
123 4. Add users to simulator: open configuration file - webseal.conf and add new user to the user list.
124    Note: You need to define the user in the SDC as well.
125 5. To run the simulator, enter to your local vagrant and run: startWebsealSimulator.sh
126 -- Restart the simulator:
127    Stop the simulator: stopWebsealSimulator.sh
128    Start the simulator: startWebsealSimulator.sh
129 6. Enter to UI: http://<ip address>:8285/login
130
131
132 ### SDC import normatives from CLI
133 SDC needs to work with predefined basic normatives, in order to update the database with the normatives need to:
134 1. From catalog-be project copy:
135    src\main\resources\import\tosca -> to <machine ip address>:catalog-be/import/tosca
136    src\main\resources\scripts\import\tosca ->to <machine ip address>:catalog-be/scripts/import/tosca
137 2. cd catalog-be/scripts/import/tosca
138 3. Run: python importNormativeAll.py
139 4. Wait until all normatives are loaded to the database
140
141
142 ### SDC APIs
143 TBD
144
145 ##### Main API endpoints in the first open source release 
146
147 - ***to be completed*** APIHandler health checks
148 TBD
149
150 # Configuration of SDC
151 TBD
152
153 Here are the main parameters you could change: 
154 TBD
155
156 The credentials are defined in 2 places:
157 TBD
158
159 # Logging
160 TBD
161
162 ### Jetty
163 TBD
164
165 ### Debuging
166 TBD
167
168 # Testing SDC Functionalities
169 TBD
170
171 ### Frontend Local Env - onboarding
172
173 Steps:
174 ------
175 Install nodejs & gulp
176 1. download nodejs from here: https://nodejs.org/en/ (take the "current" version with latest features) & install it.
177 2. install gulp by running the following command: npm install --global gulp-cli
178
179 Install DOX-UI a:
180 -----------------
181 1. pull for latest changes
182 2. go to folder dox-sequence-diagram-ui
183 3. run npm install
184 4. wait for it...
185 5. go to folder dox-ui
186 6. run npm install
187 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)
188 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>
189 9. after everything was successful, run gulp
190 10. after server was up, your favorite UI will wait for you at: http://localhost:9000/sdc1/proxy-designer1#/onboardVendor
191
192 Troubleshooting:
193 ----------------
194 | Problem                       |   Why is this happening | Solution                                                                                   |
195 --------------------------------------------------------------------------------------------------------------------------------------------------------
196 | npm cannot reach destination  | onboarding proxy        | When within onboarding network, you should set onboarding proxy to NPM as the following:   |
197 |                               |                         | npm config set proxy http://genproxy:8080                                                  |
198 |                               |                         | npm config set https-proxy http://genproxy:8080                                            |
199 |                               |                         |                                                                                            |
200 | git protocol is blocked       | onboarding network      | When within onboarding network, you should set globally that when git                      |
201 | and cannot connect            | rules for protocols     | protocol is used, then it will be replaced with "https"                                    |
202 |                               |                         | git config --global url."https://".insteadOf git://                                        |
203 --------------------------------------------------------------------------------------------------------------------------------------------------------
204
205 # Getting Help
206
207 *** to be completed on rrelease ***
208
209 SDC@lists.openecomp.org
210
211 SDC Javadoc and Maven site
212  
213 *** to be completed on rrelease ***
214