Add Debian 11 (Bullseye) to CI. (#11334)
* Add Debian 11 (Bullseye) to CI. Official feature freeze is in a couple of days, and the release is soon to follow. * Fix handling of Debian 11 package builds. * Fix build dependencies for Debian 11. `dh-systemd` has long since been deprecated, we should instead be depending on the minimum version of `debhelper` that includes the required code. We need to special-case Ubuntu 16.04 because it predates the merge of `dh-systemd` into `debhelper`. * Use correct Docker image for Debian 11. * Add repoconfig package build for Debian 11. * Simplify handling of package building and testing. This should fix the CI issues we’re seeing with package builds, or at least make them easier to diagnose.
Austin S. Hemmelgarn committed
Aug 18, 2021 at 09:11 UTC
28bea5ea903df78fd0212460b8ff9a1303784144
9 files changed
+146
-132
.github/scripts/pkg-test.sh
renamed
+58
-13
@@ -7,11 +7,10 @@ install_debian_like() {
7
apt-get update
8
9
# Install NetData
10
- apt-get install -y "/packages/netdata_${VERSION}_${ARCH}.deb"
10
+ apt-get install -y /netdata/artifacts/netdata_"${VERSION}"_*.deb || exit 1
11
12
# Install testing tools
13
- apt-get install -y --no-install-recommends \
14
- curl netcat jq
13
+ apt-get install -y --no-install-recommends curl netcat jq || exit 1
14
}
15
16
install_fedora_like() {
@@ -23,10 +22,10 @@ install_fedora_like() {
22
pkg_version="$(echo "${VERSION}" | tr - .)"
23
24
# Install NetData
26
- "$PKGMGR" install -y /packages/netdata-"${pkg_version}"-*.rpm
25
+ "$PKGMGR" install -y /netdata/artifacts/netdata-"${pkg_version}"-*.rpm
26
27
# Install testing tools
29
- "$PKGMGR" install -y curl nc jq
28
+ "$PKGMGR" install -y curl nc jq || exit 1
29
}
30
31
install_centos() {
@@ -38,13 +37,13 @@ install_centos() {
37
pkg_version="$(echo "${VERSION}" | tr - .)"
38
39
# Install EPEL (needed for `jq`
41
- "$PKGMGR" install -y epel-release
40
+ "$PKGMGR" install -y epel-release || exit 1
41
42
# Install NetData
44
- "$PKGMGR" install -y /packages/netdata-"${pkg_version}"-*.rpm
43
+ "$PKGMGR" install -y /netdata/artifacts/netdata-"${pkg_version}"-*.rpm
44
45
# Install testing tools
47
- "$PKGMGR" install -y curl nc jq
46
+ "$PKGMGR" install -y curl nc jq || exit 1
47
}
48
49
install_suse_like() {
@@ -54,13 +53,45 @@ install_suse_like() {
53
pkg_version="$(echo "${VERSION}" | tr - .)"
54
55
# Install NetData
57
- # FIXME: Allow unsigned packages (for now) #7773
58
- zypper install -y --allow-unsigned-rpm \
59
- /packages/netdata-"${pkg_version}"-*.rpm
56
+ zypper install -y --allow-unsigned-rpm /netdata/artifacts/netdata-"${pkg_version}"-*.rpm
57
58
# Install testing tools
62
- zypper install -y --no-recommends \
63
- curl netcat-openbsd jq
59
+ zypper install -y --no-recommends curl netcat-openbsd jq || exit 1
60
+}
61
+
62
+dump_log() {
63
+ cat ./netdata.log
64
+}
65
+
66
+wait_for() {
67
+ host="${1}"
68
+ port="${2}"
69
+ name="${3}"
70
+ timeout="30"
71
+
72
+ if command -v nc > /dev/null ; then
73
+ netcat="nc"
74
+ elif command -v netcat > /dev/null ; then
75
+ netcat="netcat"
76
+ else
77
+ printf "Unable to find a usable netcat command.\n"
78
+ return 1
79
+ fi
80
+
81
+ printf "Waiting for %s on %s:%s ... " "${name}" "${host}" "${port}"
82
+
83
+ sleep 30
84
+
85
+ i=0
86
+ while ! ${netcat} -z "${host}" "${port}"; do
87
+ sleep 1
88
+ if [ "$i" -gt "$timeout" ]; then
89
+ printf "Timed out!\n"
90
+ return 1
91
+ fi
92
+ i="$((i + 1))"
93
+ done
94
+ printf "OK\n"
95
}
96
97
case "${DISTRO}" in
@@ -81,3 +112,17 @@ case "${DISTRO}" in
112
exit 1
113
;;
114
esac
115
+
116
+trap dump_log EXIT
117
+
118
+/usr/sbin/netdata -D > ./netdata.log 2>&1 &
119
+
120
+wait_for localhost 19999 netdata || exit 1
121
+
122
+curl -sS http://127.0.0.1:19999/api/v1/info > ./response || exit 1
123
+
124
+cat ./response
125
+
126
+jq '.version' ./response || exit 1
127
+
128
+trap - EXIT
.github/workflows/build-and-install.yml
+4
@@ -36,6 +36,7 @@ jobs:
36
- 'archlinux:latest'
37
- 'centos:8'
38
- 'centos:7'
39
+ - 'debian:bullseye' # 11
40
- 'debian:10'
41
- 'debian:9'
42
- 'fedora:34'
@@ -70,6 +71,9 @@ jobs:
71
- distro: 'centos:8'
72
rmjsonc: 'dnf remove -y json-c-devel'
73
74
+ - distro: 'debian:bullseye' # 11
75
+ pre: 'apt-get update'
76
+ rmjsonc: 'apt-get remove -y libjson-c-dev'
77
- distro: 'debian:10'
78
pre: 'apt-get update'
79
rmjsonc: 'apt-get remove -y libjson-c-dev'
.github/workflows/packaging.yml
+17
-20
@@ -30,6 +30,8 @@ jobs:
30
- {distro: debian, version: "9", pkgclouddistro: debian/stretch, format: deb, base_image: debian, platform: linux/i386, arch: i386}
31
- {distro: debian, version: "10", pkgclouddistro: debian/buster, format: deb, base_image: debian, platform: linux/amd64, arch: amd64}
32
- {distro: debian, version: "10", pkgclouddistro: debian/buster, format: deb, base_image: debian, platform: linux/i386, arch: i386}
33
+ - {distro: debian, version: "11", pkgclouddistro: debian/bullseye, format: deb, base_image: debian, platform: linux/amd64, arch: amd64, alias: bullseye}
34
+ - {distro: debian, version: "11", pkgclouddistro: debian/bullseye, format: deb, base_image: debian, platform: linux/i386, arch: i386, alias: bullseye}
35
- {distro: ubuntu, version: "16.04", pkgclouddistro: ubuntu/xenial, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64}
36
- {distro: ubuntu, version: "16.04", pkgclouddistro: ubuntu/xenial, format: deb, base_image: ubuntu, platform: linux/i386, arch: i386}
37
- {distro: ubuntu, version: "18.04", pkgclouddistro: ubuntu/bionic, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64}
@@ -53,14 +55,14 @@ jobs:
55
uses: actions/checkout@v2
56
with:
57
fetch-depth: 0 # We need full history for versioning
56
- submodules: true
58
+ submodules: recursive
59
- name: Checkout Tag # Otherwise check out the tag that triggered this.
60
if: github.event_name == 'workflow_dispatch'
61
uses: actions/checkout@v2
62
with:
63
ref: ${{ github.event.ref }}
64
fetch-depth: 0 # We need full history for versioning
63
- submodules: true
65
+ submodules: recursive
66
- name: Check Base Branch
67
run: |
68
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
@@ -89,32 +91,27 @@ jobs:
91
- name: Setup QEMU
92
if: matrix.platform != 'linux/amd64'
93
uses: docker/setup-qemu-action@v1
92
- - name: Setup Buildx
93
- uses: docker/setup-buildx-action@v1
94
- name: Prepare Docker Environment
95
shell: bash
96
run: |
97
echo '{"cgroup-parent": "/actions_job", "experimental": true}' | sudo tee /etc/docker/daemon.json 2>/dev/null
98
sudo service docker restart
99
+ - name: Set Base Image Version
100
+ shell: bash
101
+ run: |
102
+ if [ -z "${{ matrix.alias }}" ] ; then
103
+ echo "version=${{ matrix.version }}" >> $GITHUB_ENV
104
+ else
105
+ echo "version=${{ matrix.alias }}" >> $GITHUB_ENV
106
+ fi
107
- name: Build Packages
100
- uses: docker/build-push-action@v2
101
- with:
102
- platforms: ${{ matrix.platform }}
103
- file: packaging/Dockerfile.packager
104
- tags: local/package-builder:${{ matrix.distro}}${{ matrix.version }}
105
- push: false
106
- load: true
107
- build-args: |
108
- ARCH=${{ matrix.arch }}
109
- DISTRO=${{ matrix.distro }}
110
- TEST_BASE=${{ matrix.base_image }}
111
- DISTRO_VERSION=${{ matrix.version }}
112
- PKG_VERSION=${{ env.pkg_version }}
113
- - name: Extract Packages
108
shell: bash
109
run: |
116
- mkdir -p artifacts
117
- docker run -e DO_NOT_TRACK=1 --platform ${{ matrix.platform }} -v $PWD/artifacts:/artifacts local/package-builder:${{ matrix.distro }}${{ matrix.version }}
110
+ docker run -e DO_NOT_TRACK=1 -e VERSION=${{ env.pkg_version }} --platform=${{ matrix.platform }} -v $PWD:/netdata netdata/package-builders:${{ matrix.distro }}${{ matrix.version }}
111
+ - name: Test Packages
112
+ shell: bash
113
+ run: |
114
+ docker run -e DO_NOT_TRACK=1 -e DISTRO=${{ matrix.distro }} -e VERSION=${{ env.pkg_version }} -e DISTRO_VERSION=${{ env.version }} --platform=${{ matrix.platform }} -v $PWD:/netdata ${{ matrix.base_image }}:${{ env.version }} /netdata/.github/scripts/pkg-test.sh
115
- name: Upload
116
if: github.event_name == 'workflow_dispatch'
117
shell: bash
.github/workflows/repoconfig-packages.yml
+1
@@ -18,6 +18,7 @@ jobs:
18
include:
19
- {distro: debian, version: "9", pkgclouddistro: debian/stretch, format: deb, base_image: debian, platform: linux/amd64, arch: amd64}
20
- {distro: debian, version: "10", pkgclouddistro: debian/buster, format: deb, base_image: debian, platform: linux/amd64, arch: amd64}
21
+ - {distro: debian, version: "11", pkgclouddistro: debian/buster, format: deb, base_image: debian, platform: linux/amd64, arch: amd64}
22
- {distro: ubuntu, version: "16.04", pkgclouddistro: ubuntu/xenial, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64}
23
- {distro: ubuntu, version: "18.04", pkgclouddistro: ubuntu/bionic, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64}
24
- {distro: ubuntu, version: "20.04", pkgclouddistro: ubuntu/focal, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64}
.github/workflows/updater.yml
+3
@@ -27,6 +27,7 @@ jobs:
27
- 'centos:8'
28
- 'debian:9'
29
- 'debian:10'
30
+ - 'debian:bullseye' # 11
31
- 'fedora:33'
32
- 'fedora:34'
33
- 'ubuntu:16.04'
@@ -44,6 +45,8 @@ jobs:
45
pre: 'apt-get update'
46
- distro: 'debian:10'
47
pre: 'apt-get update'
48
+ - distro: 'debian:bullseye' # 11
49
+ pre: 'apt-get update'
50
- distro: 'ubuntu:16.04'
51
pre: 'apt-get update'
52
- distro: 'ubuntu:18.04'
contrib/debian/control
+1
-2
@@ -1,7 +1,6 @@
1
Source: netdata
2
-Build-Depends: debhelper (>= 9),
2
+Build-Depends: debhelper (>= 9.20160709),
3
dh-autoreconf,
4
- dh-systemd (>= 1.5),
4
dpkg-dev (>= 1.13.19),
5
zlib1g-dev,
6
uuid-dev,
contrib/debian/control.xenial
new
+62
@@ -0,0 +1,62 @@
1
+Source: netdata
2
+Build-Depends: debhelper (>= 9),
3
+ dh-autoreconf,
4
+ dh-systemd (>= 1.5),
5
+ dpkg-dev (>= 1.13.19),
6
+ zlib1g-dev,
7
+ uuid-dev,
8
+ libelf-dev,
9
+ libuv1-dev,
10
+ liblz4-dev,
11
+ libjudy-dev,
12
+ libssl-dev,
13
+ libmnl-dev,
14
+ libjson-c-dev,
15
+ libcups2-dev,
16
+ libipmimonitoring-dev,
17
+ libnetfilter-acct-dev,
18
+ libsnappy-dev,
19
+ libprotobuf-dev,
20
+ libprotoc-dev,
21
+ cmake,
22
+ autogen,
23
+ autoconf,
24
+ automake,
25
+ pkg-config,
26
+ curl,
27
+ protobuf-compiler
28
+Section: net
29
+Priority: optional
30
+Maintainer: Netdata Builder <bot@netdata.cloud>
31
+Standards-Version: 3.9.6
32
+Homepage: https://netdata.cloud
33
+
34
+Package: netdata
35
+Architecture: any
36
+Depends: adduser,
37
+ libcap2-bin (>= 1:2.0),
38
+ lsb-base (>= 3.1-23.2),
39
+ openssl,
40
+ ${misc:Depends},
41
+ ${shlibs:Depends}
42
+Pre-Depends: dpkg (>= 1.17.14)
43
+Description: real-time charts for system monitoring
44
+ Netdata is a daemon that collects data in realtime (per second)
45
+ and presents a web site to view and analyze them. The presentation
46
+ is also real-time and full of interactive charts that precisely
47
+ render all collected values.
48
+
49
+Package: netdata-plugin-cups
50
+Architecture: any
51
+Depends: cups,
52
+ netdata (>= ${source:Version})
53
+Description: The Common Unix Printing System plugin for metrics collection from cupsd
54
+
55
+Package: netdata-plugin-freeipmi
56
+Architecture: any
57
+Depends: freeipmi,
58
+ netdata (= ${source:Version})
59
+Description: FreeIPMI - The Intelligent Platform Management System.
60
+ The IPMI specification defines a set of interfaces for platform management.
61
+ It is implemented by a number vendors for system management. The features of IPMI that most users will be interested in
62
+ are sensor monitoring, system event monitoring, power control, and serial-over-LAN (SOL).
packaging/Dockerfile.packager
deleted
-45
@@ -1,45 +0,0 @@
1
-ARG ARCH=amd64
2
-ARG DISTRO=debian
3
-ARG TEST_BASE=debian
4
-ARG DISTRO_VERSION=10
5
-ARG PKG_VERSION=0.1
6
-
7
-FROM netdata/package-builders:${DISTRO}${DISTRO_VERSION} AS build
8
-
9
-ARG ARCH
10
-ARG DISTRO
11
-ARG DISTRO_VERSION
12
-ARG PKG_VERSION
13
-
14
-ENV ARCH=$ARCH
15
-ENV DISTRO=$DISTRO
16
-ENV DISTRO_VERSION=$DISTRO_VERSION
17
-ENV VERSION=$PKG_VERSION
18
-ENV DO_NOT_TRACK=1
19
-
20
-WORKDIR /netdata
21
-COPY . .
22
-
23
-RUN /build.sh
24
-
25
-FROM ${TEST_BASE}:${DISTRO_VERSION} AS runtime
26
-
27
-ARG ARCH
28
-ARG DISTRO
29
-ARG DISTRO_VERSION
30
-ARG PKG_VERSION
31
-
32
-ENV ARCH=$ARCH
33
-ENV DISTRO=$DISTRO
34
-ENV DISTRO_VERSION=$DISTRO_VERSION
35
-ENV VERSION=$PKG_VERSION
36
-ENV DO_NOT_TRACK=1
37
-
38
-COPY ./packaging/scripts/install.sh /install.sh
39
-COPY ./packaging/scripts/test.sh /test.sh
40
-
41
-COPY --from=build /netdata/artifacts /packages
42
-
43
-RUN /install.sh
44
-
45
-CMD ["/test.sh"]
packaging/scripts/test.sh
deleted
-52
@@ -1,52 +0,0 @@
1
-#!/bin/sh
2
-
3
-dump_log() {
4
- cat ./netdata.log
5
-}
6
-
7
-trap dump_log EXIT
8
-
9
-wait_for() {
10
- host="${1}"
11
- port="${2}"
12
- name="${3}"
13
- timeout="30"
14
-
15
- if command -v nc > /dev/null ; then
16
- netcat="nc"
17
- elif command -v netcat > /dev/null ; then
18
- netcat="netcat"
19
- else
20
- printf "Unable to find a usable netcat command.\n"
21
- return 1
22
- fi
23
-
24
- printf "Waiting for %s on %s:%s ... " "${name}" "${host}" "${port}"
25
-
26
- sleep 30
27
-
28
- i=0
29
- while ! ${netcat} -z "${host}" "${port}"; do
30
- sleep 1
31
- if [ "$i" -gt "$timeout" ]; then
32
- printf "Timed out!\n"
33
- return 1
34
- fi
35
- i="$((i + 1))"
36
- done
37
- printf "OK\n"
38
-}
39
-
40
-/usr/sbin/netdata -D > ./netdata.log 2>&1 &
41
-
42
-wait_for localhost 19999 netdata || exit 1
43
-
44
-curl -sS http://127.0.0.1:19999/api/v1/info > ./response || exit 1
45
-
46
-cat ./response
47
-
48
-jq '.version' ./response || exit 1
49
-
50
-trap - EXIT
51
-
52
-cp -a /packages/* /artifacts