Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
scripts adapted to the new repo name
readme.md
  • Loading branch information
abattagl committed Jan 21, 2021
1 parent 17483c9 commit a4b0d23
Show file tree
Hide file tree
Showing 14 changed files with 190 additions and 77 deletions.
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,50 @@
# qiot-datahub-docker
## qiot-datahub-docker

A set od docker-compose files to run the QIoT environment on your host machine using a OCI-compliant container engine and tools.
Podman engine is recommendedthus you'll find below the prerequisited and mandatory actions to take before using these compose files:

# if you want to go with podman:

`$ sudo dnf install -y podman podman-compose`

# Set up a dedicated container network for both your edge pods and datahub pods


`$ sudo docker network create edge` - Network dedicated to the services running on the edge device
/etc/cni/net.d/qiot-covid19-edge.conflist

`$ sudo podman network create datahub` - Network dedicated to the services running on the datacenter
/etc/cni/net.d/qiot-covid19-datahub.conflist

`$ sudo docker network create qiotconnect` - Network dedicated to the interaction between the edge device and the datahub
/etc/cni/net.d/qiot-covid19-edge.conflist

# Tools to monitor your container engine:

Docker: Portainer

`docker run -d --privileged -p 9000:9000 -p 8000:8000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce`

Podman: Podman Cockpit extension

`sudo dnf install cockpit-podman -y`

# Disable SELinux to allow containers to access persistent-volume mappings

We can edit the `/etc/selinux/config` text file with our persistent setting, either enforcing, permissive, or disabled. By default this file appears as shown below.

```
This file controls the state of SELinux on the system.
SELINUX= can take one of these three values:
enforcing - SELinux security policy is enforced.
permissive - SELinux prints warnings instead of enforcing.
disabled - No SELinux policy is loaded.
LINUX=enforcing
ELINUXTYPE= can take one of three two values:
targeted - Targeted processes are protected,
minimum - Modification of targeted policy. Only selected processes are protected.
mls - Multi Level Security protection.
SELINUXTYPE=targeted
```

We can simply edit the SELINUX variable between enforcing, permissive, or disabled, as outlined in the comments of the file. After editing the file the changes will not be in place immediately and will only change after system reboot.
15 changes: 13 additions & 2 deletions buildQiot.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
cd /home/abattagl/git/qiot/datahub/qiot-datahub-storer/qiot-datahub-storer-gas/
chmod +x build.sh
./build.sh
cd /home/abattagl/git/qiot/datahub/qiot-datahub-storer/qiot-datahub-storer-pollution/
chmod +x build.sh
./build.sh
cd /home/abattagl/git/qiot/datahub/qiot-datahub-aggregation/
chmod +x build.sh
./build.sh
cd /home/abattagl/git/qiot/datahub/qiot-datahub-query/
chmod +x build.sh
./build.sh
cd /home/abattagl/git/qiot/datahub/qiot-datahub-importer/
chmod +x build.sh
./build.sh
#cd /home/abattagl/git/qiot/datahub/qiot-datahub-importer/
#./build.sh
cd /home/abattagl/git/qiot/datahub/qiot-datahub-registration/
chmod +x build.sh
./build.sh
cd /home/abattagl/git/qiot/datahub/qiot-datahub-endpoint/qiot-datahub-endpoint-mqtt/
chmod +x build.sh
./build.sh
#cd /home/abattagl/git/qiot/edge/qiot-sensors-emulator/
#chmod +x build.sh
#./build.sh
#cd /home/abattagl/git/qiot/edge/qiot-service/
#chmod +x build.sh
#./build.sh

84 changes: 84 additions & 0 deletions comp/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
version: '3'
services:
activemq:
image: vromero/activemq-artemis:2-alpine-latest
container_name: "activemq"
restart: "no"
networks:
- datahub
- qiotconnect
ports:
- "8161:8161"
# - "61616:61616"
# - "5672:5672"
- "1883:1883"
environment:
ARTEMIS_USERNAME: "quarkus"
ARTEMIS_PASSWORD: "quarkus"
# kafdrop:
# image: obsidiandynamics/kafdrop
# container_name: "kafkadrop"
# restart: "no"
# ports:
# - "9000:9000"
# environment:
# KAFKA_BROKERCONNECT: "kafka:29092"
# JVM_OPTS: "-Xms16M -Xmx48M -Xss180K -XX:-TieredCompilation -XX:+UseStringDeduplication -noverify"
# depends_on:
# - "kafka"
kafka:
image: obsidiandynamics/kafka
container_name: "kafka"
restart: "no"
ports:
- "2181:2181"
- "9092:9092"
environment:
KAFKA_LISTENERS: "INTERNAL://:29092,EXTERNAL://kafka:9092"
KAFKA_ADVERTISED_LISTENERS: "INTERNAL://kafka:29092,EXTERNAL://kafka:9092"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT"
KAFKA_INTER_BROKER_LISTENER_NAME: "INTERNAL"
KAFKA_ZOOKEEPER_SESSION_TIMEOUT: "6000"
KAFKA_RESTART_ATTEMPTS: "10"
KAFKA_RESTART_DELAY: "5"
ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL: "0"
mongo:
image: "mongo"
container_name: "mongo"
environment:
MONGO_INITDB_DATABASE: "qiot"
#MONGO_INITDB_ROOT_USERNAME: "root"
#MONGO_INITDB_ROOT_PASSWORD: "root"
volumes:
#- ./init-mongo.js: /docker-entrypoint-initdb.d/init-mongo.js:ro
- ./volumes/mongo:/data/db
ports:
- "27017-27019:27017-27019"
# mongo-express:
# image: mongo-express
# container_name: mongo-express
# environment:
# ME_CONFIG_MONGODB_SERVER: "mongo"
# ME_CONFIG_MONGODB_PORT: "27017"
# #ME_CONFIG_MONGODB_ENABLE_ADMIN: "false"
# #ME_CONFIG_MONGODB_AUTH_DATABASE: "qiot"
# #ME_CONFIG_MONGODB_AUTH_USERNAME: "qiot"
# #ME_CONFIG_MONGODB_AUTH_PASSWORD: "qiot"
# ports:
# - "8081:8081"
# influx:
# image: "quay.io/influxdb/influxdb:v2.0.3"
# container_name: "influx"
# volumes:
# - ./volumes/influxdb2:/root/.influxdbv2
# ports:
# - "8086:8086"
# - "9999:9999"
networks:
datahub:
external: true
qiotconnect:
external: true
default:
external:
name: datahub
1 change: 1 addition & 0 deletions comp/init-mongo.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#docker exec -it mongoContainer mongo
use qiot
db.createUser(
{
Expand Down
35 changes: 14 additions & 21 deletions datahub/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
version: '3'
services:
datahub-registration:
image: quay.io/qiot/qiot-datahub-registration
image: quay.io/qiotcovid19/qiot-datahub-registration:1.0.1
container_name: "datahub-registration"
restart: "no"
networks:
- datahub
- qiotconnect
ports:
- "5016:5016"
environment:
QUARKUS_PROFILE: "staging"
HTTPPORT: "5016"
MONGODBURL: "mongo:27017"
datahub-aggregation:
image: quay.io/qiot/qiot-datahub-aggregation
image: quay.io/qiotcovid19/qiot-datahub-aggregation:1.0.1
container_name: "datahub-aggregation"
restart: "no"
ports:
Expand All @@ -21,7 +24,7 @@ services:
HTTPPORT: "5018"
MONGODBURL: "mongo:27017"
datahub-query:
image: quay.io/qiot/qiot-datahub-query
image: quay.io/qiotcovid19/qiot-datahub-query:1.0.1
container_name: "datahub-query"
restart: "no"
ports:
Expand All @@ -31,44 +34,34 @@ services:
HTTPPORT: "5200"
MONGODBURL: "mongo:27017"
endpoint-mqtt:
image: quay.io/qiot/qiot-datahub-endpoint-mqtt
image: quay.io/qiotcovid19/qiot-datahub-endpoint-mqtt:1.0.1
container_name: "datahub-endpoint-mqtt"
restart: "no"
environment:
QUARKUS_PROFILE: "staging"
AMQPHOST: "activemq"
MQTTHOST: "activemq"
# gasstreamer:
# image: quay.io/qiot/qiot-datahub-streamer-gas
# container_name: "datahub-streamer-gas"
# restart: "no"
# environment:
# MESSAGINGHOST: "activemq"
# KAFKABOOTSTRAPURL: "kafka:9092"
# pollutionstreamer:
# image: quay.io/qiot/qiot-datahub-streamer-pollution
# container_name: "datahub-streamer-pollution"
# restart: "no"
# environment:
# MESSAGINGHOST: "activemq"
# KAFKABOOTSTRAPURL: "kafka:9092"
gasstorer:
image: quay.io/qiot/qiot-datahub-storer-gas
image: quay.io/qiotcovid19/qiot-datahub-storer-gas:1.0.1
container_name: "datahub-storer-gas"
restart: "no"
environment:
QUARKUS_PROFILE: "staging"
KAFKABOOTSTRAPURL: "kafka:9092"
MONGODBURL: "mongo:27017"
pollutionstorer:
image: quay.io/qiot/qiot-datahub-storer-pollution
image: quay.io/qiotcovid19/qiot-datahub-storer-pollution:1.0.1
container_name: "datahub-storer-pollution"
restart: "no"
environment:
QUARKUS_PROFILE: "staging"
KAFKABOOTSTRAPURL: "kafka:9092"
MONGODBURL: "mongo:27017"
networks:
datahub:
external: true
qiotconnect:
external: true
default:
external:
name: qiot
name: datahub
15 changes: 0 additions & 15 deletions docker.txt

This file was deleted.

6 changes: 3 additions & 3 deletions edge-server/application/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
edge-integrator:
image: quay.io/qiot/qiot-edge-integrator:1-x86_64
image: quay.io/qiotcovid19/qiot-edge-integrator:1-x86_64
container_name: "edge-integrator"
restart: "no"
environment:
Expand All @@ -11,7 +11,7 @@ services:
AMQPPASSWORD: "qiot"
SENSORSURL: "http://edge-sensors:5000/"
edge-server-01:
image: quay.io/qiot/qiot-edge-server:1-x86_64
image: quay.io/qiotcovid19/qiot-edge-server:1-x86_64
container_name: "edge-server-01"
restart: "no"
ports:
Expand All @@ -32,4 +32,4 @@ services:
networks:
default:
external:
name: qiot
name: edge
6 changes: 3 additions & 3 deletions edge-server/sensors/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ services:
expose:
- "5672"
edge-sensors:
image: quay.io/qiot/qiot-sensors-emulator
image: quay.io/qiotcovid19/qiot-sensors-emulator
container_name: "edge-sensors"
restart: "no"
ports:
- "5000:5000"
environment:
QUARKUS_PROFILE: "staging"
edge-sensors:
image: quay.io/qiot/qiot-sensors-emulator
image: quay.io/qiotcovid19/qiot-sensors-emulator
container_name: "edge-sensors"
restart: "no"
ports:
Expand All @@ -36,4 +36,4 @@ services:
networks:
default:
external:
name: qiot
name: edge
22 changes: 16 additions & 6 deletions edge/application/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
version: '3'
services:
edge-service-01:
image: quay.io/qiot/qiot-service:1-x86_64
image: quay.io/qiotcovid19/edge-service:1.2.0-x86_64
container_name: "edge-service-01"
restart: "no"
networks:
- edge
- qiotconnect
ports:
- "8091:8080"
environment:
Expand All @@ -17,9 +20,12 @@ services:
ENABLESSL: "false"
MQTTPORT: "1883"
edge-service-02:
image: quay.io/qiot/qiot-service:1-x86_64
image: quay.io/qiotcovid19/edge-service:1.2.0-x86_64
container_name: "edge-service-02"
restart: "no"
networks:
- edge
- qiotconnect
ports:
- "8092:8080"
environment:
Expand All @@ -33,9 +39,12 @@ services:
ENABLESSL: "false"
MQTTPORT: "1883"
edge-service-03:
image: quay.io/qiot/qiot-service:1-x86_64
image: quay.io/qiotcovid19/edge-service:1.2.0-x86_64
container_name: "edge-service-03"
restart: "no"
networks:
- edge
- qiotconnect
ports:
- "8093:8080"
environment:
Expand All @@ -49,6 +58,7 @@ services:
ENABLESSL: "false"
MQTTPORT: "1883"
networks:
default:
external:
name: qiot
edge:
external: true
qiotconnect:
external: true
Loading

0 comments on commit a4b0d23

Please sign in to comment.