From e2bf9957278e6caa9a7e3907104eae1cb7b6b43d Mon Sep 17 00:00:00 2001 From: Jalen Jones Date: Tue, 23 Jul 2019 16:37:29 -0400 Subject: [PATCH] Edits to broker, build, outer_wrapper --- broker/config.json | 7 ++++--- broker/handler.py | 2 +- build/docker-compose.yml | 14 ++++++++++---- outer_wrapper.py | 4 ++++ 4 files changed, 19 insertions(+), 8 deletions(-) mode change 100644 => 100755 outer_wrapper.py diff --git a/broker/config.json b/broker/config.json index 65f18cd..cedb002 100644 --- a/broker/config.json +++ b/broker/config.json @@ -4,7 +4,8 @@ "hector", "power_demand", "power_supply", - "water", - "waterdemand" + "waterdemand", + "climate", + "logisticpopulation" ] -} \ No newline at end of file +} diff --git a/broker/handler.py b/broker/handler.py index f70525f..1e28790 100644 --- a/broker/handler.py +++ b/broker/handler.py @@ -23,7 +23,7 @@ class Broker: self.model_tracker = set() self.incstep = 0 self.boot_timer = 60 # units: seconds - self.watchdog_timer = 10 # units: seconds + self.watchdog_timer = 30 # units: seconds self.client = None self.mongo_queue = Queue() self.broker_id = 'broker' diff --git a/build/docker-compose.yml b/build/docker-compose.yml index 8048190..4dca26f 100644 --- a/build/docker-compose.yml +++ b/build/docker-compose.yml @@ -21,14 +21,20 @@ services: volumes: - ../models/examples/hector:/opt:ro - water: - build: ../models/examples/water/ - volumes: - - ../models/examples/water:/opt:ro waterdemand: build: ../models/examples/waterdemand/ volumes: - ../models/examples/waterdemand:/opt:ro + + climate: + build: ../models/examples/climate/ + volumes: + - ../models/examples/climate:/opt:ro + + logisticpopulation: + build: ../models/examples/logisticpopulation/ + volumes: + - ../models/examples/logisticpopulation:/opt:ro mongodb: image: mongo:latest diff --git a/outer_wrapper.py b/outer_wrapper.py old mode 100644 new mode 100755 index ce22899..a4147ce --- a/outer_wrapper.py +++ b/outer_wrapper.py @@ -245,6 +245,9 @@ class OuterWrapper(ABC): for schema_name, data_msg in results.items(): try: validate(data_msg, json.loads(self.generic_output_schema)) + print(schema_name) + print(data_msg) + print(self.output_schemas) validate(data_msg, self.output_schemas[schema_name]) except Exception as e: logging.critical("message {} failed to validate schema {}".format(data_msg, schema_name)) @@ -264,6 +267,7 @@ class OuterWrapper(ABC): data_msg['payload'] = data data_msg['signal'] = 'data' data_msg['source'] = self.model_id + data_msg['incstep'] = self.incstep self.pub_queue.put(data_msg) logging.info("finished the increment")