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

Apache IoTDB: Integrate IoTDB Data Quality Library and enable visualisation in Grafana #52

Merged
merged 5 commits into from
Aug 12, 2024

Conversation

slawr
Copy link
Collaborator

@slawr slawr commented Jul 3, 2024

Summary

Changes:

  1. Integrate the Apache IoTDB Data Quality Library into the CDSP IoTDB image to allow for more advanced data processing.
  2. Enable the REST API in the CDSP IoTDB image to allow visualisation in Grafana.
  3. To enable the above introduce a CDSP IoTDB specific Docker image.
  4. Extend IoTDB section of CDSP online documentation to outline functionality added by the Library.
  5. Add example illustrating use of the library.

This is a WIP as the documentation for this needs to be added. This should not be merged without discussion with the author.

User note

To use the Data Quality Library the functions must be first registered in a running IoTDB instance. This need only be done once.
A script is provided to do this for you. With the Playground running run the following command from the host:
sudo docker exec -ti iotdb-service /iotdb/sbin/register-UDF.sh

Example use of the Data Quality Library to down-sample the timeseries root.test2.dev1.`Vehicle.Speed` to 100 points using the triangle method:
select sample(`Vehicle.Speed`,'method'='triangle','k'='100') from root.test2.dev1

Instructions for connecting Grafana to IoTDB using the IoTDB Grafana-Plugin can be found upstream here:
https://iotdb.apache.org/UserGuide/latest/Ecosystem-Integration/Grafana-Plugin.html

Technical Detail

Introduce a Dockerfile to build a CDSP specific Apache IoTDB image.

To keep the build as simple and quick as possible the starting point is
the pre-built IoTDB image from the upstream IoTDB project. This avoids
the burden of building IoTDB from scratch. This can be done because
currently our needs are limited to configuration and adding some
additional files.

Beyond some specific runtime environment values that can be hot loaded
IoTDB stores configuration in files located in the 'conf' directory.
For some specific use cases it is useful to automate the configuration
so end users of the Playground do not need to have to go through a lot
of manual configuration. For example, in this commit we enable the REST
API which is used by the IoTDB Grafana Connector to make DB queries.

In addition this commit integrates the optional IoTDB UDF (User Defined
Function) Data Quality Library into the image, which greatly extends
the data processing functions of IoTDB.

slawr added 2 commits July 3, 2024 14:08
Introduce a Dockerfile to build a CDSP specific Apache IoTDB image.

To keep the build as simple and quick as possible the starting point is
the pre-built IoTDB image from the upstream IoTDB project. This avoids
the burden of building IoTDB from scratch. This can be done because
currently our needs are limited to configuration and adding some
additional files.

Beyond some specific runtime environment values that can be hot loaded
IoTDB stores configuration in files located in the 'conf' directory.
For some specific use cases it is useful to automate the configuration
so end users of the Playground do not need to have to go through a lot
of manual configuration. For example, in this commit we enable the REST
API which is used by the IoTDB Grafana Connector to make DB queries.

In addition this commit integrates the optional IoTDB UDF (User Defined
Function) Data Quality Library into the image, which greatly extends
the data processing functions of IoTDB.

Signed-off-by: Stephen Lawrence <[email protected]>
To allow ease of configuration of Apache IoTDB and the ability to add
files to the image, a Dockerfile for a CDSP Apache IoTDB image was
introduced in a prior commit.

Now change the CDSP docker compose to use this Dockerfile rather than
simply use the upstream pre-built image.

Signed-off-by: Stephen Lawrence <[email protected]>
@slawr slawr added enhancement New feature or request task Task not fitting other labels, e.g. project ops labels Jul 3, 2024
@slawr slawr self-assigned this Jul 3, 2024
The Playground docker deployment now includes the IoTDB project's
Data Quality Library of data processing functions in the Playground
IoTDB container image.

Rewrite the existing UDF section of the IoTDB reference manual to better
explain the built-in functions and those provided in the Data Quality
Library. Along with how to enable the Library functions.

Signed-off-by: Stephen Lawrence <[email protected]>
@slawr
Copy link
Collaborator Author

slawr commented Jul 5, 2024

PR update: Added documentation for the IoTDB Data Quality Library to the doc site

@slawr
Copy link
Collaborator Author

slawr commented Jul 29, 2024

PR update 26/7: added WIP example for the using the library. Example down-samples high frequency vehicle.speed data

@slawr slawr requested a review from chrizmc July 29, 2024 16:00
@slawr slawr force-pushed the iotdb-udf-grafana branch 5 times, most recently from 50b0220 to b7b47cb Compare August 2, 2024 18:43
@slawr
Copy link
Collaborator Author

slawr commented Aug 2, 2024

Substantially updated the README.md that documents the timeseries transformation example. Squashed a series of commits during the last week for related changes.

@chrizmc
Copy link
Collaborator

chrizmc commented Aug 6, 2024

Is it still WIP or is it ready for review?

@slawr
Copy link
Collaborator Author

slawr commented Aug 6, 2024

Is it still WIP or is it ready for review?

Given your time constraints before your leave I think you could review, but not yet merge, as its 95% done.
I don't intend to change the code and documentation related to the Playground core changes for IoTDB, which integrates the Data Quality Library and configures the DB for Grafana.

With the example the coding is done and I just need to complete the documentation in the readme. I planned to do that yesterday but didn't achieve it. What's left to do on the readme:

  1. There are a couple of sentences I have spotted that could be improved.
  2. I need to spell and grammer check.
  3. Decide whether I add screen shots to the Grafana section about creating a dashboard panel that shows the down-sampling. It's standard Grafana stuff so it could be considered as not needed, or added as a second step.

It would be great of course for this to be your first merge, but depending on what time you have left a review is also useful.

Add an example that illustrates using the Playground to transform
timeseries data using the Apache IoTDB data store. It does this by
accurately down-sampling a timeseries of pre-recorded high frequency VSS
Vehicle.Speed data using the IoTDB Data Quality Library function Sample.

Signed-off-by: Stephen Lawrence <[email protected]>
@slawr
Copy link
Collaborator Author

slawr commented Aug 6, 2024

Extended the example documentation to include notes on using Grafana.
Example documentation is also now checked.

@slawr slawr changed the title [WIP] Apache IoTDB: Integrate IoTDB Data Quality Library and enable visualisation in Grafana Apache IoTDB: Integrate IoTDB Data Quality Library and enable visualisation in Grafana Aug 6, 2024
@slawr
Copy link
Collaborator Author

slawr commented Aug 6, 2024

Removed WIP from the title as the PR is now ready.

@chrizmc Please review and consider for possible merging. As discussed if merging please use "Rebase and merge" as the default Github merge strategy.

Extend the documentation for the IoTDB Data Processing example that shows
down-sampling of VSS vehicle.speed to include using Grafana.

Signed-off-by: Stephen Lawrence <[email protected]>
@slawr
Copy link
Collaborator Author

slawr commented Aug 12, 2024

Pushed final minor documentation changes prior to merge.

@slawr
Copy link
Collaborator Author

slawr commented Aug 12, 2024

[12/8/2024] I met with my fellow CDSP Maintainer @chrizmc just before Christian has gone on extended leave. Unfortunately we were unable to get this PR reviewed and merged by him before his leave. He however is familiar with the work and he is happy for me to merge when ready. The Docker changes have been reviewed by his colleague @sschleemilch.

After a final check I am now merging.

@slawr slawr merged commit b5c4338 into COVESA:main Aug 12, 2024
1 check passed
@slawr slawr mentioned this pull request Sep 2, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request task Task not fitting other labels, e.g. project ops
Projects
Development

Successfully merging this pull request may close these issues.

3 participants