Skip to content

Commit

Permalink
Merge pull request #89 from dojot/v0.4.1-RC_1
Browse files Browse the repository at this point in the history
Release V0.4.1
  • Loading branch information
Mariane Previde committed Jan 14, 2020
2 parents d504249 + 31907e0 commit fe42b78
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ before_install:
script:
- 'docker build -t ${TRAVIS_REPO_SLUG} .'
- 'docker build -t dredd-tests . -f ./tests/Dockerfile'
- 'docker-compose -f ./tests/docker-compose.yml up -d auth-redis postgres'
- 'docker-compose -f ./tests/docker-compose.yml up -d auth-redis postgres zookeeper kafka data-broker data-broker-redis'
- 'docker-compose -f ./tests/docker-compose.yml run auth'
after_success:
- travis/publish.sh
Expand Down
8 changes: 7 additions & 1 deletion auth/controller/KafkaPublisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import requests
import logging
import json
import signal
import os
from conf import kafka_subject, kafka_host, data_broker_host, dojot_management_tenant
from dojot.module import Messenger, Config, Log
import threading
Expand Down Expand Up @@ -53,4 +55,8 @@ def init(cls):
LOGGER.debug("... messenger initialized.")

def run(self):
self.init()
try:
self.init()
except Exception as e:
LOGGER.critical(f"Failed to init kafkaPublisher... Error: {e}. Shutting down")
os.kill(os.getpid(), signal.SIGINT)
3 changes: 2 additions & 1 deletion auth/webRoutes.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ def list_tenants():

# Initializing Kafka publisher
LOGGER.debug("Starting publisher initialization thread...")
Publisher().start()
publisherThread = Publisher()
publisherThread.start()
LOGGER.debug("... publisher initialization thread started.")

if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ json-logging-py==0.2
flask-redis==0.3.0
marisa_trie==0.7.4
git+https://github.com/dojot/alarm-client-python.git#egg=dojot-alarmlibrary
dojot.module==0.0.1a4
dojot.module==0.0.1a5
50 changes: 50 additions & 0 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
depends_on:
- postgres
- auth-redis
- kafka
depends_on:
postgres:
condition: service_healthy
Expand Down Expand Up @@ -35,3 +36,52 @@ services:
interval: 10s
timeout: 5s
retries: 5

zookeeper:
image: "zookeeper:3.4.14"
restart: always
logging:
driver: json-file
options:
max-size: 100m

kafka:
image: "wurstmeister/kafka:2.12-2.1.1"
depends_on:
- zookeeper
restart: always
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_HOST_NAME: kafka
KAFKA_NUM_PARTITIONS: 10
JMX_PORT: 1099
logging:
driver: json-file
options:
max-size: 100m

data-broker:
image: dojot/data-broker:latest
restart: always
depends_on:
- kafka
- data-broker-redis
- auth
environment:
DOJOT_MANAGEMENT_USER: 'data-broker'
KAFKA_GROUP_ID: 'data-broker-group'
SERVICE_PORT: 80
DATA_BROKER_URL: 'http://data-broker:80'
LOG_LEVEL: 'info'
logging:
driver: json-file
options:
max-size: 100m

data-broker-redis:
image: "redis:5.0.5-alpine3.10"
restart: always
logging:
driver: json-file
options:
max-size: 100m

0 comments on commit fe42b78

Please sign in to comment.