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
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 5 additions & 1 deletion docker/docker-compose-cdsp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ services:

# Apache IoTDB acting as VSS Data Store
iotdb-service:
image: apache/iotdb:1.2.2-standalone
hostname: iotdb-service
container_name: iotdb-service
build:
context: iotdb # CDSP IoTDB image
args:
iotdb_version: 1.2.2
service_hostname: iotdb-service
restart: on-failure:3
ports:
- "6667:6667"
Expand Down
42 changes: 42 additions & 0 deletions docker/iotdb/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SPDX-FileCopyrightText: Copyright (c) 2024 Renesas Electronics
# SPDX-License-Identifier: MPL-2.0
#
# Dockerfile for the CDSP build of Apache IoTDB.
# ---------------------------------------------------------------------------

ARG IOTDB_VERSION=1.2.2
ARG IOTDB_IMAGE=apache/iotdb:${IOTDB_VERSION}-standalone

FROM ${IOTDB_IMAGE} AS cdsp-extras

ARG IOTDB_VERSION
ARG IOTDB_IMAGE

# UDF Data Quality library
ARG UDF_ARCHIVE_NAME=apache-iotdb-${IOTDB_VERSION}-library-udf-bin.zip
ARG UDF_ARCHIVE_URL=https://archive.apache.org/dist/iotdb/${IOTDB_VERSION}/${UDF_ARCHIVE_NAME}
ARG UDF_LIB_PATH=apache-iotdb-${IOTDB_VERSION}-library-udf-bin/ext/udf/library-udf.jar
ARG UDF_REG_SCRIPT_NAME=register-UDF.sh
ARG UDF_REG_SCRIPT_PATH=apache-iotdb-${IOTDB_VERSION}-library-udf-bin/tools/${UDF_REG_SCRIPT_NAME}
ARG SERVICE_HOSTNAME=iotdb-service

# General configuration
RUN apt update \
&& apt install unzip -y

# Add the optional IoTDB UDF Data Quality Library to the image.
# Note: to use the library functions the registration script must first be run in the running container.
WORKDIR ${IOTDB_HOME}/ext/udf
ADD ${UDF_ARCHIVE_URL} .
RUN unzip -j -o ${UDF_ARCHIVE_NAME} ${UDF_LIB_PATH} ${UDF_REG_SCRIPT_PATH} \
&& sed -i "s/^host=127.0.0.1/host=${SERVICE_HOSTNAME}/g" ${UDF_REG_SCRIPT_NAME} \
&& mv ${UDF_REG_SCRIPT_NAME} ${IOTDB_HOME}/sbin/ \
&& rm ${UDF_ARCHIVE_NAME}

WORKDIR ${IOTDB_HOME}/conf
# Enable IoTDB REST API as it is used by the IoTDB Grafana Connector for queries
RUN sed -i 's/^# enable_rest_service=false/enable_rest_service=true/g' iotdb-common.properties

# Set the entry point path to the IoTDB sbin directory where the IoTDB admin scripts are.
# This mimics the upstream image.
WORKDIR ${IOTDB_HOME}/sbin
Loading