Managing Apps
Listing the applications running in the Emulation System¶
At any moment, the user can consult the applications running in the emulation system:
kelvin app images list
Success
[kelvin.sdk][2021-04-22 12:38:40][I]
*************************** Running Apps ***************************
+------------------------+----------------+------------------+--------------------+---------------------------+
| Running applications | Containers | Up and running | Local IP Address | Ports (container->host) |
|------------------------+----------------+------------------+--------------------+---------------------------|
| my-app:1.0.0 | ['my-app.app'] | True | 172.18.0.2 | [tcp:48010->55000] |
+------------------------+----------------+------------------+--------------------+---------------------------+
The Running Apps section will not only display which applications are running but also some of its running configurations.
- The presented configurations:
Running Applications, the first cell, will display the name and version of the running applicationContainers, will display the docker container name of the running application. This is useful for configuring connections between apps.Local IP Address, the container's IP Address, used for networking purposes and external communication.Ports, the ports exposed by the container and its corresponding port on the host machine. This is useful for connecting external diagnostics tools.
Consulting the logs of an application running in the Emulation System¶
The logs of a single, specific application can be obtained by using the kelvin emulation logs command.
- This command takes the following arguments:
- app-name, the name of the app to obtain the logs from.
- Additionally, this command make also take the following options:
--tail, the number of log lines to show starting from the bottom.--follow, Follows the container logs stream
# kelvin emulation logs <app-name:app-version>
kelvin emulation logs my-app:1.0.0 --follow --tail 50
Success
[ApplicationEngine.cpp: 26:I] - Loading configuration file: /opt/kelvin/app/app.yaml
[ Pipeline.cpp: 132:I] - Loading shared object: ../core/lib/Client.so (my-app) - SUCCESS
[ Pipeline.cpp: 304:I] - Loading my-app Refinery input modules:
[ Pipeline.cpp: 309:I] - Loading my-app Refinery output modules:
[ Pipeline.cpp: 314:I] - Loading my-app Gatekeeper input modules
[ Pipeline.cpp: 319:I] - Loading my-app Gatekeeper output modules
[ StorageManager.cpp: 21:I] - Using eXtremeDB storage backend
[ExtremeDbBackend.cpp: 277:I] - [config] Commit policy: MCO_COMMIT_SYNC_FLUSH // Transaction log type: REDO_LOG
[ExtremeDbBackend.cpp: 318:I] - [config] Dev: 0 // Memory type: MCO_MEMORY_CONV // Assignment: MCO_MEMORY_ASSIGN_DATABASE // Size: 2097152 // Flags: MCO_FILE_OPEN_DEFAULT
[ExtremeDbBackend.cpp: 318:I] - [config] Dev: 1 // Memory type: MCO_MEMORY_CONV // Assignment: MCO_MEMORY_ASSIGN_CACHE // Size: 8388608 // Flags: MCO_FILE_OPEN_DEFAULT
[ExtremeDbBackend.cpp: 318:I] - [config] Dev: 2 // Memory type: MCO_MEMORY_FILE // Assignment: MCO_MEMORY_ASSIGN_PERSISTENT // Filename: ./storage/kelvindb_v3.dbs // Flags: MCO_FILE_OPEN_DEFAULT
[ExtremeDbBackend.cpp: 318:I] - [config] Dev: 3 // Memory type: MCO_MEMORY_FILE // Assignment: MCO_MEMORY_ASSIGN_LOG // Filename: ./storage/kelvindb_v3.log // Flags: MCO_FILE_OPEN_DEFAULT
[ExtremeDbBackend.cpp: 258:I] - eXtremeDB is running in PAID LICENSE MODE
[ExtremeDbBackend.cpp: 260:I] - eXtremeDB version: interim build eXtremeDB_8.1_1800, rev.25973
[ExtremeDbBackend.cpp: 30:I] - eXtremeDB started successfully.
[ UploadManager.cpp: 27:I] - The UploadManager's worker will not start because it's either disabled or has no address configured
[ Poller.cpp: 70:I] - Successful poller: 1.000000 secs (fd: 8)
[ RPCApplication.cpp: 62:I] - my-app initialize.
OPCUA tree for my-app processing pipeline:
ROOT
doubled_temperature: RW
temperature: RW
[ Server.cpp: 24:I] - OPCUA server opened endpoints for following URLs:
[ Server.cpp: 29:I] - opc.tcp://bee43ce19bfd:48010
[ Network.hpp: 51:E] - Failed get addr info: Unknown error
[ Runtime.cpp: 227:I] - Establishing OPCUA client connection: opc.tcp://injector.app:48010
[ Network.hpp: 51:E] - Failed get addr info: Unknown error
[ Runtime.cpp: 227:I] - Establishing OPCUA client connection: opc.tcp://output-connection:48010
[ KelvinRuntime.cpp: 160:I] - Exiting reconnect() thread -- running: false
[ KelvinRuntime.cpp: 248:I] - Exiting run() thread -- running: false
[ Runtime.cpp: 644:I] - Exiting manage_client() thread -- running: false
Stopping an application running in the Emulation System¶
Once you're done with your running application, you can stop it with the kelvin emulation stop command.
# kelvin emulation stop <app-name>
kelvin emulation stop my-app:1.0.0
Success
[kelvin.sdk][2021-01-13 16:42:52][I] Attempting to stop application "my-app:1.0.0"
[kelvin.sdk][2021-01-13 16:42:52][I] Stopping containers of "my-app:1.0.0"
[kelvin.sdk][2021-01-13 16:42:52][I] Containers of "my-app:1.0.0" successfully stopped
[kelvin.sdk][2021-01-13 16:42:52][R] Application was successfully stopped