<commit_before># Intentionally pinning Docker images to 5.5.1 because they have 'tc' used by Pumba to simulate latency
# Docker images 6.0.0 and later are based on ubi8 and they do not have 'tc'

# docker-compose supports environment variable substitution with the ${VARIABLE-NAME} syntax.
# Environment variables can be sourced in a variety of ways.  One of those ways is through
# a well known '.env' file located in the same folder as the docker-compose.yml file.  See the Docker
# documentation for details: https://docs.docker.com/compose/environment-variables/#the-env-file
# 
# This feature is being used to parameterize some values within this file.  In this directory is also
# a .env file, which is actually a symbolic link to <examples-root>/utils/config.env.  That file
# contains values which get substituted here when docker-compose parses this file.
#
# If you'd like to view the docker-compose.yml file rendered with its environment variable substituions
# you can execute the `docker-compose config` command.  Take note that some demos provide additional 
# environment variable values by exporting them in a script prior to running `docker-compose up`.
---
version: '3'

services:
  zookeeper-west:
    image: confluentinc/cp-zookeeper:6.0.0
    hostname: zookeeper-west
    container_name: zookeeper-west
    networks:
      - n1
    ports:
      - "2181:2181"
    environment:
      ZOOKEEPER_SERVER_ID: 1
      ZOOKEEPER_CLIENT_PORT: 2181
      ZOOKEEPER_SERVERS: zookeeper-west:2888:3888;zookeeper-central:2888:3888;zookeeper-east:2888:3888

  zookeeper-central:
    image: confluentinc/cp-zookeeper:6.0.0
    hostname: zookeeper-central
    container_name: zookeeper-central
    networks:
      - n1
    ports:
      - "2182:2182"
    environment:
      ZOOKEEPER_SERVER_ID: 2
      ZOOKEEPER_CLIENT_PORT: 2182
      ZOOKEEPER_SERVERS: zookeeper-west:2888:3888;zookeeper-central:2888:3888;zookeeper-east:2888:3888
    depends_on:
      - zookeeper-west

  zookeeper-east:
    image: confluentinc/cp-zookeeper:6.0.0
    hostname: zookeeper-east
    container_name: zookeeper-east
    networks:
      - n1
    ports:
      - "2183:2183"
    environment:
      ZOOKEEPER_SERVER_ID: 3
      ZOOKEEPER_CLIENT_PORT: 2183
      ZOOKEEPER_SERVERS: zookeeper-west:2888:3888;zookeeper-central:2888:3888;zookeeper-east:2888:3888
    depends_on:
      - zookeeper-west
      - zookeeper-central

  broker-west-1:
    image: confluentinc/cp-server:6.0.0
    hostname: broker-west-1
    container_name: broker-west-1
    networks:
      - n1
    ports:
      - "9091:9091"
      - "8091:8091"
    volumes:
      - ./config:/etc/kafka/demo
    environment:
      KAFKA_BROKER_ID: 1
      KAFKA_BROKER_RACK: 'west'
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
      KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://broker-west-1:19091,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9091
      KAFKA_REPLICA_SELECTOR_CLASS: org.apache.kafka.common.replica.RackAwareReplicaSelector
      KAFKA_ZOOKEEPER_CONNECT: 'zookeeper-west:2181,zookeeper-central:2182,zookeeper-east:2183'
      KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 2
      KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter
      KAFKA_CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: broker-west-1:19091,broker-east-3:19093
      KAFKA_JMX_PORT: 8091
      KAFKA_CONFLUENT_LOG_PLACEMENT_CONSTRAINTS: '{"version": 1,"replicas": [{"count": 2, "constraints": {"rack": "west"}}], "observers": [{"count": 2, "constraints": {"rack": "east"}}]}'
      KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 4
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 2
    depends_on:
      - zookeeper-west
      - zookeeper-central
      - zookeeper-east

  broker-west-2:
    image: confluentinc/cp-server:6.0.0
    hostname: broker-west-2
    container_name: broker-west-2
    networks:
      - n1
    ports:
      - "9092:9092"
      - "8092:8092"
    environment:
      KAFKA_BROKER_ID: 2
      KAFKA_BROKER_RACK: 'west'
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
      KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://broker-west-2:19092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092
      KAFKA_REPLICA_SELECTOR_CLASS: org.apache.kafka.common.replica.RackAwareReplicaSelector
      KAFKA_ZOOKEEPER_CONNECT: 'zookeeper-west:2181,zookeeper-central:2182,zookeeper-east:2183'
      KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 2
      KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter
      KAFKA_CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: broker-west-1:19091,broker-east-3:19093
      KAFKA_JMX_PORT: 8092
      KAFKA_CONFLUENT_LOG_PLACEMENT_CONSTRAINTS: '{"version": 1,"replicas": [{"count": 2, "constraints": {"rack": "west"}}], "observers": [{"count": 2, "constraints": {"rack": "east"}}]}'
      KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 4
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 2
    depends_on:
      - zookeeper-west
      - zookeeper-central
      - zookeeper-east
      - broker-west-1

  broker-east-3:
    image: confluentinc/cp-server:6.0.0
    hostname: broker-east-3
    container_name: broker-east-3
    networks:
      - n1
    ports:
      - "9093:9093"
      - "8093:8093"
    volumes:
      - ./config:/etc/kafka/demo
    environment:
      KAFKA_BROKER_ID: 3
      KAFKA_BROKER_RACK: 'east'
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
      KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://broker-east-3:19093,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9093
      KAFKA_REPLICA_SELECTOR_CLASS: org.apache.kafka.common.replica.RackAwareReplicaSelector
      KAFKA_ZOOKEEPER_CONNECT: 'zookeeper-west:2181,zookeeper-central:2182,zookeeper-east:2183'
      KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 2
      KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter
      KAFKA_CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: broker-west-1:19091,broker-east-3:19093
      KAFKA_JMX_PORT: 8093
      KAFKA_CONFLUENT_LOG_PLACEMENT_CONSTRAINTS: '{"version": 1,"replicas": [{"count": 2, "constraints": {"rack": "west"}}], "observers": [{"count": 2, "constraints": {"rack": "east"}}]}'
      KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 4
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 2
    depends_on:
      - zookeeper-west
      - zookeeper-central
      - zookeeper-east
      - broker-west-1
      - broker-west-2

  broker-east-4:
    image: confluentinc/cp-server:6.0.0
    hostname: broker-east-4
    container_name: broker-east-4<commit_msg>DEVX-2220: repin MRC demo to 5.5.1 (not 6.0.0) (#850)<commit_after># Intentionally pinning Docker images to 5.5.1 because they have 'tc' used by Pumba to simulate latency
# Docker images 6.0.0 and later are based on ubi8 and they do not have 'tc'

# docker-compose supports environment variable substitution with the ${VARIABLE-NAME} syntax.
# Environment variables can be sourced in a variety of ways.  One of those ways is through
# a well known '.env' file located in the same folder as the docker-compose.yml file.  See the Docker
# documentation for details: https://docs.docker.com/compose/environment-variables/#the-env-file
# 
# This feature is being used to parameterize some values within this file.  In this directory is also
# a .env file, which is actually a symbolic link to <examples-root>/utils/config.env.  That file
# contains values which get substituted here when docker-compose parses this file.
#
# If you'd like to view the docker-compose.yml file rendered with its environment variable substituions
# you can execute the `docker-compose config` command.  Take note that some demos provide additional 
# environment variable values by exporting them in a script prior to running `docker-compose up`.
---
version: '3'

services:
  zookeeper-west:
    image: confluentinc/cp-zookeeper:5.5.1
    hostname: zookeeper-west
    container_name: zookeeper-west
    networks:
      - n1
    ports:
      - "2181:2181"
    environment:
      ZOOKEEPER_SERVER_ID: 1
      ZOOKEEPER_CLIENT_PORT: 2181
      ZOOKEEPER_SERVERS: zookeeper-west:2888:3888;zookeeper-central:2888:3888;zookeeper-east:2888:3888

  zookeeper-central:
    image: confluentinc/cp-zookeeper:5.5.1
    hostname: zookeeper-central
    container_name: zookeeper-central
    networks:
      - n1
    ports:
      - "2182:2182"
    environment:
      ZOOKEEPER_SERVER_ID: 2
      ZOOKEEPER_CLIENT_PORT: 2182
      ZOOKEEPER_SERVERS: zookeeper-west:2888:3888;zookeeper-central:2888:3888;zookeeper-east:2888:3888
    depends_on:
      - zookeeper-west

  zookeeper-east:
    image: confluentinc/cp-zookeeper:5.5.1
    hostname: zookeeper-east
    container_name: zookeeper-east
    networks:
      - n1
    ports:
      - "2183:2183"
    environment:
      ZOOKEEPER_SERVER_ID: 3
      ZOOKEEPER_CLIENT_PORT: 2183
      ZOOKEEPER_SERVERS: zookeeper-west:2888:3888;zookeeper-central:2888:3888;zookeeper-east:2888:3888
    depends_on:
      - zookeeper-west
      - zookeeper-central

  broker-west-1:
    image: confluentinc/cp-server:5.5.1
    hostname: broker-west-1
    container_name: broker-west-1
    networks:
      - n1
    ports:
      - "9091:9091"
      - "8091:8091"
    volumes:
      - ./config:/etc/kafka/demo
    environment:
      KAFKA_BROKER_ID: 1
      KAFKA_BROKER_RACK: 'west'
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
      KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://broker-west-1:19091,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9091
      KAFKA_REPLICA_SELECTOR_CLASS: org.apache.kafka.common.replica.RackAwareReplicaSelector
      KAFKA_ZOOKEEPER_CONNECT: 'zookeeper-west:2181,zookeeper-central:2182,zookeeper-east:2183'
      KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 2
      KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter
      KAFKA_CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: broker-west-1:19091,broker-east-3:19093
      KAFKA_JMX_PORT: 8091
      KAFKA_CONFLUENT_LOG_PLACEMENT_CONSTRAINTS: '{"version": 1,"replicas": [{"count": 2, "constraints": {"rack": "west"}}], "observers": [{"count": 2, "constraints": {"rack": "east"}}]}'
      KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 4
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 2
    depends_on:
      - zookeeper-west
      - zookeeper-central
      - zookeeper-east

  broker-west-2:
    image: confluentinc/cp-server:5.5.1
    hostname: broker-west-2
    container_name: broker-west-2
    networks:
      - n1
    ports:
      - "9092:9092"
      - "8092:8092"
    environment:
      KAFKA_BROKER_ID: 2
      KAFKA_BROKER_RACK: 'west'
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
      KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://broker-west-2:19092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092
      KAFKA_REPLICA_SELECTOR_CLASS: org.apache.kafka.common.replica.RackAwareReplicaSelector
      KAFKA_ZOOKEEPER_CONNECT: 'zookeeper-west:2181,zookeeper-central:2182,zookeeper-east:2183'
      KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 2
      KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter
      KAFKA_CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: broker-west-1:19091,broker-east-3:19093
      KAFKA_JMX_PORT: 8092
      KAFKA_CONFLUENT_LOG_PLACEMENT_CONSTRAINTS: '{"version": 1,"replicas": [{"count": 2, "constraints": {"rack": "west"}}], "observers": [{"count": 2, "constraints": {"rack": "east"}}]}'
      KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 4
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 2
    depends_on:
      - zookeeper-west
      - zookeeper-central
      - zookeeper-east
      - broker-west-1

  broker-east-3:
    image: confluentinc/cp-server:5.5.1
    hostname: broker-east-3
    container_name: broker-east-3
    networks:
      - n1
    ports:
      - "9093:9093"
      - "8093:8093"
    volumes:
      - ./config:/etc/kafka/demo
    environment:
      KAFKA_BROKER_ID: 3
      KAFKA_BROKER_RACK: 'east'
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
      KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://broker-east-3:19093,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9093
      KAFKA_REPLICA_SELECTOR_CLASS: org.apache.kafka.common.replica.RackAwareReplicaSelector
      KAFKA_ZOOKEEPER_CONNECT: 'zookeeper-west:2181,zookeeper-central:2182,zookeeper-east:2183'
      KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 2
      KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter
      KAFKA_CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: broker-west-1:19091,broker-east-3:19093
      KAFKA_JMX_PORT: 8093
      KAFKA_CONFLUENT_LOG_PLACEMENT_CONSTRAINTS: '{"version": 1,"replicas": [{"count": 2, "constraints": {"rack": "west"}}], "observers": [{"count": 2, "constraints": {"rack": "east"}}]}'
      KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 4
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 2
    depends_on:
      - zookeeper-west
      - zookeeper-central
      - zookeeper-east
      - broker-west-1
      - broker-west-2

  broker-east-4:
    image: confluentinc/cp-server:5.5.1
    hostname: broker-east-4
    container_name: broker-east-4
{'fraction_non_alphanumeric': 0.09816171190578774, 'fraction_numerical': 0.05292259083728278, 'mean_word_length': 3.9073291050035235, 'pattern_counts': {'":': 54, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3285351', 'n_tokens_mistral': 5933, 'n_tokens_neox': 5362, 'n_words': 823}