diff --git a/build/kafka-single-multi-broker/docker-compose-multi-broker-ios-xr.yaml b/build/kafka-single-multi-broker/docker-compose-multi-broker-ios-xr.yaml deleted file mode 100644 index 52ab20b3..00000000 --- a/build/kafka-single-multi-broker/docker-compose-multi-broker-ios-xr.yaml +++ /dev/null @@ -1,273 +0,0 @@ -version: "3.2" -networks: - mgmt: - driver_opts: - com.docker.network.container_iface_prefix: xr-1 - ipam: - config: - - subnet: 172.30.0.0/24 - gobmp-xrd-1: - driver_opts: - com.docker.network.container_iface_prefix: xr-2 - ipam: - config: - - subnet: 10.1.1.0/24 - xr-1-gi1-xr-2-gi0: - driver_opts: - com.docker.network.container_iface_prefix: xr-0 - com.docker.network.driver.mtu: 9000 - internal: true - name: xr-1-gi1-xr-2-gi0 -services: - gobmp: - #image: sbezverk/gobmp:v1.0.3 - image: sbezverk/gobmp:test-235 - expose: - - 5000 - entrypoint: - [ - "/gobmp", - "--source-port=5000", - "--intercept=false", - "--split-af=true", - "--v=9", - "--kafka-server=kafka-1:9091,kafka-2:9092,kafka-3:9093,kafka-4:9094" - ] - cap_add: - - NET_ADMIN - networks: - gobmp-xrd-1: - ipv4_address: 10.1.1.2 - depends_on: - - kafka-1 - - kafka-2 - - kafka-3 - - kafka-4 - zookeeper: - image: zookeeper:3.7.0 - restart: always - expose: - - 2181 - environment: - ZOOKEEPER_CLIENT_PORT: 2181 - ZOOKEEPER_TICK_TIME: 2000 - networks: - gobmp-xrd-1: - ipv4_address: 10.1.1.5 - volumes: - - ./zookeeper_hc.sh:/tmp/hc.sh - healthcheck: - test: [ "CMD-SHELL", "/tmp/hc.sh" ] - interval: 2s - timeout: 5s - retries: 5 - start_period: 20s - kafka-1: - image: confluentinc/cp-kafka:7.3.1 - restart: always - depends_on: - - zookeeper - expose: - - 9091 - environment: - KAFKA_BROKER_ID: 1 - KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181" - ZOOKEEPER: "zookeeper:2181" - KAFKA_TOPICS: "gobmp.parsed.peer:4:4:delete gobmp.parsed.unicast_prefix:6:4:delete gobmp.parsed.unicast_prefix_v4:6:4:delete gobmp.parsed.unicast_prefix_v6:6:4:delete gobmp.parsed.ls_node:4:4:delete gobmp.parsed.ls_link:4:4:delete gobmp.parsed.l3vpn:4:4:delete gobmp.parsed.l3vpn_v4:4:4:delete gobmp.parsed.l3vpn_v6:4:4:delete gobmp.parsed.sr_policy:4:4:delete gobmp.parsed.sr_policy_v4:4:4:delete gobmp.parsed.sr_policy_v6:4:4:delete gobmp.parsed.flowspec:4:4:delete gobmp.parsed.flowspec_v4:4:4:delete gobmp.parsed.flowspec_v6:4:4:delete gobmp.parsed.ls_prefix:4:4:delete gobmp.parsed.ls_srv6_sid:4:4:delete gobmp.parsed.evpn:4:4:delete gobmp.parsed.statistics:4:4:delete" - KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false" - ALLOW_PLAINTEXT_LISTENER: "yes" - KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka-1:9091" - KAFKA_LISTENERS: "PLAINTEXT://0.0.0.0:9091" - BOOTSTRAP_SERVERS: "kafka-1:9091,kafka-2:9092,kafka-3:9093,kafka-4:9094" - networks: - gobmp-xrd-1: - ipv4_address: 10.1.1.6 - healthcheck: - test: ps augwwx | egrep [S]upportedKafka - interval: 2s - timeout: 5s - retries: 5 - start_period: 20s - kafka-2: - image: confluentinc/cp-kafka:7.3.1 - restart: always - depends_on: - - zookeeper - expose: - - 9092 - environment: - KAFKA_BROKER_ID: 2 - KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181" - ZOOKEEPER: "zookeeper:2181" - KAFKA_TOPICS: "gobmp.parsed.peer:4:4:delete gobmp.parsed.unicast_prefix:6:4:delete gobmp.parsed.unicast_prefix_v4:6:4:delete gobmp.parsed.unicast_prefix_v6:6:4:delete gobmp.parsed.ls_node:4:4:delete gobmp.parsed.ls_link:4:4:delete gobmp.parsed.l3vpn:4:4:delete gobmp.parsed.l3vpn_v4:4:4:delete gobmp.parsed.l3vpn_v6:4:4:delete gobmp.parsed.sr_policy:4:4:delete gobmp.parsed.sr_policy_v4:4:4:delete gobmp.parsed.sr_policy_v6:4:4:delete gobmp.parsed.flowspec:4:4:delete gobmp.parsed.flowspec_v4:4:4:delete gobmp.parsed.flowspec_v6:4:4:delete gobmp.parsed.ls_prefix:4:4:delete gobmp.parsed.ls_srv6_sid:4:4:delete gobmp.parsed.evpn:4:4:delete gobmp.parsed.statistics:4:4:delete" - KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false" - ALLOW_PLAINTEXT_LISTENER: "yes" - KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka-2:9092" - KAFKA_LISTENERS: "PLAINTEXT://0.0.0.0:9092" - BOOTSTRAP_SERVERS: "kafka-1:9091,kafka-2:9092,kafka-3:9093,kafka-4:9094" - networks: - gobmp-xrd-1: - ipv4_address: 10.1.1.7 - healthcheck: - test: ps augwwx | egrep [S]upportedKafka - interval: 2s - timeout: 5s - retries: 5 - start_period: 20s - kafka-3: - image: confluentinc/cp-kafka:7.3.1 - restart: always - depends_on: - - zookeeper - expose: - - 9093 - environment: - KAFKA_BROKER_ID: 3 - KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181" - ZOOKEEPER: "zookeeper:2181" - KAFKA_TOPICS: "gobmp.parsed.peer:4:4:delete gobmp.parsed.unicast_prefix:6:4:delete gobmp.parsed.unicast_prefix_v4:6:4:delete gobmp.parsed.unicast_prefix_v6:6:4:delete gobmp.parsed.ls_node:4:4:delete gobmp.parsed.ls_link:4:4:delete gobmp.parsed.l3vpn:4:4:delete gobmp.parsed.l3vpn_v4:4:4:delete gobmp.parsed.l3vpn_v6:4:4:delete gobmp.parsed.sr_policy:4:4:delete gobmp.parsed.sr_policy_v4:4:4:delete gobmp.parsed.sr_policy_v6:4:4:delete gobmp.parsed.flowspec:4:4:delete gobmp.parsed.flowspec_v4:4:4:delete gobmp.parsed.flowspec_v6:4:4:delete gobmp.parsed.ls_prefix:4:4:delete gobmp.parsed.ls_srv6_sid:4:4:delete gobmp.parsed.evpn:4:4:delete gobmp.parsed.statistics:4:4:delete" - KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false" - ALLOW_PLAINTEXT_LISTENER: "yes" - KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka-3:9093" - KAFKA_LISTENERS: "PLAINTEXT://0.0.0.0:9093" - BOOTSTRAP_SERVERS: "kafka-1:9091,kafka-2:9092,kafka-3:9093,kafka-4:9094" - networks: - gobmp-xrd-1: - ipv4_address: 10.1.1.8 - healthcheck: - test: ps augwwx | egrep [S]upportedKafka - interval: 2s - timeout: 5s - retries: 5 - start_period: 20s - kafka-4: - image: confluentinc/cp-kafka:7.3.1 - restart: always - depends_on: - - zookeeper - expose: - - 9094 - environment: - KAFKA_BROKER_ID: 4 - KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181" - ZOOKEEPER: "zookeeper:2181" - KAFKA_TOPICS: "gobmp.parsed.peer:4:4:delete gobmp.parsed.unicast_prefix:6:4:delete gobmp.parsed.unicast_prefix_v4:6:4:delete gobmp.parsed.unicast_prefix_v6:6:4:delete gobmp.parsed.ls_node:4:4:delete gobmp.parsed.ls_link:4:4:delete gobmp.parsed.l3vpn:4:4:delete gobmp.parsed.l3vpn_v4:4:4:delete gobmp.parsed.l3vpn_v6:4:4:delete gobmp.parsed.sr_policy:4:4:delete gobmp.parsed.sr_policy_v4:4:4:delete gobmp.parsed.sr_policy_v6:4:4:delete gobmp.parsed.flowspec:4:4:delete gobmp.parsed.flowspec_v4:4:4:delete gobmp.parsed.flowspec_v6:4:4:delete gobmp.parsed.ls_prefix:4:4:delete gobmp.parsed.ls_srv6_sid:4:4:delete gobmp.parsed.evpn:4:4:delete gobmp.parsed.statistics:4:4:delete" - KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false" - ALLOW_PLAINTEXT_LISTENER: "yes" - KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka-4:9094" - KAFKA_LISTENERS: "PLAINTEXT://0.0.0.0:9094" - BOOTSTRAP_SERVERS: "kafka-1:9091,kafka-2:9092,kafka-3:9093,kafka-4:9094" - networks: - gobmp-xrd-1: - ipv4_address: 10.1.1.9 - healthcheck: - test: ps augwwx | egrep [S]upportedKafka - interval: 2s - timeout: 5s - retries: 5 - start_period: 20s - xr-1: - cap_add: - - CHOWN - - DAC_OVERRIDE - - FSETID - - FOWNER - - MKNOD - - NET_RAW - - SETGID - - SETUID - - SETFCAP - - SETPCAP - - NET_BIND_SERVICE - - SYS_CHROOT - - KILL - - AUDIT_WRITE - - SYS_NICE - - SYS_ADMIN - - SYS_RESOURCE - - NET_ADMIN - - SYS_PTRACE - - IPC_LOCK - cap_drop: - - all - expose: - - 179 - container_name: xr-1 - devices: - - /dev/fuse - - /dev/net/tun - environment: - XR_EVERY_BOOT_CONFIG: /etc/xrd/startup.cfg - XR_INTERFACES: linux:xr-20,xr_name=Gi0/0/0/0,chksum;linux:xr-00,xr_name=Gi0/0/0/1 - XR_MGMT_INTERFACES: linux:xr-10,xr_name=Mg0/RP0/CPU0/0,chksum - image: sbezverk/xrd-control-plane:7.9.2 - networks: - mgmt: null - gobmp-xrd-1: - ipv4_address: 10.1.1.3 - xr-1-gi1-xr-2-gi0: null - pids_limit: -1 - security_opt: - - apparmor=unconfined - - label=disable - stdin_open: true - tty: true - volumes: - - source: ./xrd-1_xrconf.cfg - target: /etc/xrd/startup.cfg - type: bind - - xr-1:/xr-storage/ - xr-2: - cap_add: - - CHOWN - - DAC_OVERRIDE - - FSETID - - FOWNER - - MKNOD - - NET_RAW - - SETGID - - SETUID - - SETFCAP - - SETPCAP - - NET_BIND_SERVICE - - SYS_CHROOT - - KILL - - AUDIT_WRITE - - SYS_NICE - - SYS_ADMIN - - SYS_RESOURCE - - NET_ADMIN - - SYS_PTRACE - - IPC_LOCK - cap_drop: - - all - expose: - - 179 - container_name: xr-2 - devices: - - /dev/fuse - - /dev/net/tun - environment: - XR_EVERY_BOOT_CONFIG: /etc/xrd/startup.cfg - XR_INTERFACES: linux:xr-00,xr_name=Gi0/0/0/0;linux:xr-30,xr_name=Gi0/0/0/1,chksum - XR_MGMT_INTERFACES: linux:xr-10,xr_name=Mg0/RP0/CPU0/0,chksum - image: sbezverk/xrd-control-plane:7.9.2 - networks: - mgmt: null - xr-1-gi1-xr-2-gi0: null - pids_limit: -1 - security_opt: - - apparmor=unconfined - - label=disable - stdin_open: true - tty: true - volumes: - - source: ./xrd-2_xrconf.cfg - target: /etc/xrd/startup.cfg - type: bind - - xr-2:/xr-storage/ -volumes: - xr-1: - name: xr-1 - xr-2: - name: xr-2 diff --git a/build/kafka-single-multi-broker/test_bed_multi_broker.yaml b/build/kafka-single-multi-broker/test_bed_multi_broker.yaml new file mode 100644 index 00000000..7e7d078d --- /dev/null +++ b/build/kafka-single-multi-broker/test_bed_multi_broker.yaml @@ -0,0 +1,249 @@ +version: "3.2" +networks: + mgmt: + driver_opts: + com.docker.network.container_iface_prefix: xr-1 + ipam: + config: + - subnet: 172.30.0.0/24 + gobmp-xrd-1: + driver_opts: + com.docker.network.container_iface_prefix: xr-2 + ipam: + config: + - subnet: 10.1.1.0/24 + xr-1-gi1-xr-2-gi0: + driver_opts: + com.docker.network.container_iface_prefix: xr-0 + com.docker.network.driver.mtu: 9000 + internal: true + name: xr-1-gi1-xr-2-gi0 +services: + gobmp: + image: localhost/gobmp:cicd + hostname: gobmp + container_name: gobmp + command: + --v=9 + --kafka-server=10.1.1.6:9091,10.1.1.7:9092,10.1.1.8:9093,10.1.1.9:9094 + ports: + - "5000:5000" + cap_add: + - NET_ADMIN + networks: + gobmp-xrd-1: + ipv4_address: 10.1.1.2 + stdin_open: true + tty: true + depends_on: + - kafka-1 + - kafka-2 + - kafka-3 + - kafka-4 + zoo: + image: bitnami/zookeeper:latest + hostname: zoo + container_name: zoo + ports: + - "2181:2181" + environment: + ZOOKEEPER_CLIENT_PORT: 2181 + ZOOKEEPER_SERVER_ID: 1 + ZOOKEEPER_SERVERS: zoo:2888:3888 + ALLOW_ANONYMOUS_LOGIN: "yes" + networks: + gobmp-xrd-1: + ipv4_address: 10.1.1.5 + kafka-1: + image: bitnami/kafka:latest + hostname: kafka-1 + container_name: kafka-1 + ports: + - "9091:9091" + - "29091:29091" + environment: + - KAFKA_CFG_BROKER_ID=1 + - KAFKA_ENABLE_KRAFT=no + - ALLOW_PLAINTEXT_LISTENER=yes + - KAFKA_ADVERTISED_HOST_NAME=kafka-1 + - KAFKA_CFG_ZOOKEEPER_CONNECT=zoo:2181 + - KAFKA_CFG_LISTENERS=PLAINTEXT://:9091,PLAINTEXT_HOST://:29091 + - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT + - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka-1:9091,PLAINTEXT_HOST://127.0.0.1:9091 + - BITNAMI_DEBUG=true + depends_on: + - zoo + networks: + gobmp-xrd-1: + ipv4_address: 10.1.1.6 + kafka-2: + image: bitnami/kafka:latest + hostname: kafka-2 + container_name: kafka-2 + ports: + - "9092:9092" + - "29092:29092" + environment: + - KAFKA_CFG_BROKER_ID=2 + - KAFKA_ENABLE_KRAFT=no + - ALLOW_PLAINTEXT_LISTENER=yes + - KAFKA_ADVERTISED_HOST_NAME=kafka-2 + - KAFKA_CFG_ZOOKEEPER_CONNECT=zoo:2181 + - KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,PLAINTEXT_HOST://:29092 + - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT + - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka-2:9092,PLAINTEXT_HOST://127.0.0.1:9092 + - BITNAMI_DEBUG=true + depends_on: + - zoo + networks: + gobmp-xrd-1: + ipv4_address: 10.1.1.7 + kafka-3: + image: bitnami/kafka:latest + hostname: kafka-3 + container_name: kafka-3 + ports: + - "9093:9093" + - "29093:29093" + environment: + - KAFKA_CFG_BROKER_ID=3 + - KAFKA_ENABLE_KRAFT=no + - ALLOW_PLAINTEXT_LISTENER=yes + - KAFKA_ADVERTISED_HOST_NAME=kafka-3 + - KAFKA_CFG_ZOOKEEPER_CONNECT=zoo:2181 + - KAFKA_CFG_LISTENERS=PLAINTEXT://:9093,PLAINTEXT_HOST://:29093 + - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT + - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka-3:9093,PLAINTEXT_HOST://127.0.0.1:9093 + - BITNAMI_DEBUG=true + depends_on: + - zoo + networks: + gobmp-xrd-1: + ipv4_address: 10.1.1.8 + kafka-4: + image: bitnami/kafka:latest + hostname: kafka-4 + container_name: kafka-4 + ports: + - "9094:9094" + - "29094:29094" + environment: + - KAFKA_CFG_BROKER_ID=4 + - KAFKA_ENABLE_KRAFT=no + - ALLOW_PLAINTEXT_LISTENER=yes + - KAFKA_ADVERTISED_HOST_NAME=kafka-4 + - KAFKA_CFG_ZOOKEEPER_CONNECT=zoo:2181 + - KAFKA_CFG_LISTENERS=PLAINTEXT://:9094,PLAINTEXT_HOST://:29094 + - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT + - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka-4:9094,PLAINTEXT_HOST://127.0.0.1:9094 + - BITNAMI_DEBUG=true + depends_on: + - zoo + networks: + gobmp-xrd-1: + ipv4_address: 10.1.1.9 + xr-1: + cap_add: + - CHOWN + - DAC_OVERRIDE + - FSETID + - FOWNER + - MKNOD + - NET_RAW + - SETGID + - SETUID + - SETFCAP + - SETPCAP + - NET_BIND_SERVICE + - SYS_CHROOT + - KILL + - AUDIT_WRITE + - SYS_NICE + - SYS_ADMIN + - SYS_RESOURCE + - NET_ADMIN + - SYS_PTRACE + - IPC_LOCK + cap_drop: + - all + expose: + - 179 + container_name: xr-1 + devices: + - /dev/fuse + - /dev/net/tun + environment: + XR_EVERY_BOOT_CONFIG: /etc/xrd/startup.cfg + XR_INTERFACES: linux:xr-20,xr_name=Gi0/0/0/0,chksum;linux:xr-00,xr_name=Gi0/0/0/1 + XR_MGMT_INTERFACES: linux:xr-10,xr_name=Mg0/RP0/CPU0/0,chksum + image: sbezverk/xrd-control-plane:7.9.2 + networks: + mgmt: null + gobmp-xrd-1: + ipv4_address: 10.1.1.3 + xr-1-gi1-xr-2-gi0: null + pids_limit: -1 + security_opt: + - apparmor=unconfined + - label=disable + stdin_open: true + tty: true + volumes: + - source: ./xrd-1_xrconf.cfg + target: /etc/xrd/startup.cfg + type: bind + - xr-1:/xr-storage/ + xr-2: + cap_add: + - CHOWN + - DAC_OVERRIDE + - FSETID + - FOWNER + - MKNOD + - NET_RAW + - SETGID + - SETUID + - SETFCAP + - SETPCAP + - NET_BIND_SERVICE + - SYS_CHROOT + - KILL + - AUDIT_WRITE + - SYS_NICE + - SYS_ADMIN + - SYS_RESOURCE + - NET_ADMIN + - SYS_PTRACE + - IPC_LOCK + cap_drop: + - all + expose: + - 179 + container_name: xr-2 + devices: + - /dev/fuse + - /dev/net/tun + environment: + XR_EVERY_BOOT_CONFIG: /etc/xrd/startup.cfg + XR_INTERFACES: linux:xr-00,xr_name=Gi0/0/0/0;linux:xr-30,xr_name=Gi0/0/0/1,chksum + XR_MGMT_INTERFACES: linux:xr-10,xr_name=Mg0/RP0/CPU0/0,chksum + image: sbezverk/xrd-control-plane:7.9.2 + networks: + mgmt: null + xr-1-gi1-xr-2-gi0: null + pids_limit: -1 + security_opt: + - apparmor=unconfined + - label=disable + stdin_open: true + tty: true + volumes: + - source: ./xrd-2_xrconf.cfg + target: /etc/xrd/startup.cfg + type: bind + - xr-2:/xr-storage/ +volumes: + xr-1: + name: xr-1 + xr-2: + name: xr-2 diff --git a/build/kafka-single-multi-broker/test_bed_one_broker.yaml b/build/kafka-single-multi-broker/test_bed_one_broker.yaml index c1a23eda..180ce192 100644 --- a/build/kafka-single-multi-broker/test_bed_one_broker.yaml +++ b/build/kafka-single-multi-broker/test_bed_one_broker.yaml @@ -25,7 +25,7 @@ services: container_name: gobmp command: --v=9 - --kafka-server=kafka-1:9091 + --kafka-server=10.1.1.6:9091 ports: - "5000:5000" cap_add: diff --git a/pkg/validator/check.go b/pkg/validator/check.go index 45f82922..97d129d1 100644 --- a/pkg/validator/check.go +++ b/pkg/validator/check.go @@ -73,7 +73,7 @@ func (c *check) checkUnicastWorker(testMsgs [][]byte, topic *kafka.TopicDescript // TODO (sbezverk) there should be no duplication, add check if the key already exists dictionary[k] = u } - glog.Infof("Dictionaly for topic type %d contains %d test messages", topic.TopicType, len(dictionary)) + glog.Infof("Dictionary for topic type %d contains %d test messages", topic.TopicType, len(dictionary)) matches := 0 for { select {