-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Leda deployment #4
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,69 +18,89 @@ limitations under the License. | |
|
||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
# Setting Up a Leda Image | ||
The components of the Fleet Management blueprint fall into two categories: the *kuksa.val Databroker*, | ||
*CSV Provider* and *FMS Forwarder* components are supposed to run in the vehicle, whereas the remaining | ||
components are supposed to run in a (cloud) back end to which the vehicle is connected via (public internet) | ||
networking infrastructure. | ||
|
||
The setup for this FMS scenario assumes a split into components running in the vehicles and components | ||
running in a (cloud) backend. The following page describes how to configure a Leda instance to become part | ||
of this FMS setup. More precisely, we deploy the containers for the feedercan, the fms-forwarder, | ||
and the Kuksa.val databroker with an FMS-specific vehicle model. | ||
All of the components can be run on a single Docker host as described in the [top level README](../README.md). However, the following sections describe a more realistic deployment scenario in which | ||
[Eclipse Leda](https://eclipse-leda.github.io/leda/) is used as the vehicle runtime environment. | ||
|
||
## Run Leda | ||
The following steps assume a running instance of Eclipse Leda. For more details see the | ||
[Eclipse Leda Getting Started](https://eclipse-leda.github.io/leda/docs/general-usage/) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would still reference this sub-page of the Eclipse documentation, since it can be helpful for newcomers to Eclipse Leda to have a pointer to the different installation options of Eclipse Leda (QEMU, Pi4, Docker, etc.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is still referenced in the Start In-Vehicle Components section ... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I See, then I would have mentioned the tested Leda version down there as well. But the current version of mentioning the version here works for me too. |
||
This guide was tested with release v0.1.0-M1 of Eclipse Leda. | ||
This guide was tested with release v0.1.0-M2 of Eclipse Leda. | ||
|
||
## Backup existing manifestes | ||
In Leda, there are manifests to manage the execution of containers by Eclipse Kanto. During the next steps we | ||
will overwrite some of the default manifests (`databroker.json`, `feedercan.json`). Because of that, | ||
we recommend to backup the existing manifests from `/data/var/containers/mainfests`. | ||
# Start Back End Components | ||
|
||
## Copy manifests to Leda | ||
To trigger the execution of the required containers for the FMS setup, copy the manifest files from | ||
`leda/data/var/containers/manifests` in the host to `/data/var/containers/manifests` in Leda: | ||
The containers for the back end components are run on the local host using Docker Compose: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could mention the different available profiles here or reference the description of the Compose file here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FMPOV this should be covered as part of adding a description (in another PR) of how to set it up using Eclipse Hono. In a cloud based setup I would not suggest to connect the vehicle(s) directly to influxdb ... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Describing this in another PR sounds good to me, as far as the 'direct' profile is the default. |
||
|
||
``` | ||
manifests % scp -P 2222 *.json [email protected]:/data/var/containers/manifests | ||
```sh | ||
# in this repository's root folder | ||
docker compose -f fms-blueprint-compose.yaml up influxdb grafana fms-server --detach | ||
``` | ||
|
||
## Create folders in Leda mounted in mainfests | ||
The containers described within the manifests require files that are not present in Leda like the FMS-specific vehicle model. | ||
Therefore, we need to create the paths (e.g,. `mkdir`) in Leda from which the containers try to mount these files which are: | ||
# Start In-Vehicle Coponents | ||
|
||
- `mkdir -p /data/usr/fms/dbc` | ||
- `mkdir -p /data/usr/fms/databroker` | ||
The containers for the in-vehicle components are deployed to a Leda instance running on the | ||
same (local) host that the back end components have been started on. | ||
The *FMS Forwarder* running in Leda will then directly connect to the *influxdb* server managed | ||
by Docker Compose. | ||
|
||
## Copy required files to leda folders: | ||
Now you can copy the files required by the containers to Leda. Execute in the root of this repository on the host: | ||
``` | ||
scp -P 2222 csv-provider/signalsFmsRecording.csv [email protected]:/data/usr/fms/csv | ||
scp -P 2222 spec/overlay/vss.json [email protected]:/data/usr/fms/databroker | ||
``` | ||
Please refer to [Leda's Getting Started](https://eclipse-leda.github.io/leda/docs/general-usage/) | ||
guide for setting up a Leda instance. | ||
|
||
## Stop default Containers | ||
|
||
Leda comes with a set of default containers (including kuksa.val Databroker) that are managed using | ||
Eclipse Kanto's *container-manager*. These containers are defined by means of JSON manifest files in | ||
Leda's `/data/var/containers/mainfests` folder. | ||
|
||
## Start backend on host | ||
Besides the in-vehicle containers in Leda, we still need the backend for the full FMS setup. | ||
You can start the remaining containers on the host with: | ||
We will stop and disable some of Leda's default containers, make some changes to the configuration of the | ||
Databroker container and also deploy additional containers. | ||
|
||
```sh | ||
# in Leda instance's /data/var/containers/mainfests folder | ||
tar cf manifests.orig.tar * | ||
kanto-cm stop --force -n feedercan | ||
mv feedercan.json feedercan.json.disabled | ||
kanto-cm stop --force -n hvacservice-example | ||
mv hvac.json hvac.json.disabled | ||
kanto-cm stop --force -n seatservice-example | ||
mv seatservice.json seatservice.json.disabled | ||
``` | ||
docker compose -f fms-blueprint-compose.yaml up influxdb grafana fms-server --detach | ||
|
||
## Deploy in-vehicle Blueprint Components | ||
|
||
Some of the Fleet Management blueprint containers require access to configuration files that are not present | ||
in Leda, e.g. the FMS-specific VSS definitions. | ||
|
||
Create the folders in Leda from which the containers can mount these files: | ||
|
||
```sh | ||
# in Leda instance | ||
mkdir -p /data/usr/fms/csv /data/usr/fms/databroker /data/usr/fms/forwarder | ||
``` | ||
|
||
## Configure InfluxDB token | ||
The fms-forwarder needs a token to write data into the InfluxDB which has been started on the host. | ||
There are multiple ways to retrieve this token, e.g., through the web-interface of InfluxDB | ||
(localhost:8086). One approach through the command line is the following: | ||
Now copy the files required by the containers to the Leda instance: | ||
|
||
```sh | ||
# on the (local) host that you have started the back end components on | ||
docker exec -it influxDB cat /tmp/out/fms-demo.token > /tmp/influxdb.token | ||
``` | ||
docker exec -it influxDB cat /tmp/out/fms-demo.token | ||
|
||
```sh | ||
# in this repository's root folder | ||
# The CSV Provider needs acces to the recording of the signals to play back. | ||
scp -P 2222 csv-provider/signalsFmsRecording.csv [email protected]:/data/usr/fms/csv | ||
# The kuksa.val Databroker needs to be configured with the VSS definition that also contains | ||
# the fleet management specific signals. The default definition file that comes with Leda does | ||
# not contain these. | ||
scp -P 2222 spec/overlay/vss.json [email protected]:/data/usr/fms/databroker | ||
# The FMS Forwarder needs to read the token required for authenticating to influxdb. | ||
scp -P 2222 /tmp/influxdb.token [email protected]:/data/usr/fms/forwarder | ||
``` | ||
|
||
You can then insert the token in the `/data/var/containers/manifests/fms-forwarder.json` manifest | ||
in Leda at the bottom of the file as value for | ||
Finally, copy the manifest files to Leda, triggering the execution of the in-vehicle containers: | ||
|
||
```json | ||
"config": { | ||
"env": [ | ||
"INFLUXDB_API_TOKEN=" | ||
] | ||
} | ||
```sh | ||
# in this repository's root folder | ||
scp -P 2222 leda/data/var/containers/manifests/*.json [email protected]:/data/var/containers/manifests | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would still mention here that the databroker needs to be configured with another vehicle model compared to the default model set in the Eclipse Leda release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add a comment to the instructions given in the Deploy in-vehicle Components section ...