Skip to content

Commit 68f1c3f

Browse files
RomenKostashvayka
authored andcommitted
Trendz 1.14.0 installation documentation
1 parent 628bb10 commit 68f1c3f

16 files changed

+681
-344
lines changed

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@ release:
102102
pe_dart_client_ver: 4.0.0
103103
broker_full_ver: 2.2.0
104104
broker_branch: release-2.2.0
105-
trendz_ver: 1.13.2
105+
trendz_ver: 1.14.0

_data/trendz/installation.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ toc:
2525
path: /docs/trendz/install/trndz-upgrade-instructions/
2626
- title: Kubernetes
2727
path: /docs/trendz/install/trndz-upgrade-instructions-kubernetes/
28+
- title: Python Executor Configuration
29+
section:
30+
- title: Windows
31+
path: /docs/trendz/install/python-executor-configuration-windows/
32+
- title: Linux or Mac OS
33+
path: /docs/trendz/install/python-executor-configuration-linux/
2834
- title: Connect Trendz to Thingsboard
2935
path: /docs/trendz/connect-thingsboard/
3036
- title: Configuration properties

docs/trendz/install/docker-windows.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ services:
5656
SPRING_DATASOURCE_USERNAME: postgres
5757
SPRING_DATASOURCE_PASSWORD: postgres
5858
SCRIPT_ENGINE_PROVIDER: DOCKER_CONTAINER
59-
SCRIPT_ENGINE_DOCKER_PROVIDER_URL: mypyexecutor:8080
59+
SCRIPT_ENGINE_DOCKER_PROVIDER_URL: mypyexecutor:8181
6060
SCRIPT_ENGINE_TIMEOUT: 30000
6161
volumes:
6262
- mytrendz-data:/data
@@ -73,6 +73,8 @@ services:
7373
THROTTLING_QUEUE_CAPACITY: 10
7474
THROTTLING_THREAD_POOL_SIZE: 6
7575
NETWORK_BUFFER_SIZE: 10485760
76+
volumes:
77+
- mytrendz-data/python-executor:/python-executor
7678
postgres:
7779
restart: always
7880
image: "postgres:15"
@@ -88,6 +90,8 @@ volumes:
8890
external: true
8991
mytrendz-logs:
9092
external: true
93+
mytrendz-data-python-executor:
94+
external: true
9195
mytrendz-data-db:
9296
external: true
9397
```
@@ -106,7 +110,8 @@ Where:
106110
- `thingsboard/trendz:{{ site.release.trendz_ver }}` - Trendz docker image
107111
- `thingsboard/trendz-python-executor:{{ site.release.trendz_ver }}` - Trendz python script executor docker image
108112
- `SCRIPT_ENGINE_RUNTIME_TIMEOUT` - Python script execution timeout
109-
113+
- `mytrendz-data/python-executor:/python-executor` - mounts the volume `mytrendz-data/python-executor` to Trendz Python Executor additional data directory
114+
110115
### Setup Docker volumes
111116

112117
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
115120
```yml
116121
docker volume create mytrendz-data
117122
docker volume create mytrendz-data-db
123+
docker volume create mytrendz-data-python-executor
118124
docker volume create mytrendz-logs
119125
```
120126
{: .copy-code}
121127

122-
**NOTE**: replace directory ~/.mytrendz-data and ~/.mytrendz-logs with directories you’re planning to used in docker-compose.yml.
128+
**NOTE**: replace directory mytrendz-data and mytrendz-logs with directories you’re planning to used in docker-compose.yml.
123129

124130
### Running service
125131

docs/trendz/install/docker.md

Lines changed: 9 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ services:
7575
THROTTLING_QUEUE_CAPACITY: 10
7676
THROTTLING_THREAD_POOL_SIZE: 6
7777
NETWORK_BUFFER_SIZE: 5242880
78+
volumes:
79+
- ~/.mytrendz-data/python-executor:/python-executor
7880
postgres:
7981
restart: always
8082
image: "postgres:15"
@@ -101,6 +103,7 @@ Where:
101103
- `thingsboard/trendz:{{ site.release.trendz_ver }}` - Trendz docker image
102104
- `thingsboard/trendz-python-executor:{{ site.release.trendz_ver }}` - Trendz python script executor docker image
103105
- `SCRIPT_ENGINE_RUNTIME_TIMEOUT` - Python script execution timeout
106+
- `~/.mytrendz-data/python-executor:/python-executor` - mounts the volume `~/.mytrendz-data/python-executor` to Trendz Python Executor additional data directory
104107

105108

106109
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
109112

110113
```bash
111114
mkdir -p ~/.mytrendz-data && sudo chown -R 799:799 ~/.mytrendz-data
115+
mkdir -p ~/.mytrendz-data/python-executor && sudo chown -R 799:799 ~/.mytrendz-data/python-executor
112116
mkdir -p ~/.mytrendz-logs && sudo chown -R 799:799 ~/.mytrendz-logs
113117
```
114118
{: .copy-code}
@@ -131,6 +135,7 @@ Trendz uses ThingsBoard as an authentication service. During first sign in Thing
131135
to validate credentials.
132136

133137
## Post-installation steps
138+
134139
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.
135140

136141
## Detaching, stop and start commands
@@ -141,7 +146,7 @@ It is essential to follow these [instructions](/docs/trendz/post-installation-st
141146

142147
## Upgrade Trendz Service
143148

144-
Below is example on how to upgrade from 1.13.1 to {{ site.release.trendz_ver }}
149+
Below is example on how to upgrade from 1.13.2 to {{ site.release.trendz_ver }}
145150

146151
* Create a dump of your database:
147152

@@ -159,17 +164,17 @@ If you still rely on Docker Compose as docker-compose (with a hyphen) execute ne
159164
* Set upgradeversion variable to your **previous** Trendz version.
160165

161166
```bash
162-
docker compose exec mytrendz sh -c "echo '1.13.1' > /data/.upgradeversion"
167+
docker compose exec mytrendz sh -c "echo '1.13.2' > /data/.upgradeversion"
163168
```
164169
{: .copy-code}
165170

166171
{% capture dockerComposeStandalone %}
167172
If you still rely on Docker Compose as docker-compose (with a hyphen) execute next command:
168-
<br>**docker-compose exec mytrendz sh -c "echo '1.13.1' > /data/.upgradeversion"**
173+
<br>**docker-compose exec mytrendz sh -c "echo '1.13.2' > /data/.upgradeversion"**
169174
{% endcapture %}
170175
{% include templates/info-banner.md content=dockerComposeStandalone %}
171176

172-
* 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:
177+
* 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:
173178

174179
* Restart Trendz container
175180

@@ -188,61 +193,6 @@ If you still rely on Docker Compose as docker-compose (with a hyphen) here is th
188193

189194
To upgrade Trendz to the latest version those steps should be done **for each intermediate version**.
190195

191-
## Standalone Python executor service
192-
You can use following docker compose file in case when you want to start Trendz python executor as a separate service.
193-
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.
194-
Using same configuration you can scale Python executors independently of Trendz service.
195-
196-
Create docker compose file:
197-
198-
```text
199-
sudo nano docker-compose.yml
200-
```
201-
{: .copy-code}
202-
203-
Add following configuration:
204-
205-
```yml
206-
version: '3.0'
207-
services:
208-
mypyexecutor:
209-
restart: always
210-
image: "thingsboard/trendz-python-executor:{{ site.release.trendz_ver }}"
211-
ports:
212-
- "8181:8181"
213-
environment:
214-
SCRIPT_ENGINE_RUNTIME_TIMEOUT: 30000
215-
EXECUTOR_MANAGER: 1
216-
EXECUTOR_SCRIPT_ENGINE: 6
217-
THROTTLING_QUEUE_CAPACITY: 10
218-
THROTTLING_THREAD_POOL_SIZE: 6
219-
NETWORK_BUFFER_SIZE: 10485760
220-
```
221-
{: .copy-code}
222-
223-
Where:
224-
225-
- `8080` - Python executor port for communication with Trendz service
226-
- `--restart always` - automatically start Trendz in case of system reboot and restart in case of failure.
227-
- `thingsboard/trendz-python-executor:{{ site.release.trendz_ver }}` - Trendz python script executor docker image
228-
- `SCRIPT_ENGINE_RUNTIME_TIMEOUT` - Python script execution timeout
229-
230-
```text
231-
docker compose up -d
232-
docker compose logs -f mypyexecutor
233-
```
234-
235-
* 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:
236-
237-
```bash
238-
export SCRIPT_ENGINE_TIMEOUT=30000
239-
export SCRIPT_ENGINE_PROVIDER=DOCKER_CONTAINER
240-
export SCRIPT_ENGINE_DOCKER_PROVIDER_URL=PYTHON_EXECUTOR_HOST:PYTHON_EXECUTOR_PORT
241-
```
242-
{: .copy-code}
243-
244-
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.
245-
246196
## Troubleshooting
247197

248198
### DNS issues

0 commit comments

Comments
 (0)