-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Docker and use Bundler cache (#144)
* Replace Docker and use Bundler cache * remarks
- Loading branch information
Showing
3 changed files
with
45 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env ruby | ||
|
||
# Waits for Kafka to be ready | ||
# Useful in CI where Kafka needs to be fully started before we run any tests | ||
|
||
require 'karafka' | ||
|
||
Karafka::App.setup do |config| | ||
config.kafka[:'bootstrap.servers'] = '127.0.0.1:9092' | ||
end | ||
|
||
60.times do | ||
begin | ||
# Stop if we can connect to the cluster and get info | ||
exit if Karafka::Admin.cluster_info | ||
rescue Rdkafka::RdkafkaError | ||
puts "Kafka not available, retrying..." | ||
sleep(1) | ||
end | ||
end | ||
|
||
puts 'Kafka not available!' | ||
|
||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
version: '2' | ||
|
||
services: | ||
zookeeper: | ||
container_name: karafka_web_21_zookeeper | ||
image: wurstmeister/zookeeper | ||
restart: on-failure | ||
ports: | ||
- '2181:2181' | ||
container_name: karafka_web_zookeeper | ||
image: confluentinc/cp-zookeeper:7.5.0 | ||
environment: | ||
ZOOKEEPER_CLIENT_PORT: 2181 | ||
ZOOKEEPER_TICK_TIME: 100 | ||
|
||
kafka: | ||
container_name: karafka_web_21_kafka | ||
image: wurstmeister/kafka | ||
container_name: karafka_web_kafka | ||
image: confluentinc/cp-kafka:7.5.0 | ||
depends_on: | ||
- zookeeper | ||
ports: | ||
- '9092:9092' | ||
- 9092:9092 | ||
environment: | ||
KAFKA_ADVERTISED_HOST_NAME: localhost | ||
KAFKA_ADVERTISED_PORT: 9092 | ||
KAFKA_BROKER_ID: 1 | ||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | ||
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true' | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
restart: on-failure | ||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:29092,PLAINTEXT_HOST://localhost:9092 | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT | ||
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 |