JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 1 | .. This work is a derivative of https://wiki.onap.org/display/DW/Running+Blueprints+Processor+Microservice+in+an+IDE |
| 2 | .. This work is licensed under a Creative Commons Attribution 4.0 |
| 3 | .. International License. http://creativecommons.org/licenses/by/4.0 |
| 4 | .. Copyright (C) 2020 Deutsche Telekom AG. |
| 5 | |
| 6 | Running Blueprints Processor Microservice in an IDE |
| 7 | ==================================================== |
| 8 | |
| 9 | Objective |
| 10 | ~~~~~~~~~~~~ |
| 11 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 12 | Have the blueprint processor running locally is to use the IDE to run the code, while having the database running in a container. |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 13 | This way, code changes can be conveniently tested and debugged. |
| 14 | |
| 15 | |
| 16 | Check out the code |
| 17 | ~~~~~~~~~~~~~~~~~~~ |
| 18 | |
| 19 | Check out the code from Gerrit: https://gerrit.onap.org/r/#/admin/projects/ccsdk/cds |
| 20 | |
| 21 | Build it locally |
| 22 | ~~~~~~~~~~~~~~~~~~ |
| 23 | |
| 24 | In the checked out directory, type |
| 25 | |
| 26 | .. code-block:: bash |
| 27 | |
| 28 | mvn clean install -DskipTests=true -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dadditionalparam=-Xdoclint:none |
| 29 | |
| 30 | Spin up a Docker container with the database |
| 31 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 32 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 33 | The Blueprints Processor project uses a database to store information about the blueprints |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 34 | and therefore it needs to be online before attempting to run it. |
| 35 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 36 | One way to create the database is by using the :file:`docker-compose.yaml` |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 37 | file present on the distribution module. This database will require a local directory to mount a volume, before running docker-compose remember to create following directory: |
| 38 | |
| 39 | .. code-block:: bash |
| 40 | |
| 41 | mkdir -p -m 755 /opt/app/cds/mysql/data |
| 42 | |
| 43 | Navigate to the docker-compose file in the distribution module: |
| 44 | |
| 45 | .. tabs:: |
| 46 | |
| 47 | .. group-tab:: Latest |
| 48 | |
| 49 | .. code-block:: bash |
| 50 | |
| 51 | cd ms/blueprintsprocessor/application/src/main/dc |
| 52 | |
| 53 | .. group-tab:: Frankfurt |
| 54 | |
| 55 | .. code-block:: bash |
| 56 | |
| 57 | cd ms/blueprintsprocessor/application/src/main/dc |
| 58 | |
| 59 | .. group-tab:: El Alto |
| 60 | |
| 61 | .. code-block:: bash |
| 62 | |
| 63 | ms/blueprintsprocessor/distribution/src/main/dc |
| 64 | |
| 65 | .. group-tab:: Dublin |
| 66 | |
| 67 | .. code-block:: bash |
| 68 | |
| 69 | ms/blueprintsprocessor/distribution/src/main/dc |
| 70 | |
| 71 | And run docker-composer: |
| 72 | |
| 73 | .. code-block:: bash |
| 74 | |
| 75 | docker-compose up -d db |
| 76 | |
| 77 | This should spin up a container of the MariaDB image in the background. |
| 78 | To check if it has worked, this command can be used: |
| 79 | |
| 80 | .. code-block:: bash |
| 81 | |
| 82 | docker-compose logs -f |
| 83 | |
| 84 | The phrase ``mysqld: ready for connections`` indicates that the database was started correctly. |
| 85 | |
| 86 | From now on, the Docker container will be available on the computer; if it ever gets stopped, |
| 87 | it can be started again by the command: |
| 88 | |
| 89 | .. code-block:: bash |
| 90 | |
| 91 | docker start <id of mariadb container> |
| 92 | |
| 93 | |
| 94 | Set permissions on the local file system |
| 95 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 96 | |
| 97 | Blueprints processor uses the local file system for some operations and, therefore, |
| 98 | need some existing and accessible paths to run properly. |
| 99 | |
| 100 | Execute the following commands to create the needed directories, and grant access to the current user to modify them: |
| 101 | |
| 102 | .. code-block:: bash |
| 103 | |
| 104 | mkdir -p -m 755 /opt/app/onap/blueprints/archive |
| 105 | mkdir -p -m 755 /opt/app/onap/blueprints/deploy |
| 106 | mkdir -p -m 755 /opt/app/onap/scripts |
| 107 | sudo chown -R $(id -u):$(id -g) /opt/app/onap/ |
| 108 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 109 | Import the project into the IDE |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 110 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 111 | |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 112 | .. tabs:: |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 113 | |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 114 | .. tab:: IntelliJ IDEA |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 115 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 116 | Go to *File | Open* and choose the :file:`pom.xml` file of the cds directory: |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 117 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 118 | |imageImportProject| |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 119 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 120 | Sometimes it may be necessary to reimport Maven project: |
| 121 | |
| 122 | |imageReimportMaven| |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 123 | |
| 124 | |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 125 | **Override some application properties:** |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 126 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 127 | After the project is compiled, a Run Configuration profile overriding some application properties |
| 128 | with custom values needs to be created, to reflect the local environment characteristics. |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 129 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 130 | .. tabs:: |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 131 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 132 | .. group-tab:: Latest |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 133 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 134 | Navigate to the main class of the Blueprints Processor, the BlueprintProcessorApplication class: |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 135 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 136 | ``ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorApplication.kt``. |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 137 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 138 | Right-click inside it, at any point, to load the context menu and select create |
| 139 | BlueprintProcessorApplication configuration from context: |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 140 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 141 | |imageCreateRunConfigkt| |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 142 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 143 | **The following window will open:** |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 144 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 145 | |imageRunConfigKt| |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 146 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 147 | **Add the following in the field `VM Options`:** |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 148 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 149 | .. code-block:: bash |
| 150 | :caption: **Custom values for properties** |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 151 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 152 | -Dspring.profiles.active=dev |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 153 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 154 | You can override any value from **application-dev.properties** file here. Use the following pattern: |
| 155 | |
| 156 | .. code-block:: java |
| 157 | |
| 158 | -D<application-dev.properties key>=<application-dev.properties value> |
| 159 | |
| 160 | .. group-tab:: Frankfurt |
| 161 | |
| 162 | Navigate to the main class of the Blueprints Processor, the BlueprintProcessorApplication class: |
| 163 | |
| 164 | ``ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorApplication.kt``. |
| 165 | |
| 166 | Right-click inside it, at any point, to load the context menu and select create |
| 167 | BlueprintProcessorApplication configuration from context: |
| 168 | |
| 169 | |imageCreateRunConfigkt| |
| 170 | |
| 171 | **The following window will open:** |
| 172 | |
| 173 | |imageRunConfigKt| |
| 174 | |
| 175 | **Add the following in the field `VM Options`:** |
| 176 | |
| 177 | .. code-block:: bash |
| 178 | :caption: **Custom values for properties** |
| 179 | |
| 180 | -Dspring.profiles.active=dev |
| 181 | |
| 182 | You can override any value from **application-dev.properties** file here. Use the following pattern: |
| 183 | |
| 184 | .. code-block:: java |
| 185 | |
| 186 | -D<application-dev.properties key>=<application-dev.properties value> |
| 187 | |
| 188 | .. group-tab:: El Alto |
| 189 | |
| 190 | Navigate to the main class of the Blueprints Processor, the BlueprintProcessorApplication class: |
| 191 | |
| 192 | ``ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorApplication.java.`` |
| 193 | |
| 194 | Right-click inside it, at any point, to load the context menu and select create |
| 195 | BlueprintProcessorApplication configuration from context: |
| 196 | |
| 197 | |imageCreateRunConfigJava| |
| 198 | |
| 199 | **The following window will open:** |
| 200 | |
| 201 | |imageRunConfigJava| |
| 202 | |
| 203 | **Add the following in the field `VM Options`:** |
| 204 | |
| 205 | .. code-block:: bash |
| 206 | :caption: **Custom values for properties** |
| 207 | |
| 208 | -Dspring.profiles.active=dev |
| 209 | |
| 210 | You can override any value from **application-dev.properties** file here. Use the following pattern: |
| 211 | |
| 212 | .. code-block:: java |
| 213 | |
| 214 | -D<application-dev.properties key>=<application-dev.properties value> |
| 215 | |
| 216 | .. group-tab:: Dublin |
| 217 | |
| 218 | Navigate to the main class of the Blueprints Processor, the BlueprintProcessorApplication class: |
| 219 | |
| 220 | ``ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorApplication.java``. |
| 221 | |
| 222 | Right-click inside it, at any point, to load the context menu and select create |
| 223 | BlueprintProcessorApplication configuration from context: |
| 224 | |
| 225 | |imageCreateRunConfigJava| |
| 226 | |
| 227 | **The following window will open:** |
| 228 | |
| 229 | |imageRunConfigJava| |
| 230 | |
| 231 | **Add the following in that field:** |
| 232 | |
| 233 | .. code-block:: java |
| 234 | :caption: **Custom values for properties** |
| 235 | |
| 236 | -DappName=ControllerBluePrints |
| 237 | -Dms_name=org.onap.ccsdk.apps.controllerblueprints |
| 238 | -DappVersion=1.0.0 |
| 239 | -Dspring.config.location=opt/app/onap/config/ |
| 240 | -Dspring.datasource.url=jdbc:mysql://127.0.0.1:3306/sdnctl |
| 241 | -Dspring.datasource.username=sdnctl |
| 242 | -Dspring.datasource.password=sdnctl |
| 243 | -Dcontrollerblueprints.loadInitialData=true |
| 244 | -Dblueprintsprocessor.restclient.sdncodl.url=http://localhost:8282/ |
| 245 | -Dblueprintsprocessor.db.primary.url=jdbc:mysql://localhost:3306/sdnctl |
| 246 | -Dblueprintsprocessor.db.primary.username=sdnctl |
| 247 | -Dblueprintsprocessor.db.primary.password=sdnctl |
| 248 | -Dblueprintsprocessor.db.primary.driverClassName=org.mariadb.jdbc.Driver |
| 249 | -Dblueprintsprocessor.db.primary.hibernateHbm2ddlAuto=update |
| 250 | -Dblueprintsprocessor.db.primary.hibernateDDLAuto=none |
| 251 | -Dblueprintsprocessor.db.primary.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy |
| 252 | -Dblueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.MySQL5InnoDBDialect |
| 253 | -Dblueprints.processor.functions.python.executor.executionPath=./components/scripts/python/ccsdk_blueprints |
| 254 | -Dblueprints.processor.functions.python.executor.modulePaths=./components/scripts/python/ccsdk_blueprints,./components/scripts/python/ccsdk_netconf,./components/scripts/python/ccsdk_restconf |
| 255 | -Dblueprintsprocessor.restconfEnabled=true |
| 256 | -Dblueprintsprocessor.restclient.sdncodl.type=basic-auth |
| 257 | -Dblueprintsprocessor.restclient.sdncodl.url=http://localhost:8282/ |
| 258 | -Dblueprintsprocessor.restclient.sdncodl.username=admin |
| 259 | -Dblueprintsprocessor.restclient.sdncodl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U |
| 260 | -Dblueprintsprocessor.grpcEnable=false |
| 261 | -Dblueprintsprocessor.grpcPort=9111 |
| 262 | -Dblueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy |
| 263 | -Dblueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive |
| 264 | -Dblueprintsprocessor.blueprintWorkingPath=/opt/app/onap/blueprints/work |
| 265 | -Dsecurity.user.password={bcrypt}$2a$10$duaUzVUVW0YPQCSIbGEkQOXwafZGwQ/b32/Ys4R1iwSSawFgz7QNu |
| 266 | -Dsecurity.user.name=ccsdkapps |
| 267 | -Dblueprintsprocessor.messageclient.self-service-api.kafkaEnable=false |
| 268 | -Dblueprintsprocessor.messageclient.self-service-api.topic=producer.t |
| 269 | -Dblueprintsprocessor.messageclient.self-service-api.type=kafka-basic-auth |
| 270 | -Dblueprintsprocessor.messageclient.self-service-api.bootstrapServers=127.0.0.1:9092 |
| 271 | -Dblueprintsprocessor.messageclient.self-service-api.consumerTopic=receiver.t |
| 272 | -Dblueprintsprocessor.messageclient.self-service-api.groupId=receiver-id |
| 273 | -Dblueprintsprocessor.messageclient.self-service-api.clientId=default-client-id |
| 274 | -Dspring.profiles.active=dev |
| 275 | -Dblueprintsprocessor.httpPort=8080 |
| 276 | -Dserver.port=55555 |
| 277 | |
| 278 | |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 279 | **Add/replace the following in Blueprint's application-dev.properties file:** |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 280 | |
| 281 | .. code-block:: java |
| 282 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 283 | blueprintsprocessor.grpcclient.remote-python.type=token-auth |
| 284 | blueprintsprocessor.grpcclient.remote-python.host=localhost |
| 285 | blueprintsprocessor.grpcclient.remote-python.port=50051 |
| 286 | blueprintsprocessor.grpcclient.remote-python.token=Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 287 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 288 | blueprintprocessor.remoteScriptCommand.enabled=true |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 289 | |
| 290 | |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 291 | **Run the application:** |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 292 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 293 | Select either run or debug for this Run Configuration to start the Blueprints Processor: |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 294 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 295 | |imageRunDebug| |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 296 | |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 297 | |imageBuildLogs| |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 298 | |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 299 | .. tab:: Visual Studio Code |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 300 | |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 301 | .. tabs:: |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 302 | |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 303 | .. group-tab:: Latest |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 304 | |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 305 | * **Step #1** - Make sure your installation of Visual Studio Code is up to date. This guide was writen using version 1.48 |
| 306 | * **Step #2** - Install `Kotlin extension from the Visual Studio Code Marketplace <https://marketplace.visualstudio.com/items?itemName=fwcd.kotlin>`_ |
| 307 | * **Step #3** - On the top menu click *Run | Open Configurations* |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 308 | |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 309 | .. warning:: This should open the file called `launch.json` but in some cases you'll need to wait for the Kotlin Language Server to be installed before you can do anything. |
| 310 | Please watch the bottom bar in Visual Studio Code for messages about things getting installed. |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 311 | |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 312 | * **Step #4** - add configuration shown below to your configurations list. |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 313 | |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 314 | .. code-block:: json |
Marek Szwałkiewicz | d586bc5 | 2020-08-21 11:05:49 +0000 | [diff] [blame] | 315 | |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 316 | { |
| 317 | "type": "kotlin", |
| 318 | "request": "launch", |
| 319 | "name": "Blueprint Processor", |
| 320 | "projectRoot": "${workspaceFolder}/ms/blueprintsprocessor/application", |
| 321 | "mainClass": "-Dspring.profiles.active=dev org.onap.ccsdk.cds.blueprintsprocessor.BlueprintProcessorApplicationKt" |
| 322 | } |
| 323 | |
| 324 | .. warning:: The `projectRoot` path assumes that you created your Workspace in the main CDS repository folder. If not - please change the path accordingly |
| 325 | |
| 326 | .. note:: The `mainClass` contains a spring profile param before the full class name. This is done because `args` is not supported by Kotlin launch.json configuration. |
| 327 | If you have a cleaner idea how to solve this - please let us know. |
| 328 | |
| 329 | **Add/replace the following in Blueprint's application-dev.properties file:** |
| 330 | |
| 331 | .. code-block:: java |
| 332 | |
| 333 | blueprintsprocessor.grpcclient.remote-python.type=token-auth |
| 334 | blueprintsprocessor.grpcclient.remote-python.host=localhost |
| 335 | blueprintsprocessor.grpcclient.remote-python.port=50051 |
| 336 | blueprintsprocessor.grpcclient.remote-python.token=Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== |
| 337 | |
| 338 | blueprintprocessor.remoteScriptCommand.enabled=true |
| 339 | |
| 340 | **Currently the following entries need to be added in VSC too:** |
| 341 | |
| 342 | .. code-block:: java |
| 343 | |
| 344 | logging.level.web=DEBUG |
| 345 | logging.level.org.springframework.web: DEBUG |
| 346 | |
| 347 | #Encrypted username and password for health check service |
| 348 | endpoints.user.name=eHbVUbJAj4AG2522cSbrOQ== |
| 349 | endpoints.user.password=eHbVUbJAj4AG2522cSbrOQ== |
| 350 | |
| 351 | #BaseUrls for health check blueprint processor services |
| 352 | blueprintprocessor.healthcheck.baseUrl=http://localhost:8080/ |
| 353 | blueprintprocessor.healthcheck.mapping-service-name-with-service-link=[Execution service,/api/v1/execution-service/health-check],[Resources service,/api/v1/resources/health-check],[Template service,/api/v1/template/health-check] |
| 354 | |
| 355 | #BaseUrls for health check Cds Listener services |
| 356 | cdslistener.healthcheck.baseUrl=http://cds-sdc-listener:8080/ |
| 357 | cdslistener.healthcheck.mapping-service-name-with-service-link=[SDC Listener service,/api/v1/sdclistener/healthcheck] |
| 358 | |
| 359 | #Actuator properties |
| 360 | management.endpoints.web.exposure.include=* |
| 361 | management.endpoint.health.show-details=always |
| 362 | management.info.git.mode=full |
| 363 | |
| 364 | In VSC the properties are read from target folder, thats why the following maven command needs to be rerun: |
| 365 | |
| 366 | .. code-block:: bash |
| 367 | |
| 368 | mvn clean install -DskipTests=true -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dadditionalparam=-Xdoclint:none |
| 369 | |
| 370 | Click Run in Menu bar. |
| 371 | |
| 372 | |imageLogsVSC| |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 373 | |
| 374 | |
| 375 | Testing the application |
| 376 | ~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 377 | |
| 378 | There are two main features of the Blueprints Processor that can be of interest of a developer: |
| 379 | blueprint upload and blueprint process. |
| 380 | |
| 381 | To upload custom blueprints, the endpoint ``api/v1/execution-service/upload`` is used. |
| 382 | |
| 383 | To process, the endpoint is ``api/v1/execution-service/process``. |
| 384 | |
| 385 | Postman is a software that can be used to send these request, and an example of |
| 386 | them is present on https://www.getpostman.com/collections/b99863b0cde7565a32fc. |
| 387 | |
| 388 | |
| 389 | Possible Fixes |
| 390 | ~~~~~~~~~~~~~~~~~~~ |
| 391 | |
| 392 | Imported packages or annotiations are not found, Run Config not available? |
| 393 | ***************************************************************************** |
| 394 | |
| 395 | 1. Rebuild with ``maven install ...`` (see above) |
| 396 | 2. Potentially change Maven home directory in Settings |
| 397 | 3. Maven reimport in IDE |
| 398 | |
| 399 | Compilation error? |
| 400 | ******************** |
| 401 | |
| 402 | * Change Java Version to 11 or 8 |
| 403 | |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 404 | |
| 405 | .. image alignment inside tabs doesn't work |
| 406 | |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 407 | .. |imageRunConfigJava| image:: media/run_config_java.png |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 408 | :scale: 75 % |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 409 | :align: middle |
| 410 | |
| 411 | .. |imageRunConfigKt| image:: media/run_config_kt.png |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 412 | :scale: 75 % |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 413 | :align: middle |
| 414 | |
| 415 | .. |imageCreateRunConfigJava| image:: media/create_run_config_java.png |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 416 | :scale: 75 % |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 417 | :align: middle |
| 418 | |
| 419 | .. |imageCreateRunConfigKt| image:: media/create_run_config_kt.png |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 420 | :scale: 75 % |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 421 | :align: middle |
| 422 | |
| 423 | .. |imageImportProject| image:: media/import_project.png |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 424 | :scale: 75 % |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 425 | :align: middle |
| 426 | |
| 427 | .. |imageReimportMaven| image:: media/reimport_maven.png |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 428 | :scale: 75 % |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 429 | :align: middle |
| 430 | |
| 431 | .. |imageRunDebug| image:: media/run_debug.png |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 432 | :scale: 75 % |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 433 | :align: middle |
| 434 | |
| 435 | .. |imageRunDebug| image:: media/run_debug.png |
| 436 | :align: middle |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 437 | :scale: 75 % |
JakobKrieg | f47eeee | 2020-08-17 21:04:35 +0200 | [diff] [blame] | 438 | |
| 439 | .. |imageBuildLogs| image:: media/build_logs.png |
| 440 | :align: middle |
JakobKrieg | 668466f | 2020-08-27 16:36:38 +0200 | [diff] [blame^] | 441 | :scale: 75 % |
| 442 | |
| 443 | .. |imageLogsVSC| image:: media/vsc_logs.png |
| 444 | :align: middle |
| 445 | :scale: 75 % |