Skip to content

Commit f274594

Browse files
committed
Update scorpio.
1 parent aecc693 commit f274594

File tree

4 files changed

+38
-96
lines changed

4 files changed

+38
-96
lines changed

.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Project name
22
COMPOSE_PROJECT_NAME=fiware
3+
EXPOSED_PORT=1026
34

45
# Orion LD variables
56
ORION_LD_PORT=1026
67
ORION_LD_VERSION=1.4.0
78

89
# Scorpio variables
910
SCORPIO_PORT=9090
10-
SCORPIO_VERSION=4.1.3
11+
SCORPIO_VERSION=4.1.8
1112

1213
# Stellio variables
1314
STELLIO_DOCKER_TAG=2.5.2

docker-compose/scorpio-aaio.yml renamed to docker-compose/scorpio.yml

Lines changed: 9 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,21 @@
1616
#
1717
# see: https://github.com/FIWARE/helm-charts/
1818
#
19-
version: "3.8"
20-
19+
version: '3.9'
2120
services:
22-
zookeeper:
23-
labels:
24-
org.fiware: 'tutorial'
25-
image: zookeeper
26-
hostname: zookeeper
27-
container_name: zookeeper
28-
networks:
29-
- default
30-
ports:
31-
- "2181"
32-
logging:
33-
driver: none
34-
kafka:
21+
# Scorpio is the context broker
22+
scorpio:
3523
labels:
3624
org.fiware: 'tutorial'
37-
image: bitnami/kafka
38-
hostname: kafka
39-
container_name: kafka
25+
image: quay.io/fiware/scorpio:java-${SCORPIO_VERSION}
26+
hostname: scorpio
27+
container_name: fiware-scorpio
4028
networks:
4129
- default
4230
ports:
43-
- "9092"
44-
environment:
45-
KAFKA_ADVERTISED_HOST_NAME: kafka
46-
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
47-
KAFKA_ADVERTISED_PORT: 9092
48-
KAFKA_LOG_RETENTION_MS: 10000
49-
KAFKA_LOG_RETENTION_CHECK_INTERVAL_MS: 5000
50-
ALLOW_PLAINTEXT_LISTENER: "yes"
51-
volumes:
52-
- /var/run/docker.sock:/var/run/docker.sock
31+
- "${EXPOSED_PORT}:${SCORPIO_PORT}"
5332
depends_on:
54-
- zookeeper
55-
logging:
56-
driver: none
33+
- postgres
5734
postgres:
5835
labels:
5936
org.fiware: 'tutorial'
@@ -70,21 +47,8 @@ services:
7047
POSTGRES_DB: ngb
7148
logging:
7249
driver: none
73-
scorpio:
74-
labels:
75-
org.fiware: 'tutorial'
76-
image: scorpiobroker/all-in-one-runner:java-kafka-${SCORPIO_VERSION}
77-
hostname: scorpio
78-
container_name: fiware-scorpio
79-
networks:
80-
- default
81-
ports:
82-
- "${SCORPIO_PORT}:9090"
83-
depends_on:
84-
- postgres
85-
- kafka
8650

87-
# Tutorial acts as a series of dummy IoT Sensors over HTTP and connects to the Scorpio Broker
51+
# Tutorial connects to the Scorpio Broker
8852
tutorial:
8953
environment:
9054
- IOTA_DEFAULT_RESOURCE=/iot/d

import-data

Lines changed: 23 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,14 @@ curl -s -o /dev/null -X POST \
2929
"location": {"type": "GeoProperty", "value": {"type": "Point", "coordinates": [13.3986, 52.5547]}
3030
},
3131
"name": {"type": "Property", "value": "Bösebrücke Einkauf"},
32-
"furniture":[
33-
{
34-
"type": "Relationship",
35-
"datasetId": "urn:ngsi-ld:Relationship:1",
36-
"object": "urn:ngsi-ld:Shelf:unit001"
37-
},
38-
{
39-
"type": "Relationship",
40-
"datasetId": "urn:ngsi-ld:Relationship:2",
41-
"object": "urn:ngsi-ld:Shelf:unit002"
42-
},
43-
{
44-
"type": "Relationship",
45-
"datasetId": "urn:ngsi-ld:Relationship:3",
46-
"object": "urn:ngsi-ld:Shelf:unit003"
47-
}
48-
],
32+
"furniture": {
33+
"type": "Relationship",
34+
"object": [
35+
"urn:ngsi-ld:Shelf:unit001",
36+
"urn:ngsi-ld:Shelf:unit002",
37+
"urn:ngsi-ld:Shelf:unit003"
38+
]
39+
},
4940
"@context": "'"${TUTORIAL_DATA_MODELS_CONTEXT}"'"
5041
}'
5142

@@ -67,18 +58,13 @@ curl -s -o /dev/null -X POST \
6758
"location": {"type": "GeoProperty", "value": {"type": "Point", "coordinates": [13.3903,52.5075]}
6859
},
6960
"name": {"type": "Property", "value": "Checkpoint Markt"},
70-
"furniture":[
71-
{
72-
"type": "Relationship",
73-
"datasetId": "urn:ngsi-ld:Relationship:1",
74-
"object": "urn:ngsi-ld:Shelf:unit004"
75-
},
76-
{
77-
"type": "Relationship",
78-
"datasetId": "urn:ngsi-ld:Relationship:2",
79-
"object": "urn:ngsi-ld:Shelf:unit005"
80-
}
81-
],
61+
"furniture": {
62+
"type": "Relationship",
63+
"object": [
64+
"urn:ngsi-ld:Shelf:unit004",
65+
"urn:ngsi-ld:Shelf:unit005"
66+
]
67+
},
8268
"@context": "'"${TUTORIAL_DATA_MODELS_CONTEXT}"'"
8369
}'
8470

@@ -97,23 +83,14 @@ curl -s -o /dev/null -X POST \
9783
"location": {"type": "GeoProperty", "value": {"type": "Point", "coordinates": [13.4447,52.5031]}
9884
},
9985
"name": {"type": "Property", "value": "East Side Galleria"},
100-
"furniture":[
101-
{
102-
"type": "Relationship",
103-
"datasetId": "urn:ngsi-ld:Relationship:1",
104-
"object": "urn:ngsi-ld:Shelf:unit006"
105-
},
106-
{
107-
"type": "Relationship",
108-
"datasetId": "urn:ngsi-ld:Relationship:2",
109-
"object": "urn:ngsi-ld:Shelf:unit007"
110-
},
111-
{
112-
"type": "Relationship",
113-
"datasetId": "urn:ngsi-ld:Relationship:3",
114-
"object": "urn:ngsi-ld:Shelf:unit008"
115-
}
116-
],
86+
"furniture": {
87+
"type": "Relationship",
88+
"object": [
89+
"urn:ngsi-ld:Shelf:unit006",
90+
"urn:ngsi-ld:Shelf:unit007",
91+
"urn:ngsi-ld:Shelf:unit008"
92+
]
93+
},
11794
"@context": "'"${TUTORIAL_DATA_MODELS_CONTEXT}"'"
11895
}'
11996

services

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ waitForScorpio () {
5858
while [ "${response}" -eq 000 ]
5959
do
6060
echo -e "Context Broker HTTP state: ${response} (waiting for 404)"
61-
pause 60
61+
pause 6
6262
getHeartbeat "${SCORPIO}"
6363
done
6464
}
@@ -186,11 +186,11 @@ case "${command}" in
186186
export $(cat .env | grep "#" -v)
187187
stoppingContainers
188188
waitForCoreContext
189-
echo -e "Starting containers: \033[1;34mScorpio\033[0m, \033[1mKafka\033[0m, \033[1mZookeeper\033[0m and a \033[1mPostgres\033[0m database, \033[1;36mIoT-Agent\033[0m, \033[1mTutorial\033[0m and a \033[1mMongoDB\033[0m database."
189+
echo -e "Starting containers: \033[1;34mScorpio\033[0m and a \033[1mPostgres\033[0m database, \033[1;36mIoT-Agent\033[0m, \033[1mTutorial\033[0m and a \033[1mMongoDB\033[0m database."
190190
echo -e "- \033[1;34mScorpio\033[0m is the context broker"
191191
echo -e "- Data models \033[1m@context\033[0m (Smart Supermarket) is supplied externally"
192192
echo ""
193-
${dockerCmd} -f docker-compose/common.yml -f docker-compose/scorpio-aaio.yml up -d --remove-orphans --renew-anon-volumes
193+
${dockerCmd} -f docker-compose/common.yml -f docker-compose/scorpio.yml up -d --remove-orphans --renew-anon-volumes
194194
waitForMongo
195195
waitForScorpio
196196
export CONTEXT_BROKER=scorpio:9090
@@ -224,7 +224,7 @@ case "${command}" in
224224
export $(cat .env | grep "#" -v)
225225
echo "Pulling Docker images"
226226
docker pull -q quay.io/curl/curl
227-
${dockerCmd} -f docker-compose/common.yml -f docker-compose/scorpio-aaio.yml -f docker-compose/orion-ld.yml -f docker-compose/stellio.yml pull
227+
${dockerCmd} -f docker-compose/common.yml -f docker-compose/scorpio.yml -f docker-compose/orion-ld.yml -f docker-compose/stellio.yml pull
228228
;;
229229
*)
230230
echo "Command not Found."

0 commit comments

Comments
 (0)