tree: 5123db7b9f5a6732c8dcfdaea537ea17408be02e [path history] [tgz]
  1. compose/
  2. conf/
  3. scripts/
  4. .gitignore
  5. pom.xml
  6. README.md
metron-contrib/metron-docker-e2e/README.md

Metron Docker

Metron Docker E2E is a Docker Compose application that serves as a backend to integration tests.

Metron Docker includes these images that have been customized for Metron:

  • Kafka
  • Zookeeper
  • Elasticsearch
  • Metron REST
  • Metron UIs

Setup

Install Docker for Mac or Docker for Windows. The following versions have been tested:

  • Docker version 17.12.0-ce
  • docker-machine version 0.13.0
  • docker-compose version 1.18.0

Build Metron from the top level directory with:

$ cd $METRON_HOME
$ mvn clean install -DskipTests

Create a Docker machine:

$ export METRON_DOCKER_E2E_HOME=$METRON_HOME/metron-contrib/metron-docker-e2e
$ cd $METRON_DOCKER_E2E_HOME
$ ./scripts/create-docker-machine.sh

This will create a host called “metron-machine”. Anytime you want to run Docker commands against this host, make sure you run this first to set the Docker environment variables:

$ eval "$(docker-machine env metron-machine)"

If you wish to use a local docker-engine install, please set an environment variable BROKER_IP_ADDR to the IP address of your host machine. This cannot be the loopback address.

Usage

Navigate to the compose application root:

$ cd $METRON_DOCKER_E2E_HOME/compose/

The Metron Docker environment lifecycle is controlled by the docker-compose command. The service names can be found in the docker-compose.yml file. For example, to build and start the environment run this command:

$ eval "$(docker-machine env metron-machine)"
$ docker-compose up -d

After all services have started list the containers and ensure their status is ‘Up’:

$ docker-compose ps
         Name                       Command               State                       Ports                     
----------------------------------------------------------------------------------------------------------------
metron_elasticsearch_1   /bin/bash bin/es-docker          Up      0.0.0.0:9210->9200/tcp, 0.0.0.0:9310->9300/tcp
metron_kafka_1           start-kafka.sh                   Up      0.0.0.0:9092->9092/tcp                        
metron_metron-rest_1     /bin/sh -c ./bin/start.sh        Up      0.0.0.0:8082->8082/tcp                        
metron_metron-ui_1       /bin/sh -c ./bin/start.sh        Up      0.0.0.0:4201->4201/tcp                        
metron_zookeeper_1       /docker-entrypoint.sh zkSe ...   Up      0.0.0.0:2181->2181/tcp, 2888/tcp, 3888/tcp    

Various services are exposed through http on the Docker host. Get the host ip from the URL property:

$ docker-machine ls
NAME             ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
metron-machine   *        virtualbox   Running   tcp://192.168.99.100:2376           v1.12.5

The various integration tests can now be run against this environment.

TODO: document how to set docker machine ip address for e2e tests