Skip to content

Commit

Permalink
Updated the Kafka playground versions. (#35)
Browse files Browse the repository at this point in the history
Signed-off-by: Hermann Mayer <[email protected]>
  • Loading branch information
Jack12816 authored May 22, 2024
1 parent 2b265f5 commit a73cef8
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 78 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### next

* TODO: Replace this bullet point with an actual description of a change.
* Updated the [Kafka Playground](./doc/kafka-playground) to the latest
Apache Kafka (3.7) and Schema Registry (7.6) versions (#35)

### 1.5.1

Expand Down
4 changes: 2 additions & 2 deletions doc/kafka-playground/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM hausgold/ruby:2.5
MAINTAINER Hermann Mayer <[email protected]>

# Update system gem
RUN gem update --system
RUN gem update --system '3.3.26'

# Add backports repository
RUN echo 'deb http://archive.debian.org/debian buster-backports main' \
Expand All @@ -18,7 +18,7 @@ RUN apt-get update -yqqq && \
ca-certificates jq curl cmake \
bash-completion inotify-tools && \
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && /usr/sbin/locale-gen && \
gem install bundler --no-document --no-prerelease
gem install bundler -v '~> 2.3.0' --no-document --no-prerelease

# Install kcat (formerly known as kafkacat)
RUN curl -sL https://github.com/edenhill/kcat/archive/refs/tags/1.7.0.tar.gz \
Expand Down
2 changes: 1 addition & 1 deletion doc/kafka-playground/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
source 'https://rubygems.org'

# A bundle of opinionated Apache Kafka / Confluent Schema Registry helpers.
gem 'rimless', '~> 1.2'
gem 'rimless', '~> 1.5'
# Thor is a toolkit for building powerful command-line interfaces.
gem 'thor', '~> 1.1'
94 changes: 50 additions & 44 deletions doc/kafka-playground/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (6.1.4.1)
activesupport (6.1.7.7)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
avro (1.9.2)
multi_json
avro_turf (0.11.0)
avro (>= 1.7.7, < 1.10)
excon (~> 0.45)
concurrent-ruby (1.1.9)
connection_pool (2.2.5)
crack (0.4.5)
bigdecimal (3.1.8)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
crack (1.0.0)
bigdecimal
rexml
delivery_boy (1.1.0)
delivery_boy (1.2.0)
king_konf (~> 1.0)
ruby-kafka (~> 1.0)
digest-crc (0.6.4)
ruby-kafka (~> 1.5)
digest-crc (0.6.5)
rake (>= 12.0.0, < 14.0.0)
dry-configurable (0.12.1)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -64,15 +66,15 @@ GEM
dry-equalizer (~> 0.2)
dry-initializer (~> 3.0)
dry-schema (~> 1.5, >= 1.5.2)
envlogic (1.1.3)
envlogic (1.1.4)
dry-inflector (~> 0.1)
excon (0.87.0)
hashdiff (1.0.1)
i18n (1.8.10)
excon (0.109.0)
hashdiff (1.1.0)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
io-console (0.5.9)
irb (1.3.7)
reline (>= 0.2.7)
irb (1.4.2)
reline (>= 0.3.0)
karafka (1.4.3)
dry-configurable (~> 0.8)
dry-inflector (~> 0.1)
Expand All @@ -90,46 +92,50 @@ GEM
sidekiq (>= 4.2)
karafka-testing (1.4.1)
karafka (~> 1.4.0.rc2)
king_konf (1.0.0)
minitest (5.14.4)
king_konf (1.0.1)
minitest (5.15.0)
multi_json (1.15.0)
mustermann (1.1.1)
mustermann (2.0.2)
ruby2_keywords (~> 0.0.1)
public_suffix (4.0.6)
rack (2.2.3)
rack-protection (2.1.0)
public_suffix (4.0.7)
rack (2.2.9)
rack-protection (2.2.4)
rack
rake (13.0.6)
redis (4.4.0)
reline (0.2.7)
rake (13.2.1)
redis (4.8.1)
reline (0.3.1)
io-console (~> 0.5)
rexml (3.2.5)
rimless (1.2.0)
activesupport (>= 4.2.0)
retries (0.0.5)
rexml (3.2.8)
strscan (>= 3.0.9)
rimless (1.5.1)
activesupport (>= 5.2)
avro_turf (~> 0.11.0)
karafka (~> 1.4)
karafka (~> 1.4, < 1.4.15)
karafka-sidekiq-backend (~> 1.4)
karafka-testing (~> 1.4)
sinatra
retries (>= 0.0.5)
sinatra (~> 2.2)
sparsify (~> 1.1)
waterdrop (~> 1.2)
webmock
ruby-kafka (1.4.0)
waterdrop (~> 1.4)
webmock (~> 3.18)
ruby-kafka (1.5.0)
digest-crc
ruby2_keywords (0.0.5)
sidekiq (6.2.2)
connection_pool (>= 2.2.2)
sidekiq (6.5.12)
connection_pool (>= 2.2.5, < 3)
rack (~> 2.0)
redis (>= 4.2.0)
sinatra (2.1.0)
mustermann (~> 1.0)
redis (>= 4.5.0, < 5)
sinatra (2.2.4)
mustermann (~> 2.0)
rack (~> 2.2)
rack-protection (= 2.1.0)
rack-protection (= 2.2.4)
tilt (~> 2.0)
sparsify (1.1.0)
thor (1.1.0)
tilt (2.0.10)
tzinfo (2.0.4)
strscan (3.1.0)
thor (1.2.2)
tilt (2.3.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
waterdrop (1.4.2)
delivery_boy (>= 0.2, < 2.x)
Expand All @@ -138,17 +144,17 @@ GEM
dry-validation (~> 1.2)
ruby-kafka (>= 0.7.8)
zeitwerk (~> 2.1)
webmock (3.14.0)
webmock (3.23.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
zeitwerk (2.4.2)
zeitwerk (2.6.14)

PLATFORMS
x86_64-linux

DEPENDENCIES
rimless (~> 1.2)
rimless (~> 1.5)
thor (~> 1.1)

BUNDLED WITH
Expand Down
11 changes: 8 additions & 3 deletions doc/kafka-playground/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,14 @@ the creation of the `/etc/mdns.allow` file.
After the installation and bootup processes are finished you should have a
working Apache Kafka setup which includes the following:

* A single node [Apache Kafka](https://kafka.apache.org/) broker via [Zookeeper](https://zookeeper.apache.org/)
* [Confluent Schema Registry](https://docs.confluent.io/platform/current/schema-registry/index.html), used for [Apache Avro](https://avro.apache.org/docs/current/) schemas
* [Lenses.io Schema Registry UI](https://github.com/lensesio/schema-registry-ui), you can access it via mDNS at http://schema-registry-ui.playground.local
* A single node [Apache Kafka](https://kafka.apache.org/) (without Zookeeper,
KRaft) broker
* [Confluent Schema
Registry](https://docs.confluent.io/platform/current/schema-registry/index.html),
used for [Apache Avro](https://avro.apache.org/docs/current/) schemas
* [Lenses.io Schema Registry
UI](https://github.com/lensesio/schema-registry-ui), you can access it via
mDNS at http://schema-registry-ui.playground.local
* A Ruby 2.5 enabled playground container with configured Rimless support

## Examples
Expand Down
1 change: 1 addition & 0 deletions doc/kafka-playground/bin/create-topic
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class CreateTopic < Thor
desc: 'The number of replications'
option :verbose, aliases: '-v', type: :boolean,
desc: 'Enable verbose outputs'

def create(name, *configs)
debug! options

Expand Down
1 change: 1 addition & 0 deletions doc/kafka-playground/bin/delete-topic
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class DeleteTopic < Thor
desc 'NAME', 'delete an existing Apache Kafka topic'
option :verbose, aliases: '-v', type: :boolean,
desc: 'Enable verbose outputs'

def delete(name)
debug! options

Expand Down
1 change: 1 addition & 0 deletions doc/kafka-playground/bin/produce-event
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class ProduceTopic < Thor
desc: 'The partition key to use to select the partition'
option :verbose, aliases: '-v', type: :boolean,
desc: 'Enable verbose outputs'

def produce(topic, *files)
debug! options

Expand Down
2 changes: 2 additions & 0 deletions doc/kafka-playground/config/environment.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require 'bundler/setup' # Set up gems listed in the Gemfile.
require 'active_support'
Expand Down
30 changes: 3 additions & 27 deletions doc/kafka-playground/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,12 @@
version: "3"
services:
zookeeper:
image: zookeeper:3.7
network_mode: bridge
ports: ["2181"]
ulimits:
# Due to systemd/pam RLIMIT_NOFILE settings (max int inside the
# container), the Java process seams to allocate huge limits which result
# in a +unable to allocate file descriptor table - out of memory+ error.
# Lowering this value fixes the issue for now.
#
# See: http://bit.ly/2U62A80
# See: http://bit.ly/2T2Izit
nofile:
soft: 100000
hard: 100000

kafka:
image: hausgold/kafka:2.1
image: hausgold/kafka:3.7
network_mode: bridge
environment:
MDNS_HOSTNAME: kafka.playground.local
# See: http://bit.ly/2UDzgqI for Kafka downscaling
KAFKA_HEAP_OPTS: -Xmx256M -Xms32M
links:
- zookeeper
extra_hosts:
# Due to missing nss-mdns support on Alpine Linux
# and the requirement to tell our self who we are
# for Apache Kafka, we register ourself as hostent.
- kafka.playground.local:127.0.0.1
ulimits:
# Due to systemd/pam RLIMIT_NOFILE settings (max int inside the
# container), the Java process seams to allocate huge limits which result
Expand All @@ -43,17 +20,16 @@ services:
hard: 100000

schema-registry:
image: hausgold/schema-registry:5.1.2
image: hausgold/schema-registry:7.6
network_mode: bridge
environment:
MDNS_HOSTNAME: schema-registry.playground.local
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: kafka.playground.local:9092
# Set the default Apache Avro schema compatibility
#
# See: http://bit.ly/2TcpoY1
# See: http://bit.ly/2Hfo4wj
SCHEMA_REGISTRY_AVRO_COMPATIBILITY_LEVEL: full
links:
- zookeeper
ulimits:
# Due to systemd/pam RLIMIT_NOFILE settings (max int inside the
# container), the Java process seams to allocate huge limits which result
Expand Down

0 comments on commit a73cef8

Please sign in to comment.