Skip to content

Commit 9ba45b9

Browse files
committed
Update Orion and MongoDB
1 parent 8bcf3a4 commit 9ba45b9

File tree

4 files changed

+18
-28
lines changed

4 files changed

+18
-28
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ COMPOSE_PROJECT_NAME=fiware
33

44
# Orion variables
55
ORION_PORT=1026
6-
ORION_VERSION=3.10.1
6+
ORION_VERSION=3.11.0
77

88
# MongoDB variables
99
MONGO_DB_PORT=27017
10-
MONGO_DB_VERSION=4.4
10+
MONGO_DB_VERSION=6.0
1111

1212
# IoT Agent Ultralight Variables
1313
ULTRALIGHT_VERSION=3.1.0-distroless

docker-compose/cygnus-sth-comet.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: "3.8"
22
services:
3-
# Orion is the context broker
4-
orion:
3+
# Orion is an NGSI-v2 context broker
4+
orion-v2:
55
labels:
66
org.fiware: 'tutorial'
77
image: quay.io/fiware/orion:${ORION_VERSION}
@@ -105,7 +105,7 @@ services:
105105
hostname: iot-sensors
106106
container_name: fiware-tutorial
107107
depends_on:
108-
- orion
108+
- orion-v2
109109
- iot-agent
110110
- sth-comet
111111
networks:
@@ -154,10 +154,11 @@ services:
154154
volumes:
155155
- mongo-db:/data
156156
healthcheck:
157-
test: |
158-
host=`hostname --ip-address || echo '127.0.0.1'`;
159-
mongo --quiet $host/test --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' && echo 0 || echo 1
157+
test: ["CMD","mongosh", "--eval", "db.adminCommand('ping')"]
160158
interval: 5s
159+
timeout: 5s
160+
retries: 3
161+
start_period: 5s
161162

162163

163164
networks:

docker-compose/sth-comet.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
#
1919
version: "3.8"
2020
services:
21-
# Orion is the context broker
22-
orion:
21+
# Orion is an NGSI-v2 context broker
22+
orion-v2:
2323
labels:
2424
org.fiware: 'tutorial'
2525
image: quay.io/fiware/orion:${ORION_VERSION}
@@ -98,7 +98,7 @@ services:
9898
hostname: iot-sensors
9999
container_name: fiware-tutorial
100100
depends_on:
101-
- orion
101+
- orion-v2
102102
- iot-agent
103103
- sth-comet
104104
networks:
@@ -146,10 +146,11 @@ services:
146146
volumes:
147147
- mongo-db:/data
148148
healthcheck:
149-
test: |
150-
host=`hostname --ip-address || echo '127.0.0.1'`;
151-
mongo --quiet $host/test --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)' && echo 0 || echo 1
149+
test: ["CMD","mongosh", "--eval", "db.adminCommand('ping')"]
152150
interval: 5s
151+
timeout: 5s
152+
retries: 3
153+
start_period: 5s
153154

154155
networks:
155156
default:

services

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ displayServices () {
6161

6262
addDatabaseIndex () {
6363
printf "Adding appropriate \033[1mMongoDB\033[0m indexes for \033[1;34mOrion\033[0m ..."
64-
docker exec db-mongo mongo --eval '
64+
docker exec db-mongo mongosh --eval '
6565
conn = new Mongo();db.createCollection("orion");
6666
db = conn.getDB("orion");
6767
db.createCollection("entities");
6868
db.entities.createIndex({"_id.servicePath": 1, "_id.id": 1, "_id.type": 1}, {unique: true});
6969
db.entities.createIndex({"_id.type": 1});
7070
db.entities.createIndex({"_id.id": 1});' > /dev/null
7171

72-
docker exec db-mongo mongo --eval '
72+
docker exec db-mongo mongosh --eval '
7373
conn = new Mongo();db.createCollection("orion-openiot");
7474
db = conn.getDB("orion-openiot");
7575
db.createCollection("entities");
@@ -78,18 +78,6 @@ addDatabaseIndex () {
7878
db.entities.createIndex({"_id.id": 1});' > /dev/null
7979
echo -e " \033[1;32mdone\033[0m"
8080

81-
printf "Adding appropriate \033[1mMongoDB\033[0m indexes for \033[1;36mIoT-Agent\033[0m ..."
82-
docker exec db-mongo mongo --eval '
83-
conn = new Mongo();
84-
db = conn.getDB("iotagentul");
85-
db.createCollection("devices");
86-
db.devices.createIndex({"_id.service": 1, "_id.id": 1, "_id.type": 1});
87-
db.devices.createIndex({"_id.type": 1});
88-
db.devices.createIndex({"_id.id": 1});
89-
db.createCollection("groups");
90-
db.groups.createIndex({"_id.resource": 1, "_id.apikey": 1, "_id.service": 1});
91-
db.groups.createIndex({"_id.type": 1});' > /dev/null
92-
echo -e " \033[1;32mdone\033[0m"
9381
}
9482

9583
waitForMongo () {

0 commit comments

Comments
 (0)