COVESA / cdsp

The Central Data Service Playground.
https://covesa.github.io/cdsp/
Mozilla Public License 2.0
4 stars 8 forks source link

(WIP) Rebase on VISSR HEAD commit for upstreamed Apache IoTDB support #30

Closed slawr closed 7 months ago

slawr commented 7 months ago

Summary

This is a replacement for PR https://github.com/COVESA/cdsp/pull/20 which maintained a VISS server fork whilst the changes to add Apache IoTDB support were upstreamed.

This is a WIP to rebase on the upstream VISSR HEAD commit now they have been merged.


Here is some of the technical information relating to development and testing from that original PR:

Summary

Currently WAII supports the SQLite and Redis databases as State Storage backends. Extend WAII to support Apache IoTDB database as well.

Detail

Development environment:

Runtime assumptions:

Sanity testing

Sanity testing was carried out within a Docker deployment of the COVESA Central Data Service Playground:

  1. Create timeseries within database containing VSS nodes and populate some date.
    
    IoTDB> show timeseries
    +-------------------------------------------------------------+-----+---------------+--------+--------+-----------+----+----------+--------+------------------+--------+
    |                                                   Timeseries|Alias|       Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType|
    +-------------------------------------------------------------+-----+---------------+--------+--------+-----------+----+----------+--------+------------------+--------+
    |          root.test2.dev1.`Vehicle.CurrentLocation.Longitude`| null|root.test2.dev1|   FLOAT|   PLAIN|     SNAPPY|null|      null|    null|              null|    BASE|
    |           root.test2.dev1.`Vehicle.CurrentLocation.Latitude`| null|root.test2.dev1|   FLOAT|   PLAIN|     SNAPPY|null|      null|    null|              null|    BASE|
    |root.test2.dev1.`Vehicle.Cabin.Infotainment.HMI.DistanceUnit`| null|root.test2.dev1|    TEXT|   PLAIN|     SNAPPY|null|      null|    null|              null|    BASE|
    +-------------------------------------------------------------+-----+---------------+--------+--------+-----------+----+----------+--------+------------------+--------+
2. Using WAII HTML client connect to WAII and 'get' VSS node Vehicle.CurrentLocation.Longitude
3. Using WAII HTML client connect to WAII and 'set' VSS node Vehicle.Cabin.Infotainment.HMI.DistanceUnit
4. Check HTML client reports success and values set/returned match the data in the database.
![playground-iotdb-set](https://github.com/w3c/automotive-viss2/assets/4562522/878b6b54-d608-4fa4-94b9-de2445c89cb3)

### Setup
If you wish to try it then using the default configuration WAII makes the following runtime assumptions when accessing the DB:

1. Your database is root.test2.dev1
2. That a timeseries exists in the DB with the VSS nodes you want to work with.

Both are easy to create in the DB cli:

1. With the Playground docker deployment running (see playground docker readme for instructions) connect to the DB CLI from your host:
`$ sudo docker exec -ti iotdb-service /iotdb/sbin/start-cli.sh -h iotdb-service`
2. Create database from CLI command line:
`IoTDB > create database root.test2.dev1`
3. Create timeseries from CLI command line:

IoTDB > CREATE ALIGNED TIMESERIES root.test2.dev1(Vehicle.CurrentLocation.Longitude FLOAT, Vehicle.CurrentLocation.Latitude FLOAT, Vehicle.Cabin.Infotainment.HMI.DistanceUnit TEXT)

4 Add some data into the timeseries:

IoTDB> insert into root.test2.dev1(Vehicle.CurrentLocation.Longitude, Vehicle.CurrentLocation.Latitude, Vehicle.Cabin.Infotainment.HMI.DistanceUnit) values(-42.4567, 22.1234, "MILES")