karafka-rdkafka 0.21.0.rc1-arm64-darwin → 0.21.0.rc2-arm64-darwin
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.
- checksums.yaml +4 -4
- data/.github/workflows/{ci_linux_x86_64_musl.yml → ci_linux_alpine_x86_64_musl.yml} +12 -9
- data/.github/workflows/ci_linux_alpine_x86_64_musl_complementary.yml +264 -0
- data/.github/workflows/ci_linux_debian_x86_64_gnu.yml +271 -0
- data/.github/workflows/ci_linux_debian_x86_64_gnu_complementary.yml +334 -0
- data/.github/workflows/{ci_linux_x86_64_gnu.yml → ci_linux_ubuntu_aarch64_gnu.yml} +15 -15
- data/.github/workflows/ci_linux_ubuntu_aarch64_gnu_complementary.yml +295 -0
- data/.github/workflows/ci_linux_ubuntu_x86_64_gnu.yml +281 -0
- data/.github/workflows/ci_linux_ubuntu_x86_64_gnu_complementary.yml +294 -0
- data/.github/workflows/ci_macos_arm64.yml +5 -5
- data/.github/workflows/push_linux_aarch64_gnu.yml +65 -0
- data/.github/workflows/push_linux_x86_64_gnu.yml +2 -2
- data/.github/workflows/push_linux_x86_64_musl.yml +3 -3
- data/.github/workflows/push_macos_arm64.yml +2 -2
- data/.github/workflows/push_ruby.yml +1 -1
- data/.github/workflows/trigger-wiki-refresh.yml +30 -0
- data/.github/workflows/verify-action-pins.yml +1 -1
- data/.gitignore +1 -0
- data/.rspec +1 -0
- data/CHANGELOG.md +7 -1
- data/README.md +34 -134
- data/dist/cyrus-sasl-2.1.28.tar.gz +0 -0
- data/dist/krb5-1.21.3.tar.gz +0 -0
- data/dist/openssl-3.0.16.tar.gz +0 -0
- data/dist/zlib-1.3.1.tar.gz +0 -0
- data/dist/zstd-1.5.7.tar.gz +0 -0
- data/docker-compose-ssl.yml +35 -0
- data/ext/build_common.sh +16 -1
- data/ext/build_linux_aarch64_gnu.sh +326 -0
- data/ext/build_linux_x86_64_gnu.sh +12 -1
- data/ext/build_linux_x86_64_musl.sh +18 -8
- data/ext/build_macos_arm64.sh +7 -0
- data/ext/generate-ssl-certs.sh +109 -0
- data/ext/librdkafka.dylib +0 -0
- data/karafka-rdkafka.gemspec +2 -0
- data/lib/rdkafka/bindings.rb +0 -1
- data/lib/rdkafka/consumer.rb +1 -1
- data/lib/rdkafka/version.rb +1 -1
- data/spec/integrations/ssl_stress_spec.rb +121 -0
- data/spec/{rdkafka → lib/rdkafka}/admin_spec.rb +16 -4
- data/spec/{rdkafka → lib/rdkafka}/consumer_spec.rb +50 -3
- data/spec/{rdkafka → lib/rdkafka}/metadata_spec.rb +2 -2
- data/spec/{rdkafka → lib/rdkafka}/producer/delivery_report_spec.rb +1 -1
- data/spec/{rdkafka → lib/rdkafka}/producer_spec.rb +6 -5
- data/spec/spec_helper.rb +45 -8
- metadata +76 -31
- /data/spec/{rdkafka → lib/rdkafka}/abstract_handle_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/create_acl_handle_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/create_acl_report_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/create_topic_handle_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/create_topic_report_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/delete_acl_handle_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/delete_acl_report_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/delete_topic_handle_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/delete_topic_report_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/describe_acl_handle_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/admin/describe_acl_report_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/bindings_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/callbacks_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/config_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/consumer/headers_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/consumer/message_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/consumer/partition_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/consumer/topic_partition_list_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/error_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/native_kafka_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/producer/delivery_handle_spec.rb +0 -0
- /data/spec/{rdkafka → lib/rdkafka}/producer/partitions_count_cache_spec.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75aae869c1fa312c91a14d391e59781ce3473e32355eba3194ec26f9954198b0
|
4
|
+
data.tar.gz: 6f84c8debcee81201cd6a40e59fd7aa5fa3916683eee71c39528dac793dca60c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a867be7dc4dfabe777f9367bf3fe1c560dc20c244db0bfe397b3a6361841728e0f40e2d3fb71eff0cee1a4058b0705167d5839a7e012d14a9fad4d309891706
|
7
|
+
data.tar.gz: 444101ead5816088cc243edfb8e08ae0620b8948d5f0f5689847fec549a6d727231d915aabdd21a819b8d8ec3cd808ac0625652f5553d42645486288acb35cd9
|
@@ -21,7 +21,7 @@
|
|
21
21
|
# Trade-offs: Slightly longer CI times (~2-3 min per job) but much more reliable
|
22
22
|
# than dealing with architecture mismatches and artifact corruption issues.
|
23
23
|
|
24
|
-
name: CI Linux x86_64 musl
|
24
|
+
name: CI Linux Alpine x86_64 musl
|
25
25
|
|
26
26
|
concurrency:
|
27
27
|
group: ${{ github.workflow }}-${{ github.ref }}
|
@@ -44,7 +44,7 @@ env:
|
|
44
44
|
|
45
45
|
jobs:
|
46
46
|
specs_install:
|
47
|
-
timeout-minutes:
|
47
|
+
timeout-minutes: 45
|
48
48
|
runs-on: ubuntu-latest
|
49
49
|
strategy:
|
50
50
|
fail-fast: false
|
@@ -73,7 +73,7 @@ jobs:
|
|
73
73
|
|
74
74
|
- name: Start Kafka with Docker Compose
|
75
75
|
run: |
|
76
|
-
docker compose up -d
|
76
|
+
docker compose -f docker-compose.yml up -d
|
77
77
|
echo "Waiting for Kafka to be ready..."
|
78
78
|
sleep 10
|
79
79
|
for i in {1..30}; do
|
@@ -84,7 +84,7 @@ jobs:
|
|
84
84
|
sleep 2
|
85
85
|
done
|
86
86
|
|
87
|
-
- name: Run all specs
|
87
|
+
- name: Run all specs in PLAINTEXT
|
88
88
|
env:
|
89
89
|
GITHUB_COVERAGE: ${{ matrix.coverage }}
|
90
90
|
run: |
|
@@ -127,7 +127,7 @@ jobs:
|
|
127
127
|
- name: Configure git safe directory
|
128
128
|
run: git config --global --add safe.directory /__w/karafka-rdkafka/karafka-rdkafka
|
129
129
|
- name: Cache build-tmp directory
|
130
|
-
uses: actions/cache@
|
130
|
+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
131
131
|
with:
|
132
132
|
path: ext/build-tmp-musl
|
133
133
|
key: build-tmp-musl-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
|
@@ -162,13 +162,13 @@ jobs:
|
|
162
162
|
with:
|
163
163
|
fetch-depth: 0
|
164
164
|
- name: Download precompiled library
|
165
|
-
uses: actions/download-artifact@
|
165
|
+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
|
166
166
|
with:
|
167
167
|
name: librdkafka-precompiled-musl
|
168
168
|
path: ext/
|
169
169
|
- name: Start Kafka with Docker Compose
|
170
170
|
run: |
|
171
|
-
docker compose up -d
|
171
|
+
docker compose -f docker-compose.yml up -d
|
172
172
|
echo "Waiting for Kafka to be ready..."
|
173
173
|
sleep 10
|
174
174
|
|
@@ -179,7 +179,7 @@ jobs:
|
|
179
179
|
fi
|
180
180
|
sleep 2
|
181
181
|
done
|
182
|
-
- name: Run specs with precompiled library
|
182
|
+
- name: Run specs with precompiled library and PLAINTEXT
|
183
183
|
env:
|
184
184
|
GITHUB_COVERAGE: ${{ matrix.coverage }}
|
185
185
|
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
@@ -191,4 +191,7 @@ jobs:
|
|
191
191
|
-e "GITHUB_COVERAGE=${{ matrix.coverage }}" \
|
192
192
|
-e "RDKAFKA_EXT_PATH=/workspace/ext" \
|
193
193
|
ruby:${{ matrix.ruby }}-alpine \
|
194
|
-
sh -c 'apk add --no-cache git build-base linux-headers bash &&
|
194
|
+
sh -c 'apk add --no-cache git build-base linux-headers bash && \
|
195
|
+
git config --global --add safe.directory /workspace && \
|
196
|
+
bundle config set --local path vendor/bundle && \
|
197
|
+
bundle install && bundle exec ruby -S rspec'
|
@@ -0,0 +1,264 @@
|
|
1
|
+
# CI Strategy: Complementary Testing for SSL and System Library Regressions on Alpine/musl
|
2
|
+
#
|
3
|
+
# This workflow runs complementary tests that don't need to block PRs but are essential
|
4
|
+
# for catching regressions in SSL functionality and musl libc/Alpine system library compatibility.
|
5
|
+
# It complements the main CI by testing stable-but-critical functionality on a nightly
|
6
|
+
# schedule and when workflow changes are made.
|
7
|
+
#
|
8
|
+
# WHY COMPLEMENTARY TESTING FOR ALPINE/MUSL:
|
9
|
+
# - SSL specs have been stable for 3+ years and rarely break due to code changes
|
10
|
+
# - Integration specs test musl libc and Alpine package compatibility
|
11
|
+
# - These tests catch regressions from external changes (OpenSSL updates, Alpine package updates)
|
12
|
+
# - Running every 3 days to prevent these slower tests from blocking PR velocity
|
13
|
+
# - Manual triggering allows testing workflow changes before they go into schedule
|
14
|
+
#
|
15
|
+
# SSL TESTING (specs_install + specs_precompiled):
|
16
|
+
# - Tests SSL/TLS connectivity with Kafka using docker-compose-ssl.yml on Alpine
|
17
|
+
# - Validates certificate handling and SSL handshakes across Ruby versions on musl
|
18
|
+
# - Ensures SSL works with both compiled-from-source and precompiled flows on Alpine
|
19
|
+
# - Catches OpenSSL version compatibility issues and SSL library regressions on musl
|
20
|
+
# - Tests real SSL scenarios that mirror Alpine-based production deployments
|
21
|
+
#
|
22
|
+
# INTEGRATION TESTING (integration specs in both jobs):
|
23
|
+
# - Tests musl libc and Alpine system library compatibility without requiring Kafka infrastructure
|
24
|
+
# - Validates libssl, libsasl2, libzstd, zlib integration across Alpine versions
|
25
|
+
# - Ensures native extensions work with different Alpine package versions
|
26
|
+
# - Catches regressions from Alpine package updates and musl libc changes
|
27
|
+
# - Tests both compilation and precompiled library compatibility on Alpine
|
28
|
+
#
|
29
|
+
# SCHEDULING STRATEGY:
|
30
|
+
# - Runs every 3 days at 5 AM to catch system/library changes from Alpine base image updates
|
31
|
+
# - Triggers on workflow file changes to validate CI modifications
|
32
|
+
# - Manual dispatch available for ad-hoc regression testing
|
33
|
+
# - Separate artifact naming prevents interference with main CI
|
34
|
+
#
|
35
|
+
# This approach ensures comprehensive coverage while keeping PR CI fast and focused
|
36
|
+
# on code-related issues rather than infrastructure/system regressions on Alpine.
|
37
|
+
|
38
|
+
name: CI Linux Complementary Alpine x86_64 musl
|
39
|
+
|
40
|
+
concurrency:
|
41
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
42
|
+
cancel-in-progress: true
|
43
|
+
|
44
|
+
on:
|
45
|
+
schedule:
|
46
|
+
- cron: '0 5 */3 * *'
|
47
|
+
workflow_dispatch:
|
48
|
+
push:
|
49
|
+
paths:
|
50
|
+
- '.github/workflows/ci_linux_alpine_x86_64_musl_complementary.yml'
|
51
|
+
branches: [ main, master ]
|
52
|
+
pull_request:
|
53
|
+
paths:
|
54
|
+
- '.github/workflows/ci_linux_alpine_x86_64_musl_complementary.yml'
|
55
|
+
branches: [ main, master ]
|
56
|
+
|
57
|
+
permissions:
|
58
|
+
contents: read
|
59
|
+
|
60
|
+
env:
|
61
|
+
BUNDLE_RETRY: 6
|
62
|
+
BUNDLE_JOBS: 4
|
63
|
+
|
64
|
+
jobs:
|
65
|
+
build_precompiled:
|
66
|
+
timeout-minutes: 45
|
67
|
+
runs-on: ubuntu-latest
|
68
|
+
container:
|
69
|
+
# Similar to GNU, we build on the oldest for ABI compatibility
|
70
|
+
image: alpine:3.18@sha256:de0eb0b3f2a47ba1eb89389859a9bd88b28e82f5826b6969ad604979713c2d4f # renovate: ignore
|
71
|
+
steps:
|
72
|
+
- name: Install dependencies
|
73
|
+
run: |
|
74
|
+
apk add --no-cache git curl ca-certificates build-base linux-headers \
|
75
|
+
pkgconf perl autoconf automake libtool bison flex file bash wget zstd-dev \
|
76
|
+
openssl-dev cyrus-sasl-dev cyrus-sasl cyrus-sasl-login \
|
77
|
+
cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapiv2 cyrus-sasl-scram \
|
78
|
+
krb5-libs openssl zlib zlib-dev zstd-libs
|
79
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
80
|
+
with:
|
81
|
+
fetch-depth: 0
|
82
|
+
- name: Configure git safe directory
|
83
|
+
run: git config --global --add safe.directory /__w/karafka-rdkafka/karafka-rdkafka
|
84
|
+
- name: Cache build-tmp directory
|
85
|
+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
86
|
+
with:
|
87
|
+
path: ext/build-tmp-musl
|
88
|
+
key: build-tmp-musl-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
|
89
|
+
- name: Build precompiled librdkafka.so
|
90
|
+
run: |
|
91
|
+
cd ext
|
92
|
+
bash ./build_linux_x86_64_musl.sh
|
93
|
+
- name: Upload precompiled library
|
94
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
95
|
+
with:
|
96
|
+
name: librdkafka-precompiled-musl-complementary
|
97
|
+
path: ext/
|
98
|
+
retention-days: 1
|
99
|
+
|
100
|
+
specs_install:
|
101
|
+
timeout-minutes: 45
|
102
|
+
runs-on: ubuntu-latest
|
103
|
+
strategy:
|
104
|
+
fail-fast: false
|
105
|
+
matrix:
|
106
|
+
include:
|
107
|
+
- ruby: '3.4'
|
108
|
+
alpine_version: '3.22'
|
109
|
+
- ruby: '3.3'
|
110
|
+
alpine_version: '3.21'
|
111
|
+
- ruby: '3.2'
|
112
|
+
alpine_version: '3.21'
|
113
|
+
- ruby: '3.1'
|
114
|
+
alpine_version: '3.21'
|
115
|
+
steps:
|
116
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
117
|
+
with:
|
118
|
+
fetch-depth: 0
|
119
|
+
|
120
|
+
- name: Start Kafka with Docker Compose
|
121
|
+
run: |
|
122
|
+
./ext/generate-ssl-certs.sh
|
123
|
+
docker compose -f docker-compose-ssl.yml up -d
|
124
|
+
echo "Waiting for Kafka to be ready..."
|
125
|
+
sleep 10
|
126
|
+
for i in {1..30}; do
|
127
|
+
if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
|
128
|
+
echo "Kafka topics command succeeded!"
|
129
|
+
break
|
130
|
+
fi
|
131
|
+
sleep 2
|
132
|
+
done
|
133
|
+
|
134
|
+
- name: Run all specs in SSL (compiled flow)
|
135
|
+
env:
|
136
|
+
KAFKA_SSL_ENABLED: "true"
|
137
|
+
run: |
|
138
|
+
docker run --rm \
|
139
|
+
--network host \
|
140
|
+
-v "${{ github.workspace }}:/workspace" \
|
141
|
+
-w /workspace \
|
142
|
+
-e "KAFKA_SSL_ENABLED=true" \
|
143
|
+
ruby:${{ matrix.ruby }}-alpine${{ matrix.alpine_version }} \
|
144
|
+
sh -c 'apk add --no-cache git curl ca-certificates build-base linux-headers \
|
145
|
+
pkgconf perl autoconf automake libtool bison flex file \
|
146
|
+
ruby-dev ruby-bundler bash zstd-dev zlib zlib-dev openssl-dev \
|
147
|
+
cyrus-sasl-dev cyrus-sasl cyrus-sasl-login \
|
148
|
+
cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapiv2 cyrus-sasl-scram \
|
149
|
+
krb5-libs openssl zlib zstd-libs openjdk17-jre-headless && \
|
150
|
+
git config --global --add safe.directory /workspace && \
|
151
|
+
bundle config set --local path vendor/bundle && \
|
152
|
+
bundle install && \
|
153
|
+
cd ext && bundle exec rake && \
|
154
|
+
cd .. && \
|
155
|
+
echo "=== SSL Library Versions ===" && \
|
156
|
+
openssl version && \
|
157
|
+
apk list --installed | grep -E "(openssl|cyrus-sasl)" && \
|
158
|
+
echo "=== Running SSL Specs (Compiled) ===" && \
|
159
|
+
bundle exec ruby -S rspec'
|
160
|
+
|
161
|
+
- name: Run integration specs (compiled flow)
|
162
|
+
run: |
|
163
|
+
docker run --rm \
|
164
|
+
-v "${{ github.workspace }}:/workspace" \
|
165
|
+
-w /workspace \
|
166
|
+
ruby:${{ matrix.ruby }}-alpine${{ matrix.alpine_version }} \
|
167
|
+
sh -c 'apk add --no-cache git curl ca-certificates build-base linux-headers \
|
168
|
+
pkgconf perl autoconf automake libtool bison flex file \
|
169
|
+
ruby-dev ruby-bundler bash zstd-dev zlib zlib-dev openssl-dev \
|
170
|
+
cyrus-sasl-dev cyrus-sasl cyrus-sasl-login \
|
171
|
+
cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapiv2 cyrus-sasl-scram \
|
172
|
+
krb5-libs openssl zlib zstd-libs libcurl curl-dev && \
|
173
|
+
git config --global --add safe.directory /workspace && \
|
174
|
+
bundle config set --local path vendor/bundle && \
|
175
|
+
bundle install && \
|
176
|
+
cd ext && bundle exec rake && \
|
177
|
+
cd .. && \
|
178
|
+
echo "=== Alpine/musl Library Versions ===" && \
|
179
|
+
openssl version && \
|
180
|
+
apk list --installed | grep -E "(openssl|cyrus-sasl|zstd|zlib)" && \
|
181
|
+
echo "=== Running Integration Specs (Compiled) ===" && \
|
182
|
+
for file in $(ls spec/integrations/*_spec.rb); do \
|
183
|
+
echo "Running $file with Ruby ${{ matrix.ruby }} on Alpine ${{ matrix.alpine_version }}"; \
|
184
|
+
bundle exec ruby "$file" || exit 1; \
|
185
|
+
done'
|
186
|
+
|
187
|
+
specs_precompiled:
|
188
|
+
timeout-minutes: 30
|
189
|
+
needs: build_precompiled
|
190
|
+
strategy:
|
191
|
+
fail-fast: false
|
192
|
+
matrix:
|
193
|
+
ruby:
|
194
|
+
- '3.4'
|
195
|
+
- '3.3'
|
196
|
+
- '3.2'
|
197
|
+
- '3.1'
|
198
|
+
runs-on: ubuntu-latest
|
199
|
+
steps:
|
200
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
201
|
+
with:
|
202
|
+
fetch-depth: 0
|
203
|
+
- name: Download precompiled library
|
204
|
+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
|
205
|
+
with:
|
206
|
+
name: librdkafka-precompiled-musl-complementary
|
207
|
+
path: ext/
|
208
|
+
- name: Start Kafka with Docker Compose
|
209
|
+
run: |
|
210
|
+
./ext/generate-ssl-certs.sh
|
211
|
+
docker compose -f docker-compose-ssl.yml up -d
|
212
|
+
echo "Waiting for Kafka to be ready..."
|
213
|
+
sleep 10
|
214
|
+
|
215
|
+
for i in {1..30}; do
|
216
|
+
if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
|
217
|
+
echo "Kafka topics command succeeded!"
|
218
|
+
break
|
219
|
+
fi
|
220
|
+
sleep 2
|
221
|
+
done
|
222
|
+
|
223
|
+
- name: Run specs with precompiled library and SSL
|
224
|
+
env:
|
225
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
226
|
+
KAFKA_SSL_ENABLED: "true"
|
227
|
+
run: |
|
228
|
+
docker run --rm \
|
229
|
+
--network host \
|
230
|
+
-v "${{ github.workspace }}:/workspace" \
|
231
|
+
-w /workspace \
|
232
|
+
-e "RDKAFKA_EXT_PATH=/workspace/ext" \
|
233
|
+
-e "KAFKA_SSL_ENABLED=true" \
|
234
|
+
ruby:${{ matrix.ruby }}-alpine \
|
235
|
+
sh -c 'apk add --no-cache git build-base linux-headers bash openjdk17-jre-headless && \
|
236
|
+
git config --global --add safe.directory /workspace && \
|
237
|
+
bundle config set --local path vendor/bundle && bundle install && \
|
238
|
+
apk list --installed | grep -E "(openssl|cyrus-sasl)" && \
|
239
|
+
bundle exec ruby -S rspec'
|
240
|
+
|
241
|
+
- name: Run integration specs (precompiled flow)
|
242
|
+
env:
|
243
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
244
|
+
run: |
|
245
|
+
docker run --rm \
|
246
|
+
-v "${{ github.workspace }}:/workspace" \
|
247
|
+
-w /workspace \
|
248
|
+
-e "RDKAFKA_EXT_PATH=/workspace/ext" \
|
249
|
+
ruby:${{ matrix.ruby }}-alpine \
|
250
|
+
sh -c 'apk add --no-cache git curl ca-certificates build-base linux-headers \
|
251
|
+
pkgconf perl autoconf automake libtool bison flex file \
|
252
|
+
ruby-dev ruby-bundler bash zstd-dev zlib zlib-dev openssl-dev \
|
253
|
+
cyrus-sasl-dev cyrus-sasl cyrus-sasl-login \
|
254
|
+
cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapiv2 cyrus-sasl-scram \
|
255
|
+
krb5-libs openssl zlib zstd-libs libcurl curl-dev && \
|
256
|
+
git config --global --add safe.directory /workspace && \
|
257
|
+
bundle config set --local path vendor/bundle && \
|
258
|
+
bundle install && \
|
259
|
+
apk list --installed | grep -E "(openssl|cyrus-sasl|zstd|zlib)" && \
|
260
|
+
echo "=== Running Integration Specs (Precompiled) ===" && \
|
261
|
+
for file in $(ls spec/integrations/*_spec.rb); do \
|
262
|
+
echo "Running $file with Ruby ${{ matrix.ruby }} (precompiled)"; \
|
263
|
+
bundle exec ruby "$file" || exit 1; \
|
264
|
+
done'
|
@@ -0,0 +1,271 @@
|
|
1
|
+
# CI Strategy: Comprehensive Testing of Build and Precompiled Flows
|
2
|
+
#
|
3
|
+
# This workflow tests both compilation-from-source and precompiled binary distribution
|
4
|
+
# strategies across multiple Debian and Ruby versions to ensure broad compatibility and
|
5
|
+
# reliability.
|
6
|
+
#
|
7
|
+
# WHY WE TEST DEBIAN BOOKWORM AND TRIXIE:
|
8
|
+
# - Different system library versions (OpenSSL, zlib, libsasl2, libzstd, etc.)
|
9
|
+
# - Different GCC compiler versions that affect native extension compilation
|
10
|
+
# - Different glibc versions that can impact binary compatibility
|
11
|
+
# - Real-world deployment scenarios where users run on Debian stable and testing
|
12
|
+
# - Different Ruby versions
|
13
|
+
# - Forward compatibility testing with Trixie (Debian testing/future stable)
|
14
|
+
#
|
15
|
+
# COMPILATION FLOW (build_install + specs_install):
|
16
|
+
# - Tests that librdkafka compiles correctly from source on both Debian versions
|
17
|
+
# - Validates that mini_portile2 can successfully build native dependencies
|
18
|
+
# - Ensures Ruby native extensions link properly with system libraries
|
19
|
+
# - Verifies that the same codebase works across different toolchain versions
|
20
|
+
#
|
21
|
+
# PRECOMPILED FLOW (build_precompiled + specs_precompiled):
|
22
|
+
# - Tests our precompiled static libraries work on both Debian versions
|
23
|
+
# - Validates that statically-linked binaries are truly portable across environments
|
24
|
+
# - Ensures precompiled libraries don't have unexpected system dependencies
|
25
|
+
# - Verifies that removing build tools doesn't break precompiled binary usage
|
26
|
+
#
|
27
|
+
# ARTIFACT ISOLATION:
|
28
|
+
# - Debian gets separate artifacts (rdkafka-built-gem-debian-bookworm, etc.)
|
29
|
+
# - Prevents cross-contamination of OS-specific compiled extensions
|
30
|
+
# - Ensures test accuracy by matching build and test environments
|
31
|
+
#
|
32
|
+
# This comprehensive approach catches issues that single-platform testing would miss,
|
33
|
+
# such as system library incompatibilities, compiler-specific bugs, or static linking
|
34
|
+
# problems that only manifest on specific Debian versions.
|
35
|
+
|
36
|
+
name: CI Linux Debian Multi-Version x86_64 GNU
|
37
|
+
|
38
|
+
concurrency:
|
39
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
40
|
+
cancel-in-progress: true
|
41
|
+
|
42
|
+
on:
|
43
|
+
pull_request:
|
44
|
+
branches: [ main, master ]
|
45
|
+
push:
|
46
|
+
branches: [ main, master ]
|
47
|
+
schedule:
|
48
|
+
- cron: '0 1 * * *'
|
49
|
+
|
50
|
+
permissions:
|
51
|
+
contents: read
|
52
|
+
|
53
|
+
env:
|
54
|
+
BUNDLE_RETRY: 6
|
55
|
+
BUNDLE_JOBS: 4
|
56
|
+
|
57
|
+
jobs:
|
58
|
+
specs_install:
|
59
|
+
timeout-minutes: 50
|
60
|
+
strategy:
|
61
|
+
fail-fast: false
|
62
|
+
matrix:
|
63
|
+
ruby:
|
64
|
+
- '3.4'
|
65
|
+
- '3.3'
|
66
|
+
- '3.2'
|
67
|
+
- '3.1'
|
68
|
+
debian:
|
69
|
+
- 'bookworm'
|
70
|
+
- 'trixie'
|
71
|
+
exclude:
|
72
|
+
- ruby: '3.1'
|
73
|
+
debian: 'trixie'
|
74
|
+
include:
|
75
|
+
- ruby: '3.4'
|
76
|
+
coverage: 'true'
|
77
|
+
runs-on: ubuntu-latest
|
78
|
+
steps:
|
79
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
80
|
+
with:
|
81
|
+
fetch-depth: 0
|
82
|
+
|
83
|
+
- name: Start Kafka with Docker Compose
|
84
|
+
run: |
|
85
|
+
docker compose -f docker-compose.yml up -d
|
86
|
+
echo "Waiting for Kafka to be ready..."
|
87
|
+
sleep 10
|
88
|
+
for i in {1..30}; do
|
89
|
+
if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
|
90
|
+
echo "Kafka topics command succeeded!"
|
91
|
+
break
|
92
|
+
fi
|
93
|
+
sleep 2
|
94
|
+
done
|
95
|
+
|
96
|
+
- name: Install dependencies
|
97
|
+
env:
|
98
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
99
|
+
run: |
|
100
|
+
docker run --rm \
|
101
|
+
--network host \
|
102
|
+
-v "${{ github.workspace }}:/workspace" \
|
103
|
+
-w /workspace \
|
104
|
+
-e "RDKAFKA_EXT_PATH=/workspace/ext" \
|
105
|
+
ruby:${{ matrix.ruby }}-${{ matrix.debian }} \
|
106
|
+
sh -c 'apt-get update && \
|
107
|
+
apt-get upgrade -y openssl libssl3 libssl-dev && \
|
108
|
+
apt-get install -y git build-essential pkg-config \
|
109
|
+
libssl-dev libsasl2-dev zlib1g-dev libzstd-dev && \
|
110
|
+
git config --global --add safe.directory /workspace && \
|
111
|
+
bundle config set --local path vendor/bundle && \
|
112
|
+
bundle install'
|
113
|
+
|
114
|
+
- name: Build gem with mini_portile
|
115
|
+
run: |
|
116
|
+
docker run --rm \
|
117
|
+
--network host \
|
118
|
+
-v "${{ github.workspace }}:/workspace" \
|
119
|
+
-w /workspace \
|
120
|
+
ruby:${{ matrix.ruby }}-${{ matrix.debian }} \
|
121
|
+
sh -c 'apt-get update && \
|
122
|
+
apt-get upgrade -y openssl libssl3 libssl-dev && \
|
123
|
+
apt-get install -y git build-essential pkg-config \
|
124
|
+
libssl-dev libsasl2-dev zlib1g-dev libzstd-dev && \
|
125
|
+
git config --global --add safe.directory /workspace && \
|
126
|
+
bundle config set --local path vendor/bundle && \
|
127
|
+
bundle install && \
|
128
|
+
cd ext && bundle exec rake'
|
129
|
+
|
130
|
+
- name: Run all specs in PLAINTEXT
|
131
|
+
env:
|
132
|
+
GITHUB_COVERAGE: ${{matrix.coverage}}
|
133
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
134
|
+
run: |
|
135
|
+
docker run --rm \
|
136
|
+
--network host \
|
137
|
+
-v "${{ github.workspace }}:/workspace" \
|
138
|
+
-w /workspace \
|
139
|
+
-e "GITHUB_COVERAGE=${{ matrix.coverage }}" \
|
140
|
+
-e "RDKAFKA_EXT_PATH=/workspace/ext" \
|
141
|
+
ruby:${{ matrix.ruby }}-${{ matrix.debian }} \
|
142
|
+
sh -c 'apt-get update && \
|
143
|
+
apt-get upgrade -y openssl libssl3 libssl-dev && \
|
144
|
+
apt-get install -y git build-essential pkg-config \
|
145
|
+
libssl-dev libsasl2-dev zlib1g-dev libzstd-dev && \
|
146
|
+
git config --global --add safe.directory /workspace && \
|
147
|
+
bundle config set --local path vendor/bundle && \
|
148
|
+
bundle install && \
|
149
|
+
bundle exec rspec'
|
150
|
+
|
151
|
+
build_precompiled:
|
152
|
+
timeout-minutes: 50
|
153
|
+
strategy:
|
154
|
+
fail-fast: false
|
155
|
+
matrix:
|
156
|
+
debian:
|
157
|
+
- 'bookworm'
|
158
|
+
- 'trixie'
|
159
|
+
# We precompile on older Ubuntu and check compatibility by running specs since we aim to
|
160
|
+
# release only one precompiled version for all supported Ubuntu versions
|
161
|
+
# This is why we do not want Renovate to update it automatically
|
162
|
+
runs-on: ubuntu-22.04 # renovate: ignore
|
163
|
+
steps:
|
164
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
165
|
+
with:
|
166
|
+
fetch-depth: 0
|
167
|
+
- name: Install build dependencies
|
168
|
+
run: |
|
169
|
+
sudo apt-get update
|
170
|
+
sudo apt-get install -y --no-install-recommends \
|
171
|
+
build-essential \
|
172
|
+
gcc \
|
173
|
+
g++ \
|
174
|
+
make \
|
175
|
+
tar \
|
176
|
+
gzip \
|
177
|
+
wget \
|
178
|
+
curl \
|
179
|
+
file \
|
180
|
+
pkg-config \
|
181
|
+
autoconf \
|
182
|
+
automake \
|
183
|
+
libtool \
|
184
|
+
python3 \
|
185
|
+
git \
|
186
|
+
ca-certificates \
|
187
|
+
patch \
|
188
|
+
libsasl2-dev \
|
189
|
+
libssl-dev \
|
190
|
+
zlib1g-dev \
|
191
|
+
libzstd-dev \
|
192
|
+
bison \
|
193
|
+
flex \
|
194
|
+
perl \
|
195
|
+
binutils-dev
|
196
|
+
- name: Cache build-tmp directory
|
197
|
+
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
198
|
+
with:
|
199
|
+
path: ext/build-tmp
|
200
|
+
key: build-tmp-${{ runner.os }}-${{ matrix.debian }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
|
201
|
+
- name: Build precompiled librdkafka.so
|
202
|
+
run: |
|
203
|
+
cd ext
|
204
|
+
./build_linux_x86_64_gnu.sh
|
205
|
+
- name: Upload precompiled library
|
206
|
+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
207
|
+
with:
|
208
|
+
name: librdkafka-precompiled-linux-${{ matrix.debian }}
|
209
|
+
path: ext/
|
210
|
+
retention-days: 1
|
211
|
+
|
212
|
+
specs_precompiled:
|
213
|
+
timeout-minutes: 50
|
214
|
+
needs: build_precompiled
|
215
|
+
strategy:
|
216
|
+
fail-fast: false
|
217
|
+
matrix:
|
218
|
+
ruby:
|
219
|
+
- '3.4'
|
220
|
+
- '3.3'
|
221
|
+
- '3.2'
|
222
|
+
- '3.1'
|
223
|
+
debian:
|
224
|
+
- 'bookworm'
|
225
|
+
- 'trixie'
|
226
|
+
exclude:
|
227
|
+
- ruby: '3.1'
|
228
|
+
debian: 'trixie'
|
229
|
+
include:
|
230
|
+
- ruby: '3.4'
|
231
|
+
coverage: 'true'
|
232
|
+
|
233
|
+
runs-on: ubuntu-latest
|
234
|
+
steps:
|
235
|
+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
236
|
+
with:
|
237
|
+
fetch-depth: 0
|
238
|
+
- name: Download precompiled library
|
239
|
+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
|
240
|
+
with:
|
241
|
+
name: librdkafka-precompiled-linux-${{ matrix.debian }}
|
242
|
+
path: ext/
|
243
|
+
- name: Start Kafka with Docker Compose
|
244
|
+
run: |
|
245
|
+
docker compose -f docker-compose.yml up -d
|
246
|
+
echo "Waiting for Kafka to be ready..."
|
247
|
+
sleep 10
|
248
|
+
for i in {1..30}; do
|
249
|
+
if docker compose exec -T kafka kafka-topics --bootstrap-server localhost:9092 --list >/dev/null 2>&1; then
|
250
|
+
echo "Kafka topics command succeeded!"
|
251
|
+
break
|
252
|
+
fi
|
253
|
+
sleep 2
|
254
|
+
done
|
255
|
+
- name: Run specs with precompiled library and PLAINTEXT
|
256
|
+
env:
|
257
|
+
GITHUB_COVERAGE: ${{ matrix.coverage }}
|
258
|
+
RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
|
259
|
+
run: |
|
260
|
+
docker run --rm \
|
261
|
+
--network host \
|
262
|
+
-v "${{ github.workspace }}:/workspace" \
|
263
|
+
-w /workspace \
|
264
|
+
-e "GITHUB_COVERAGE=${{ matrix.coverage }}" \
|
265
|
+
-e "RDKAFKA_EXT_PATH=/workspace/ext" \
|
266
|
+
ruby:${{ matrix.ruby }}-${{ matrix.debian }} \
|
267
|
+
sh -c 'apt-get update && \
|
268
|
+
apt-get install -y git && \
|
269
|
+
git config --global --add safe.directory /workspace && \
|
270
|
+
bundle config set --local path vendor/bundle && \
|
271
|
+
bundle install && bundle exec rspec'
|