diff --git a/_config.yml b/_config.yml index 6f86109d04..cf04a291d2 100644 --- a/_config.yml +++ b/_config.yml @@ -102,4 +102,4 @@ release: pe_dart_client_ver: 4.0.0 broker_full_ver: 2.2.0 broker_branch: release-2.2.0 - trendz_ver: 1.13.2 + trendz_ver: 1.14.0 diff --git a/_data/trendz/installation.yml b/_data/trendz/installation.yml index 5b7a067cec..e9637c1c3e 100644 --- a/_data/trendz/installation.yml +++ b/_data/trendz/installation.yml @@ -25,6 +25,12 @@ toc: path: /docs/trendz/install/trndz-upgrade-instructions/ - title: Kubernetes path: /docs/trendz/install/trndz-upgrade-instructions-kubernetes/ +- title: Python Executor Configuration + section: + - title: Windows + path: /docs/trendz/install/python-executor-configuration-windows/ + - title: Linux or Mac OS + path: /docs/trendz/install/python-executor-configuration-linux/ - title: Connect Trendz to Thingsboard path: /docs/trendz/connect-thingsboard/ - title: Configuration properties diff --git a/docs/trendz/install/docker-windows.md b/docs/trendz/install/docker-windows.md index 4392f35713..10d9aa2923 100644 --- a/docs/trendz/install/docker-windows.md +++ b/docs/trendz/install/docker-windows.md @@ -56,7 +56,7 @@ services: SPRING_DATASOURCE_USERNAME: postgres SPRING_DATASOURCE_PASSWORD: postgres SCRIPT_ENGINE_PROVIDER: DOCKER_CONTAINER - SCRIPT_ENGINE_DOCKER_PROVIDER_URL: mypyexecutor:8080 + SCRIPT_ENGINE_DOCKER_PROVIDER_URL: mypyexecutor:8181 SCRIPT_ENGINE_TIMEOUT: 30000 volumes: - mytrendz-data:/data @@ -73,6 +73,8 @@ services: THROTTLING_QUEUE_CAPACITY: 10 THROTTLING_THREAD_POOL_SIZE: 6 NETWORK_BUFFER_SIZE: 10485760 + volumes: + - mytrendz-data/python-executor:/python-executor postgres: restart: always image: "postgres:15" @@ -88,6 +90,8 @@ volumes: external: true mytrendz-logs: external: true + mytrendz-data-python-executor: + external: true mytrendz-data-db: external: true ``` @@ -106,7 +110,8 @@ Where: - `thingsboard/trendz:{{ site.release.trendz_ver }}` - Trendz docker image - `thingsboard/trendz-python-executor:{{ site.release.trendz_ver }}` - Trendz python script executor docker image - `SCRIPT_ENGINE_RUNTIME_TIMEOUT` - Python script execution timeout - +- `mytrendz-data/python-executor:/python-executor` - mounts the volume `mytrendz-data/python-executor` to Trendz Python Executor additional data directory + ### Setup Docker volumes Windows users should use docker managed volume for Trendz DataBase. Create docker volume (for ex. `mytrendz-data`) before @@ -115,11 +120,12 @@ executing docker run command: Open “Docker Quickstart Terminal”. Execute the ```yml docker volume create mytrendz-data docker volume create mytrendz-data-db +docker volume create mytrendz-data-python-executor docker volume create mytrendz-logs ``` {: .copy-code} -**NOTE**: replace directory ~/.mytrendz-data and ~/.mytrendz-logs with directories you’re planning to used in docker-compose.yml. +**NOTE**: replace directory mytrendz-data and mytrendz-logs with directories you’re planning to used in docker-compose.yml. ### Running service diff --git a/docs/trendz/install/docker.md b/docs/trendz/install/docker.md index 6e282c22ab..cba99a6a68 100644 --- a/docs/trendz/install/docker.md +++ b/docs/trendz/install/docker.md @@ -75,6 +75,8 @@ services: THROTTLING_QUEUE_CAPACITY: 10 THROTTLING_THREAD_POOL_SIZE: 6 NETWORK_BUFFER_SIZE: 5242880 + volumes: + - ~/.mytrendz-data/python-executor:/python-executor postgres: restart: always image: "postgres:15" @@ -101,6 +103,7 @@ Where: - `thingsboard/trendz:{{ site.release.trendz_ver }}` - Trendz docker image - `thingsboard/trendz-python-executor:{{ site.release.trendz_ver }}` - Trendz python script executor docker image - `SCRIPT_ENGINE_RUNTIME_TIMEOUT` - Python script execution timeout +- `~/.mytrendz-data/python-executor:/python-executor` - mounts the volume `~/.mytrendz-data/python-executor` to Trendz Python Executor additional data directory Run following commands, before starting docker container(s), to create folders for storing data and logs. @@ -109,6 +112,7 @@ To do this (to change user) **chown** command is used, and this command requires ```bash mkdir -p ~/.mytrendz-data && sudo chown -R 799:799 ~/.mytrendz-data +mkdir -p ~/.mytrendz-data/python-executor && sudo chown -R 799:799 ~/.mytrendz-data/python-executor mkdir -p ~/.mytrendz-logs && sudo chown -R 799:799 ~/.mytrendz-logs ``` {: .copy-code} @@ -131,6 +135,7 @@ Trendz uses ThingsBoard as an authentication service. During first sign in Thing to validate credentials. ## Post-installation steps + It is essential to follow these [instructions](/docs/trendz/post-installation-steps) to fully use all features, such as saving telemetry to ThingsBoard and adding Trendz views to dashboards. ## Detaching, stop and start commands @@ -141,7 +146,7 @@ It is essential to follow these [instructions](/docs/trendz/post-installation-st ## Upgrade Trendz Service -Below is example on how to upgrade from 1.13.1 to {{ site.release.trendz_ver }} +Below is example on how to upgrade from 1.13.2 to {{ site.release.trendz_ver }} * Create a dump of your database: @@ -159,17 +164,17 @@ If you still rely on Docker Compose as docker-compose (with a hyphen) execute ne * Set upgradeversion variable to your **previous** Trendz version. ```bash -docker compose exec mytrendz sh -c "echo '1.13.1' > /data/.upgradeversion" +docker compose exec mytrendz sh -c "echo '1.13.2' > /data/.upgradeversion" ``` {: .copy-code} {% capture dockerComposeStandalone %} If you still rely on Docker Compose as docker-compose (with a hyphen) execute next command: -
**docker-compose exec mytrendz sh -c "echo '1.13.1' > /data/.upgradeversion"** +
**docker-compose exec mytrendz sh -c "echo '1.13.2' > /data/.upgradeversion"** {% endcapture %} {% include templates/info-banner.md content=dockerComposeStandalone %} -* After this you need to update docker-compose.yml as in [Step 2](#docker-compose-setup) but with {{ site.release.trendz_ver }} instead of 1.13.1: +* After this you need to update docker-compose.yml as in [Step 2](#docker-compose-setup) but with {{ site.release.trendz_ver }} instead of 1.13.3: * Restart Trendz container @@ -188,61 +193,6 @@ If you still rely on Docker Compose as docker-compose (with a hyphen) here is th To upgrade Trendz to the latest version those steps should be done **for each intermediate version**. -## Standalone Python executor service -You can use following docker compose file in case when you want to start Trendz python executor as a separate service. -It is useful when your Trendz service is installed in monolith mode, and you want to logically separate Trendz from service that executes Python scripts for prediction models. -Using same configuration you can scale Python executors independently of Trendz service. - -Create docker compose file: - -```text -sudo nano docker-compose.yml -``` -{: .copy-code} - -Add following configuration: - -```yml -version: '3.0' -services: - mypyexecutor: - restart: always - image: "thingsboard/trendz-python-executor:{{ site.release.trendz_ver }}" - ports: - - "8181:8181" - environment: - SCRIPT_ENGINE_RUNTIME_TIMEOUT: 30000 - EXECUTOR_MANAGER: 1 - EXECUTOR_SCRIPT_ENGINE: 6 - THROTTLING_QUEUE_CAPACITY: 10 - THROTTLING_THREAD_POOL_SIZE: 6 - NETWORK_BUFFER_SIZE: 10485760 -``` -{: .copy-code} - -Where: - -- `8080` - Python executor port for communication with Trendz service -- `--restart always` - automatically start Trendz in case of system reboot and restart in case of failure. -- `thingsboard/trendz-python-executor:{{ site.release.trendz_ver }}` - Trendz python script executor docker image -- `SCRIPT_ENGINE_RUNTIME_TIMEOUT` - Python script execution timeout - -```text -docker compose up -d -docker compose logs -f mypyexecutor -``` - -* Final step is to tell Trendz service how to communicate with Python executor service. You can do that by changing following environment variables in `/usr/share/trendz/conf/trendz.conf` file: - -```bash -export SCRIPT_ENGINE_TIMEOUT=30000 -export SCRIPT_ENGINE_PROVIDER=DOCKER_CONTAINER -export SCRIPT_ENGINE_DOCKER_PROVIDER_URL=PYTHON_EXECUTOR_HOST:PYTHON_EXECUTOR_PORT -``` -{: .copy-code} - -Note: you need to replace `PYTHON_EXECUTOR_HOST` and `PYTHON_EXECUTOR_PORT` with actual values of your Python executor service and ensure that Trendz is able to send network traffic to that destination. - ## Troubleshooting ### DNS issues diff --git a/docs/trendz/install/python-executor-configuration-linux.md b/docs/trendz/install/python-executor-configuration-linux.md new file mode 100644 index 0000000000..620cb3df83 --- /dev/null +++ b/docs/trendz/install/python-executor-configuration-linux.md @@ -0,0 +1,209 @@ +--- +layout: docwithnav-trendz +title: Trendz Python Executor Configuration +description: How to configure Trendz Python Executor on Linux or Mac OS + +--- + +* TOC +{:toc} + +## Overview + +Trendz Python Executor is required to run: + +* Python Calculation fields +* All prediction models (except Fourier Transformation) +* Code generation for Metric Explorer + +Starting from version 1.14.0, the only way to run these features is via Trendz Python Executor using Docker (or Kubernetes). + +## Python Executor Standalone Installation + +### Step 1: Create Docker Compose File + +Create the Docker Compose file with the following configuration: + +```yml +version: '3.0' +services: + mypyexecutor: + restart: always + image: "thingsboard/trendz-python-executor:{{ site.release.trendz_ver }}" + ports: + - "8181:8181" + environment: + SCRIPT_ENGINE_RUNTIME_TIMEOUT: 30000 + EXECUTOR_MANAGER: 1 + EXECUTOR_SCRIPT_ENGINE: 6 + THROTTLING_QUEUE_CAPACITY: 10 + THROTTLING_THREAD_POOL_SIZE: 6 + NETWORK_BUFFER_SIZE: 10485760 + volumes: + - ~/.mytrendz-data/python-executor:/python-executor +``` +{: .copy-code} + +Explanation of key fields: + +* `8181` - Python executor port for communication with Trendz service +* `restart: always` - automatically restarts the executor on failure or system reboot +* `thingsboard/trendz-python-executor:{{ site.release.trendz_ver }}` - Docker image for Trendz Python Executor +* `SCRIPT_ENGINE_RUNTIME_TIMEOUT` - timeout for Python script execution +* `~/.mytrendz-data/python-executor:/python-executor` - mounts the volume `~/.mytrendz-data/python-executor` to Trendz Python Executor additional data directory + +### Step 2: Create Volumes + +Run the following commands before starting the Docker container. These commands also change the owner of the newly +created folders to the Docker container user. The `chown` command requires *sudo* permissions and will prompt for your password: + +```bash +mkdir -p ~/.mytrendz-data && sudo chown -R 799:799 ~/.mytrendz-data +mkdir -p ~/.mytrendz-data/python-executor && sudo chown -R 799:799 ~/.mytrendz-data/python-executor +``` +{: .copy-code} + +**Note:** Replace the directory `~/.mytrendz-data` with the directories you plan to use in `docker-compose.yaml`. + +### Step 3: Start Python Executor + +```bash +docker compose up -d +docker compose logs -f mypyexecutor +``` +{: .copy-code} + +### Step 4: Connect Trendz to Python Executor + +Configure Trendz to communicate with the Python Executor. + +Edit `/usr/share/trendz/conf/trendz.conf` and add: + +```bash +export SCRIPT_ENGINE_TIMEOUT=30000 +export SCRIPT_ENGINE_PROVIDER=DOCKER_CONTAINER +export SCRIPT_ENGINE_DOCKER_PROVIDER_URL=PYTHON_EXECUTOR_HOST:PYTHON_EXECUTOR_PORT +``` +{: .copy-code} + +Replace `PYTHON_EXECUTOR_HOST` and `PYTHON_EXECUTOR_PORT` with actual host and port values. + +## How to Migrate Trendz Python Executor 1.13.3 to Trendz Python Executor 1.14.0 + +If you already have a Python Executor with a version earlier than 1.14.0 connected to Trendz, you should migrate it before updating Trendz to 1.14.0. + +### Modify Docker Compose File + +Locate the `docker-compose.yaml` file from which the Python Executor was launched. + +Change the Python Executor image tag to version 1.14.0: + +```yml + image: "thingsboard/trendz-python-executor:1.14.0" +``` +{: .copy-code} + +Add the following lines at the end of the Python Executor configuration: + +```yml + volumes: + - ~/.mytrendz-data/python-executor:/python-executor +``` +{: .copy-code} + +The final `docker-compose.yaml` should look like: + +```yml +version: '3.0' +services: + mypyexecutor: + restart: always + image: "thingsboard/trendz-python-executor:1.14.0" + ports: + - "8181:8181" + environment: + SCRIPT_ENGINE_RUNTIME_TIMEOUT: 30000 + EXECUTOR_MANAGER: 1 + EXECUTOR_SCRIPT_ENGINE: 6 + THROTTLING_QUEUE_CAPACITY: 10 + THROTTLING_THREAD_POOL_SIZE: 6 + NETWORK_BUFFER_SIZE: 10485760 + volumes: + - ~/.mytrendz-data/python-executor:/python-executor +``` +{: .copy-code} + +### Create Volumes for Python Executor + +Run the following commands before starting the Docker container. These commands also change the owner of the newly +created folders to the Docker container user. The `chown` command requires *sudo* permissions and will prompt for your password: + +```bash +mkdir -p ~/.mytrendz-data && sudo chown -R 799:799 ~/.mytrendz-data +mkdir -p ~/.mytrendz-data/python-executor && sudo chown -R 799:799 ~/.mytrendz-data/python-executor +``` +{: .copy-code} + +**Note:** Replace the directory `~/.mytrendz-data` with the directories you plan to use in `docker-compose.yaml`. + +### Restart Python Executor + +Restart the Python Executor to apply the changes: + +```bash +docker compose restart -d +docker compose logs -f mypyexecutor +``` +{: .copy-code} + +## How to Connect Additional Libraries to the Python Executor + +If necessary, you can add additional Python libraries to the **Python Executor** and use them in your Trendz Calculation Fields or Trendz Custom Prediction Models. + +For example, if you want to add the **`emoji`** library (specific version 2.2.0), follow these steps. + +### Step 1. Locate the Volume + +The volume is usually at: + +```bash +cd ~/.mytrendz-data/python-executor +``` + +### Step 2. Add a `requirements.txt` File + +Create the file with the library: + +```bash +echo 'emoji==2.2.0' > requirements.txt +``` + +### Step 3. Restart the Docker Container + +Find the container name and restart it: + +```bash +docker compose ps +docker compose restart mypyexecutor +``` + +### Step 4. Verify Installation + +Check the logs: + +```bash +docker compose logs mypyexecutor +``` + +You should see: + +```text +Installing custom Python requirements... +Requirement already satisfied: emoji==2.2.0 in /usr/local/lib/python3.9/site-packages +``` + +After the container restarts, you can import and use the custom libraries in your Trendz Calculation Fields or Trendz Custom Prediction Models. + +## Next steps + +{% assign currentGuide = "InstallationOptions" %}{% include templates/trndz-guides-banner.md %} diff --git a/docs/trendz/install/python-executor-configuration-windows.md b/docs/trendz/install/python-executor-configuration-windows.md new file mode 100644 index 0000000000..d8b3c712a1 --- /dev/null +++ b/docs/trendz/install/python-executor-configuration-windows.md @@ -0,0 +1,231 @@ +--- +layout: docwithnav-trendz +title: Trendz Python Executor Configuration +description: How to configure Trendz Python Executor on Windows + +--- + +* TOC +{:toc} + +## Overview + +Trendz Python Executor is required to run: + +* Python Calculation fields +* All prediction models (except Fourier Transformation) +* Code generation for Metric Explorer + +Starting from version 1.14.0, the only way to run these features is via Trendz Python Executor using Docker (or Kubernetes). + +## Python Executor Standalone Installation + +### Step 1: Create Docker Compose File + +Create the Docker Compose file with the following configuration: + +```yml +version: '3.0' +services: + mypyexecutor: + restart: always + image: "thingsboard/trendz-python-executor:{{ site.release.trendz_ver }}" + ports: + - "8181:8181" + environment: + SCRIPT_ENGINE_RUNTIME_TIMEOUT: 30000 + EXECUTOR_MANAGER: 1 + EXECUTOR_SCRIPT_ENGINE: 6 + THROTTLING_QUEUE_CAPACITY: 10 + THROTTLING_THREAD_POOL_SIZE: 6 + NETWORK_BUFFER_SIZE: 10485760 + volumes: + - mytrendz-data/python-executor:/python-executor + +``` +{: .copy-code} + +Explanation of key fields: + +* `8181` - Python executor port for communication with Trendz service +* `restart: always` - automatically restarts the executor on failure or system reboot +* `thingsboard/trendz-python-executor:{{ site.release.trendz_ver }}` - Docker image for Trendz Python Executor +* `SCRIPT_ENGINE_RUNTIME_TIMEOUT` - timeout for Python script execution +* `mytrendz-data/python-executor:/python-executor` - mounts the volume `mytrendz-data/python-executor` to Trendz Python Executor additional data directory + + +### Step 2: Create Volumes + +Windows users should use Docker-managed volumes for Trendz data. +Create a Docker volume before executing the Docker run command. +Open “Docker Quickstart Terminal” and run: + +```bash +docker volume create mytrendz-data-python-executor +``` +{: .copy-code} + +**Note:** Replace the volume name `mytrendz-data-python-executor` with the name you plan to use in `docker-compose.yaml`. + +### Step 3: Start Python Executor + +```bash +docker compose up -d +docker compose logs -f mypyexecutor +``` +{: .copy-code} + +### Step 4: Connect Trendz to Python Executor + +Configure Trendz to communicate with the Python Executor. + +Open Notepad as Administrator and edit: + +```text +C:\Program Files (x86)\trendz\conf\trendz.yml +``` + +Locate the `script-engine` block and configure: + +```yml +script-engine: + provider: "${SCRIPT_ENGINE_PROVIDER:DOCKER_CONTAINER}" + runtime-timeout: "${SCRIPT_ENGINE_TIMEOUT:60000}" + callback-timeout: "${SCRIPT_ENGINE_TIMEOUT:60000}" + docker-provider-url: "${SCRIPT_ENGINE_DOCKER_PROVIDER_URL:PYTHON_EXECUTOR_HOST:PYTHON_EXECUTOR_PORT}" + websocket-buffer-size: "${SCRIPT_ENGINE_WEBSOCKET_BUFFER_SIZE:20971520}" + websocket-concurrency: "${SCRIPT_ENGINE_WEBSOCKET_CONCURRENCY:5}" +``` + +Replace `PYTHON_EXECUTOR_HOST` and `PYTHON_EXECUTOR_PORT` with your Python Executor service values and ensure Trendz can reach this network destination. + +## How to Migrate Trendz Python Executor 1.13.3 to Trendz Python Executor 1.14.0 + +If you already have a Python Executor with a version earlier than 1.14.0 connected to Trendz, you should migrate it before updating Trendz to 1.14.0. + +### Modify Docker Compose File + +Locate the `docker-compose.yaml` file from which the Python Executor was launched. + +Change the Python Executor image tag to version 1.14.0: + +```yml + image: "thingsboard/trendz-python-executor:1.14.0" +``` +{: .copy-code} + +Add the following lines at the end of the Python Executor configuration: + +```yml + volumes: + - mytrendz-data/python-executor:/python-executor +``` +{: .copy-code} + +Add the following lines at the end of the Docker Compose file: + +```yml +volumes: + mytrendz-data-python-executor: + external: true +``` +{: .copy-code} + +The final `docker-compose.yaml` should look like: + +```yml +version: '3.0' +services: + mypyexecutor: + restart: always + image: "thingsboard/trendz-python-executor:1.14.0" + ports: + - "8181:8181" + environment: + SCRIPT_ENGINE_RUNTIME_TIMEOUT: 30000 + EXECUTOR_MANAGER: 1 + EXECUTOR_SCRIPT_ENGINE: 6 + THROTTLING_QUEUE_CAPACITY: 10 + THROTTLING_THREAD_POOL_SIZE: 6 + NETWORK_BUFFER_SIZE: 10485760 + volumes: + - mytrendz-data/python-executor:/python-executor +volumes: + mytrendz-data-python-executor: + external: true +``` +{: .copy-code} + +### Create Volumes for Python Executor + +Windows users should use Docker-managed volumes for Trendz data. +Create a Docker volume before executing the Docker run command. +Open “Docker Quickstart Terminal” and run: + +```bash +docker volume create mytrendz-data-python-executor +``` +{: .copy-code} + +**Note:** Replace the volume name `mytrendz-data-python-executor` with the name you plan to use in `docker-compose.yaml`. + +### Restart Python Executor + +Restart the Python Executor to apply the changes: + +```bash +docker compose restart -d +docker compose logs -f mypyexecutor +``` +{: .copy-code} + +## How to Connect Additional Libraries to the Python Executor + +If necessary, you can add additional Python libraries to the **Python Executor** and use them in your Trendz Calculation Fields or Trendz Custom Prediction Models. + +For example, if you want to add the **`emoji`** library (specific version 2.2.0), follow these steps. + +### Step 1. Locate the Volume + +The Python Executor data is mapped to a local folder via Docker volumes. By default: + +```powershell +cd %USERPROFILE%\mytrendz-data\python-executor +``` +{: .copy-code} + +### Step 2. Add a `requirements.txt` File + +Create a file named `requirements.txt` in this folder with the library you need. For example: + +```powershell +echo emoji==2.2.0 > requirements.txt +``` + +### Step 3. Restart the Docker Container + +After updating `requirements.txt`, restart the Python Executor container: + +```powershell +docker compose ps +docker compose restart mypyexecutor +``` + +### Step 4. Verify Installation + +Check the logs to ensure the library installed successfully: + +```powershell +docker compose logs mypyexecutor +``` + +You should see something like: + +```text +Installing custom Python requirements... +Requirement already satisfied: emoji==2.2.0 in /usr/local/lib/python3.9/site-packages +``` + +## Next steps + +{% assign currentGuide = "InstallationOptions" %}{% include templates/trndz-guides-banner.md %} diff --git a/docs/trendz/install/resources/1.14.0/trendz-centos-download.sh b/docs/trendz/install/resources/1.14.0/trendz-centos-download.sh new file mode 100644 index 0000000000..5fe1f7be0c --- /dev/null +++ b/docs/trendz/install/resources/1.14.0/trendz-centos-download.sh @@ -0,0 +1 @@ +wget https://dist.thingsboard.io/trendz-1.14.0.rpm \ No newline at end of file diff --git a/docs/trendz/install/resources/1.14.0/trendz-centos-installation.sh b/docs/trendz/install/resources/1.14.0/trendz-centos-installation.sh new file mode 100644 index 0000000000..1afbf0f308 --- /dev/null +++ b/docs/trendz/install/resources/1.14.0/trendz-centos-installation.sh @@ -0,0 +1 @@ +sudo rpm -Uvh trendz-1.14.0.rpm \ No newline at end of file diff --git a/docs/trendz/install/resources/1.14.0/trendz-ubuntu-download.sh b/docs/trendz/install/resources/1.14.0/trendz-ubuntu-download.sh new file mode 100644 index 0000000000..2d5424e7f2 --- /dev/null +++ b/docs/trendz/install/resources/1.14.0/trendz-ubuntu-download.sh @@ -0,0 +1 @@ +wget https://dist.thingsboard.io/trendz-1.14.0.deb \ No newline at end of file diff --git a/docs/trendz/install/resources/1.14.0/trendz-ubuntu-installation.sh b/docs/trendz/install/resources/1.14.0/trendz-ubuntu-installation.sh new file mode 100644 index 0000000000..3b01e1c8bd --- /dev/null +++ b/docs/trendz/install/resources/1.14.0/trendz-ubuntu-installation.sh @@ -0,0 +1 @@ +sudo dpkg -i trendz-1.14.0.deb \ No newline at end of file diff --git a/docs/trendz/install/rhel.md b/docs/trendz/install/rhel.md index e9c8ad6105..ee65d2c38f 100644 --- a/docs/trendz/install/rhel.md +++ b/docs/trendz/install/rhel.md @@ -10,9 +10,18 @@ description: Installing ThingsBoard Trendz Analytics on CentOS/RHEL * TOC {:toc} -## Prerequisites +This guide explains how to install **Trendz Analytics** on **RHEL/CentOS 8 or 9**. + +**Important note before proceeding with RHEL/CentOS installation** + +Certain Trendz Analytics features like **predictions, metric explorations, and Python calculation fields** require a Python executor. + +The python executor runs **only via Docker**. Even on RHEL/CentOS, Docker is essential to fully utilize all Trendz features. +We recommend following the [Docker (Linux or Mac OS) installation guide](/docs/trendz/install/docker) and using the Docker installation instead of RHEL/CentOS. -This guide describes how to install Trendz Analytics on RHEL/CentOS 8/9. +Proceed here **only** if you have a compelling reason to use a combined RHEL/CentOS + Docker setup. + +## Prerequisites **Hardware requirements** depend on amount of analyzed data and amount of devices connected to the system. To run Trendz Analytics on a single machine you will need at least 1Gb of free RAM. @@ -24,7 +33,7 @@ Before continue to installation execute the following commands in order to insta **For CentOS 7:** ```bash -# Install wget +# Install wget and nano sudo yum install -y nano wget # Add latest EPEL release for CentOS 7 sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm @@ -35,7 +44,7 @@ sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7. **For CentOS 8:** ```bash -# Install wget +# Install wget and nano sudo yum install -y nano wget # Add latest EPEL release for CentOS 8 sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm @@ -183,7 +192,7 @@ Once Trendz service is installed and DB configuration is updated, you can execut ```bash sudo /usr/share/trendz/bin/install/install.sh -``` +``` ## Step 7. Start Trendz service @@ -210,33 +219,12 @@ For first authentication you need to use **Tenant Administrator** credentials fr Trendz uses ThingsBoard as an authentication service. During first sign in ThingsBoard service should be also available to validate credentials. -## Step 8. Install Trendz Python executor -For writing custom Python models and transformation script you need to install Python libraries on the server where Trendz is installed. -Alternative option is to run executor as a docker container, you can find how to do that in [install instructions for Docker](/docs/trendz/install/docker/#standalone-python-executor-service). -But in this section we will write how to install Python libraries directly on the server with Trendz. +## Step 8. Install Trendz Python Executor -* Install Python3 -```bash -sudo apt update -sudo apt install python3 -sudo apt install python3-pip -``` -{: .copy-code} - -* Install required python packages -```bash -echo "flask == 2.3.2" > requirements.txt -echo "numpy == 1.24.1" >> requirements.txt -echo "statsmodels == 0.13.5" >> requirements.txt -echo "pandas == 1.5.3" >> requirements.txt -echo "scikit-learn == 1.2.2" >> requirements.txt -echo "prophet == 1.1.3" >> requirements.txt -echo "seaborn == 0.12.2" >> requirements.txt -echo "pmdarima == 2.0.3" >> requirements.txt -sudo -u trendz pip3 install --user --no-cache-dir -r requirements.txt -``` -{: .copy-code} +To utilize all Trendz capabilities, such as Trendz Python Calculation Fields or Prediction Models, it is essential to +install an additional service: the Trendz Python Executor, which can securely run Python code. +You can learn more about how to install it [here](/docs/trendz/install/python-executor-configuration-linux). ## Step 9. HTTPS configuration diff --git a/docs/trendz/install/trndz-upgrade-instructions-kubernetes.md b/docs/trendz/install/trndz-upgrade-instructions-kubernetes.md index cec8d34331..cdaf4aadda 100644 --- a/docs/trendz/install/trndz-upgrade-instructions-kubernetes.md +++ b/docs/trendz/install/trndz-upgrade-instructions-kubernetes.md @@ -8,9 +8,9 @@ description: ThingsBoard Trendz Analytics upgrade instructions kubernetes * TOC {:toc} -## Upgrading to 1.13.2 +## Upgrading to 1.14.0 -These steps are applicable for 1.13.1 Trendz Analytics version. +These steps are applicable for 1.13.2 Trendz Analytics version. ### Obtain Trendz Kubernetes scripts @@ -45,13 +45,13 @@ kubectl scale deployment trendz-app-deployment --replicas=1 Create a file “.upgradeversion” inside the directory by calling the command that must be executed by Trendz pod. Run the command: ```text -kubectl exec -- sh -c "echo '1.13.1' > /data/.upgradeversion" +kubectl exec -- sh -c "echo '1.13.2' > /data/.upgradeversion" ``` You can get the pod name by the command: ```text kubectl get pods -l app=trendz-app-pod-label ``` -Use another version instead of '1.13.1 if another is needed +Use another version instead of '1.13.2 if another is needed ### Change image version diff --git a/docs/trendz/install/trndz-upgrade-instructions.md b/docs/trendz/install/trndz-upgrade-instructions.md index 7d7cd0bbf6..f16a560bb4 100644 --- a/docs/trendz/install/trndz-upgrade-instructions.md +++ b/docs/trendz/install/trndz-upgrade-instructions.md @@ -7,6 +7,17 @@ description: ThingsBoard Trendz Analytics upgrade instructions