Managing charging applications¶
Applications are in containers¶
We chose to run our applications in Linux containers with Docker for various reasons:
- It simplifies updates for just one application.
- The layering of containers file system makes for lightweight updates.
-
Containers use system tools and libs that are independent of the host Buildroot system (which is more constrained and potentially less up-to-date for some packages).
-
Benefit from process and network isolations to further minimize security risks.
- Resources of the system can be limited for each application in case one misbehaves.
- Docker itself can monitor for processes heartbeat and restart them if they fail.
Users are free to use containers or not. If they do, they are also free to use the base images they want.
Advantics provides base images for Python environment (installed by default). These images are themselves based on Debian 10 (Buster) arm32v7 images provided directly by Docker, Inc.
PEV applications¶
Start and stop all¶
There is a central script for managing all applications at once:
$ /etc/init.d/S80vehicle <COMMAND>
This script takes one parameter COMMAND which correspond to the following actions:
| COMMAND | Description |
|---|---|
| start | Start all applications. |
| stop | Stop all applications. |
| restart | Stop and start again all applications. |
| clean | Clean all application logs. Must be done when all applications are stopped. |
| restart-clean | Stop all applications, then clean their logs, then restart them. |
Individual control¶
Each application has its own managing script:
$ /srv/run-pev-controller.sh <COMMAND>
$ /srv/run-ccs-evcc.sh <COMMAND>
$ /srv/run-slac-pev.sh <COMMAND>
They all takes the same COMMAND parameter:
| COMMAND | Description |
|---|---|
| setup | Prepare the application for running. Automatically called by start. |
| start | Start the application. |
| stop | Stop the application. |
| clean | Clean application logs and unprepare it. Must be done when application is stopped. |
| status | Print out the status of the application. |
| logs | Print out the logs and keep following them. Do CTRL+C to exit the log. |
| exportlogs | Takes one exta parameter to give the file name where the logs will be exported to. |
Export and copy Logs¶
After exporting the logs of an application with exportlogs command as shown in the following example :
$ /srv/run-pev-controller.sh exportlogs pev_controller_logs.log
$ /srv/run-ccs-evcc.sh exportlogs ccs_evcc_logs.log
$ /srv/run-slac-pev.sh exportlogs slac_pev_logs.log
You can download the logs to your system:
- Using the command line interface:
$ scp root@<controllerIPAddress>:<LogsPath> <DestinationPath>
$ scp root@192.168.1.49:/root/pev_controller_logs.log .
- Or using the WINDOWS tool WinSCP (more convenient for WINDOWS users)