Skip to content

Commit 31b4eff

Browse files
authored
Use debian-based builder image for bulding Linux glibc images (#228)
* Use debian based docker image for builds * Change version for testing * Use just one builder * Revert version changes (which were only for testing)
1 parent 2f8d293 commit 31b4eff

File tree

4 files changed

+33
-14
lines changed

4 files changed

+33
-14
lines changed
File renamed without changes.

.semaphore/build-docker-debian.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
export DEBIAN_FRONTEND=noninteractive
4+
export NEEDRESTART_MODE=a
5+
apt update
6+
apt install -y gcc make build-essential
7+
8+
# /v is the volume mount point for the project root
9+
cd /v
10+
npm ci
11+
npx node-pre-gyp package

.semaphore/semaphore.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ blocks:
4545
jobs:
4646
- name: "Build from source and test for musl"
4747
commands:
48-
- docker run -v "$(pwd):/v" node:18-alpine /v/.semaphore/build-docker.sh
48+
- docker run -v "$(pwd):/v" node:18-alpine /v/.semaphore/build-docker-alpine.sh
4949

5050
- name: "Linux arm64 (musl): Build and test"
5151
dependencies: [ ]
@@ -59,7 +59,7 @@ blocks:
5959
jobs:
6060
- name: "Build from source and test for musl"
6161
commands:
62-
- docker run -v "$(pwd):/v" node:18-alpine /v/.semaphore/build-docker.sh
62+
- docker run -v "$(pwd):/v" node:18-alpine /v/.semaphore/build-docker-alpine.sh
6363

6464
- name: "Linux arm64: Build and test"
6565
dependencies: [ ]
@@ -183,10 +183,8 @@ blocks:
183183
commands:
184184
- export NODE_VERSION=$(echo $NODE_VERSION_ABI | cut -d, -f1)
185185
- export NODE_ABI=$(echo $NODE_VERSION_ABI | cut -d, -f2)
186-
- sem-version node $NODE_VERSION
187186
- export ARTIFACT_KEY="confluent-kafka-javascript-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
188-
- npm ci # node-pre-gyp will fallback to build here, because new tag implies no release yet.
189-
- npx node-pre-gyp package
187+
- docker run -v "$(pwd):/v" node:${NODE_VERSION}-bullseye /v/.semaphore/build-docker-debian.sh
190188
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
191189
- artifact push workflow "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
192190

@@ -221,10 +219,8 @@ blocks:
221219
commands:
222220
- export NODE_VERSION=$(echo $NODE_VERSION_ABI | cut -d, -f1)
223221
- export NODE_ABI=$(echo $NODE_VERSION_ABI | cut -d, -f2)
224-
- sem-version node $NODE_VERSION
225222
- export ARTIFACT_KEY="confluent-kafka-javascript-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
226-
- npm ci # node-pre-gyp will fallback to build here, because new tag implies no release yet.
227-
- npx node-pre-gyp package
223+
- docker run -v "$(pwd):/v" node:${NODE_VERSION}-bullseye /v/.semaphore/build-docker-debian.sh
228224
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
229225
- artifact push workflow "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
230226

@@ -260,7 +256,7 @@ blocks:
260256
- export NODE_VERSION=$(echo $NODE_VERSION_ABI | cut -d, -f1)
261257
- export NODE_ABI=$(echo $NODE_VERSION_ABI | cut -d, -f2)
262258
- export ARTIFACT_KEY="confluent-kafka-javascript-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-linux-${LIBC}-${ARCHITECTURE}.tar.gz"
263-
- docker run -v "$(pwd):/v" node:${NODE_VERSION}-alpine /v/.semaphore/build-docker.sh
259+
- docker run -v "$(pwd):/v" node:${NODE_VERSION}-alpine /v/.semaphore/build-docker-alpine.sh
264260
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
265261
- artifact push workflow "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
266262

@@ -296,7 +292,7 @@ blocks:
296292
- export NODE_VERSION=$(echo $NODE_VERSION_ABI | cut -d, -f1)
297293
- export NODE_ABI=$(echo $NODE_VERSION_ABI | cut -d, -f2)
298294
- export ARTIFACT_KEY="confluent-kafka-javascript-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-linux-${LIBC}-${ARCHITECTURE}.tar.gz"
299-
- docker run -v "$(pwd):/v" node:${NODE_VERSION}-alpine /v/.semaphore/build-docker.sh
295+
- docker run -v "$(pwd):/v" node:${NODE_VERSION}-alpine /v/.semaphore/build-docker-alpine.sh
300296
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
301297
- artifact push workflow "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
302298

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,22 @@ To use **Schema Registry**, use the [@confluentinc/schemaregistry](https://www.n
2929

3030
The following configurations are supported:
3131

32-
* Any supported version of Node.js (The two LTS versions, 18 and 20, and the latest versions, 21, 22 and 23).
33-
* Linux (x64 and arm64) - both glibc and musl/alpine.
34-
* macOS - arm64/m1. macOS (Intel) is supported on a best-effort basis.
35-
* Windows - x64.
32+
* Linux (x64 and arm64) - we support both musl and glibc based distributions:
33+
34+
| Distribution | Supported Node Versions |
35+
| ----------------------------------------- | ----------------------- |
36+
| Debian Bullseye/Ubuntu 20.04 | 18, 20, 21, 22, 23 |
37+
| Debian Bookworm/Ubuntu 22.04 | 18, 20, 21, 22, 23 |
38+
| Alpine Linux 3.20+ | 18, 20, 21, 22, 23 |
39+
| AlmaLinux 9/Rocky Linux 9/CentOS Stream 9 | 18, 20, 21, 22, 23 |
40+
41+
Other distributions will probably work given a modern version of gcc/glibc, but we don't test the pre-built binaries with them.
42+
43+
* macOS - arm64/m1. macOS (Intel) is supported on a best-effort basis. Node versions 18, 20, 21, 22, and 23 are supported.
44+
* Windows - x64. Node versions 18, 20, 21, 22, and 23 are supported.
45+
46+
> [!WARNING]
47+
> Pre-built binary support will be dropped after the EOL of the node version or the OS.
3648
3749
Installation on any of these platforms is meant to be seamless, without any C/C++ compilation required.
3850

0 commit comments

Comments
 (0)