This commit consists of:
1) Provide a kafka client to publish events to kafka brokers
2) Provide zookeeper and kafka docker containers for local testing,
will not be present in production
3) Sends a regular heartbeat to the kafka broker from voltha to
exercise all the components
4) Provides a basic kafka consumeri (requires kafka-python to be
installed) to read the messages off the local kafka broker -
this time it is only heartbeat messages
diff --git a/compose/docker-compose-system-test.yml b/compose/docker-compose-system-test.yml
index 01c03ea..4fec883 100644
--- a/compose/docker-compose-system-test.yml
+++ b/compose/docker-compose-system-test.yml
@@ -1,6 +1,31 @@
version: '2'
services:
#
+ # Single-node zookeeper service
+ #
+ zookeeper:
+ image: wurstmeister/zookeeper
+ ports:
+ - "2181:2181"
+ environment:
+ SERVICE_2181_NAME: "zookeeper"
+ #
+ # Single-node kafka service
+ #
+ kafka:
+ build: ../kafka
+ ports:
+ - "9092:9092"
+ environment:
+ KAFKA_ADVERTISED_HOST_NAME: ${DOCKER_HOST_IP}
+ KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
+ KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
+ SERVICE_9092_NAME: "kafka"
+ depends_on:
+ - consul
+ volumes:
+ - /var/run/docker.sock:/var/run/docker.sock
+ #
# Single-node consul agent
#
consul:
@@ -50,10 +75,11 @@
command: [
"/voltha/main.py",
"-v",
- "--consul=consul:8500",
+ "--consul=${DOCKER_HOST_IP}:8500",
"--fluentd=fluentd:24224",
"--rest-port=8880",
"--grpc-port=50555",
+ "--kafka=@kafka",
"--instance-id-is-container-name",
"-v"
]