Skip to content

Commit 890ba43

Browse files
committed
CSV Provider Migration
1 parent 16a7acc commit 890ba43

File tree

9 files changed

+101
-106
lines changed

9 files changed

+101
-106
lines changed

.github/workflows/kuksa_csv_provider.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ on:
1717
push:
1818
branches: [ main ]
1919
pull_request:
20-
paths:
21-
- ".github/workflows/kuksa_csv_provider.yml"
22-
- ".github/actions/post-container-location/action.yml"
23-
- "csv_provider/**"
2420
workflow_dispatch:
2521

2622
concurrency:
2723
group: ${{ github.ref }}-${{ github.workflow }}
2824
cancel-in-progress: true
2925

26+
# Needed as default_workflow_permissions is "read"
27+
permissions:
28+
packages: write
29+
3030
jobs:
3131
check_ghcr_push:
3232
uses: eclipse-kuksa/kuksa-actions/.github/workflows/check_ghcr_push.yml@2
@@ -42,7 +42,6 @@ jobs:
4242

4343
- name: Run pylint (but accept errors for now)
4444
run: |
45-
cd csv_provider
4645
pip3 install --no-cache-dir -r requirements.txt
4746
pip3 install --no-cache-dir pylint
4847
# First just show, never fail
@@ -65,7 +64,7 @@ jobs:
6564
with:
6665
# list of Docker images to use as base name for tags
6766
images: |
68-
ghcr.io/eclipse/kuksa.val.feeders/csv-provider
67+
ghcr.io/eclipse-kuksa/kuksa-csv-provider/csv-provider
6968
# generate Docker tags based on the following events/attributes
7069
tags: |
7170
type=ref,event=branch
@@ -96,12 +95,12 @@ jobs:
9695
platforms: |
9796
linux/amd64
9897
linux/arm64
99-
file: ./csv_provider/Dockerfile
100-
context: ./csv_provider/
98+
file: ./Dockerfile
99+
context: ./
101100
push: true
102101
tags: |
103102
${{ steps.meta.outputs.tags }}
104-
ttl.sh/kuksa.val/kuksa-csvprovider-${{github.sha}}
103+
ttl.sh/eclipse-kuksa/kuksa-csv-provider/csv-provider-${{github.sha}}
105104
labels: ${{ steps.meta.outputs.labels }}
106105

107106
- name: Build ephemeral CSV provider container and push to ttl.sh
@@ -112,13 +111,13 @@ jobs:
112111
platforms: |
113112
linux/amd64
114113
linux/arm64
115-
file: ./csv_provider/Dockerfile
116-
context: ./csv_provider/
114+
file: ./Dockerfile
115+
context: ./
117116
push: true
118-
tags: "ttl.sh/kuksa.val/kuksa-csvprovider-${{github.sha}}"
117+
tags: ttl.sh/eclipse-kuksa/kuksa-csv-provider/csv-provider-${{github.sha}}
119118
labels: ${{ steps.meta.outputs.labels }}
120119

121120
- name: Posting message
122-
uses: ./.github/actions/post-container-location
121+
uses: eclipse-kuksa/kuksa-actions/post-container-location@2
123122
with:
124-
image: ttl.sh/kuksa.val/kuksa-csvprovider-${{github.sha}}
123+
image: ttl.sh/eclipse-kuksa/kuksa-csv-provider/csv-provider-${{github.sha}}
File renamed without changes.

LICENSE.txt renamed to LICENSE

File renamed without changes.

README.md

Lines changed: 88 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,96 @@
1-
# Kuksa Feeders
1+
# KUKSA CSV Provider
2+
23
![kuksa.val Logo](./doc/img/logo.png)
34

4-
This are data feeders for VSS based systems. The feeders here work with [KUKSA.val](https://github.com/eclipse/kuksa.val)
5+
The aim of this script is to provide and replay VSS data into a [KUKSA Databroker](https://github.com/eclipse/kuksa.val/tree/master/kuksa_databroker).
6+
Therefore, it takes a CSV-file, containting pre-defined sequences of VSS signals including timing delays, and provides it to the KUKSA Databroker.
7+
8+
## Usage
9+
10+
The provider requires an installation of Python in version 3 and can be executed with the following commands:
11+
12+
```
13+
pip install -r requirements.txt
14+
python3 provider.py
15+
```
16+
17+
This assumes a running KUKSA Databroker at `127.0.0.1:55555` and a file named `signals.csv` containing the signals to apply. See the section [Arguments](#arguments) for more details on possible arguments and default values.
18+
19+
The provider uses the [kuksa_client]() Python implementation which you need to install on your system, e.g., by applying the [requirement.txt](requirements.txt) with pip.
20+
21+
## Arguments
22+
23+
You can start the provider with the following arguments on a command line:
24+
25+
| short argument | long argument | environment variable | description | default value |
26+
|---- | ---- | ---- |----- | ----|
27+
|-f| --file | PROVIDER_SIGNALS_FILE | This indicates the CSV-file containing the signals to update in the KUKSA Databroker. | signals.csv |
28+
| -a | --address | KUKSA_DATA_BROKER_ADDR | This indicates the address of KUKSA Databroker to connect to. | 127.0.0.1 |
29+
| -p | --port | KUKSA_DATA_BROKER_PORT | This indicates the port of the KUKSA Databroker to connect to. | 55555 |
30+
| -i | --infinite | PROVIDER_INFINITE | If the flag is set, the provider loops over the file until stopped, otherwise the file gets processed once. | not present/False
31+
| -l | --log | PROVIDER_LOG_LEVEL | This sets the logging level. Possible values are: DEBUG, INFO, DEBUG, WARNING, ERROR, CRITICAL | WARNING
32+
| | --cacertificate | - | Path to root CA. If defined the client will attempt to use a secure connection and identify the server using this certificate. | None
33+
| | --tls-server-name | - | TLS server name, may be needed if addressing a server by IP-name. | None
34+
35+
## CSV File
36+
37+
An example CSV-files is available in [signals.csv](signals.csv) where an example line is:
38+
39+
```
40+
current,Vehicle.Speed,48,1
41+
```
42+
43+
The delimiter for the CSV-file is the ',' sign. The first line is interpreted as header and not as data.
544

6-
Name | Description
7-
---- | -----------
8-
[GPS Provider](https://github.com/eclipse-kuksa/kuksa-gps-provider) | GPS data source for KUKSA.val Server and KUKSA.val Databroker *- NOTE: Moved to new repo!*
9-
[CAN Provider (DBC feeder)](https://github.com/eclipse-kuksa/kuksa-can-provider) | DBC feeder for for KUKSA.val Server and KUKSA.val Databroker *- NOTE: Moved to new repo!*
10-
[SOME/IP feeder](./someip2val) | SOME/IP feeder for KUKSA.val Databroker
11-
[DDS Provider](https://github.com/eclipse-kuksa/kuksa-dds-provider) | DDS provider for KUKSA.val Databroker *- NOTE: Moved to new repo!*
12-
[Replay](./replay) | KUKSA.val Server replay script for previously recorded files, created by providing KUKSA.val Server with `--record` argument
13-
[CSV provider](./csv_provider) | Script to replay VSS signals to KUKSA.val Databroker as defined in a CSV-file
45+
Each line in the csv file consists of the following elements:
46+
47+
| header | description | example |
48+
| -- | -----------| --|
49+
| field | indicates whether to update the current value (`current`) or the target value (`target`) for the signal. | current |
50+
| signal | the name of the signal to update | Vehicle.Speed
51+
| value | the new value | 48 |
52+
| delay | Indicates the time in seconds which the provider shall wait after processing this signal. This way one can emulate the change of signals over time. | 0 |
53+
54+
## TLS
55+
56+
If connecting to a KUKSA Databroker that require a secure connection you must specify which root certificate to
57+
use to identify the Server by the `--cacertificate` argument. If your (test) setup use the KUKSA example
58+
certificates you must give [CA.pem](https://github.com/eclipse/kuksa.val/blob/master/kuksa_certificates/CA.pem)
59+
as root CA. The server name must match the name in the certificate provided by KUKSA.val databroker.
60+
Due to a limitation in the gRPC client, if connecting by IP-address you may need to give a name listed in the certificate
61+
by the `--tls-server-name` argument. The example server certificate lists the names `Server` and `localhost`,
62+
so one of those names needs to be specified if connecting to `127.0.0.1`. An example is shown below:
63+
64+
```
65+
python provider.py --cacertificate /home/user/kuksa.val/kuksa_certificates/CA.pem --tls-server-name Server
66+
```
67+
68+
## Limitations
69+
70+
* CSV Provider does not support authentication, i.e. it is impossible to communicate with a Databroker that require authentication!
71+
72+
## Recorder
73+
74+
One way to generate a CSV-file for the CSV-provider is to record it from an KUKSA Databroker. This way one can reproduce an interaction of different providers with the KUKSA Databroker. The script in `csv_provider/recorder.py` allows this recording.
75+
An example call, only recording the vehicle speed and width would be:
76+
77+
```
78+
pip install -r requirements.txt
79+
python3 recorder.py -s Vehicle.Speed Vehicle.Width
80+
```
81+
82+
The recorder supports the following parameters:
83+
84+
| short argument | long argument | description | default value |
85+
|---- | ---- | ----- | ----|
86+
|-f| --file | This indicates the filename to which to write the VSS-signals. | signalsOut.csv |
87+
|-s| --signals | A list of signals to record. | There is no default value, but the argument is required.| |
88+
| -a | --address | This indicates the address of KUKSA Databroker to connect to. | 127.0.0.1 |
89+
| -p | --port | This indicates the port of the KUKSA Databroker to connect to. | 55555 |
90+
| -l | --log | This sets the logging level. Possible values are: DEBUG, INFO, WARNING, ERROR, CRITICAL | INFO
1491

1592
## Pre-commit set up
93+
1694
This repository is set up to use [pre-commit](https://pre-commit.com/) hooks.
1795
Use `pip install pre-commit` to install pre-commit.
1896
After you clone the project, run `pre-commit install` to install pre-commit into your git hooks.

csv_provider/README.md

Lines changed: 0 additions & 82 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)