rdkafka 0.22.2 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +38 -3
  3. data/Gemfile +9 -0
  4. data/README.md +17 -14
  5. data/bin/verify_kafka_warnings +37 -0
  6. data/dist/{librdkafka-2.8.0.tar.gz → librdkafka-2.12.1.tar.gz} +0 -0
  7. data/docker-compose-ssl.yml +35 -0
  8. data/docker-compose.yml +1 -1
  9. data/lib/rdkafka/abstract_handle.rb +23 -5
  10. data/lib/rdkafka/admin/acl_binding_result.rb +1 -1
  11. data/lib/rdkafka/admin/config_resource_binding_result.rb +1 -0
  12. data/lib/rdkafka/admin/create_acl_handle.rb +3 -0
  13. data/lib/rdkafka/admin/create_acl_report.rb +3 -0
  14. data/lib/rdkafka/admin/create_partitions_handle.rb +3 -0
  15. data/lib/rdkafka/admin/create_partitions_report.rb +1 -0
  16. data/lib/rdkafka/admin/create_topic_handle.rb +3 -0
  17. data/lib/rdkafka/admin/create_topic_report.rb +3 -0
  18. data/lib/rdkafka/admin/delete_acl_handle.rb +3 -0
  19. data/lib/rdkafka/admin/delete_acl_report.rb +3 -0
  20. data/lib/rdkafka/admin/delete_groups_handle.rb +5 -0
  21. data/lib/rdkafka/admin/delete_groups_report.rb +3 -0
  22. data/lib/rdkafka/admin/delete_topic_handle.rb +3 -0
  23. data/lib/rdkafka/admin/delete_topic_report.rb +3 -0
  24. data/lib/rdkafka/admin/describe_acl_handle.rb +3 -0
  25. data/lib/rdkafka/admin/describe_acl_report.rb +3 -0
  26. data/lib/rdkafka/admin/describe_configs_handle.rb +3 -0
  27. data/lib/rdkafka/admin/describe_configs_report.rb +6 -0
  28. data/lib/rdkafka/admin/incremental_alter_configs_handle.rb +3 -0
  29. data/lib/rdkafka/admin/incremental_alter_configs_report.rb +6 -0
  30. data/lib/rdkafka/admin.rb +108 -113
  31. data/lib/rdkafka/bindings.rb +76 -30
  32. data/lib/rdkafka/callbacks.rb +71 -11
  33. data/lib/rdkafka/config.rb +21 -12
  34. data/lib/rdkafka/consumer/headers.rb +3 -2
  35. data/lib/rdkafka/consumer/message.rb +7 -3
  36. data/lib/rdkafka/consumer/partition.rb +6 -2
  37. data/lib/rdkafka/consumer/topic_partition_list.rb +11 -7
  38. data/lib/rdkafka/consumer.rb +41 -29
  39. data/lib/rdkafka/defaults.rb +106 -0
  40. data/lib/rdkafka/error.rb +16 -1
  41. data/lib/rdkafka/helpers/oauth.rb +45 -12
  42. data/lib/rdkafka/metadata.rb +29 -5
  43. data/lib/rdkafka/native_kafka.rb +26 -2
  44. data/lib/rdkafka/producer/delivery_report.rb +8 -4
  45. data/lib/rdkafka/producer/partitions_count_cache.rb +24 -14
  46. data/lib/rdkafka/producer.rb +52 -26
  47. data/lib/rdkafka/version.rb +6 -3
  48. data/lib/rdkafka.rb +1 -0
  49. data/rdkafka.gemspec +35 -13
  50. data/renovate.json +6 -25
  51. metadata +23 -124
  52. data/.github/CODEOWNERS +0 -3
  53. data/.github/FUNDING.yml +0 -1
  54. data/.github/workflows/ci_linux_x86_64_gnu.yml +0 -271
  55. data/.github/workflows/ci_linux_x86_64_musl.yml +0 -194
  56. data/.github/workflows/ci_macos_arm64.yml +0 -284
  57. data/.github/workflows/push_linux_x86_64_gnu.yml +0 -65
  58. data/.github/workflows/push_linux_x86_64_musl.yml +0 -79
  59. data/.github/workflows/push_macos_arm64.yml +0 -54
  60. data/.github/workflows/push_ruby.yml +0 -37
  61. data/.github/workflows/verify-action-pins.yml +0 -16
  62. data/.gitignore +0 -14
  63. data/.rspec +0 -2
  64. data/.ruby-gemset +0 -1
  65. data/.ruby-version +0 -1
  66. data/.yardopts +0 -2
  67. data/ext/README.md +0 -19
  68. data/ext/build_common.sh +0 -361
  69. data/ext/build_linux_x86_64_gnu.sh +0 -306
  70. data/ext/build_linux_x86_64_musl.sh +0 -763
  71. data/ext/build_macos_arm64.sh +0 -550
  72. data/spec/rdkafka/abstract_handle_spec.rb +0 -117
  73. data/spec/rdkafka/admin/create_acl_handle_spec.rb +0 -56
  74. data/spec/rdkafka/admin/create_acl_report_spec.rb +0 -18
  75. data/spec/rdkafka/admin/create_topic_handle_spec.rb +0 -52
  76. data/spec/rdkafka/admin/create_topic_report_spec.rb +0 -16
  77. data/spec/rdkafka/admin/delete_acl_handle_spec.rb +0 -85
  78. data/spec/rdkafka/admin/delete_acl_report_spec.rb +0 -72
  79. data/spec/rdkafka/admin/delete_topic_handle_spec.rb +0 -52
  80. data/spec/rdkafka/admin/delete_topic_report_spec.rb +0 -16
  81. data/spec/rdkafka/admin/describe_acl_handle_spec.rb +0 -85
  82. data/spec/rdkafka/admin/describe_acl_report_spec.rb +0 -73
  83. data/spec/rdkafka/admin_spec.rb +0 -971
  84. data/spec/rdkafka/bindings_spec.rb +0 -199
  85. data/spec/rdkafka/callbacks_spec.rb +0 -20
  86. data/spec/rdkafka/config_spec.rb +0 -258
  87. data/spec/rdkafka/consumer/headers_spec.rb +0 -73
  88. data/spec/rdkafka/consumer/message_spec.rb +0 -139
  89. data/spec/rdkafka/consumer/partition_spec.rb +0 -57
  90. data/spec/rdkafka/consumer/topic_partition_list_spec.rb +0 -248
  91. data/spec/rdkafka/consumer_spec.rb +0 -1274
  92. data/spec/rdkafka/error_spec.rb +0 -89
  93. data/spec/rdkafka/metadata_spec.rb +0 -79
  94. data/spec/rdkafka/native_kafka_spec.rb +0 -130
  95. data/spec/rdkafka/producer/delivery_handle_spec.rb +0 -45
  96. data/spec/rdkafka/producer/delivery_report_spec.rb +0 -25
  97. data/spec/rdkafka/producer/partitions_count_cache_spec.rb +0 -359
  98. data/spec/rdkafka/producer_spec.rb +0 -1345
  99. data/spec/spec_helper.rb +0 -195
@@ -1,194 +0,0 @@
1
- # Why We Build and Run Without Caching Native Extensions
2
- #
3
- # We intentionally compile the native librdkafka library fresh in each test job
4
- # rather than caching or pre-building it for several reasons:
5
- #
6
- # 1. Architecture Compatibility
7
- # - Pre-built native libraries (.so files) are architecture-specific
8
- # - Can cause "Exec format error" when build/runtime environments differ
9
- # - Building in the same container guarantees compatibility
10
- #
11
- # 2. Container Image Variations
12
- # - Different Ruby Alpine images may have subtle differences in:
13
- # * Base system libraries, compiler toolchains, musl libc versions
14
- # - These differences can cause pre-built libraries to fail at runtime
15
- #
16
- # 3. Simplicity and Reliability
17
- # - Single source of truth: everything builds and runs in same environment
18
- # - No artifact management complexity or potential upload/download failures
19
- # - Easier debugging when issues are contained in one job
20
- #
21
- # Trade-offs: Slightly longer CI times (~2-3 min per job) but much more reliable
22
- # than dealing with architecture mismatches and artifact corruption issues.
23
-
24
- name: CI Linux x86_64 musl
25
-
26
- concurrency:
27
- group: ${{ github.workflow }}-${{ github.ref }}
28
- cancel-in-progress: true
29
-
30
- on:
31
- pull_request:
32
- branches: [ main, master ]
33
- push:
34
- branches: [ main, master ]
35
- schedule:
36
- - cron: '0 1 * * *'
37
-
38
- permissions:
39
- contents: read
40
-
41
- env:
42
- BUNDLE_RETRY: 6
43
- BUNDLE_JOBS: 4
44
-
45
- jobs:
46
- specs_install:
47
- timeout-minutes: 30
48
- runs-on: ubuntu-latest
49
- strategy:
50
- fail-fast: false
51
- matrix:
52
- include:
53
- - ruby: '3.1'
54
- alpine_version: '3.21'
55
- - ruby: '3.2'
56
- alpine_version: '3.21'
57
- - ruby: '3.2'
58
- alpine_version: '3.22'
59
- - ruby: '3.3'
60
- alpine_version: '3.21'
61
- - ruby: '3.3'
62
- alpine_version: '3.22'
63
- - ruby: '3.4'
64
- alpine_version: '3.21'
65
- coverage: 'true'
66
- - ruby: '3.4'
67
- alpine_version: '3.22'
68
- coverage: 'true'
69
- steps:
70
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
71
- with:
72
- fetch-depth: 0
73
-
74
- - name: Start Kafka with Docker Compose
75
- run: |
76
- docker compose up -d
77
- echo "Waiting for Kafka to be ready..."
78
- sleep 10
79
- for i in {1..30}; do
80
- if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
81
- echo "Kafka topics command succeeded!"
82
- break
83
- fi
84
- sleep 2
85
- done
86
-
87
- - name: Run all specs
88
- env:
89
- GITHUB_COVERAGE: ${{ matrix.coverage }}
90
- run: |
91
- docker run --rm \
92
- --network host \
93
- -v "${{ github.workspace }}:/workspace" \
94
- -w /workspace \
95
- -e "GITHUB_COVERAGE=${{ matrix.coverage }}" \
96
- ruby:${{ matrix.ruby }}-alpine${{ matrix.alpine_version }} \
97
- sh -c 'apk add --no-cache git curl ca-certificates build-base linux-headers \
98
- pkgconf perl autoconf automake libtool bison flex file \
99
- ruby-dev ruby-bundler bash zstd-dev zlib zlib-dev openssl-dev \
100
- cyrus-sasl-dev cyrus-sasl cyrus-sasl-login \
101
- cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapiv2 cyrus-sasl-scram \
102
- krb5-libs openssl zlib zstd-libs && \
103
- git config --global --add safe.directory /workspace && \
104
- bundle config set --local path vendor/bundle && \
105
- bundle install && \
106
- cd ext && bundle exec rake && \
107
- cd .. && \
108
- bundle exec ruby -S rspec'
109
-
110
- build_precompiled:
111
- timeout-minutes: 45
112
- runs-on: ubuntu-latest
113
- container:
114
- # Similar to GNU, we build on the oldest for ABI compatibility
115
- image: alpine:3.18@sha256:de0eb0b3f2a47ba1eb89389859a9bd88b28e82f5826b6969ad604979713c2d4f # renovate: ignore
116
- steps:
117
- - name: Install dependencies
118
- run: |
119
- apk add --no-cache git curl ca-certificates build-base linux-headers \
120
- pkgconf perl autoconf automake libtool bison flex file bash wget zstd-dev \
121
- openssl-dev cyrus-sasl-dev cyrus-sasl cyrus-sasl-login \
122
- cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapiv2 cyrus-sasl-scram \
123
- krb5-libs openssl zlib zlib-dev zstd-libs
124
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
125
- with:
126
- fetch-depth: 0
127
- - name: Configure git safe directory
128
- run: git config --global --add safe.directory /__w/karafka-rdkafka/karafka-rdkafka
129
- - name: Cache build-tmp directory
130
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
131
- with:
132
- path: ext/build-tmp-musl
133
- key: build-tmp-musl-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
134
- - name: Build precompiled librdkafka.so
135
- run: |
136
- cd ext
137
- bash ./build_linux_x86_64_musl.sh
138
- - name: Upload precompiled library
139
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
140
- with:
141
- name: librdkafka-precompiled-musl
142
- path: ext/
143
- retention-days: 1
144
-
145
- specs_precompiled:
146
- timeout-minutes: 30
147
- runs-on: ubuntu-latest
148
- needs: build_precompiled
149
- strategy:
150
- fail-fast: false
151
- matrix:
152
- ruby:
153
- - '3.4'
154
- - '3.3'
155
- - '3.2'
156
- - '3.1'
157
- include:
158
- - ruby: '3.4'
159
- coverage: 'true'
160
- steps:
161
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
162
- with:
163
- fetch-depth: 0
164
- - name: Download precompiled library
165
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
166
- with:
167
- name: librdkafka-precompiled-musl
168
- path: ext/
169
- - name: Start Kafka with Docker Compose
170
- run: |
171
- docker compose up -d
172
- echo "Waiting for Kafka to be ready..."
173
- sleep 10
174
-
175
- for i in {1..30}; do
176
- if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
177
- echo "Kafka topics command succeeded!"
178
- break
179
- fi
180
- sleep 2
181
- done
182
- - name: Run specs with precompiled library
183
- env:
184
- GITHUB_COVERAGE: ${{ matrix.coverage }}
185
- RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
186
- run: |
187
- docker run --rm \
188
- --network host \
189
- -v "${{ github.workspace }}:/workspace" \
190
- -w /workspace \
191
- -e "GITHUB_COVERAGE=${{ matrix.coverage }}" \
192
- -e "RDKAFKA_EXT_PATH=/workspace/ext" \
193
- ruby:${{ matrix.ruby }}-alpine \
194
- sh -c 'apk add --no-cache git build-base linux-headers bash && git config --global --add safe.directory /workspace && bundle config set --local path vendor/bundle && bundle install && bundle exec ruby -S rspec'
@@ -1,284 +0,0 @@
1
- name: CI macOS ARM64
2
-
3
- concurrency:
4
- group: ${{ github.workflow }}-${{ github.ref }}
5
- cancel-in-progress: true
6
-
7
- on:
8
- pull_request:
9
- branches: [ main, master ]
10
- push:
11
- branches: [ main, master ]
12
- schedule:
13
- - cron: '0 1 * * *'
14
-
15
- permissions:
16
- contents: read
17
-
18
- env:
19
- BUNDLE_RETRY: 6
20
- BUNDLE_JOBS: 4
21
- # Renovate can track and update this version
22
- CONFLUENT_VERSION: "8.0.0"
23
-
24
- jobs:
25
- specs_install:
26
- timeout-minutes: 30
27
- strategy:
28
- fail-fast: false
29
- matrix:
30
- ruby:
31
- - '3.5.0-preview1'
32
- - '3.4'
33
- - '3.3'
34
- - '3.2'
35
- - '3.1'
36
- macos-version:
37
- - 'macos-14' # macOS 14 Sonoma (ARM64)
38
- - 'macos-15' # macOS 15 Sequoia (ARM64)
39
- include:
40
- - ruby: '3.4'
41
- macos-version: 'macos-15'
42
- coverage: 'true'
43
- exclude:
44
- - ruby: '3.5.0-preview1'
45
- macos-version: 'macos-14'
46
- runs-on: ${{ matrix.macos-version }}
47
- steps:
48
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
49
- with:
50
- fetch-depth: 0
51
- - name: Install Bash 4+ and Kerberos
52
- run: |
53
- brew install bash
54
- brew list krb5 &>/dev/null || brew install krb5
55
- echo "/opt/homebrew/bin" >> $GITHUB_PATH
56
- - name: Set up Ruby
57
- uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
58
- with:
59
- ruby-version: ${{matrix.ruby}}
60
- bundler-cache: false
61
- - name: Install and Start Confluent Community Kafka (KRaft)
62
- run: |
63
- brew install openjdk@17
64
- export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"
65
- export JAVA_HOME="/opt/homebrew/opt/openjdk@17"
66
-
67
- curl -O "https://packages.confluent.io/archive/8.0/confluent-community-${CONFLUENT_VERSION}.tar.gz"
68
- tar -xzf "confluent-community-${CONFLUENT_VERSION}.tar.gz"
69
-
70
- export CONFLUENT_HOME="$(pwd)/confluent-${CONFLUENT_VERSION}"
71
- export PATH="$CONFLUENT_HOME/bin:$PATH"
72
- cd "$CONFLUENT_HOME"
73
-
74
- # Find the correct server config
75
- KRAFT_CONFIG=""
76
- for config in "etc/kafka/kraft/server.properties" "config/kraft/server.properties" "etc/kafka/server.properties"; do
77
- if [ -f "$config" ]; then
78
- KRAFT_CONFIG="$config"
79
- echo "Found config: $KRAFT_CONFIG"
80
- break
81
- fi
82
- done
83
-
84
- if [ -z "$KRAFT_CONFIG" ]; then
85
- echo "❌ No server config found"
86
- exit 1
87
- fi
88
-
89
- # Configure KRaft for single-node setup
90
- cat >> "$KRAFT_CONFIG" << 'EOF'
91
-
92
- # KRaft mode configuration for single-node setup
93
- process.roles=broker,controller
94
- node.id=1
95
- controller.quorum.voters=1@127.0.0.1:9093
96
- listeners=PLAINTEXT://127.0.0.1:9092,CONTROLLER://127.0.0.1:9093
97
- controller.listener.names=CONTROLLER
98
- inter.broker.listener.name=PLAINTEXT
99
- log.dirs=/tmp/kraft-combined-logs
100
-
101
- # Enable simple ACL authorization for testing
102
- authorizer.class.name=org.apache.kafka.metadata.authorizer.StandardAuthorizer
103
- super.users=User:ANONYMOUS
104
- allow.everyone.if.no.acl.found=true
105
- EOF
106
-
107
- echo "Updated KRaft configuration"
108
-
109
- CLUSTER_ID=$(bin/kafka-storage random-uuid)
110
- bin/kafka-storage format -t "$CLUSTER_ID" -c "$KRAFT_CONFIG"
111
- bin/kafka-server-start "$KRAFT_CONFIG" &
112
-
113
- sleep 20
114
-
115
- for i in {1..30}; do
116
- if bin/kafka-topics --bootstrap-server 127.0.0.1:9092 --list >/dev/null 2>&1; then
117
- echo "✅ Confluent Community ${CONFLUENT_VERSION} (KRaft) is ready!"
118
- break
119
- fi
120
- [ $i -eq 30 ] && { echo "❌ Kafka failed to start"; exit 1; }
121
- sleep 2
122
- done
123
- - name: Install dependencies
124
- env:
125
- RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
126
- run: |
127
- bundle install
128
- - name: Build gem with mini_portile
129
- run: |
130
- set -e
131
- cd ext && bundle exec rake
132
- cd ..
133
- - name: Run all specs
134
- env:
135
- GITHUB_COVERAGE: ${{matrix.coverage}}
136
- RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
137
- run: |
138
- bundle exec rspec
139
-
140
- build_precompiled:
141
- timeout-minutes: 45
142
- runs-on: macos-14
143
- steps:
144
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
145
- with:
146
- fetch-depth: 0
147
- - name: Install Bash 4+ and Kerberos
148
- run: |
149
- brew install bash
150
- brew list krb5 &>/dev/null || brew install krb5
151
- echo "/opt/homebrew/bin" >> $GITHUB_PATH
152
- - name: Cache build-tmp directory
153
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
154
- with:
155
- path: ext/build-tmp-macos
156
- key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
157
- - name: Build precompiled librdkafka for macOS ARM64
158
- run: |
159
- cd ext
160
- /opt/homebrew/bin/bash ./build_macos_arm64.sh
161
- - name: Upload precompiled library
162
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
163
- with:
164
- name: librdkafka-precompiled-macos
165
- path: ext/
166
- retention-days: 1
167
-
168
- specs_precompiled:
169
- timeout-minutes: 30
170
- needs: build_precompiled
171
- strategy:
172
- fail-fast: false
173
- matrix:
174
- ruby:
175
- - '3.5.0-preview1'
176
- - '3.4'
177
- - '3.3'
178
- - '3.2'
179
- - '3.1'
180
- macos-version:
181
- - 'macos-14'
182
- - 'macos-15'
183
- include:
184
- - ruby: '3.4'
185
- macos-version: 'macos-15'
186
- coverage: 'true'
187
- exclude:
188
- - ruby: '3.5.0-preview1'
189
- macos-version: 'macos-14'
190
- runs-on: ${{ matrix.macos-version }}
191
- steps:
192
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
193
- with:
194
- fetch-depth: 0
195
- - name: Download precompiled library
196
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
197
- with:
198
- name: librdkafka-precompiled-macos
199
- path: ext/
200
- - name: Set up Ruby
201
- uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
202
- with:
203
- ruby-version: ${{ matrix.ruby }}
204
- bundler-cache: false
205
- - name: Install Bash 4+ and Kerberos
206
- run: |
207
- brew install bash
208
- brew list krb5 &>/dev/null || brew install krb5
209
- echo "/opt/homebrew/bin" >> $GITHUB_PATH
210
- - name: Install and Start Confluent Community Kafka (KRaft)
211
- run: |
212
- brew install openjdk@17
213
- export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"
214
- export JAVA_HOME="/opt/homebrew/opt/openjdk@17"
215
-
216
- curl -O "https://packages.confluent.io/archive/8.0/confluent-community-${CONFLUENT_VERSION}.tar.gz"
217
- tar -xzf "confluent-community-${CONFLUENT_VERSION}.tar.gz"
218
-
219
- export CONFLUENT_HOME="$(pwd)/confluent-${CONFLUENT_VERSION}"
220
- export PATH="$CONFLUENT_HOME/bin:$PATH"
221
- cd "$CONFLUENT_HOME"
222
-
223
- # Find the correct server config
224
- KRAFT_CONFIG=""
225
- for config in "etc/kafka/kraft/server.properties" "config/kraft/server.properties" "etc/kafka/server.properties"; do
226
- if [ -f "$config" ]; then
227
- KRAFT_CONFIG="$config"
228
- echo "Found config: $KRAFT_CONFIG"
229
- break
230
- fi
231
- done
232
-
233
- if [ -z "$KRAFT_CONFIG" ]; then
234
- echo "❌ No server config found"
235
- exit 1
236
- fi
237
-
238
- # Configure KRaft for single-node setup
239
- cat >> "$KRAFT_CONFIG" << 'EOF'
240
-
241
- # KRaft mode configuration for single-node setup
242
- process.roles=broker,controller
243
- node.id=1
244
- controller.quorum.voters=1@127.0.0.1:9093
245
- listeners=PLAINTEXT://127.0.0.1:9092,CONTROLLER://127.0.0.1:9093
246
- controller.listener.names=CONTROLLER
247
- inter.broker.listener.name=PLAINTEXT
248
- log.dirs=/tmp/kraft-combined-logs
249
-
250
- # Enable simple ACL authorization for testing
251
- authorizer.class.name=org.apache.kafka.metadata.authorizer.StandardAuthorizer
252
- super.users=User:ANONYMOUS
253
- allow.everyone.if.no.acl.found=true
254
- EOF
255
-
256
- echo "Updated KRaft configuration"
257
-
258
- CLUSTER_ID=$(bin/kafka-storage random-uuid)
259
- bin/kafka-storage format -t "$CLUSTER_ID" -c "$KRAFT_CONFIG"
260
- bin/kafka-server-start "$KRAFT_CONFIG" &
261
-
262
- sleep 20
263
-
264
- for i in {1..30}; do
265
- if bin/kafka-topics --bootstrap-server 127.0.0.1:9092 --list >/dev/null 2>&1; then
266
- echo "✅ Confluent Community ${CONFLUENT_VERSION} (KRaft) is ready!"
267
- break
268
- fi
269
- [ $i -eq 30 ] && { echo "❌ Kafka failed to start"; exit 1; }
270
- sleep 2
271
- done
272
- - name: Install bundle with precompiled library
273
- env:
274
- GITHUB_COVERAGE: ${{ matrix.coverage }}
275
- RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
276
- run: |
277
- bundle install
278
- echo "Bundle install completed with precompiled library"
279
- - name: Run specs with precompiled library
280
- env:
281
- GITHUB_COVERAGE: ${{ matrix.coverage }}
282
- RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
283
- run: |
284
- bundle exec rspec
@@ -1,65 +0,0 @@
1
- name: Push Linux x86_64 GNU Platform Gem
2
-
3
- on:
4
- push:
5
- tags:
6
- - v*
7
-
8
- permissions:
9
- contents: read
10
-
11
- env:
12
- BUNDLE_RETRY: 6
13
- BUNDLE_JOBS: 4
14
-
15
- jobs:
16
- push:
17
- if: github.repository_owner == 'karafka'
18
- timeout-minutes: 30
19
- # Same as CI, we build on the oldest possible for ABI compatibility
20
- runs-on: ubuntu-22.04 # renovate: ignore
21
- environment: deployment
22
- permissions:
23
- contents: write
24
- id-token: write
25
- steps:
26
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27
- with:
28
- fetch-depth: 0
29
- - name: Install build dependencies
30
- run: |
31
- sudo apt-get update
32
- sudo apt-get install -y --no-install-recommends \
33
- build-essential \
34
- gcc \
35
- make \
36
- patch \
37
- tar \
38
- wget \
39
- ca-certificates \
40
- libsasl2-dev \
41
- libssl-dev \
42
- zlib1g-dev \
43
- libzstd-dev
44
- - name: Cache build-tmp directory
45
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
46
- with:
47
- path: ext/build-tmp
48
- key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh') }}
49
- - name: Set up Ruby
50
- uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
51
- with:
52
- ruby-version: '3.4'
53
- bundler-cache: false
54
- - name: Build precompiled librdkafka.so
55
- run: |
56
- cd ext
57
- ./build_linux_x86_64_gnu.sh
58
- - name: Configure trusted publishing credentials
59
- uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
60
- - name: Build and push platform-specific gem
61
- run: |
62
- gem build *.gemspec
63
- gem push *.gem
64
- env:
65
- RUBY_PLATFORM: 'x86_64-linux-gnu'
@@ -1,79 +0,0 @@
1
- name: Push Linux x86_64 musl Platform Gem
2
- on:
3
- push:
4
- tags:
5
- - v*
6
- permissions:
7
- contents: read
8
- env:
9
- BUNDLE_RETRY: 6
10
- BUNDLE_JOBS: 4
11
- jobs:
12
- build:
13
- if: github.repository_owner == 'karafka'
14
- timeout-minutes: 30
15
- runs-on: ubuntu-latest
16
- environment: deployment
17
- container:
18
- # Same as CI, we build on the oldest possible for ABI compatibility
19
- image: alpine:3.18@sha256:de0eb0b3f2a47ba1eb89389859a9bd88b28e82f5826b6969ad604979713c2d4f # renovate: ignore
20
- steps:
21
- - name: Install dependencies
22
- run: |
23
- apk add --no-cache git curl ca-certificates build-base linux-headers \
24
- pkgconf perl autoconf automake libtool bison flex file bash wget zstd-dev \
25
- openssl-dev cyrus-sasl-dev cyrus-sasl cyrus-sasl-login \
26
- cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapiv2 cyrus-sasl-scram \
27
- krb5-libs openssl zlib zlib-dev zstd-libs
28
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29
- with:
30
- fetch-depth: 0
31
- - name: Configure git safe directory
32
- run: git config --global --add safe.directory /__w/karafka-rdkafka/karafka-rdkafka
33
- - name: Cache build-tmp directory
34
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
35
- with:
36
- path: ext/build-tmp-musl
37
- key: build-tmp-musl-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
38
- - name: Build precompiled librdkafka.so
39
- run: |
40
- cd ext
41
- bash ./build_linux_x86_64_musl.sh
42
- - name: Upload precompiled library
43
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
44
- with:
45
- name: librdkafka-precompiled-musl
46
- path: ext/
47
- retention-days: 1
48
-
49
- push:
50
- if: github.repository_owner == 'karafka'
51
- timeout-minutes: 30
52
- runs-on: ubuntu-latest
53
- needs: build
54
- environment: deployment
55
- permissions:
56
- contents: write
57
- id-token: write
58
- steps:
59
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
60
- with:
61
- fetch-depth: 0
62
- - name: Download precompiled library
63
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
64
- with:
65
- name: librdkafka-precompiled-musl
66
- path: ext/
67
- - name: Set up Ruby
68
- uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
69
- with:
70
- ruby-version: '3.4'
71
- bundler-cache: false
72
- - name: Configure trusted publishing credentials
73
- uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
74
- - name: Build and push platform-specific gem
75
- run: |
76
- gem build *.gemspec
77
- gem push *.gem
78
- env:
79
- RUBY_PLATFORM: 'x86_64-linux-musl'
@@ -1,54 +0,0 @@
1
- name: Push macOS ARM64 Platform Gem
2
-
3
- on:
4
- push:
5
- tags:
6
- - v*
7
-
8
- permissions:
9
- contents: read
10
-
11
- env:
12
- BUNDLE_RETRY: 6
13
- BUNDLE_JOBS: 4
14
-
15
- jobs:
16
- push:
17
- if: github.repository_owner == 'karafka'
18
- timeout-minutes: 30
19
- runs-on: macos-14
20
- environment: deployment
21
- permissions:
22
- contents: write
23
- id-token: write
24
- steps:
25
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26
- with:
27
- fetch-depth: 0
28
- - name: Install Bash 4+ and Kerberos
29
- run: |
30
- brew install bash
31
- brew list krb5 &>/dev/null || brew install krb5
32
- echo "/opt/homebrew/bin" >> $GITHUB_PATH
33
- - name: Cache build-tmp directory
34
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
35
- with:
36
- path: ext/build-tmp-macos
37
- key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
38
- - name: Set up Ruby
39
- uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
40
- with:
41
- ruby-version: '3.4'
42
- bundler-cache: false
43
- - name: Build precompiled librdkafka for macOS ARM64
44
- run: |
45
- cd ext
46
- /opt/homebrew/bin/bash ./build_macos_arm64.sh
47
- - name: Configure trusted publishing credentials
48
- uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
49
- - name: Build and push platform-specific gem
50
- run: |
51
- gem build *.gemspec
52
- gem push *.gem
53
- env:
54
- RUBY_PLATFORM: 'arm64-darwin'