Skip to content

Commit 30e6206

Browse files
YevhenBondarenkoashvayka
authored andcommitted
added docker-compose and environment for queues
1 parent 577d339 commit 30e6206

26 files changed

+527
-54
lines changed

Diff for: .env

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
TB_QUEUE_TYPE=kafka
12

2-
DOCKER_REPO=store/thingsboard
3+
DOCKER_REPO=thingsboard
34

45
JS_EXECUTOR_DOCKER_NAME=tb-pe-js-executor
56
TB_NODE_DOCKER_NAME=tb-pe-node
@@ -9,7 +10,7 @@ HTTP_TRANSPORT_DOCKER_NAME=tb-pe-http-transport
910
COAP_TRANSPORT_DOCKER_NAME=tb-pe-coap-transport
1011
WEB_REPORT_DOCKER_NAME=tb-pe-web-report
1112

12-
TB_VERSION=2.4.3PE
13+
TB_VERSION=2.5.0PE-SNAPSHOT
1314

1415
# Database used by ThingsBoard, can be either postgres (PostgreSQL) or cassandra (Cassandra).
1516
# According to the database type corresponding docker service will be deployed (see docker-compose.postgres.yml, docker-compose.cassandra.yml for details).

Diff for: compose-utils.sh

+26
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,32 @@ function additionalComposeArgs() {
4747
echo $ADDITIONAL_COMPOSE_ARGS
4848
}
4949

50+
function additionalComposeQueueArgs() {
51+
source .env
52+
ADDITIONAL_COMPOSE_QUEUE_ARGS=""
53+
case $TB_QUEUE_TYPE in
54+
kafka)
55+
ADDITIONAL_COMPOSE_QUEUE_ARGS="-f docker-compose.kafka.yml"
56+
;;
57+
aws-sqs)
58+
ADDITIONAL_COMPOSE_QUEUE_ARGS="-f docker-compose.aws-sqs.yml"
59+
;;
60+
pubsub)
61+
ADDITIONAL_COMPOSE_QUEUE_ARGS="-f docker-compose.pubsub.yml"
62+
;;
63+
rabbitmq)
64+
ADDITIONAL_COMPOSE_QUEUE_ARGS="-f docker-compose.rabbitmq.yml"
65+
;;
66+
service-bus)
67+
ADDITIONAL_COMPOSE_QUEUE_ARGS="-f docker-compose.service-bus.yml"
68+
;;
69+
*)
70+
echo "Unknown Queue service value specified: '${TB_QUEUE_TYPE}'. Should be either kafka or aws-sqs or pubsub or rabbitmq or service-bus." >&2
71+
exit 1
72+
esac
73+
echo $ADDITIONAL_COMPOSE_QUEUE_ARGS
74+
}
75+
5076
function additionalStartupServices() {
5177
source .env
5278
ADDITIONAL_STARTUP_SERVICES=""

Diff for: docker-compose.aws-sqs.yml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#
2+
# ThingsBoard, Inc. ("COMPANY") CONFIDENTIAL
3+
#
4+
# Copyright © 2016-2019 ThingsBoard, Inc. All Rights Reserved.
5+
#
6+
# NOTICE: All information contained herein is, and remains
7+
# the property of ThingsBoard, Inc. and its suppliers,
8+
# if any. The intellectual and technical concepts contained
9+
# herein are proprietary to ThingsBoard, Inc.
10+
# and its suppliers and may be covered by U.S. and Foreign Patents,
11+
# patents in process, and are protected by trade secret or copyright law.
12+
#
13+
# Dissemination of this information or reproduction of this material is strictly forbidden
14+
# unless prior written permission is obtained from COMPANY.
15+
#
16+
# Access to the source code contained herein is hereby forbidden to anyone except current COMPANY employees,
17+
# managers or contractors who have executed Confidentiality and Non-disclosure agreements
18+
# explicitly covering such access.
19+
#
20+
# The copyright notice above does not evidence any actual or intended publication
21+
# or disclosure of this source code, which includes
22+
# information that is confidential and/or proprietary, and is a trade secret, of COMPANY.
23+
# ANY REPRODUCTION, MODIFICATION, DISTRIBUTION, PUBLIC PERFORMANCE,
24+
# OR PUBLIC DISPLAY OF OR THROUGH USE OF THIS SOURCE CODE WITHOUT
25+
# THE EXPRESS WRITTEN CONSENT OF COMPANY IS STRICTLY PROHIBITED,
26+
# AND IN VIOLATION OF APPLICABLE LAWS AND INTERNATIONAL TREATIES.
27+
# THE RECEIPT OR POSSESSION OF THIS SOURCE CODE AND/OR RELATED INFORMATION
28+
# DOES NOT CONVEY OR IMPLY ANY RIGHTS TO REPRODUCE, DISCLOSE OR DISTRIBUTE ITS CONTENTS,
29+
# OR TO MANUFACTURE, USE, OR SELL ANYTHING THAT IT MAY DESCRIBE, IN WHOLE OR IN PART.
30+
#
31+
32+
version: '2.2'
33+
34+
services:
35+
tb-js-executor:
36+
env_file:
37+
- queue-aws-sqs.env
38+
tb-core1:
39+
env_file:
40+
- queue-aws-sqs.env
41+
depends_on:
42+
- zookeeper
43+
- redis
44+
tb-core2:
45+
env_file:
46+
- queue-aws-sqs.env
47+
depends_on:
48+
- zookeeper
49+
- redis
50+
tb-rule-engine1:
51+
env_file:
52+
- queue-aws-sqs.env
53+
depends_on:
54+
- zookeeper
55+
- redis
56+
tb-rule-engine2:
57+
env_file:
58+
- queue-aws-sqs.env
59+
depends_on:
60+
- zookeeper
61+
- redis
62+
tb-mqtt-transport1:
63+
env_file:
64+
- queue-aws-sqs.env
65+
depends_on:
66+
- zookeeper
67+
tb-mqtt-transport2:
68+
env_file:
69+
- queue-aws-sqs.env
70+
depends_on:
71+
- zookeeper
72+
tb-http-transport1:
73+
env_file:
74+
- queue-aws-sqs.env
75+
depends_on:
76+
- zookeeper
77+
tb-http-transport2:
78+
env_file:
79+
- queue-aws-sqs.env
80+
depends_on:
81+
- zookeeper
82+
tb-coap-transport:
83+
env_file:
84+
- queue-aws-sqs.env
85+
depends_on:
86+
- zookeeper

Diff for: docker-compose.cassandra.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -43,28 +43,27 @@ services:
4343
env_file:
4444
- tb-node.cassandra.env
4545
depends_on:
46-
- kafka
46+
- zookeeper
4747
- redis
4848
- cassandra
4949
tb-core2:
5050
env_file:
5151
- tb-node.cassandra.env
5252
depends_on:
53-
- kafka
53+
- zookeeper
5454
- redis
5555
- cassandra
5656
tb-rule-engine1:
5757
env_file:
5858
- tb-node.cassandra.env
5959
depends_on:
60-
- kafka
60+
- zookeeper
6161
- redis
6262
- cassandra
6363
tb-rule-engine2:
6464
env_file:
6565
- tb-node.cassandra.env
6666
depends_on:
67-
- kafka
67+
- zookeeper
6868
- redis
6969
- cassandra
70-

Diff for: docker-compose.kafka.yml

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
#
2+
# ThingsBoard, Inc. ("COMPANY") CONFIDENTIAL
3+
#
4+
# Copyright © 2016-2019 ThingsBoard, Inc. All Rights Reserved.
5+
#
6+
# NOTICE: All information contained herein is, and remains
7+
# the property of ThingsBoard, Inc. and its suppliers,
8+
# if any. The intellectual and technical concepts contained
9+
# herein are proprietary to ThingsBoard, Inc.
10+
# and its suppliers and may be covered by U.S. and Foreign Patents,
11+
# patents in process, and are protected by trade secret or copyright law.
12+
#
13+
# Dissemination of this information or reproduction of this material is strictly forbidden
14+
# unless prior written permission is obtained from COMPANY.
15+
#
16+
# Access to the source code contained herein is hereby forbidden to anyone except current COMPANY employees,
17+
# managers or contractors who have executed Confidentiality and Non-disclosure agreements
18+
# explicitly covering such access.
19+
#
20+
# The copyright notice above does not evidence any actual or intended publication
21+
# or disclosure of this source code, which includes
22+
# information that is confidential and/or proprietary, and is a trade secret, of COMPANY.
23+
# ANY REPRODUCTION, MODIFICATION, DISTRIBUTION, PUBLIC PERFORMANCE,
24+
# OR PUBLIC DISPLAY OF OR THROUGH USE OF THIS SOURCE CODE WITHOUT
25+
# THE EXPRESS WRITTEN CONSENT OF COMPANY IS STRICTLY PROHIBITED,
26+
# AND IN VIOLATION OF APPLICABLE LAWS AND INTERNATIONAL TREATIES.
27+
# THE RECEIPT OR POSSESSION OF THIS SOURCE CODE AND/OR RELATED INFORMATION
28+
# DOES NOT CONVEY OR IMPLY ANY RIGHTS TO REPRODUCE, DISCLOSE OR DISTRIBUTE ITS CONTENTS,
29+
# OR TO MANUFACTURE, USE, OR SELL ANYTHING THAT IT MAY DESCRIBE, IN WHOLE OR IN PART.
30+
#
31+
32+
version: '2.2'
33+
34+
services:
35+
kafka:
36+
restart: always
37+
image: "wurstmeister/kafka:2.12-2.3.0"
38+
ports:
39+
- "9092:9092"
40+
env_file:
41+
- kafka.env
42+
depends_on:
43+
- zookeeper
44+
tb-js-executor:
45+
env_file:
46+
- queue-kafka.env
47+
depends_on:
48+
- kafka
49+
tb-core1:
50+
env_file:
51+
- queue-kafka.env
52+
depends_on:
53+
- kafka
54+
- redis
55+
tb-core2:
56+
env_file:
57+
- queue-kafka.env
58+
depends_on:
59+
- kafka
60+
- redis
61+
tb-rule-engine1:
62+
env_file:
63+
- queue-kafka.env
64+
depends_on:
65+
- kafka
66+
- redis
67+
tb-rule-engine2:
68+
env_file:
69+
- queue-kafka.env
70+
depends_on:
71+
- kafka
72+
- redis
73+
tb-mqtt-transport1:
74+
env_file:
75+
- queue-kafka.env
76+
depends_on:
77+
- kafka
78+
tb-mqtt-transport2:
79+
env_file:
80+
- queue-kafka.env
81+
depends_on:
82+
- kafka
83+
tb-http-transport1:
84+
env_file:
85+
- queue-kafka.env
86+
depends_on:
87+
- kafka
88+
tb-http-transport2:
89+
env_file:
90+
- queue-kafka.env
91+
depends_on:
92+
- kafka
93+
tb-coap-transport:
94+
env_file:
95+
- queue-kafka.env
96+
depends_on:
97+
- kafka

Diff for: docker-compose.postgres.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,27 +46,27 @@ services:
4646
env_file:
4747
- tb-node.postgres.env
4848
depends_on:
49-
- kafka
49+
- zookeeper
5050
- redis
5151
- postgres
5252
tb-core2:
5353
env_file:
5454
- tb-node.postgres.env
5555
depends_on:
56-
- kafka
56+
- zookeeper
5757
- redis
5858
- postgres
5959
tb-rule-engine1:
6060
env_file:
6161
- tb-node.postgres.env
6262
depends_on:
63-
- kafka
63+
- zookeeper
6464
- redis
6565
- postgres
6666
tb-rule-engine2:
6767
env_file:
6868
- tb-node.postgres.env
6969
depends_on:
70-
- kafka
70+
- zookeeper
7171
- redis
7272
- postgres

Diff for: docker-compose.pubsub.yml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#
2+
# ThingsBoard, Inc. ("COMPANY") CONFIDENTIAL
3+
#
4+
# Copyright © 2016-2019 ThingsBoard, Inc. All Rights Reserved.
5+
#
6+
# NOTICE: All information contained herein is, and remains
7+
# the property of ThingsBoard, Inc. and its suppliers,
8+
# if any. The intellectual and technical concepts contained
9+
# herein are proprietary to ThingsBoard, Inc.
10+
# and its suppliers and may be covered by U.S. and Foreign Patents,
11+
# patents in process, and are protected by trade secret or copyright law.
12+
#
13+
# Dissemination of this information or reproduction of this material is strictly forbidden
14+
# unless prior written permission is obtained from COMPANY.
15+
#
16+
# Access to the source code contained herein is hereby forbidden to anyone except current COMPANY employees,
17+
# managers or contractors who have executed Confidentiality and Non-disclosure agreements
18+
# explicitly covering such access.
19+
#
20+
# The copyright notice above does not evidence any actual or intended publication
21+
# or disclosure of this source code, which includes
22+
# information that is confidential and/or proprietary, and is a trade secret, of COMPANY.
23+
# ANY REPRODUCTION, MODIFICATION, DISTRIBUTION, PUBLIC PERFORMANCE,
24+
# OR PUBLIC DISPLAY OF OR THROUGH USE OF THIS SOURCE CODE WITHOUT
25+
# THE EXPRESS WRITTEN CONSENT OF COMPANY IS STRICTLY PROHIBITED,
26+
# AND IN VIOLATION OF APPLICABLE LAWS AND INTERNATIONAL TREATIES.
27+
# THE RECEIPT OR POSSESSION OF THIS SOURCE CODE AND/OR RELATED INFORMATION
28+
# DOES NOT CONVEY OR IMPLY ANY RIGHTS TO REPRODUCE, DISCLOSE OR DISTRIBUTE ITS CONTENTS,
29+
# OR TO MANUFACTURE, USE, OR SELL ANYTHING THAT IT MAY DESCRIBE, IN WHOLE OR IN PART.
30+
#
31+
32+
version: '2.2'
33+
34+
services:
35+
tb-js-executor:
36+
env_file:
37+
- queue-pubsub.env.env
38+
tb-core1:
39+
env_file:
40+
- queue-pubsub.env.env
41+
depends_on:
42+
- zookeeper
43+
- redis
44+
tb-core2:
45+
env_file:
46+
- queue-pubsub.env
47+
depends_on:
48+
- zookeeper
49+
- redis
50+
tb-rule-engine1:
51+
env_file:
52+
- queue-pubsub.env
53+
depends_on:
54+
- zookeeper
55+
- redis
56+
tb-rule-engine2:
57+
env_file:
58+
- queue-pubsub.env
59+
depends_on:
60+
- zookeeper
61+
- redis
62+
tb-mqtt-transport1:
63+
env_file:
64+
- queue-pubsub.env
65+
depends_on:
66+
- zookeeper
67+
tb-mqtt-transport2:
68+
env_file:
69+
- queue-pubsub.env
70+
depends_on:
71+
- zookeeper
72+
tb-http-transport1:
73+
env_file:
74+
- queue-pubsub.env
75+
depends_on:
76+
- zookeeper
77+
tb-http-transport2:
78+
env_file:
79+
- queue-pubsub.env
80+
depends_on:
81+
- zookeeper
82+
tb-coap-transport:
83+
env_file:
84+
- queue-pubsub.env
85+
depends_on:
86+
- zookeeper

0 commit comments

Comments
 (0)