Skip to content

Commit a09ccd9

Browse files
authoredFeb 14, 2025
Ubuntu 24.04 and arm64 linux package verification (confluentinc#4954)
* Verify Ubuntu 24.04 and arm64 packages * Add Semaphore task for verifying
1 parent 876cf4a commit a09ccd9

7 files changed

+129
-54
lines changed
 

‎.semaphore/verify-linux-packages.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
version: v1.0
2+
name: verify-linux-packages
3+
4+
agent:
5+
machine:
6+
type: s1-prod-ubuntu22-04-amd64-1
7+
8+
execution_time_limit:
9+
hours: 2
10+
11+
global_job_config:
12+
prologue:
13+
commands:
14+
- checkout
15+
env_vars:
16+
- name: REPOSITORY_BASE_URL
17+
value: "https://packages.confluent.io"
18+
19+
blocks:
20+
- name: "Verify Linux packages (x86_64)"
21+
dependencies: []
22+
task:
23+
agent:
24+
machine:
25+
type: s1-prod-ubuntu22-04-amd64-2
26+
jobs:
27+
- name: "Verify packages"
28+
commands:
29+
- cd packaging/cp
30+
- ./verify-packages.sh ${REPOSITORY_BASE_URL} linux/amd64 ${LIBRDKAFKA_VERSION}
31+
- name: "Verify Linux packages (aarch64)"
32+
dependencies: []
33+
task:
34+
agent:
35+
machine:
36+
type: s1-prod-ubuntu22-04-arm64-2
37+
jobs:
38+
- name: "Verify packages"
39+
commands:
40+
- cd packaging/cp
41+
- ./verify-packages.sh ${REPOSITORY_BASE_URL} linux/arm64 ${LIBRDKAFKA_VERSION}

‎packaging/cp/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ This small set of scripts verifies the librdkafka packages that
44
are part of the Confluent Platform.
55

66
The base_url is the http S3 bucket path to the a PR job, or similar.
7+
Pass the platform (e.g. linux/arm64) and the expected librdkafka version too.
78

89
## How to use
910

10-
$ ./verify-packages.sh 7.6 https://packages.confluent.io
11+
```
12+
$ ./verify-packages.sh https://packages.confluent.io linux/amd64 2.8.0
13+
```
1114

1215
Requires docker and patience.
1316

‎packaging/cp/check_features.c

+9-3
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,18 @@ int main(int argc, char **argv) {
1515
printf("librdkafka %s (0x%x, define: 0x%x)\n", rd_kafka_version_str(),
1616
rd_kafka_version(), RD_KAFKA_VERSION);
1717

18-
if (argc > 1 && !(argc & 1)) {
19-
printf("Usage: %s [config.property config-value ..]\n",
18+
if (argc < 2 || (argc > 2 && (argc & 1))) {
19+
printf("Usage: %s <version_string> [config.property config-value ..]\n",
2020
argv[0]);
2121
return 1;
2222
}
2323

24+
if (!strstr(rd_kafka_version_str(), argv[1])) {
25+
printf("ERROR: version string mismatch: expected %s, got %s\n",
26+
argv[1], rd_kafka_version_str());
27+
return 1;
28+
}
29+
2430
conf = rd_kafka_conf_new();
2531
res = rd_kafka_conf_get(conf, "builtin.features", buf, &sz);
2632

@@ -46,7 +52,7 @@ int main(int argc, char **argv) {
4652
printf("all expected features matched: %s\n", expected_features);
4753

4854
/* Apply config from argv key value pairs */
49-
for (i = 1; i + 1 < argc; i += 2) {
55+
for (i = 2; i + 1 < argc; i += 2) {
5056
printf("verifying config %s=%s\n", argv[i], argv[i + 1]);
5157
if (rd_kafka_conf_set(conf, argv[i], argv[i + 1], errstr,
5258
sizeof(errstr)) != RD_KAFKA_CONF_OK) {

‎packaging/cp/verify-deb.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@
33

44
set -e
55

6-
cpver=$1
7-
base_url=$2
6+
base_url=$1
7+
version=$2
88

99
if [[ -z $base_url ]]; then
10-
echo "Usage: $0 <cp-base-ver> <base_url>"
10+
echo "Usage: $0 <base_url>"
1111
exit 1
1212
fi
1313

1414
apt-get update
1515
apt-get install -y apt-transport-https wget gnupg2 lsb-release
1616

17-
wget -qO - ${base_url}/deb/${cpver}/archive.key | apt-key add -
17+
wget -qO - ${base_url}/clients/deb/archive.key | apt-key add -
1818

1919
release=$(lsb_release -cs)
2020
cat >/etc/apt/sources.list.d/Confluent.list <<EOF
21-
deb [arch=amd64] $base_url/clients/deb ${release} main
21+
deb $base_url/clients/deb ${release} main
2222
EOF
2323

2424
apt-get update
2525
apt-get install -y librdkafka-dev gcc
2626

2727
gcc /v/check_features.c -o /tmp/check_features -lrdkafka
2828

29-
/tmp/check_features
29+
/tmp/check_features $version
3030

3131
# FIXME: publish plugins in newer versions
3232
# apt-get install -y confluent-librdkafka-plugins

‎packaging/cp/verify-packages.sh

+54-31
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,70 @@
22
#
33
# Verifies RPM and DEB packages from Confluent Platform
44
#
5+
base_url=$1
6+
platform=$2
7+
version=$3
58

6-
cpver=$1
7-
base_url=$2
8-
9-
if [[ -z $base_url ]]; then
10-
echo "Usage: $0 <CP-M.m-version> <base-url>"
9+
if [[ -z $base_url || -z $version ]]; then
10+
echo "Usage: $0 <base-url> <platform> <version>"
1111
echo ""
12-
echo " <CP-M.m-version> is the Major.minor version of CP, e.g., 5.3"
1312
echo " <base-url> is the release base bucket URL"
13+
echo " <platform> is platform to verify (e.g. linux/amd64)"
14+
echo " <version> is the expected version"
1415
exit 1
1516
fi
1617

1718
thisdir="$( cd "$(dirname "$0")" ; pwd -P )"
1819

19-
echo "#### Verifying RPM packages ####"
20-
docker run -v $thisdir:/v rockylinux:8 /v/verify-rpm.sh $cpver $base_url
21-
docker run -v $thisdir:/v rockylinux:9 /v/verify-rpm.sh $cpver $base_url
22-
rpm_status=$?
23-
24-
echo "#### Verifying Debian packages ####"
25-
docker run -v $thisdir:/v debian:10 /v/verify-deb.sh $cpver $base_url
26-
docker run -v $thisdir:/v debian:11 /v/verify-deb.sh $cpver $base_url
27-
docker run -v $thisdir:/v debian:12 /v/verify-deb.sh $cpver $base_url
28-
docker run -v $thisdir:/v ubuntu:20.04 /v/verify-deb.sh $cpver $base_url
29-
docker run -v $thisdir:/v ubuntu:22.04 /v/verify-deb.sh $cpver $base_url
30-
deb_status=$?
20+
verify_debian() {
21+
local version=$2
22+
docker run -v $thisdir:/v $1 /v/verify-deb.sh $base_url $version
23+
deb_status=$?
24+
if [[ $deb_status == 0 ]]; then
25+
echo "SUCCESS: Debian based $1 $2 packages verified"
26+
else
27+
echo "ERROR: Debian based $1 $2 package verification failed"
28+
exit 1
29+
fi
30+
}
3131

32+
verify_rpm() {
33+
local version=$2
34+
docker run -v $thisdir:/v $1 /v/verify-rpm.sh $base_url $version
35+
rpm_status=$?
36+
if [[ $rpm_status == 0 ]]; then
37+
echo "SUCCESS: RPM $1 $2 packages verified"
38+
else
39+
echo "ERROR: RPM $1 $2 package verification failed"
40+
exit 1
41+
fi
42+
}
3243

33-
if [[ $rpm_status == 0 ]]; then
34-
echo "SUCCESS: RPM packages verified"
35-
else
36-
echo "ERROR: RPM package verification failed"
37-
fi
44+
verify_rpm_distros() {
45+
local platform=$1
46+
local version=$2
47+
echo "#### Verifying RPM packages for $platform ####"
48+
# Last RHEL 8 version is 2.4.0
49+
verify_rpm rockylinux:8 "2.4.0"
50+
verify_rpm rockylinux:9 $version
51+
}
3852

39-
if [[ $deb_status == 0 ]]; then
40-
echo "SUCCESS: Debian packages verified"
41-
else
42-
echo "ERROR: Debian package verification failed"
43-
fi
53+
verify_debian_distros() {
54+
local platform=$1
55+
local version=$2
56+
echo "#### Verifying Debian packages for $platform ####"
57+
# Last Debian 10 version is 2.5.0
58+
verify_debian debian:10 "2.5.0"
59+
verify_debian debian:11 $version
60+
verify_debian debian:12 $version
61+
verify_debian ubuntu:20.04 $version
62+
verify_debian ubuntu:22.04 $version
63+
verify_debian ubuntu:24.04 $version
64+
}
4465

45-
if [[ $deb_status != 0 || $rpm_status != 0 ]]; then
46-
exit 1
47-
fi
66+
verify_distros() {
67+
verify_rpm_distros $1 $2
68+
verify_debian_distros $1 $2
69+
}
4870

71+
verify_distros $platform $version

‎packaging/cp/verify-rpm.sh

+6-13
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,15 @@
33

44
set -e
55

6-
cpver=$1
7-
base_url=$2
6+
base_url=$1
7+
version=$2
88

99
if [[ -z $base_url ]]; then
10-
echo "Usage: $0 <cp-base-ver> <base_url>"
10+
echo "Usage: $0 <base_url>"
1111
exit 1
1212
fi
1313

1414
cat >/etc/yum.repos.d/Confluent.repo <<EOF
15-
[Confluent]
16-
name=Confluent repository
17-
baseurl=$base_url/rpm/${cpver}
18-
gpgcheck=1
19-
gpgkey=$base_url/rpm/${cpver}/archive.key
20-
enabled=1
21-
2215
[Confluent-Clients]
2316
name=Confluent Clients repository
2417
baseurl=$base_url/clients/rpm/centos/\$releasever/\$basearch
@@ -31,9 +24,9 @@ yum install -y librdkafka-devel gcc
3124

3225
gcc /v/check_features.c -o /tmp/check_features -lrdkafka
3326

34-
/tmp/check_features
27+
/tmp/check_features $version
3528

3629
# Verify plugins
37-
yum install -y confluent-librdkafka-plugins
30+
# yum install -y confluent-librdkafka-plugins
3831

39-
/tmp/check_features plugin.library.paths monitoring-interceptor
32+
# /tmp/check_features plugin.library.paths monitoring-interceptor

‎service.yml

+9
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,12 @@ semaphore:
1616
- /semaphore.*/
1717
- /dev_.*/
1818
- /feature\/.*/
19+
tasks:
20+
- name: verify-linux-packages
21+
branch: master
22+
scheduled: false
23+
pipeline_file: .semaphore/verify-linux-packages.yml
24+
parameters:
25+
- name: LIBRDKAFKA_VERSION
26+
required: true
27+
description: librdkafka version to verify

0 commit comments

Comments
 (0)
Please sign in to comment.