Skip to content
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

Feature/push to quay.io #4

Merged
merged 2 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions .github/workflows/kuksa_csv_provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
# list of Docker images to use as base name for tags
images: |
ghcr.io/eclipse-kuksa/kuksa-csv-provider/csv-provider
quay.io/eclipse-kuksa/csv-provider
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch
Expand All @@ -79,15 +80,23 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
- name: Log in to ghcr.io container registry
if: needs.check_ghcr_push.outputs.push == 'true'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build CSV provider container and push to ghcr.io (and ttl.sh)
- name: Log in to quay.io container registry
if: needs.check_ghcr_push.outputs.push == 'true'
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_IO_USERNAME }}
password: ${{ secrets.QUAY_IO_TOKEN }}

- name: Build CSV provider container and push to ghcr.io, quay.io and ttl.sh
id: ghcr-build
if: needs.check_ghcr_push.outputs.push == 'true'
uses: docker/build-push-action@v5
Expand Down
38 changes: 26 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ Therefore, it takes a CSV-file, containting pre-defined sequences of VSS signals

The provider requires an installation of Python in version 3 and can be executed with the following commands:

```
```console
pip install -r requirements.txt
python3 provider.py
```

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.

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.
The provider uses the [KUKSA Python SDK](https://github.com/eclipse-kuksa/kuksa-python-sdk), which you need to install on your system, e.g., by applying the [requirement.txt](requirements.txt) with pip.

## Arguments

Expand All @@ -27,16 +27,16 @@ You can start the provider with the following arguments on a command line:
|-f| --file | PROVIDER_SIGNALS_FILE | This indicates the CSV-file containing the signals to update in the KUKSA Databroker. | signals.csv |
| -a | --address | KUKSA_DATA_BROKER_ADDR | This indicates the address of KUKSA Databroker to connect to. | 127.0.0.1 |
| -p | --port | KUKSA_DATA_BROKER_PORT | This indicates the port of the KUKSA Databroker to connect to. | 55555 |
| -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
| -l | --log | PROVIDER_LOG_LEVEL | This sets the logging level. Possible values are: DEBUG, INFO, DEBUG, WARNING, ERROR, CRITICAL | WARNING
| | --cacertificate | - | Path to root CA. If defined the client will attempt to use a secure connection and identify the server using this certificate. | None
| | --tls-server-name | - | TLS server name, may be needed if addressing a server by IP-name. | None
| -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 |
| -l | --log | PROVIDER_LOG_LEVEL | This sets the logging level. Possible values are: DEBUG, INFO, DEBUG, WARNING, ERROR, CRITICAL | WARNING |
| | --cacertificate | - | Path to root CA. If defined the client will attempt to use a secure connection and identify the server using this certificate. | None |
| | --tls-server-name | - | TLS server name, may be needed if addressing a server by IP-name. | None |

## CSV File

An example CSV-files is available in [signals.csv](signals.csv) where an example line is:

```
```csv
current,Vehicle.Speed,48,1
```

Expand All @@ -47,7 +47,7 @@ Each line in the csv file consists of the following elements:
| header | description | example |
| -- | -----------| --|
| field | indicates whether to update the current value (`current`) or the target value (`target`) for the signal. | current |
| signal | the name of the signal to update | Vehicle.Speed
| signal | the name of the signal to update | Vehicle.Speed |
| value | the new value | 48 |
| 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 |

Expand All @@ -61,7 +61,7 @@ Due to a limitation in the gRPC client, if connecting by IP-address you may need
by the `--tls-server-name` argument. The example server certificate lists the names `Server` and `localhost`,
so one of those names needs to be specified if connecting to `127.0.0.1`. An example is shown below:

```
```console
python provider.py --cacertificate /home/user/kuksa.val/kuksa_certificates/CA.pem --tls-server-name Server
```

Expand All @@ -74,7 +74,7 @@ python provider.py --cacertificate /home/user/kuksa.val/kuksa_certificates/CA.pe
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.
An example call, only recording the vehicle speed and width would be:

```
```console
pip install -r requirements.txt
python3 recorder.py -s Vehicle.Speed Vehicle.Width
```
Expand All @@ -84,10 +84,24 @@ The recorder supports the following parameters:
| short argument | long argument | description | default value |
|---- | ---- | ----- | ----|
|-f| --file | This indicates the filename to which to write the VSS-signals. | signalsOut.csv |
|-s| --signals | A list of signals to record. | There is no default value, but the argument is required.| |
|-s| --signals | A list of signals to record. | There is no default value, but the argument is required.|
| -a | --address | This indicates the address of KUKSA Databroker to connect to. | 127.0.0.1 |
| -p | --port | This indicates the port of the KUKSA Databroker to connect to. | 55555 |
| -l | --log | This sets the logging level. Possible values are: DEBUG, INFO, WARNING, ERROR, CRITICAL | INFO
| -l | --log | This sets the logging level. Possible values are: DEBUG, INFO, WARNING, ERROR, CRITICAL | INFO |

## Container

CSV-provider is also available as container

```console
docker run -it --rm --net=host ghcr.io/eclipse-kuksa/kuksa-csv-provider/csv-provider:main
```

If the ghcr registry is not easily accessible to you, e.g. if you are a China mainland user, starting from release 0.4.4 we also made the container images available at quay.io:

```console
docker run -it --rm --net=host quay.io/eclipse-kuksa/csv-provider:main
```

## Pre-commit set up

Expand Down