e2e-tests.yaml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. ---
  2. version: '3.5'
  3. services:
  4. kafka-ui:
  5. container_name: kafka-ui
  6. image: provectuslabs/kafka-ui:latest
  7. ports:
  8. - 8080:8080
  9. healthcheck:
  10. test: wget --no-verbose --tries=1 --spider http://localhost:8080/actuator/health
  11. interval: 30s
  12. timeout: 10s
  13. retries: 10
  14. depends_on:
  15. kafka0:
  16. condition: service_healthy
  17. schemaregistry0:
  18. condition: service_healthy
  19. kafka-connect0:
  20. condition: service_healthy
  21. environment:
  22. KAFKA_CLUSTERS_0_NAME: local
  23. KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka0:29092
  24. KAFKA_CLUSTERS_0_METRICS_PORT: 9997
  25. KAFKA_CLUSTERS_0_SCHEMAREGISTRY: http://schemaregistry0:8085
  26. KAFKA_CLUSTERS_0_KAFKACONNECT_0_NAME: first
  27. KAFKA_CLUSTERS_0_KAFKACONNECT_0_ADDRESS: http://kafka-connect0:8083
  28. KAFKA_CLUSTERS_0_KSQLDBSERVER: http://ksqldb:8088
  29. kafka0:
  30. image: confluentinc/cp-kafka:7.2.1
  31. hostname: kafka0
  32. container_name: kafka0
  33. healthcheck:
  34. test: unset JMX_PORT && KAFKA_JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=kafka0 -Dcom.sun.management.jmxremote.rmi.port=9999" && kafka-broker-api-versions --bootstrap-server=localhost:9092
  35. interval: 30s
  36. timeout: 10s
  37. retries: 10
  38. ports:
  39. - "9092:9092"
  40. - "9997:9997"
  41. environment:
  42. KAFKA_BROKER_ID: 1
  43. KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT'
  44. KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://kafka0:29092,PLAINTEXT_HOST://localhost:9092'
  45. KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
  46. KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
  47. KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
  48. KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
  49. KAFKA_JMX_PORT: 9997
  50. KAFKA_JMX_HOSTNAME: localhost
  51. KAFKA_JMX_OPTS: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=kafka0 -Dcom.sun.management.jmxremote.rmi.port=9997
  52. KAFKA_PROCESS_ROLES: 'broker,controller'
  53. KAFKA_NODE_ID: 1
  54. KAFKA_CONTROLLER_QUORUM_VOTERS: '1@kafka0:29093'
  55. KAFKA_LISTENERS: 'PLAINTEXT://kafka0:29092,CONTROLLER://kafka0:29093,PLAINTEXT_HOST://0.0.0.0:9092'
  56. KAFKA_INTER_BROKER_LISTENER_NAME: 'PLAINTEXT'
  57. KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
  58. KAFKA_LOG_DIRS: '/tmp/kraft-combined-logs'
  59. volumes:
  60. - ./scripts/update_run.sh:/tmp/update_run.sh
  61. command: "bash -c 'if [ ! -f /tmp/update_run.sh ]; then echo \"ERROR: Did you forget the update_run.sh file that came with this docker-compose.yml file?\" && exit 1 ; else /tmp/update_run.sh && /etc/confluent/docker/run ; fi'"
  62. schemaregistry0:
  63. image: confluentinc/cp-schema-registry:7.2.1
  64. ports:
  65. - 8085:8085
  66. depends_on:
  67. kafka0:
  68. condition: service_healthy
  69. healthcheck:
  70. test: [ "CMD", "timeout", "1", "curl", "--silent", "--fail", "http://schemaregistry0:8085/subjects" ]
  71. interval: 30s
  72. timeout: 10s
  73. retries: 10
  74. environment:
  75. SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: PLAINTEXT://kafka0:29092
  76. SCHEMA_REGISTRY_KAFKASTORE_SECURITY_PROTOCOL: PLAINTEXT
  77. SCHEMA_REGISTRY_HOST_NAME: schemaregistry0
  78. SCHEMA_REGISTRY_LISTENERS: http://schemaregistry0:8085
  79. SCHEMA_REGISTRY_SCHEMA_REGISTRY_INTER_INSTANCE_PROTOCOL: "http"
  80. SCHEMA_REGISTRY_LOG4J_ROOT_LOGLEVEL: INFO
  81. SCHEMA_REGISTRY_KAFKASTORE_TOPIC: _schemas
  82. kafka-connect0:
  83. build:
  84. context: ./kafka-connect
  85. args:
  86. image: confluentinc/cp-kafka-connect:6.0.1
  87. ports:
  88. - 8083:8083
  89. depends_on:
  90. kafka0:
  91. condition: service_healthy
  92. schemaregistry0:
  93. condition: service_healthy
  94. healthcheck:
  95. test: [ "CMD", "nc", "127.0.0.1", "8083" ]
  96. interval: 30s
  97. timeout: 10s
  98. retries: 10
  99. environment:
  100. CONNECT_BOOTSTRAP_SERVERS: kafka0:29092
  101. CONNECT_GROUP_ID: compose-connect-group
  102. CONNECT_CONFIG_STORAGE_TOPIC: _connect_configs
  103. CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: 1
  104. CONNECT_OFFSET_STORAGE_TOPIC: _connect_offset
  105. CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: 1
  106. CONNECT_STATUS_STORAGE_TOPIC: _connect_status
  107. CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: 1
  108. CONNECT_KEY_CONVERTER: org.apache.kafka.connect.storage.StringConverter
  109. CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL: http://schemaregistry0:8085
  110. CONNECT_VALUE_CONVERTER: org.apache.kafka.connect.storage.StringConverter
  111. CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: http://schemaregistry0:8085
  112. CONNECT_INTERNAL_KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter
  113. CONNECT_INTERNAL_VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter
  114. CONNECT_REST_ADVERTISED_HOST_NAME: kafka-connect0
  115. CONNECT_PLUGIN_PATH: "/usr/share/java,/usr/share/confluent-hub-components"
  116. # AWS_ACCESS_KEY_ID: ""
  117. # AWS_SECRET_ACCESS_KEY: ""
  118. kafka-init-topics:
  119. image: confluentinc/cp-kafka:7.2.1
  120. volumes:
  121. - ./data/message.json:/data/message.json
  122. depends_on:
  123. kafka0:
  124. condition: service_healthy
  125. command: "bash -c 'echo Waiting for Kafka to be ready... && \
  126. cub kafka-ready -b kafka0:29092 1 30 && \
  127. kafka-topics --create --topic users --partitions 3 --replication-factor 1 --if-not-exists --bootstrap-server kafka0:29092 && \
  128. kafka-topics --create --topic messages --partitions 2 --replication-factor 1 --if-not-exists --bootstrap-server kafka0:29092 && \
  129. kafka-console-producer --bootstrap-server kafka0:29092 --topic users < /data/message.json'"
  130. postgres-db:
  131. build:
  132. context: ./postgres
  133. args:
  134. image: postgres:9.6.22
  135. ports:
  136. - 5432:5432
  137. healthcheck:
  138. test: [ "CMD-SHELL", "pg_isready -U dev_user" ]
  139. interval: 10s
  140. timeout: 5s
  141. retries: 5
  142. environment:
  143. POSTGRES_USER: 'dev_user'
  144. POSTGRES_PASSWORD: '12345'
  145. create-connectors:
  146. image: ellerbrock/alpine-bash-curl-ssl
  147. depends_on:
  148. postgres-db:
  149. condition: service_healthy
  150. kafka-connect0:
  151. condition: service_healthy
  152. volumes:
  153. - ./connectors:/connectors
  154. command: bash -c '/connectors/start.sh'
  155. ksqldb:
  156. image: confluentinc/ksqldb-server:0.18.0
  157. healthcheck:
  158. test: [ "CMD", "timeout", "1", "curl", "--silent", "--fail", "http://localhost:8088/info" ]
  159. interval: 30s
  160. timeout: 10s
  161. retries: 10
  162. depends_on:
  163. kafka0:
  164. condition: service_healthy
  165. kafka-connect0:
  166. condition: service_healthy
  167. schemaregistry0:
  168. condition: service_healthy
  169. ports:
  170. - 8088:8088
  171. environment:
  172. KSQL_CUB_KAFKA_TIMEOUT: 120
  173. KSQL_LISTENERS: http://0.0.0.0:8088
  174. KSQL_BOOTSTRAP_SERVERS: PLAINTEXT://kafka0:29092
  175. KSQL_KSQL_LOGGING_PROCESSING_STREAM_AUTO_CREATE: "true"
  176. KSQL_KSQL_LOGGING_PROCESSING_TOPIC_AUTO_CREATE: "true"
  177. KSQL_KSQL_CONNECT_URL: http://kafka-connect0:8083
  178. KSQL_KSQL_SCHEMA_REGISTRY_URL: http://schemaregistry0:8085
  179. KSQL_KSQL_SERVICE_ID: my_ksql_1
  180. KSQL_KSQL_HIDDEN_TOPICS: '^_.*'
  181. KSQL_CACHE_MAX_BYTES_BUFFERING: 0