diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-04-14 18:12:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-04-14 18:12:10 +0000 |
commit | b5321aff06d6ea8d730d62aec2ffd8e9271c1ffc (patch) | |
tree | 36c41e35994786456154f9d3bf88c324763aeea4 /.github | |
parent | Adding upstream version 1.33.1. (diff) | |
download | netdata-b5321aff06d6ea8d730d62aec2ffd8e9271c1ffc.tar.xz netdata-b5321aff06d6ea8d730d62aec2ffd8e9271c1ffc.zip |
Adding upstream version 1.34.0.upstream/1.34.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
23 files changed, 1396 insertions, 377 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9aae48d5..fb371e4f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,63 +5,55 @@ * @Ferroin # Ownership by directory structure -.travis/ @Ferroin @iigorkarpov @maneamarius @kaskavel @vkalintiris -.github/ @Ferroin @iigorkarpov @maneamarius @kaskavel @vkalintiris +.travis/ @Ferroin @iigorkarpov @maneamarius +.github/ @Ferroin @iigorkarpov @maneamarius aclk/ @stelfrag @underhood -backends/ @thiagoftsm @vlvkobal -backends/graphite/ @thiagoftsm @vlvkobal -backends/json/ @thiagoftsm @vlvkobal -backends/opentsdb/ @thiagoftsm @vlvkobal -backends/prometheus/ @vlvkobal @thiagoftsm build/ @Ferroin @iigorkarpov @maneamarius -contrib/debian @Ferroin @iigorkarpov @maneamarius @vkalintiris -collectors/ @vlvkobal -collectors/charts.d.plugin/ @ilyam8 @Ferroin -collectors/freebsd.plugin/ @vlvkobal @thiagoftsm +contrib/debian @Ferroin @iigorkarpov @maneamarius +collectors/ @vlvkobal @surajnpn collectors/ebpf.plugin/ @thiagoftsm @vlvkobal -collectors/macos.plugin/ @vlvkobal @thiagoftsm +collectors/charts.d.plugin/ @ilyam8 @surajnpn @Ferroin +collectors/freebsd.plugin/ @vlvkobal @thiagoftsm @surajnpn +collectors/macos.plugin/ @vlvkobal @thiagoftsm @surajnpn collectors/node.d.plugin/ @jacekkolasa -collectors/node.d.plugin/fronius/ @ccremer collectors/node.d.plugin/snmp/ @jacekkolasa -collectors/node.d.plugin/stiebeleltron/ @ccremer collectors/python.d.plugin/ @ilyam8 collectors/cups.plugin/ @simonnagl @vlvkobal @thiagoftsm exporting/ @vlvkobal @thiagoftsm -daemon/ @thiagoftsm +daemon/ @thiagoftsm @vkalintiris database/ @thiagoftsm @vkalintiris docs/ @DShreve2 @kickoke health/ @thiagoftsm @vlvkobal @vkalintiris health/health.d/ @thiagoftsm @vlvkobal health/notifications/ @Ferroin @thiagoftsm ml/ @andrewm4894 @vkalintiris -libnetdata/ @thiagofsm -packaging/ @Ferroin @iigorkarpov @maneamarius @vkalintiris +libnetdata/ @thiagoftsm @vkalintiris +packaging/ @Ferroin @iigorkarpov @maneamarius registry/ @jacekkolasa streaming/ @thiagoftsm @vlvkobal -system/ @Ferroin @iigorkarpov @maneamarius @vkalintiris -tests/ @Ferroin @iigorkarpov @maneamarius @kaskavel @vkalintiris +system/ @Ferroin @iigorkarpov @maneamarius +tests/ @Ferroin @iigorkarpov @maneamarius @vkalintiris web/ @thiagoftsm @vlvkobal @vkalintiris web/gui/ @jacekkolasa # Ownership by filetype (overwrites ownership by directory) -*.am @Ferroin @iigorkarpov @maneamarius @vkalintiris +*.am @Ferroin @iigorkarpov @maneamarius *.md @DShreve2 @kickoke -Dockerfile* @Ferroin @iigorkarpov @maneamarius @vkalintiris +Dockerfile* @Ferroin @iigorkarpov @maneamarius # Ownership of specific files .gitignore @Ferroin @iigorkarpov @maneamarius @vkalintiris -.travis.yml @Ferroin @iigorkarpov @maneamarius @kaskavel @vkalintiris -.lgtm.yml @Ferroin @iigorkarpov @maneamarius @vkalintiris -.eslintrc @Ferroin @iigorkarpov @maneamarius @vkalintiris -.eslintignore @Ferroin @iigorkarpov @maneamarius @vkalintiris -.csslintrc @Ferroin @iigorkarpov @maneamarius @vkalintiris -.codeclimate.yml @Ferroin @iigorkarpov @maneamarius @vkalintiris -.codacy.yml @Ferroin @iigorkarpov @maneamarius @vkalintiris -.yamllint.yml @Ferroin @iigorkarpov @maneamarius @vkalintiris -netdata.spec.in @Ferroin @iigorkarpov @maneamarius @vkalintiris -netdata-installer.sh @Ferroin @iigorkarpov @maneamarius @vkalintiris -package.json @jacekkolasa @Ferroin @iigorkarpov @maneamarius @vkalintiris -packaging/version @netdatabot @Ferroin @iigorkarpov @maneamarius @vkalintiris +.travis.yml @Ferroin @iigorkarpov @maneamarius +.lgtm.yml @Ferroin @iigorkarpov @maneamarius +.eslintrc @Ferroin @iigorkarpov @maneamarius +.eslintignore @Ferroin @iigorkarpov @maneamarius +.csslintrc @Ferroin @iigorkarpov @maneamarius +.codeclimate.yml @Ferroin @iigorkarpov @maneamarius +.codacy.yml @Ferroin @iigorkarpov @maneamarius +.yamllint.yml @Ferroin @iigorkarpov @maneamarius +netdata.spec.in @Ferroin @iigorkarpov @maneamarius +netdata-installer.sh @Ferroin @iigorkarpov @maneamarius +packaging/version @netdatabot @Ferroin @iigorkarpov @maneamarius LICENSE.md @DShreve2 @Ferroin @vkalintiris -CHANGELOG.md @netdatabot @Ferroin @iigorkarpov @maneamarius @vkalintiris +CHANGELOG.md @netdatabot @Ferroin @iigorkarpov @maneamarius diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 74f9918e..829d8e64 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,23 +1,27 @@ +##### Summary <!-- Describe the change in summary section, including rationale and design decisions. Include "Fixes #nnn" if you are fixing an existing issue. - -In "Test Plan" provide enough detail on how you plan to test this PR so that a reviewer can validate your tests. If our CI covers sufficient tests, then state which tests cover the change. - -If you have more information you want to add, write them in "Additional -Information" section. This is usually used to help others understand your -motivation behind this change. A step-by-step reproduction of the problem is -helpful if there is no related issue. --> -##### Summary - ##### Test Plan -<!--- -Provide enough detail so that your reviewer can understand which test-cases you -have covered, and recreate them if necessary. If sufficient tests are covered -by our CI, then state which tests cover the change. +<!-- +Provide enough detail so that your reviewer can understand which test cases you +have covered, and recreate them if necessary. If our CI covers sufficient tests, then state which tests cover the change. --> ##### Additional Information +<!-- This is usually used to help others understand your +motivation behind this change. A step-by-step reproduction of the problem is +helpful if there is no related issue. --> + +<details> <summary>For users: How does this change affect me?</summary> + <!-- +Describe the PR affects users: +- Which area of Netdata is affected by the change? +- Can they see the change or is it an under the hood? If they can see it, where? +- How is the user impacted by the change? +- What are there any benefits of the change? +--> +</details> diff --git a/.github/data/build-matrix.json b/.github/data/build-matrix.json deleted file mode 100644 index 6ceb9fa5..00000000 --- a/.github/data/build-matrix.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "include": [ - { - "distro": "alpine:edge", - "artifact_key": "alpine-edge", - "pre": "apk add -U bash", - "rmjsonc": "apk del json-c-dev" - }, - { - "distro": "alpine:3.14", - "artifact_key": "alpine-3.14", - "pre": "apk add -U bash", - "rmjsonc": "apk del json-c-dev" - }, - { - "distro": "alpine:3.13", - "artifact_key": "alpine-3.13", - "pre": "apk add -U bash", - "rmjsonc": "apk del json-c-dev" - }, - { - "distro": "alpine:3.12", - "artifact_key": "alpine-3.12", - "pre": "apk add -U bash", - "rmjsonc": "apk del json-c-dev" - }, - { - "distro": "archlinux:latest", - "artifact_key": "archlinux", - "pre": "pacman --noconfirm -Syu && pacman --noconfirm -Sy grep libffi" - }, - { - "distro": "centos:7", - "artifact_key": "centos7" - }, - { - "distro": "rockylinux/rockylinux:8", - "artifact_key": "rockylinux8", - "rmjsonc": "dnf remove -y json-c-devel" - }, - { - "distro": "debian:11", - "artifact_key": "debian11", - "pre": "apt-get update", - "rmjsonc": "apt-get remove -y libjson-c-dev" - }, - { - "distro": "debian:10", - "artifact_key": "debian10", - "pre": "apt-get update", - "rmjsonc": "apt-get remove -y libjson-c-dev" - }, - { - "distro": "debian:9", - "artifact_key": "debian9", - "pre": "apt-get update", - "rmjsonc": "apt-get remove -y libjson-c-dev" - }, - { - "distro": "fedora:35", - "artifact_key": "fedora35", - "rmjsonc": "dnf remove -y json-c-devel" - }, - { - "distro": "fedora:34", - "artifact_key": "fedora34", - "rmjsonc": "dnf remove -y json-c-devel" - }, - { - "distro": "opensuse/leap:15.3", - "artifact_key": "opensuse15.3", - "rmjsonc": "zypper rm -y libjson-c-devel" - }, - { - "distro": "oraclelinux:8", - "artifact_key": "oraclelinux8", - "rmjsonc": "dnf remove -y json-c-devel" - }, - { - "distro": "ubuntu:21.10", - "artifact_key": "ubuntu21.10", - "pre": "rm -f /etc/apt/apt.conf.d/docker && apt-get update", - "rmjsonc": "apt-get remove -y libjson-c-dev" - }, - { - "distro": "ubuntu:20.04", - "artifact_key": "ubuntu20.04", - "pre": "apt-get update", - "rmjsonc": "apt-get remove -y libjson-c-dev" - }, - { - "distro": "ubuntu:18.04", - "artifact_key": "ubuntu18.04", - "pre": "apt-get update", - "rmjsonc": "apt-get remove -y libjson-c-dev" - } - ] -} diff --git a/.github/data/distros.yml b/.github/data/distros.yml new file mode 100644 index 00000000..8d58f4d2 --- /dev/null +++ b/.github/data/distros.yml @@ -0,0 +1,155 @@ +# This defines the full set of distros we run CI on. +--- +platform_map: # map packaging architectures to docker platforms + i386: linux/i386 + amd64: linux/amd64 + armhf: linux/arm/v7 + arm64: linux/arm64/v8 +include: + - &alpine + distro: alpine + version: edge + env_prep: | + apk add -U bash + jsonc_removal: | + apk del json-c-dev + - <<: *alpine + version: "3.15" + - <<: *alpine + version: "3.14" + - <<: *alpine + version: "3.13" + - <<: *alpine + version: "3.12" + + - distro: archlinux + version: latest + env_prep: | + pacman --noconfirm -Syu && pacman --noconfirm -Sy grep libffi + + - distro: rockylinux + version: "8" + base_image: rockylinux/rockylinux + jsonc_removal: | + dnf remove -y json-c-devel + packages: + type: rpm + repo_distro: el/8 + arches: + - amd64 + - arm64 + - distro: centos + version: "7" + packages: + type: rpm + repo_distro: el/7 + arches: + - amd64 + + - &debian + distro: debian + version: "11" + env_prep: | + apt-get update + jsonc_removal: | + apt-get purge -y libjson-c-dev + packages: &debian_packages + type: deb + repo_distro: debian/bullseye + arches: + - i386 + - amd64 + - armhf + - arm64 + - <<: *debian + version: "10" + packages: + <<: *debian_packages + repo_distro: debian/buster + - <<: *debian + version: "9" + packages: + <<: *debian_packages + repo_distro: debian/stretch + + - &fedora + distro: fedora + version: "36" + jsonc_removal: | + dnf remove -y json-c-devel + packages: &fedora_packages + type: rpm + repo_distro: fedora/36 + arches: + - amd64 + - armhf + - arm64 + - <<: *fedora + version: "35" + packages: + <<: *fedora_packages + repo_distro: fedora/35 + - <<: *fedora + version: "34" + packages: + <<: *fedora_packages + repo_distro: fedora/34 + + - &opensuse + distro: opensuse + version: "15.3" + base_image: opensuse/leap + jsonc_removal: | + zypper rm -y libjson-c-devel + packages: + type: rpm + repo_distro: opensuse/15.3 + arches: + - amd64 + - arm64 + + - distro: oraclelinux + version: "8" + jsonc_removal: | + dnf remove -y json-c-devel + packages: + type: rpm + repo_distro: ol/8 + arches: + - amd64 + - arm64 + + - &ubuntu + distro: ubuntu + version: "22.04" + env_prep: | + rm -f /etc/apt/apt.conf.d/docker && apt-get update + jsonc_removal: | + apt-get remove -y libjson-c-dev + packages: &ubuntu_packages + type: deb + repo_distro: ubuntu/jammy + arches: + - amd64 + - armhf + - arm64 + - <<: *ubuntu + version: "21.10" + packages: + <<: *ubuntu_packages + repo_distro: ubuntu/impish + - <<: *ubuntu + version: "20.04" + packages: + <<: *ubuntu_packages + repo_distro: ubuntu/focal + - <<: *ubuntu + version: "18.04" + packages: + <<: *ubuntu_packages + repo_distro: ubuntu/bionic + arches: + - i386 + - amd64 + - armhf + - arm64 diff --git a/.github/dockerfiles/Dockerfile.build_test b/.github/dockerfiles/Dockerfile.build_test index 50cfdee0..c275d61d 100644 --- a/.github/dockerfiles/Dockerfile.build_test +++ b/.github/dockerfiles/Dockerfile.build_test @@ -6,7 +6,7 @@ ARG PRE ENV PRE=${PRE} ARG RMJSONC ENV RMJSONC=${RMJSONC} -ENV DO_NOT_TRACK=1 +ENV DISABLE_TELEMETRY=1 ENV GITHUB_ACTIONS=true RUN echo "${PRE}" > /prep-cmd.sh && \ diff --git a/.github/labeler.yml b/.github/labeler.yml index 4c0d857d..d576b937 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -15,10 +15,6 @@ ACLK: - aclk/**/* - mqtt_websockets -area/backends: - - backends/* - - backends/**/* - area/claim: - claim/* @@ -42,10 +38,6 @@ area/ci: - .github/* - .github/**/* -area/collectors: - - collectors/* - - collectors/**/* - area/daemon: - daemon/* - daemon/**/* @@ -60,16 +52,106 @@ area/docs: - diagrams/* - diagrams/**/* -area/external/python: - - collectors/python.d.plugin/* - - collectors/python.d.plugin/**/* +# -----------------collectors---------------------- + +area/collectors: + - collectors/* + - collectors/**/* + +collectors/plugins.d: + - collectors/plugins.d/* + - collectors/plugins.d/**/* + +collectors/apps: + - collectors/apps.plugin/* + - collectors/apps.plugin/**/* + +collectors/cgroups: + - collectors/cgroups.plugin/* + - collectors/cgroups.plugin/**/* -area/external: +collectors/charts.d: - collectors/charts.d.plugin/* - collectors/charts.d.plugin/**/* + +collectors/cups: + - collectors/cups.plugin/* + - collectors/cups.plugin/**/* + +collectors/diskspace: + - collectors/diskspace.plugin/* + - collectors/diskspace.plugin/**/* + +collectors/ebpf: + - collectors/ebpf.plugin/* + - collectors/ebpf.plugin/**/* + +collectors/fping: + - collectors/fping.plugin/* + - collectors/fping.plugin/**/* + +collectors/freebsd: + - collectors/freebsd.plugin/* + - collectors/freebsd.plugin/**/* + +collectors/freeipmi: + - collectors/freeipmi.plugin/* + - collectors/freeipmi.plugin/**/* + +collectors/idlejitter: + - collectors/idlejitter.plugin/* + - collectors/idlejitter.plugin/**/* + +collectors/ioping: + - collectors/ioping.plugin/* + - collectors/ioping.plugin/**/* + +collectors/macos: + - collectors/macos.plugin/* + - collectors/macos.plugin/**/* + +collectors/nfacct: + - collectors/nfacct.plugin/* + - collectors/nfacct.plugin/**/* + +collectors/node.d: - collectors/node.d.plugin/* - collectors/node.d.plugin/**/* +collectors/perf: + - collectors/perf.plugin/* + - collectors/perf.plugin/**/* + +collectors/proc: + - collectors/proc.plugin/* + - collectors/proc.plugin/**/* + +collectors/python.d: + - collectors/python.d.plugin/* + - collectors/python.d.plugin/**/* + +collectors/slabinfo: + - collectors/slabinfo.plugin/* + - collectors/slabinfo.plugin/**/* + +collectors/statsd: + - collectors/statsd.plugin/* + - collectors/statsd.plugin/**/* + +collectors/tc: + - collectors/tc.plugin/* + - collectors/tc.plugin/**/* + +collectors/timex: + - collectors/timex.plugin/* + - collectors/timex.plugin/**/* + +collectors/xenstat: + - collectors/xenstat.plugin/* + - collectors/xenstat.plugin/**/* + +# ----------------/collectors---------------------- + area/health: - health/* - health/**/* diff --git a/.github/scripts/docker-test.sh b/.github/scripts/docker-test.sh index 795711b1..22821d17 100755 --- a/.github/scripts/docker-test.sh +++ b/.github/scripts/docker-test.sh @@ -33,7 +33,9 @@ wait_for() { printf "OK\n" } -apt-get update && apt-get upgrade -y && apt get install -y netcat +if [ -z "$(command -v nc 2>/dev/null)" ] && [ -z "$(command -v netcat 2>/dev/null)" ]; then + sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -y netcat +fi docker run -d --name=netdata \ -p 19999:19999 \ diff --git a/.github/scripts/prepare-release-base.sh b/.github/scripts/prepare-release-base.sh new file mode 100755 index 00000000..cb6be8e7 --- /dev/null +++ b/.github/scripts/prepare-release-base.sh @@ -0,0 +1,177 @@ +#!/bin/sh + +set -e + +REPO="${1}" +EVENT_NAME="${2}" +EVENT_TYPE="${3}" +EVENT_VERSION="${4}" + +############################################################## +# Version validation functions + +check_version_format() { + if ! echo "${EVENT_VERSION}" | grep -qE '^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$'; then + echo "::error::The supplied version (${EVENT_VERSION}) is not a valid version string." + return 1 + fi +} + +patch_is_zero() { + if ! echo "${EVENT_VERSION}" | grep -qE '^v[[:digit:]]+\.[[:digit:]]+\.0$'; then + echo "::error::The patch number for a ${EVENT_TYPE} build must be 0." + return 1 + fi +} + +minor_is_zero() { + if ! echo "${EVENT_VERSION}" | grep -qE '^v[[:digit:]]+\.0'; then + echo "::error::The minor version number for a ${EVENT_TYPE} build must be 0." + return 1 + fi +} + +major_matches() { + current_major="$(cut -f 1 -d '-' packaging/version | cut -f 1 -d '.' | cut -f 2 -d 'v')" + target_major="$(echo "${EVENT_VERSION}" | cut -f 1 -d '.' | cut -f 2 -d 'v')" + + if [ "${target_major}" != "${current_major}" ]; then + echo "::error::Major version mismatch, expected ${current_major} but got ${target_major}." + return 1 + fi +} + +minor_matches() { + current_minor="$(cut -f 1 -d '-' packaging/version | cut -f 2 -d '.')" + target_minor="$(echo "${EVENT_VERSION}" | cut -f 2 -d '.')" + + if [ "${target_minor}" != "${current_minor}" ]; then + echo "::error::Minor version mismatch, expected ${current_minor} but got ${target_minor}." + return 1 + fi +} + +check_for_existing_tag() { + if git tag | grep -qE "^${EVENT_VERSION}$"; then + echo "::error::A tag for version ${EVENT_VERSION} already exists." + return 1 + fi +} + +check_newer_major_version() { + current="$(cut -f 1 -d '-' packaging/version | cut -f 1 -d '.' | cut -f 2 -d 'v')" + target="$(echo "${EVENT_VERSION}" | cut -f 1 -d '.' | cut -f 2 -d 'v')" + + if [ "${target}" -le "${current}" ]; then + echo "::error::Version ${EVENT_VERSION} is not newer than the current version." + return 1 + fi +} + +check_newer_minor_version() { + current="$(cut -f 1 -d '-' packaging/version | cut -f 2 -d '.')" + target="$(echo "${EVENT_VERSION}" | cut -f 2 -d '.')" + + if [ "${target}" -le "${current}" ]; then + echo "::error::Version ${EVENT_VERSION} is not newer than the current version." + return 1 + fi +} + +check_newer_patch_version() { + current="$(cut -f 1 -d '-' packaging/version | cut -f 3 -d '.')" + target="$(echo "${EVENT_VERSION}" | cut -f 3 -d '.')" + + if [ "${target}" -le "${current}" ]; then + echo "::error::Version ${EVENT_VERSION} is not newer than the current version." + return 1 + fi +} + +############################################################## +# Core logic + +git config user.name "netdatabot" +git config user.email "bot@netdata.cloud" + +if [ "${REPO}" != "netdata/netdata" ]; then + echo "::notice::Not running in the netdata/netdata repository, not queueing a release build." + echo "::set-output name=run::false" +elif [ "${EVENT_NAME}" = 'schedule' ] || [ "${EVENT_TYPE}" = 'nightly' ]; then + echo "::notice::Preparing a nightly release build." + LAST_TAG=$(git describe --abbrev=0 --tags) + COMMITS_SINCE_RELEASE=$(git rev-list "${LAST_TAG}"..HEAD --count) + NEW_VERSION="${LAST_TAG}-$((COMMITS_SINCE_RELEASE + 1))-nightly" + LAST_VERSION_COMMIT="$(git rev-list -1 HEAD packaging/version)" + HEAD_COMMIT="$(git rev-parse HEAD)" + if [ "${EVENT_NAME}" = 'schedule' ] && [ "${LAST_VERSION_COMMIT}" = "${HEAD_COMMIT}" ] && grep -qE '.*-nightly$' packaging/version; then + echo "::notice::No commits since last nightly build, not publishing a new nightly build." + echo "::set-output name=run::false" + else + echo "${NEW_VERSION}" > packaging/version || exit 1 + echo "::set-output name=run::true" + echo "::set-output name=message::Update changelog and version for nightly build: ${NEW_VERSION}." + echo "::set-output name=ref::master" + echo "::set-output name=type::nightly" + echo "::set-output name=branch::master" + echo "::set-output name=version::nightly" + fi +elif [ "${EVENT_TYPE}" = 'patch' ] && [ "${EVENT_VERSION}" != "nightly" ]; then + echo "::notice::Preparing a patch release build." + check_version_format || exit 1 + check_for_existing_tag || exit 1 + branch_name="$(echo "${EVENT_VERSION}" | cut -f 1-2 -d '.')" + if [ -z "$(git branch --list "${branch_name}")" ]; then + echo "::error::Could not find a branch for the ${branch_name}.x release series." + exit 1 + fi + git checkout "${branch_name}" + minor_matches || exit 1 + major_matches || exit 1 + check_newer_patch_number || exit 1 + echo "${EVENT_VERSION}" > packaging/version || exit 1 + echo "::set-output name=run::true" + echo "::set-output name=message::Patch release ${EVENT_VERSION}." + echo "::set-output name=ref::${EVENT_VERSION}" + echo "::set-output name=type::release" + echo "::set-output name=branch::${branch_name}" + echo "::set-output name=version::$(tr -d 'v' < packaging/version)" +elif [ "${EVENT_TYPE}" = 'minor' ] && [ "${EVENT_VERSION}" != "nightly" ]; then + echo "::notice::Preparing a minor release build." + check_version_format || exit 1 + patch_is_zero || exit 1 + major_matches || exit 1 + check_newer_minor_version || exit 1 + check_for_existing_tag || exit 1 + branch_name="$(echo "${EVENT_VERSION}" | cut -f 1-2 -d '.')" + if [ -n "$(git branch --list "${branch_name}")" ]; then + echo "::error::A branch named ${branch_name} already exists in the repository." + exit 1 + fi + git branch "${branch_name}" + git checkout "${branch_name}" + echo "${EVENT_VERSION}" > packaging/version || exit 1 + echo "::set-output name=run::true" + echo "::set-output name=message::Minor release ${EVENT_VERSION}." + echo "::set-output name=ref::${EVENT_VERSION}" + echo "::set-output name=type::release" + echo "::set-output name=branch::${branch_name}" + echo "::set-output name=version::$(tr -d 'v' < packaging/version)" +elif [ "${EVENT_TYPE}" = 'major' ] && [ "${EVENT_VERSION}" != "nightly" ]; then + echo "::notice::Preparing a major release build." + check_version_format || exit 1 + minor_is_zero || exit 1 + patch_is_zero || exit 1 + check_newer_major_version || exit 1 + check_for_existing_tag || exit 1 + echo "${EVENT_VERSION}" > packaging/version || exit 1 + echo "::set-output name=run::true" + echo "::set-output name=message::Major release ${EVENT_VERSION}" + echo "::set-output name=ref::${EVENT_VERSION}" + echo "::set-output name=type::release" + echo "::set-output name=branch::master" + echo "::set-output name=version::$(tr -d 'v' < packaging/version)" +else + echo '::error::Unrecognized release type or invalid version.' + exit 1 +fi diff --git a/.github/scripts/run_install_with_dist_file.sh b/.github/scripts/run_install_with_dist_file.sh index 18cf8092..83559f26 100755 --- a/.github/scripts/run_install_with_dist_file.sh +++ b/.github/scripts/run_install_with_dist_file.sh @@ -29,7 +29,7 @@ printf >&2 "Entering %s and starting docker run ..." "${distdir}" pushd "${distdir}" || exit 1 docker run \ - -e DO_NOT_TRACK=1 \ + -e DISABLE_TELEMETRY=1 \ -v "${PWD}:/netdata" \ -w /netdata \ "ubuntu:latest" \ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index abf08c2e..caa49e29 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ on: default: nightly required: true concurrency: # This keeps multiple instances of the job from running concurrently for the same ref and event type. - group: release-${{ github.ref }}-${{ github.event_name }} + group: build-${{ github.ref }}-${{ github.event_name }} cancel-in-progress: true jobs: build-dist: # Build the distribution tarball and store it as an artifact. @@ -27,11 +27,13 @@ jobs: distfile: ${{ steps.build.outputs.distfile }} steps: - name: Checkout - uses: actions/checkout@v2 + id: checkout + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: recursive - name: Mark Stable + id: channel if: github.event_name == 'workflow_dispatch' && github.event.inputs.type != 'nightly' run: | sed -i 's/^RELEASE_CHANNEL="nightly" *#/RELEASE_CHANNEL="stable" #/' netdata-installer.sh @@ -52,7 +54,8 @@ jobs: echo "::set-output name=distfile::$(find . -name 'netdata-*.tar.gz')" cp netdata-*.tar.gz artifacts/ - name: Store - uses: actions/upload-artifact@v2 + id: store + uses: actions/upload-artifact@v3 with: name: dist-tarball path: artifacts/*.tar.gz @@ -63,9 +66,14 @@ jobs: SLACK_COLOR: 'danger' SLACK_FOOTER: '' SLACK_ICON_EMOJI: ':github-actions:' - SLACK_TITLE: 'Distribution tarball build failed:' + SLACK_TITLE: 'Distribution tarball creation failed:' SLACK_USERNAME: 'GitHub Actions' - SLACK_MESSAGE: "Distribution tarball build failed." + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to create source tarball for distribution. + Checkout: ${{ steps.checkout.outcome }} + Mark stable: ${{ steps.channel.outcome }} + Build: ${{ steps.build.outcome }} + Store: ${{ steps.store.outcome }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} if: >- ${{ @@ -86,18 +94,22 @@ jobs: - 'ppc64le' steps: - name: Checkout - uses: actions/checkout@v2 + id: checkout + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: recursive - name: Mark Stable + id: channel if: github.event_name == 'workflow_dispatch' && github.event.inputs.type != 'nightly' run: | sed -i 's/^RELEASE_CHANNEL="nightly" *#/RELEASE_CHANNEL="stable" #/' netdata-installer.sh packaging/makeself/install-or-update.sh - name: Build + id: build run: .github/scripts/build-static.sh ${{ matrix.arch }} - name: Store - uses: actions/upload-artifact@v2 + id: store + uses: actions/upload-artifact@v3 with: name: static-archive path: artifacts/*.gz.run @@ -108,9 +120,14 @@ jobs: SLACK_COLOR: 'danger' SLACK_FOOTER: '' SLACK_ICON_EMOJI: ':github-actions:' - SLACK_TITLE: 'Static build for ${{ matrix.arch }} failed:' + SLACK_TITLE: 'Static build failed:' SLACK_USERNAME: 'GitHub Actions' - SLACK_MESSAGE: "Static build for ${{ matrix.arch }} failed." + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to create static installer archive for ${{ matrix.arch }}. + Checkout: ${{ steps.checkout.outcome }} + Mark stable: ${{ steps.channel.outcome }} + Build: ${{ steps.build.outcome }} + Store: ${{ steps.store.outcome }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} if: >- ${{ @@ -126,33 +143,112 @@ jobs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - name: Checkout - uses: actions/checkout@v2 + id: checkout + uses: actions/checkout@v3 - name: Prepare tools + id: prepare run: | - sudo apt-get update && sudo apt-get install -y jq + sudo apt-get update && sudo apt-get install -y python3-ruamel.yaml - name: Read build matrix id: set-matrix + shell: python3 {0} run: | - TASKS="$(jq -c . .github/data/build-matrix.json)" - echo "Generated Matrix: $TASKS" - echo "::set-output name=matrix::$TASKS" + from ruamel.yaml import YAML + import json + yaml = YAML(typ='safe') + with open('.github/data/distros.yml') as f: + data = yaml.load(f) + del data['platform_map'] + for i, v in enumerate(data['include']): + data['include'][i]['artifact_key'] = data['include'][i]['distro'] + str(data['include'][i]['version']).replace('.', '') + if 'packages' in data['include'][i]: + del data['include'][i]['packages'] + if 'base_image' in data['include'][i]: + data['include'][i]['distro'] = data['include'][i]['base_image'] + del data['include'][i]['base_image'] + data['include'][i]['distro'] = ':'.join([data['include'][i]['distro'], str(data['include'][i]['version'])]) + del data['include'][i]['version'] + matrix = json.dumps(data, sort_keys=True) + print('Generated Matrix: ' + matrix) + print('::set-output name=matrix::' + matrix) + - name: Failure Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_FOOTER: '' + SLACK_ICON_EMOJI: ':github-actions:' + SLACK_TITLE: 'Build matrix preparation failed:' + SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to prepare build matrix for build checks. + Checkout: ${{ steps.checkout.outcome }} + Prepare tools: ${{ steps.prepare.outcome }} + Read build matrix: ${{ steps.set-matrix.outcome }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: >- + ${{ + failure() + && startsWith(github.ref, 'refs/heads/master') + && github.event_name != 'pull_request' + }} prepare-test-images: # Prepare the test environments for our build checks. This also checks dependency handling code for each tested environment. name: Prepare Test Environments runs-on: ubuntu-latest needs: - matrix + env: + RETRY_DELAY: 300 strategy: # Unlike the actal build tests, this completes _very_ fast (average of about 3 minutes for each job), so we # just run everything in parallel instead lof limiting job concurrency. fail-fast: false matrix: ${{ fromJson(needs.matrix.outputs.matrix) }} steps: - - name: Git clone repository - uses: actions/checkout@v2 + - name: Checkout + id: checkout + uses: actions/checkout@v3 - name: Setup Buildx + id: buildx uses: docker/setup-buildx-action@v1 - name: Build test environment + id: build1 + uses: docker/build-push-action@v2 + continue-on-error: true # We retry 3 times at 5 minute intervals if there is a failure here. + with: + push: false + load: false + file: .github/dockerfiles/Dockerfile.build_test + build-args: | + BASE=${{ matrix.distro }} + PRE=${{ matrix.env_prep }} + RMJSONC=${{ matrix.jsonc_removal }} + outputs: type=oci,dest=/tmp/image.tar + tags: test:${{ matrix.artifact_key }} + - name: Retry delay + if: ${{ steps.build1.outcome }} == 'failure' + run: sleep "${RETRY_DELAY}" + - name: Build test environment (attempt 2) + if: ${{ steps.build1.outcome }} == 'failure' + id: build2 + uses: docker/build-push-action@v2 + continue-on-error: true # We retry 3 times at 5 minute intervals if there is a failure here. + with: + push: false + load: false + file: .github/dockerfiles/Dockerfile.build_test + build-args: | + BASE=${{ matrix.distro }} + PRE=${{ matrix.env_prep }} + RMJSONC=${{ matrix.jsonc_removal }} + outputs: type=oci,dest=/tmp/image.tar + tags: test:${{ matrix.artifact_key }} + - name: Retry delay + if: ${{ steps.build1.outcome }} == 'failure' && ${{ steps.build2.outcome }} == 'failure' + run: sleep "${RETRY_DELAY}" + - name: Build test environment (attempt 3) + if: ${{ steps.build1.outcome }} == 'failure' && ${{ steps.build2.outcome }} == 'failure' + id: build3 uses: docker/build-push-action@v2 with: push: false @@ -160,12 +256,13 @@ jobs: file: .github/dockerfiles/Dockerfile.build_test build-args: | BASE=${{ matrix.distro }} - PRE=${{ matrix.pre }} - RMJSONC=${{ matrix.rmjsonc }} + PRE=${{ matrix.env_prep }} + RMJSONC=${{ matrix.jsonc_removal }} outputs: type=oci,dest=/tmp/image.tar tags: test:${{ matrix.artifact_key }} - name: Upload image artifact - uses: actions/upload-artifact@v2 + id: upload + uses: actions/upload-artifact@v3 with: name: ${{ matrix.artifact_key }}-test-env path: /tmp/image.tar @@ -178,7 +275,14 @@ jobs: SLACK_ICON_EMOJI: ':github-actions:' SLACK_TITLE: 'Test environment preparation for ${{ matrix.distro }} failed:' SLACK_USERNAME: 'GitHub Actions' - SLACK_MESSAGE: "Test environment preparation for ${{ matrix.distro }} failed." + SLACK_MESSAGE: |- + ${{ github.repository }}: Test environment preparation for ${{ matrix.distro }} failed. + Checkout: ${{ steps.checkout.outcome }} + Set up Buildx: ${{ steps.buildx.outcome }} + Build test environment: ${{ steps.build1.outcome }} + Build test environment (attempt 2): ${{ steps.build2.outcome }} + Build test environment (attempt 3): ${{ steps.build3.outcome }} + Upload: ${{ steps.upload.outcome }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} if: >- ${{ @@ -198,12 +302,14 @@ jobs: max-parallel: 8 matrix: ${{ fromJson(needs.matrix.outputs.matrix) }} steps: - - name: Git clone repository - uses: actions/checkout@v2 + - name: Checkout + id: checkout + uses: actions/checkout@v3 with: submodules: recursive - name: Fetch test environment - uses: actions/download-artifact@v2 + id: fetch + uses: actions/download-artifact@v3 with: name: ${{ matrix.artifact_key }}-test-env - name: Load test environment @@ -212,19 +318,23 @@ jobs: docker load --input image.tar | tee image-info.txt echo "::set-output name=image::$(cut -d ':' -f 3 image-info.txt)" - name: Regular build on ${{ matrix.distro }} + id: build-basic run: | docker run --security-opt seccomp=unconfined -w /netdata sha256:${{ steps.load.outputs.image }} \ /bin/sh -c 'autoreconf -ivf && ./configure && make -j2' - name: netdata-installer on ${{ matrix.distro }}, disable cloud + id: build-no-cloud run: | docker run --security-opt seccomp=unconfined -w /netdata sha256:${{ steps.load.outputs.image }} \ /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --disable-cloud' - name: netdata-installer on ${{ matrix.distro }}, require cloud + id: build-cloud run: | docker run --security-opt seccomp=unconfined -w /netdata sha256:${{ steps.load.outputs.image }} \ /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --require-cloud' - name: netdata-installer on ${{ matrix.distro }}, require cloud, no JSON-C - if: matrix.rmjsonc != '' + id: build-no-jsonc + if: matrix.jsonc_removal != '' run: | docker run --security-opt seccomp=unconfined -w /netdata sha256:${{ steps.load.outputs.image }} \ /bin/sh -c '/rmjsonc.sh && ./netdata-installer.sh --dont-wait --dont-start-it --require-cloud' @@ -236,7 +346,15 @@ jobs: SLACK_ICON_EMOJI: ':github-actions:' SLACK_TITLE: 'Build tests for ${{ matrix.distro }} failed:' SLACK_USERNAME: 'GitHub Actions' - SLACK_MESSAGE: "Build tests for ${{ matrix.distro }} failed." + SLACK_MESSAGE: |- + ${{ github.repository }}: Build tests for ${{ matrix.distro }} failed. + Checkout: ${{ steps.checkout.outcome }} + Fetch test environment: ${{ steps.fetch.outcome }} + Load test environment: ${{ steps.load.outcome }} + Regular build: ${{ steps.build-basic.outcome }} + netdata-installer, disable cloud: ${{ steps.build-no-cloud.outcome }} + netdata-installer, require cloud: ${{ steps.build-cloud.outcome }} + netdata-installer, no JSON-C: ${{ steps.build-no-jsonc.outcome }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} if: >- ${{ @@ -265,13 +383,16 @@ jobs: - ${{ github.workspace }}:/usr/local/apache2/htdocs/ steps: - name: Checkout - uses: actions/checkout@v2 + id: checkout + uses: actions/checkout@v3 - name: Fetch dist tarball artifacts - uses: actions/download-artifact@v2 + id: fetch-tarball + uses: actions/download-artifact@v3 with: name: dist-tarball path: dist-tarball - name: Prepare artifact directory + id: prepare run: | mkdir -p artifacts || exit 1 echo "9999.0.0-0" > artifacts/latest-version.txt || exit 1 @@ -281,7 +402,8 @@ jobs: sha256sum -b ./* > "sha256sums.txt" || exit 1 cat sha256sums.txt - name: Fetch test environment - uses: actions/download-artifact@v2 + id: fetch-test-environment + uses: actions/download-artifact@v3 with: name: ${{ matrix.artifact_key }}-test-env - name: Load test environment @@ -290,8 +412,9 @@ jobs: docker load --input image.tar | tee image-info.txt echo "::set-output name=image::$(cut -d ':' -f 3 image-info.txt)" - name: Install netdata and run the updater on ${{ matrix.distro }} + id: updater-check run: | - docker run --security-opt seccomp=unconfined -e DO_NOT_TRACK=1 --network host -w /netdata sha256:${{ steps.load.outputs.image }} \ + docker run --security-opt seccomp=unconfined -e DISABLE_TELEMETRY=1 --network host -w /netdata sha256:${{ steps.load.outputs.image }} \ /netdata/.github/scripts/run-updater-check.sh - name: Failure Notification uses: rtCamp/action-slack-notify@v2 @@ -301,7 +424,14 @@ jobs: SLACK_ICON_EMOJI: ':github-actions:' SLACK_TITLE: 'Updater checks for ${{ matrix.distro }} failed:' SLACK_USERNAME: 'GitHub Actions' - SLACK_MESSAGE: "Updater checks for ${{ matrix.distro }} failed." + SLACK_MESSAGE: |- + ${{ github.repository }}: Updater checks for ${{ matrix.distro }} failed. + Checkout: ${{ steps.checkout.outcome }} + Fetch dist tarball: ${{ steps.fetch-tarball.outcome }} + Prepare artifact directory: ${{ steps.prepare.outcome }} + Fetch test environment: ${{ steps.fetch-test-environment.outcome }} + Load test environment: ${{ steps.load.outcome }} + Updater check: ${{ steps.updater-check.outcome }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} if: >- ${{ @@ -318,20 +448,25 @@ jobs: - build-static steps: - name: Checkout - uses: actions/checkout@v2 + id: checkout + uses: actions/checkout@v3 - name: Prepare Environment + id: prepare run: mkdir -p artifacts - name: Retrieve Dist Tarball - uses: actions/download-artifact@v2 + id: fetch-dist + uses: actions/download-artifact@v3 with: name: dist-tarball path: dist-tarball - name: Retrieve Static Build Artifacts - uses: actions/download-artifact@v2 + id: fetch-static + uses: actions/download-artifact@v3 with: name: static-archive path: static-archive - name: Prepare Artifacts + id: consolidate working-directory: ./artifacts/ run: | mv ../dist-tarball/* . || exit 1 @@ -341,7 +476,8 @@ jobs: sha256sum -b ./* > sha256sums.txt || exit 1 cat sha256sums.txt - name: Store Artifacts - uses: actions/upload-artifact@v2 + id: store + uses: actions/upload-artifact@v3 with: name: final-artifacts path: artifacts/* @@ -354,7 +490,14 @@ jobs: SLACK_ICON_EMOJI: ':github-actions:' SLACK_TITLE: 'Failed to prepare release artifacts for upload:' SLACK_USERNAME: 'GitHub Actions' - SLACK_MESSAGE: "Failed to prepare release artifacts for upload." + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to prepare release artifacts for upload. + CHeckout: ${{ steps.checkout.outcome }} + Prepare environment: ${{ steps.prepare.outcome }} + Fetch dist tarball: ${{ steps.fetch-dist.outcome }} + Fetch static builds: ${{ steps.fetch-static.outcome }} + Consolidate artifacts: ${{ steps.consolidate.outcome }} + Store: ${{ steps.store.outcome }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} if: >- ${{ @@ -377,13 +520,16 @@ jobs: - ${{ github.workspace }}:/usr/local/apache2/htdocs/ steps: - name: Checkout - uses: actions/checkout@v2 + id: checkout + uses: actions/checkout@v3 - name: Fetch artifacts - uses: actions/download-artifact@v2 + id: fetch + uses: actions/download-artifact@v3 with: name: final-artifacts path: artifacts - name: Verify that artifacts work with installer + id: verify env: NETDATA_TARBALL_BASEURL: http://localhost:8080/artifacts run: packaging/installer/kickstart.sh --build-only --dont-start-it --disable-telemetry --dont-wait @@ -395,7 +541,11 @@ jobs: SLACK_ICON_EMOJI: ':github-actions:' SLACK_TITLE: 'Artifact verification for source tarball failed.' SLACK_USERNAME: 'GitHub Actions' - SLACK_MESSAGE: "Artifact verification for source tarball failed." + SLACK_MESSAGE: |- + ${{ github.repository }}: Artifact verification for source tarball failed. + Checkout: ${{ steps.checkout.outcome }} + Fetch artifacts: ${{ steps.fetch.outcome }} + Verify artifacts: ${{ steps.verify.outcome }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} if: >- ${{ @@ -418,13 +568,16 @@ jobs: - ${{ github.workspace }}:/usr/local/apache2/htdocs/ steps: - name: Checkout - uses: actions/checkout@v2 + id: checkout + uses: actions/checkout@v3 - name: Fetch artifacts - uses: actions/download-artifact@v2 + id: fetch-artifacts + uses: actions/download-artifact@v3 with: name: final-artifacts path: artifacts - name: Verify that artifacts work with installer + id: verify env: NETDATA_TARBALL_BASEURL: http://localhost:8080/artifacts run: packaging/installer/kickstart.sh --static-only --dont-start-it --disable-telemetry @@ -436,7 +589,11 @@ jobs: SLACK_ICON_EMOJI: ':github-actions:' SLACK_TITLE: 'Artifact verification for static build failed.' SLACK_USERNAME: 'GitHub Actions' - SLACK_MESSAGE: "Artifact verification for static build failed." + SLACK_MESSAGE: |- + ${{ github.repository }}: Artifact verification for static build failed. + Checkout: ${{ steps.checkout.outcome }} + Fetch artifacts: ${{ steps.fetch-artifacts.outcome }} + Verify artifacts: ${{ steps.verify.outcome }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} if: >- ${{ @@ -456,18 +613,21 @@ jobs: - artifact-verification-static steps: - name: Retrieve Artifacts - uses: actions/download-artifact@v2 + id: fetch + uses: actions/download-artifact@v3 with: name: final-artifacts path: final-artifacts - name: Setup Gcloud - uses: google-github-actions/setup-gcloud@v0.5.0 + id: gcloud + uses: google-github-actions/setup-gcloud@v0.6.0 with: project_id: ${{ secrets.GCP_NIGHTLY_STORAGE_PROJECT }} service_account_key: ${{ secrets.GCP_STORAGE_SERVICE_ACCOUNT_KEY }} export_default_credentials: true - name: Upload Artifacts - uses: google-github-actions/upload-cloud-storage@v0.5.0 + id: upload + uses: google-github-actions/upload-cloud-storage@v0.9.0 with: destination: ${{ secrets.GCP_NIGHTLY_STORAGE_BUCKET }} gzip: false @@ -481,7 +641,11 @@ jobs: SLACK_ICON_EMOJI: ':github-actions:' SLACK_TITLE: 'Failed to upload nightly release artifacts:' SLACK_USERNAME: 'GitHub Actions' - SLACK_MESSAGE: "Failed to upload nightly release artifacts." + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to upload nightly release artifacts. + Fetch artifacts: ${{ steps.fetch.outcome }} + Setup GCloud: ${{ steps.gcloud.outcome }} + Upload artifacts: ${{ steps.upload.outcome }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} if: >- ${{ @@ -501,13 +665,16 @@ jobs: - artifact-verification-static steps: - name: Checkout - uses: actions/checkout@v2 + id: checkout + uses: actions/checkout@v3 - name: Retrieve Artifacts - uses: actions/download-artifact@v2 + id: fetch + uses: actions/download-artifact@v3 with: name: final-artifacts path: final-artifacts - name: Create Release + id: create-release uses: ncipollo/release-action@v1 with: allowUpdates: false @@ -524,11 +691,29 @@ jobs: SLACK_ICON_EMOJI: ':github-actions:' SLACK_TITLE: 'Failed to draft release:' SLACK_USERNAME: 'GitHub Actions' - SLACK_MESSAGE: "Failed to draft release." + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to create draft release or attach artifacts. + Checkout: ${{ steps.checkout.outcome }} + Fetch artifacts: ${{ steps.fetch.outcome }} + Create draft release: ${{ steps.create-release.outcome }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} if: >- ${{ failure() - && startsWith(github.ref, 'refs/heads/master') + && github.event_name == 'workflow_dispatch' + }} + - name: Success Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'good' + SLACK_FOOTER: '' + SLACK_ICON_EMOJI: ':github-actions:' + SLACK_TITLE: 'Created agent draft release:' + SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: "${{ github.repository }}: ${{ steps.create-release.outputs.html_url }}" + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: >- + ${{ + success() && github.event_name == 'workflow_dispatch' }} diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index bc746f9a..5f9a9c8c 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -6,30 +6,17 @@ on: - master pull_request: null env: - DO_NOT_TRACK: 1 + DISABLE_TELEMETRY: 1 concurrency: group: checks-${{ github.ref }} cancel-in-progress: true jobs: - checksum-checks: - name: Checksums - runs-on: ubuntu-latest - steps: - - name: Git clone repository - uses: actions/checkout@v2 - with: - submodules: recursive - - name: Run checksum checks on kickstart files - env: - LOCAL_ONLY: "true" - run: | - ./tests/installer/checksums.sh libressl-checks: name: LibreSSL runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive - name: Build @@ -47,7 +34,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive - name: Build @@ -58,7 +45,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive - name: Prepare environment diff --git a/.github/workflows/cloud_regression.yml b/.github/workflows/cloud_regression.yml new file mode 100644 index 00000000..03b12c15 --- /dev/null +++ b/.github/workflows/cloud_regression.yml @@ -0,0 +1,53 @@ +name: Trigger Cloud Regression E2E Tests +on: + push: + branches: [master] + paths: + - 'CMakeLists.txt' + - '**.c' + - '**.cc' + - '**.cpp' + - '**.h' + - 'mqtt_websockets/**' + - 'aclk/aclk-schemas/**' +jobs: + trigger_cloud_regression_tests: + runs-on: ubuntu-latest + steps: + - name: Evaluate workflow dispatch parameters + env: + PR_REPO_NAME: ${{ github.event.pull_request.head.repo.full_name }} + PR_BRANCH_NAME: ${{ github.event.pull_request.head.ref }} + PR_COMMIT_HASH: ${{ github.event.pull_request.head.sha }} + id: output-workflow-dispatch-params + run: | + if [ ${{ github.event_name }} == 'pull_request_target' ]; then + NETDATA_CUSTOM_REPO="$PR_REPO_NAME" + NETDATA_CUSTOM_BRANCH="$PR_BRANCH_NAME" + NETDATA_CUSTOM_PR_NUMBER="${{ github.event.number }}" + NETDATA_CUSTOM_COMMIT_HASH="$PR_COMMIT_HASH" + elif [ ${{ github.event_name }} == 'push' ]; then + NETDATA_CUSTOM_REPO="netdata/netdata" + NETDATA_CUSTOM_BRANCH="master" + NETDATA_CUSTOM_PR_NUMBER="" + NETDATA_CUSTOM_COMMIT_HASH="${{ github.sha }}" + fi + echo "::set-output name=netdata_repo::${NETDATA_CUSTOM_REPO}" + echo "::set-output name=netdata_branch::${NETDATA_CUSTOM_BRANCH}" + echo "::set-output name=netdata_pr_number::${NETDATA_CUSTOM_PR_NUMBER}" + echo "::set-output name=netdata_commit_hash::${NETDATA_CUSTOM_COMMIT_HASH}" + + - name: Trigger Cloud Regression + uses: aurelien-baudet/workflow-dispatch@v2 + with: + repo: netdata/test-automation + ref: refs/heads/master + workflow: regression.yml + token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }} + inputs: '{ "netdata_branch": "${{ steps.output-workflow-dispatch-params.outputs.netdata_branch }}", + "netdata_repo": "${{ steps.output-workflow-dispatch-params.outputs.netdata_repo }}", + "netdata_pr_number": "${{ steps.output-workflow-dispatch-params.outputs.netdata_pr_number }}", + "netdata_branch_commit_hash": "${{ steps.output-workflow-dispatch-params.outputs.netdata_commit_hash }}", + "custom_netdata_image": "true" + }' + wait-for-completion: false diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index c9e25ebf..9d1119a8 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -9,7 +9,7 @@ on: - .github/workflows/coverity.yml - coverity-scan.sh env: - DO_NOT_TRACK: 1 + DISABLE_TELEMETRY: 1 concurrency: group: coverity-${{ github.ref }} cancel-in-progress: true @@ -19,10 +19,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 + id: checkout with: submodules: recursive - name: Prepare environment + id: prepare env: DEBIAN_FRONTEND: 'noninteractive' run: | @@ -33,12 +35,13 @@ jobs: libprotoc-dev libssl-dev protobuf-compiler \ libnetfilter-acct-dev - name: Run coverity-scan + id: run env: REPOSITORY: 'netdata/netdata' COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} COVERITY_SCAN_SUBMIT_MAIL: ${{ secrets.COVERITY_SCAN_SUBMIT_MAIL }} run: | - ./coverity-scan.sh --with-install + bash -x ./coverity-scan.sh --with-install - name: Failure Notification uses: rtCamp/action-slack-notify@v2 env: @@ -47,6 +50,11 @@ jobs: SLACK_ICON_EMOJI: ':github-actions:' SLACK_TITLE: 'Coverity run failed:' SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: |- + ${{ github.repository }}: Coverity failed to run correctly. + Checkout: ${{ steps.checkout.outcome }} + Environment preparation: ${{ steps.prepare.outcome }} + Coverity run: ${{ steps.run.outcome }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} if: ${{ failure() diff --git a/.github/workflows/dashboard-pr.yml b/.github/workflows/dashboard-pr.yml index 711cf1e1..c99f9891 100644 --- a/.github/workflows/dashboard-pr.yml +++ b/.github/workflows/dashboard-pr.yml @@ -12,7 +12,7 @@ on: required: true env: - DO_NOT_TRACK: 1 + DISABLE_TELEMETRY: 1 jobs: dashboard-pr: @@ -20,12 +20,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + id: checkout + uses: actions/checkout@v3 - name: Update Files + id: update run: | web/gui/bundle_dashboard.py ${{ github.event.inputs.dashboard_version }} - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 + id: pr + uses: peter-evans/create-pull-request@v4 with: title: 'Update dashboard to version ${{ github.event.inputs.dashboard_version }}.' body: 'See https://github.com/netdata/dashboard/releases/tag/${{ github.event.inputs.dashboard_version }} for changes.' @@ -34,3 +37,18 @@ jobs: delete-branch: true commit-message: 'Update dashboard to version ${{ github.event.inputs.dashboard_version }}.' token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }} + - name: Failure Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_FOOTER: '' + SLACK_ICON_EMOJI: ':github-actions:' + SLACK_TITLE: 'Dashboard update PR creation failed:' + SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to create PR to update dashboard code to newest release. + Checkout: ${{ steps.checkout.outcome }} + Update files: ${{ steps.update.outcome }} + Create PR: ${{ steps.pr.outcome }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: failure() diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f8a1d685..5a45b0f9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -8,11 +8,11 @@ on: workflow_dispatch: inputs: version: - name: Version Tag + description: Version Tag default: nightly required: true env: - DO_NOT_TRACK: 1 + DISABLE_TELEMETRY: 1 concurrency: group: docker-${{ github.ref }}-${{ github.event_name }} cancel-in-progress: true @@ -22,19 +22,44 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + id: checkout + uses: actions/checkout@v3 with: submodules: recursive - name: Setup Buildx + id: prepare uses: docker/setup-buildx-action@v1 - name: Test Build + id: build uses: docker/build-push-action@v2 with: load: true push: false tags: netdata/netdata:test - name: Test Image + id: test run: .github/scripts/docker-test.sh + - name: Failure Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_FOOTER: '' + SLACK_ICON_EMOJI: ':github-actions:' + SLACK_TITLE: 'Docker runtime testing failed:' + SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: |- + ${{ github.repository }}: Building or testing Docker image for linux/amd64 failed. + CHeckout: ${{ steps.checkout.outcome }} + Setup buildx: ${{ steps.prepare.outcome }} + Build image: ${{ steps.build.outcome }} + Test image: ${{ steps.test.outcome }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: >- + ${{ + failure() + && github.event_name != 'pull_request' + && startsWith(github.ref, 'refs/heads/master') + }} docker-ci: if: github.event_name != 'workflow_dispatch' @@ -50,21 +75,46 @@ jobs: - linux/ppc64le steps: - name: Checkout - uses: actions/checkout@v2 + id: checkout + uses: actions/checkout@v3 with: submodules: recursive - name: Setup QEMU + id: qemu if: matrix.platforms != 'linux/i386' uses: docker/setup-qemu-action@v1 - name: Setup Buildx + id: buildx uses: docker/setup-buildx-action@v1 - name: Build + id: build uses: docker/build-push-action@v2 with: platforms: ${{ matrix.platforms }} load: false push: false tags: netdata/netdata:test + - name: Failure Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_FOOTER: '' + SLACK_ICON_EMOJI: ':github-actions:' + SLACK_TITLE: 'Docker build testing failed:' + SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: |- + ${{ github.repository }}: Building Docker image for ${{ matrix.platforms }} failed. + CHeckout: ${{ steps.checkout.outcome }} + Setup QEMU: ${{ steps.qemu.outcome }} + Setup buildx: ${{ steps.buildx.outcome }} + Build image: ${{ steps.build.outcome }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: >- + ${{ + failure() + && github.event_name != 'pull_request' + && startsWith(github.ref, 'refs/heads/master') + }} docker-publish: if: github.event_name == 'workflow_dispatch' @@ -73,30 +123,39 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + id: checkout + uses: actions/checkout@v3 with: submodules: recursive - name: Determine which tags to use + id: release-tags if: github.event.inputs.version != 'nightly' run: | - echo "tags=netdata/netdata:latest,netdata/netdata:stable,$(.github/scripts/gen-docker-tags.py ${{ github.event.inputs.version }})" >> $GITHUB_ENV + echo "tags=netdata/netdata:latest,netdata/netdata:stable,$(.github/scripts/gen-docker-tags.py ${{ github.event.inputs.version }})" \ + >> "${GITHUB_ENV}" - name: Determine which tags to use + id: nightly-tags if: github.event.inputs.version == 'nightly' run: | - echo "tags=netdata/netdata:latest,netdata/netdata:edge" >> $GITHUB_ENV + echo "tags=netdata/netdata:latest,netdata/netdata:edge" >> "${GITHUB_ENV}" - name: Mark image as official + id: env if: github.repository == 'netdata/netdata' - run: echo "OFFICIAL_IMAGE=true" >> $GITHUB_ENV + run: echo "OFFICIAL_IMAGE=true" >> "${GITHUB_ENV}" - name: Setup QEMU + id: qemu uses: docker/setup-qemu-action@v1 - name: Setup Buildx + id: buildx uses: docker/setup-buildx-action@v1 - name: Docker Hub Login + id: login uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_PASSWORD }} - name: Docker Build + id: build uses: docker/build-push-action@v2 with: platforms: linux/amd64,linux/i386,linux/arm/v7,linux/arm64,linux/ppc64le @@ -111,7 +170,16 @@ jobs: SLACK_ICON_EMOJI: ':github-actions:' SLACK_TITLE: 'Docker Build failed:' SLACK_USERNAME: 'GitHub Actions' - SLACK_MESSAGE: "Docker image build failed." + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to build or publish Docker images. + CHeckout: ${{ steps.checkout.outcome }} + Generate release tags: ${{ steps.release-tags.outcome }} + Generate nightly tags: ${{ steps.nightly-tags.outcome }} + Setup environment: ${{ steps.env.outcome }} + Setup QEMU: ${{ steps.qemu.outcome }} + Setup buildx: ${{ steps.buildx.outcome }} + Authenticate against DockerHub: ${{ steps.login.outcome }} + Build and publish images: ${{ steps.build.outcome }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} if: >- ${{ diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 73bcc877..69fda40c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,14 +10,14 @@ on: paths: - '**.md' env: - DO_NOT_TRACK: 1 + DISABLE_TELEMETRY: 1 jobs: markdown-link-check: name: Broken Links runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive - name: Run link check diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index a4937a9d..0854080a 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -5,7 +5,7 @@ on: schedule: - cron: '*/10 * * * *' env: - DO_NOT_TRACK: 1 + DISABLE_TELEMETRY: 1 jobs: labeler: runs-on: ubuntu-latest diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 38a78731..dbf334d5 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -6,164 +6,235 @@ on: branches: - master - develop + push: + branches: + - master workflow_dispatch: inputs: type: - name: Package build type + description: Package build type default: devel required: true version: - name: Package version + description: Package version required: false env: - DO_NOT_TRACK: 1 + DISABLE_TELEMETRY: 1 + REPO_PREFIX: netdata/netdata concurrency: group: packages-${{ github.ref }}-${{ github.event_name }} cancel-in-progress: true jobs: + matrix: + name: Prepare Build Matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout + id: checkout + uses: actions/checkout@v3 + - name: Prepare tools + id: prepare + run: | + sudo apt-get update && sudo apt-get install -y python3-ruamel.yaml + - name: Read build matrix + id: set-matrix + shell: python3 {0} + run: | + from ruamel.yaml import YAML + import json + import re + FULL_CI_REGEX = '/actions run full ci' + ALWAYS_RUN_ARCHES = ["amd64"] + PR_BODY = """${{ github.event.pull_request.body }}""" + yaml = YAML(typ='safe') + entries = list() + run_limited = False + + with open('.github/data/distros.yml') as f: + data = yaml.load(f) + + if "${{ github.event_name }}" == "pull_request" and re.search(FULL_CI_REGEX, PR_BODY, re.I) is None: + run_limited = True + + for i, v in enumerate(data['include']): + if 'packages' in data['include'][i]: + for arch in data['include'][i]['packages']['arches']: + if arch in ALWAYS_RUN_ARCHES or not run_limited: + entries.append({ + 'distro': data['include'][i]['distro'], + 'version': data['include'][i]['version'], + 'pkgclouddistro': data['include'][i]['packages']['repo_distro'], + 'format': data['include'][i]['packages']['type'], + 'base_image': data['include'][i]['base_image'] if 'base_image' in data['include'][i] else data['include'][i]['distro'], + 'platform': data['platform_map'][arch], + 'arch': arch + }) + + entries.sort(key=lambda k: (k['arch'], k['distro'], k['version'])) + matrix = json.dumps({'include': entries}, sort_keys=True) + print('Generated Matrix: ' + matrix) + print('::set-output name=matrix::' + matrix) + - name: Failure Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_ICON_EMOJI: ':github-actions:' + SLACK_TITLE: 'Package Build matrix generation failed:' + SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to generate build matrix for package build. + Checkout: ${{ steps.checkout.outcome }} + Prepare Tools: ${{ steps.prepare.outcome }} + Read Build Matrix: ${{ steps.set-matrix.outcome }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: >- + ${{ + failure() + && github.event_name != 'pull_request' + && startsWith(github.ref, 'refs/heads/master') + }} + + version-check: + name: Version check + runs-on: ubuntu-latest + outputs: + repo: ${{ steps.check-version.outputs.repo }} + version: ${{ steps.check-version.outputs.version }} + retention: ${{ steps.check-version.outputs.retention }} + steps: + - name: Checkout + id: checkout + uses: actions/checkout@v3 + - name: Check Version + id: check-version + run: | + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + case "${{ github.event.inputs.type }}" in + "release") + echo "::set-output name=repo::${REPO_PREFIX}" + echo "::set-output name=version::${{ github.event.inputs.version }}" + echo "::set-output name=retention::365" + ;; + "nightly") + echo "::set-output name=repo::${REPO_PREFIX}-edge" + echo "::set-output name=version::$(tr -d 'v' < packaging/version)" + echo "::set-output name=retention::30" + ;; + *) + echo "::set-output name=repo::${REPO_PREFIX}-devel" + echo "::set-output name=version::0.${GITHUB_SHA}" + echo "::set-output name=retention::30" + ;; + esac + else + echo "::set-output name=version::$(cut -d'-' -f 1 packaging/version | tr -d 'v')" + echo "::set-output name=retention::0" + fi + - name: Failure Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_ICON_EMOJI: ':github-actions:' + SLACK_TITLE: 'Package Build version check failed:' + SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to generate version information for package build. + Checkout: ${{ steps.checkout.outcome }} + Check Version: ${{ steps.check-version.outcome }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: >- + ${{ + failure() + && github.event_name != 'pull_request' + && startsWith(github.ref, 'refs/heads/master') + }} + build: name: Build runs-on: ubuntu-latest env: DOCKER_CLI_EXPERIMENTAL: enabled + needs: + - matrix + - version-check strategy: - matrix: - include: - - {distro: debian, version: "9", pkgclouddistro: debian/stretch, format: deb, base_image: debian, platform: linux/amd64, arch: amd64} - - {distro: debian, version: "9", pkgclouddistro: debian/stretch, format: deb, base_image: debian, platform: linux/i386, arch: i386} - - {distro: debian, version: "9", pkgclouddistro: debian/stretch, format: deb, base_image: debian, platform: linux/arm/v7, arch: armhf} - - {distro: debian, version: "9", pkgclouddistro: debian/stretch, format: deb, base_image: debian, platform: linux/arm64/v8, arch: arm64} - - {distro: debian, version: "10", pkgclouddistro: debian/buster, format: deb, base_image: debian, platform: linux/amd64, arch: amd64} - - {distro: debian, version: "10", pkgclouddistro: debian/buster, format: deb, base_image: debian, platform: linux/i386, arch: i386} - - {distro: debian, version: "10", pkgclouddistro: debian/buster, format: deb, base_image: debian, platform: linux/arm/v7, arch: armhf} - - {distro: debian, version: "10", pkgclouddistro: debian/buster, format: deb, base_image: debian, platform: linux/arm64/v8, arch: arm64} - - {distro: debian, version: "11", pkgclouddistro: debian/bullseye, format: deb, base_image: debian, platform: linux/amd64, arch: amd64, alias: bullseye} - - {distro: debian, version: "11", pkgclouddistro: debian/bullseye, format: deb, base_image: debian, platform: linux/i386, arch: i386, alias: bullseye} - - {distro: debian, version: "11", pkgclouddistro: debian/bullseye, format: deb, base_image: debian, platform: linux/arm/v7, arch: armhf, alias: bullseye} - - {distro: debian, version: "11", pkgclouddistro: debian/bullseye, format: deb, base_image: debian, platform: linux/arm64/v8, arch: arm64, alias: bullseye} - - {distro: ubuntu, version: "18.04", pkgclouddistro: ubuntu/bionic, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64} - - {distro: ubuntu, version: "18.04", pkgclouddistro: ubuntu/bionic, format: deb, base_image: ubuntu, platform: linux/i386, arch: i386} - - {distro: ubuntu, version: "18.04", pkgclouddistro: ubuntu/bionic, format: deb, base_image: ubuntu, platform: linux/arm/v7, arch: armhf} - - {distro: ubuntu, version: "18.04", pkgclouddistro: ubuntu/bionic, format: deb, base_image: ubuntu, platform: linux/arm64/v8, arch: arm64} - - {distro: ubuntu, version: "20.04", pkgclouddistro: ubuntu/focal, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64} - - {distro: ubuntu, version: "20.04", pkgclouddistro: ubuntu/focal, format: deb, base_image: ubuntu, platform: linux/arm/v7, arch: armhf} - - {distro: ubuntu, version: "20.04", pkgclouddistro: ubuntu/focal, format: deb, base_image: ubuntu, platform: linux/arm64/v8, arch: arm64} - - {distro: ubuntu, version: "21.10", pkgclouddistro: ubuntu/impish, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64} - - {distro: ubuntu, version: "21.10", pkgclouddistro: ubuntu/impish, format: deb, base_image: ubuntu, platform: linux/arm/v7, arch: armhf} - - {distro: ubuntu, version: "21.10", pkgclouddistro: ubuntu/impish, format: deb, base_image: ubuntu, platform: linux/arm64/v8, arch: arm64} - - {distro: centos, version: "7", pkgclouddistro: el/7, format: rpm, base_image: centos, platform: linux/amd64, arch: amd64} - - {distro: rockylinux, version: "8", pkgclouddistro: el/8, format: rpm, base_image: rockylinux/rockylinux, platform: linux/amd64, arch: amd64} - - {distro: rockylinux, version: "8", pkgclouddistro: el/8, format: rpm, base_image: rockylinux/rockylinux, platform: linux/arm64/v8, arch: arm64} - - {distro: fedora, version: "34", pkgclouddistro: fedora/34, format: rpm, base_image: fedora, platform: linux/amd64, arch: amd64} - - {distro: fedora, version: "34", pkgclouddistro: fedora/34, format: rpm, base_image: fedora, platform: linux/arm/v7, arch: armhf} - - {distro: fedora, version: "34", pkgclouddistro: fedora/34, format: rpm, base_image: fedora, platform: linux/arm64/v8, arch: arm64} - - {distro: fedora, version: "35", pkgclouddistro: fedora/35, format: rpm, base_image: fedora, platform: linux/amd64, arch: amd64} - - {distro: fedora, version: "35", pkgclouddistro: fedora/35, format: rpm, base_image: fedora, platform: linux/arm/v7, arch: armhf} - - {distro: fedora, version: "35", pkgclouddistro: fedora/35, format: rpm, base_image: fedora, platform: linux/arm64/v8, arch: arm64} - - {distro: opensuse, version: "15.3", pkgclouddistro: opensuse/15.3, format: rpm, base_image: opensuse/leap, platform: linux/amd64, arch: amd64} - - {distro: opensuse, version: "15.3", pkgclouddistro: opensuse/15.3, format: rpm, base_image: opensuse/leap, platform: linux/arm64/v8, arch: arm64} - - {distro: oraclelinux, version: "8", pkgclouddistro: ol/8, format: rpm, base_image: oraclelinux, platform: linux/amd64, arch: amd64} - - {distro: oraclelinux, version: "8", pkgclouddistro: ol/8, format: rpm, base_image: oraclelinux, platform: linux/arm64/v8, arch: arm64} + matrix: ${{ fromJson(needs.matrix.outputs.matrix) }} # We intentiaonally disable the fail-fast behavior so that a # build failure for one version doesn't prevent us from publishing # successfully built and tested packages for another version. fail-fast: false max-parallel: 8 steps: - - name: Checkout PR # Checkout the PR if it's a PR. - if: github.event_name == 'pull_request' - uses: actions/checkout@v2 - with: - fetch-depth: 0 # We need full history for versioning - submodules: recursive - - name: Checkout Tag # Otherwise check out the tag that triggered this. - if: github.event_name == 'workflow_dispatch' - uses: actions/checkout@v2 + - name: Checkout + id: checkout + uses: actions/checkout@v3 with: - ref: ${{ github.event.ref }} fetch-depth: 0 # We need full history for versioning submodules: recursive - - name: Check Base Branch - run: | - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - echo "runtype=${{ github.event.inputs.type }}" >> $GITHUB_ENV - case "${{ github.event.inputs.type }}" in - "release") - echo "repo=${{ secrets.PACKAGE_CLOUD_REPO }}" >> $GITHUB_ENV - echo "pkg_version=${{ github.event.inputs.version }}" >> $GITHUB_ENV - echo "pkg_retention_days=365" >> $GITHUB_ENV - ;; - "nightly") - echo "repo=${{ secrets.PACKAGE_CLOUD_REPO }}-edge" >> $GITHUB_ENV - echo "pkg_version=${{ github.event.inputs.version }}" >> $GITHUB_ENV - echo "pkg_retention_days=30" >> $GITHUB_ENV - ;; - *) - echo "repo=${{ secrets.PACKAGE_CLOUD_REPO }}-devel" >> $GITHUB_ENV - echo "pkg_version=0.${GITHUB_SHA}" >> $GITHUB_ENV - echo "pkg_retention_days=30" >> $GITHUB_ENV - ;; - esac - else - echo "runtype=test" >> $GITHUB_ENV - echo "pkg_version=$(cut -d'-' -f 1 packaging/version | sed -e 's/^v//')" >> $GITHUB_ENV - fi - name: Setup QEMU + id: qemu if: matrix.platform != 'linux/amd64' && matrix.platform != 'linux/i386' uses: docker/setup-qemu-action@v1 - name: Prepare Docker Environment + id: docker-config shell: bash run: | echo '{"cgroup-parent": "/actions_job", "experimental": true}' | sudo tee /etc/docker/daemon.json 2>/dev/null sudo service docker restart - - name: Set Base Image Version - shell: bash - run: | - if [ -z "${{ matrix.alias }}" ] ; then - echo "version=${{ matrix.version }}" >> $GITHUB_ENV - else - echo "version=${{ matrix.alias }}" >> $GITHUB_ENV - fi - - name: Fetch base image + - name: Fetch images + id: fetch-images uses: nick-invision/retry@v2 with: max_attempts: 3 retry_wait_seconds: 30 timeout_seconds: 900 command: | - docker pull --platform ${{ matrix.platform }} ${{ matrix.base_image }}:${{ env.version }} + docker pull --platform ${{ matrix.platform }} ${{ matrix.base_image }}:${{ matrix.version }} docker pull --platform ${{ matrix.platform }} netdata/package-builders:${{ matrix.distro }}${{ matrix.version }} - name: Build Packages + id: build shell: bash run: | - docker run --security-opt seccomp=unconfined -e DO_NOT_TRACK=1 -e VERSION=${{ env.pkg_version }} --platform=${{ matrix.platform }} -v $PWD:/netdata netdata/package-builders:${{ matrix.distro }}${{ matrix.version }} + docker run --security-opt seccomp=unconfined -e DISABLE_TELEMETRY=1 -e VERSION=${{ needs.version-check.outputs.version }} \ + --platform=${{ matrix.platform }} -v "$PWD":/netdata netdata/package-builders:${{ matrix.distro }}${{ matrix.version }} - name: Test Packages + id: test shell: bash run: | - docker run --security-opt seccomp=unconfined -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 + docker run --security-opt seccomp=unconfined -e DISABLE_TELEMETRY=1 -e DISTRO=${{ matrix.distro }} \ + -e VERSION=${{ needs.version-check.outputs.version }} -e DISTRO_VERSION=${{ matrix.version }} \ + --platform=${{ matrix.platform }} -v "$PWD":/netdata ${{ matrix.base_image }}:${{ matrix.version }} \ + /netdata/.github/scripts/pkg-test.sh - name: Save Packages - uses: actions/upload-artifact@v2 + id: artifacts + continue-on-error: true + uses: actions/upload-artifact@v3 with: name: ${{ matrix.distro }}-${{ matrix.version }}-${{ matrix.arch }}-packages path: ${{ github.workspace }}/artifacts/* - name: Upload to PackageCloud + id: upload if: github.event_name == 'workflow_dispatch' shell: bash env: PKG_CLOUD_TOKEN: ${{ secrets.PACKAGE_CLOUD_API_KEY }} run: | - echo "Packages to upload:\n$(ls artifacts/*.${{ matrix.format }})" + printf "Packages to upload:\n%s" "$(ls artifacts/*.${{ matrix.format }})" for pkgfile in artifacts/*.${{ matrix.format }} ; do - .github/scripts/package_cloud_wrapper.sh yank ${{ env.repo }}/${{ matrix.pkgclouddistro }} $(basename ${pkgfile}) || true - .github/scripts/package_cloud_wrapper.sh push ${{ env.repo }}/${{ matrix.pkgclouddistro }} ${pkgfile} + .github/scripts/package_cloud_wrapper.sh yank ${{ needs.version-check.outputs.repo }}/${{ matrix.pkgclouddistro }} \ + "$(basename "${pkgfile}")" || true + .github/scripts/package_cloud_wrapper.sh push ${{ needs.version-check.outputs.repo }}/${{ matrix.pkgclouddistro }} "${pkgfile}" done - name: Clean + id: cleanup if: github.event_name == 'workflow_dispatch' shell: bash env: - REPO: ${{ env.repo }} + REPO: ${{ needs.version-check.outputs.repo }} PKG_CLOUD_TOKEN: ${{ secrets.PACKAGE_CLOUD_API_KEY }} - PACKAGE_CLOUD_RETENTION_DAYS: ${{ env.pkg_retention_days }} + PACKAGE_CLOUD_RETENTION_DAYS: ${{ needs.version-check.outputs.retention }} run: .github/scripts/old_package_purging.sh - name: Failure Notification uses: rtCamp/action-slack-notify@v2 @@ -172,7 +243,16 @@ jobs: SLACK_ICON_EMOJI: ':github-actions:' SLACK_TITLE: 'Package Build failed:' SLACK_USERNAME: 'GitHub Actions' - SLACK_MESSAGE: "${{ matrix.pkgclouddistro }} ${{ matrix.version }} package build for ${{ matrix.arch }} failed." + SLACK_MESSAGE: |- + ${{ github.repository }}: ${{ matrix.pkgclouddistro }} ${{ matrix.version }} package build for ${{ matrix.arch }} failed. + Checkout: ${{ steps.checkout.outcome }} + Setup QEMU: ${{ steps.qemu.outcome }} + Setup Docker: ${{ steps.docker-config.outcome }} + Fetch images: ${{ steps.fetch-images.outcome }} + Build: ${{ steps.build.outcome }} + Test: ${{ steps.test.outcome }} + Publish: ${{ steps.upload.outcome }} + Cleanup: ${{ steps.cleanup.outcome }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} if: >- ${{ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..248e45e0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,207 @@ +--- +# Workflow for triggering a release. +name: Release +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: # Dispatch runs build and validate, then push to the appropriate storage location. + inputs: + type: + description: Build Type + default: nightly + required: true + version: + description: Version Tag + default: nightly + required: true +concurrency: # This keeps multiple instances of the job from running concurrently for the same ref and event type. + group: release-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true +jobs: + update-changelogs: + name: Update changelog + runs-on: ubuntu-latest + outputs: + ref: ${{ steps.target.outputs.ref }} + version: ${{ steps.target.outputs.version }} + type: ${{ steps.target.outputs.type }} + run: ${{ steps.target.outputs.run }} + steps: + - name: Checkout + id: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + submodules: recursive + token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }} + - name: Prepare base ref + id: target + run: >- + .github/scripts/prepare-release-base.sh \ + ${{ github.repository }} \ + ${{ github.event_name }} \ + ${{ github.event.inputs.type }} \ + ${{ github.event.inputs.version }} + - name: Generate Nightly Changleog + id: nightly-changelog + if: steps.target.outputs.run == 'true' && steps.target.outputs.type == 'nightly' + uses: heinrichreimer/github-changelog-generator-action@v2.3 + with: + bugLabels: IGNOREBUGS + excludeLabels: "stale,duplicate,question,invalid,wontfix,discussion,no changelog" + issues: false + sinceTag: v1.10.0 + token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }} + unreleasedLabel: "**Next release**" + verbose: true + maxIssues: 500 + - name: Generate Release Changelog + id: release-changelog + if: steps.target.outputs.run == 'true' && steps.target.outputs.type != 'nightly' + uses: heinrichreimer/github-changelog-generator-action@v2.3 + with: + bugLabels: IGNOREBUGS + excludeLabels: "stale,duplicate,question,invalid,wontfix,discussion,no changelog" + futureRelease: ${{ github.event.inputs.version }} + issues: false + sinceTag: v1.10.0 + token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }} + unreleasedLabel: "**Next release**" + verbose: true + maxIssues: 500 + - name: Commit Changes + id: commit + if: steps.target.outputs.run == 'true' + env: + GITHUB_TOKEN: ${{ secrets.NETDATABOT_GITHUB_TOKEN }} + run: | + git config user.name "netdatabot" + git config user.email "bot@netdata.cloud" + git add packaging/version CHANGELOG.md + git commit -m "[ci skip] ${{ steps.target.outputs.message }}" + if [ "${{ steps.target.outputs.type }}" != "nightly" ]; then + git tag ${{ github.event.inputs.version }} + fi + git push --follow-tags origin ${{ steps.target.outputs.branch }} + - name: Failure Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_FOOTER: '' + SLACK_ICON_EMOJI: ':github-actions:' + SLACK_TITLE: 'Failed to prepare changelog:' + SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to prepare changelog. + Checkout: ${{ steps.checkout.outcome }} + Prepare base ref: ${{ steps.target.outcome }} + Generate nightly changelog: ${{ steps.nightly-changelog.outcome }} + Generate release changelog: ${{ steps.release-changelog.outcome }} + Commit changes: ${{ steps.commit.outcome }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: failure() + + trigger-artifacts: + name: Trigger artifact builds + runs-on: ubuntu-latest + needs: update-changelogs + if: ${{ needs.update-changelogs.outputs.run }} == 'true' + steps: + - name: Checkout + id: checkout + uses: actions/checkout@v2 + with: + ref: ${{ needs.update-changelogs.outputs.ref }} + - name: Trigger build + id: trigger + uses: benc-uk/workflow-dispatch@v1 + with: + token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }} + repo: ${{ github.repository }} + workflow: Build + ref: ${{ needs.update-changelogs.outputs.ref }} + inputs: '{"version": "${{ needs.update-changelogs.outputs.version }}", "type": "${{ needs.update-changelogs.outputs.type }}"}' + - name: Failure Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_FOOTER: '' + SLACK_ICON_EMOJI: ':github-actions:' + SLACK_TITLE: 'Failed to trigger ${{ needs.update-changelogs.outputs.type }} artifact builds:' + SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to trigger ${{ needs.update-changelogs.outputs.type }} artifact builds. + Checkout: ${{ steps.checkout.outcome }} + Trigger build: ${{ steps.trigger.outcome }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: failure() + + trigger-docker: + name: Trigger docker builds + runs-on: ubuntu-latest + needs: update-changelogs + if: ${{ needs.update-changelogs.outputs.run }} == 'true' + steps: + - name: Checkout + id: checkout + uses: actions/checkout@v2 + with: + ref: ${{ needs.update-changelogs.outputs.ref }} + - name: Trigger build + id: trigger + uses: benc-uk/workflow-dispatch@v1 + with: + token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }} + repo: ${{ github.repository }} + workflow: Docker + ref: ${{ needs.update-changelogs.outputs.ref }} + inputs: '{"version": "${{ needs.update-changelogs.outputs.version }}"}' + - name: Failure Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_FOOTER: '' + SLACK_ICON_EMOJI: ':github-actions:' + SLACK_TITLE: 'Failed to trigger ${{ needs.update-changelogs.outputs.type }} Docker builds:' + SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to trigger ${{ needs.update-changelogs.outputs.type }} Docker builds. + Checkout: ${{ steps.checkout.outcome }} + Trigger build: ${{ steps.trigger.outcome }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: failure() + + trigger-packages: + name: Trigger package builds + runs-on: ubuntu-latest + needs: update-changelogs + if: ${{ needs.update-changelogs.outputs.run }} == 'true' + steps: + - name: Checkout + id: checkout + uses: actions/checkout@v2 + with: + ref: ${{ needs.update-changelogs.outputs.ref }} + - name: Trigger build + id: trigger + uses: benc-uk/workflow-dispatch@v1 + with: + token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }} + repo: ${{ github.repository }} + workflow: Packages + ref: ${{ needs.update-changelogs.outputs.ref }} + inputs: '{"version": "${{ needs.update-changelogs.outputs.version }}", "type": "${{ needs.update-changelogs.outputs.type }}"}' + - name: Failure Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_FOOTER: '' + SLACK_ICON_EMOJI: ':github-actions:' + SLACK_TITLE: 'Failed to trigger ${{ needs.update-changelogs.outputs.type }} package builds:' + SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to trigger ${{ needs.update-changelogs.outputs.type }} package builds. + Checkout: ${{ steps.checkout.outcome }} + Trigger build: ${{ steps.trigger.outcome }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: failure() diff --git a/.github/workflows/repoconfig-packages.yml b/.github/workflows/repoconfig-packages.yml index b8d0ff67..b0600cc0 100644 --- a/.github/workflows/repoconfig-packages.yml +++ b/.github/workflows/repoconfig-packages.yml @@ -14,30 +14,80 @@ on: - packaging/repoconfig/** - .github/workflows/repoconfig-packages.yml env: - DO_NOT_TRACK: 1 + DISABLE_TELEMETRY: 1 + REPO_PREFIX: netdata/netdata jobs: + matrix: + name: Prepare Build Matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout + id: checkout + uses: actions/checkout@v3 + - name: Prepare tools + id: prepare + run: | + sudo apt-get update && sudo apt-get install -y python3-ruamel.yaml + - name: Read build matrix + id: set-matrix + shell: python3 {0} + run: | + from ruamel.yaml import YAML + import json + yaml = YAML(typ='safe') + entries = list() + + with open('.github/data/distros.yml') as f: + data = yaml.load(f) + + for i, v in enumerate(data['include']): + if 'packages' in data['include'][i]: + entries.append({ + 'distro': data['include'][i]['distro'], + 'version': data['include'][i]['version'], + 'pkgclouddistro': data['include'][i]['packages']['repo_distro'], + 'format': data['include'][i]['packages']['type'], + 'base_image': data['include'][i]['base_image'] if 'base_image' in data['include'][i] else data['include'][i]['distro'], + 'platform': data['platform_map']['amd64'], + 'arch': 'amd64' + }) + + entries.sort(key=lambda k: (k['arch'], k['distro'], k['version'])) + matrix = json.dumps({'include': entries}, sort_keys=True) + print('Generated Matrix: ' + matrix) + print('::set-output name=matrix::' + matrix) + - name: Failure Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_ICON_EMOJI: ':github-actions:' + SLACK_TITLE: 'Repository Package Build matrix generation failed:' + SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to generate build matrix for repository package build. + Checkout: ${{ steps.checkout.outcome }} + Prepare Tools: ${{ steps.prepare.outcome }} + Read Build Matrix: ${{ steps.set-matrix.outcome }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: >- + ${{ + failure() + && github.event_name != 'pull_request' + && startsWith(github.ref, 'refs/heads/master') + }} + build: name: Build runs-on: ubuntu-latest env: - DO_NOT_TRACK: 1 + DISABLE_TELEMETRY: 1 DOCKER_CLI_EXPERIMENTAL: enabled + needs: + - matrix strategy: - # This needs to be kept in sync with the matrix in packaging.yml, but should only include the AMD64 lines. - matrix: - include: - - {distro: debian, version: "9", pkgclouddistro: debian/stretch, format: deb, base_image: debian, platform: linux/amd64, arch: amd64} - - {distro: debian, version: "10", pkgclouddistro: debian/buster, format: deb, base_image: debian, platform: linux/amd64, arch: amd64} - - {distro: debian, version: "11", pkgclouddistro: debian/bullseye, format: deb, base_image: debian, platform: linux/amd64, arch: amd64} - - {distro: ubuntu, version: "18.04", pkgclouddistro: ubuntu/bionic, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64} - - {distro: ubuntu, version: "20.04", pkgclouddistro: ubuntu/focal, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64} - - {distro: ubuntu, version: "21.10", pkgclouddistro: ubuntu/impish, format: deb, base_image: ubuntu, platform: linux/amd64, arch: amd64} - - {distro: centos, version: "7", pkgclouddistro: el/7, format: rpm, base_image: centos, platform: linux/amd64, arch: amd64} - - {distro: rockylinux, version: "8", pkgclouddistro: el/8, format: rpm, base_image: rockylinux/rockylinux, platform: linux/amd64, arch: amd64} - - {distro: fedora, version: "34", pkgclouddistro: fedora/34, format: rpm, base_image: fedora, platform: linux/amd64, arch: amd64} - - {distro: fedora, version: "35", pkgclouddistro: fedora/35, format: rpm, base_image: fedora, platform: linux/amd64, arch: amd64} - - {distro: opensuse, version: "15.3", pkgclouddistro: opensuse/15.3, format: rpm, base_image: opensuse/leap, platform: linux/amd64, arch: amd64} - - {distro: oraclelinux, version: "8", pkgclouddistro: ol/8, format: rpm, base_image: oraclelinux, platform: linux/amd64, arch: amd64} + matrix: ${{ fromJson(needs.matrix.outputs.matrix) }} # We intentiaonally disable the fail-fast behavior so that a # build failure for one version doesn't prevent us from publishing # successfully built and tested packages for another version. @@ -45,9 +95,11 @@ jobs: max-parallel: 8 steps: - name: Checkout - uses: actions/checkout@v2 + id: checkout + uses: actions/checkout@v3 # Unlike normally, we do not need a deep clone or submodules for this. - name: Fetch base image + id: fetch-images uses: nick-invision/retry@v2 with: max_attempts: 3 @@ -55,25 +107,30 @@ jobs: timeout_seconds: 900 command: docker pull --platform ${{ matrix.platform }} ${{ matrix.base_image }}:${{ matrix.version }} - name: Build Packages + id: build shell: bash run: | - docker run --security-opt seccomp=unconfined -e DO_NOT_TRACK=1 --platform ${{ matrix.platform }} \ - -v $PWD:/netdata ${{ matrix.base_image }}:${{ matrix.version }} \ + docker run --security-opt seccomp=unconfined -e DISABLE_TELEMETRY=1 --platform ${{ matrix.platform }} \ + -v "$PWD":/netdata ${{ matrix.base_image }}:${{ matrix.version }} \ /netdata/packaging/repoconfig/build-${{ matrix.format }}.sh - name: Upload Packages + id: publish if: github.event_name != 'pull_request' && github.repository == 'netdata/netdata' shell: bash env: PKG_CLOUD_TOKEN: ${{ secrets.PACKAGE_CLOUD_API_KEY }} run: | - echo "Packages to upload:\n$(ls artifacts/*.${{ matrix.format }})" + printf "Packages to upload:\n%s" "$(ls artifacts/*.${{ matrix.format }})" for pkgfile in artifacts/*.${{ matrix.format }} ; do - .github/scripts/package_cloud_wrapper.sh yank ${{ secrets.PACKAGE_CLOUD_REPO }}/${{ matrix.pkgclouddistro }} $(basename ${pkgfile}) || true - .github/scripts/package_cloud_wrapper.sh push ${{ secrets.PACKAGE_CLOUD_REPO }}/${{ matrix.pkgclouddistro }} ${pkgfile} - .github/scripts/package_cloud_wrapper.sh yank ${{ secrets.PACKAGE_CLOUD_REPO }}-edge/${{ matrix.pkgclouddistro }} $(basename ${pkgfile}) || true - .github/scripts/package_cloud_wrapper.sh push ${{ secrets.PACKAGE_CLOUD_REPO }}-edge/${{ matrix.pkgclouddistro }} ${pkgfile} - .github/scripts/package_cloud_wrapper.sh yank ${{ secrets.PACKAGE_CLOUD_REPO }}-repoconfig/${{ matrix.pkgclouddistro }} $(basename ${pkgfile}) || true - .github/scripts/package_cloud_wrapper.sh push ${{ secrets.PACKAGE_CLOUD_REPO }}-repoconfig/${{ matrix.pkgclouddistro }} ${pkgfile} + .github/scripts/package_cloud_wrapper.sh yank "${REPO_PREFIX}/${{ matrix.pkgclouddistro }}" \ + "$(basename "${pkgfile}")" || true + .github/scripts/package_cloud_wrapper.sh push "${REPO_PREFIX}/${{ matrix.pkgclouddistro }}" "${pkgfile}" + .github/scripts/package_cloud_wrapper.sh yank "${REPO_PREFIX}-edge/${{ matrix.pkgclouddistro }}" \ + "$(basename "${pkgfile}")" || true + .github/scripts/package_cloud_wrapper.sh push "${REPO_PREFIX}-edge/${{ matrix.pkgclouddistro }}" "${pkgfile}" + .github/scripts/package_cloud_wrapper.sh yank "${REPO_PREFIX}-repoconfig/${{ matrix.pkgclouddistro }}" \ + "$(basename "${pkgfile}")" || true + .github/scripts/package_cloud_wrapper.sh push "${REPO_PREFIX}-repoconfig/${{ matrix.pkgclouddistro }}" "${pkgfile}" done - name: Failure Notification if: ${{ failure() }} @@ -84,5 +141,10 @@ jobs: SLACK_ICON_EMOJI: ':github-actions:' SLACK_TITLE: 'Repository Package Build failed:' SLACK_USERNAME: 'GitHub Actions' - SLACK_MESSAGE: "${{ matrix.pkgclouddistro }} ${{ matrix.version }} repository package build failed." + SLACK_MESSAGE: |- + ${{ github.repository }}: ${{ matrix.pkgclouddistro }} ${{ matrix.version }} repository package build failed. + Checkout: ${{ steps.checkout.outcome }} + Fetch images: ${{ steps.fetch-images.outcome }} + Build: ${{ steps.build.outcome }} + Publish: ${{ steps.publish.outcome }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index b6ee6fcf..f631b929 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -4,7 +4,7 @@ name: Review on: pull_request: null env: - DO_NOT_TRACK: 1 + DISABLE_TELEMETRY: 1 concurrency: group: review-${{ github.ref }} cancel-in-progress: true @@ -20,7 +20,7 @@ jobs: yamllint: ${{ steps.yamllint.outputs.run }} steps: - name: Clone repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive fetch-depth: 0 @@ -77,7 +77,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Git clone repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive fetch-depth: 0 @@ -94,7 +94,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Git clone repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive fetch-depth: 0 @@ -114,7 +114,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Git clone repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Run hadolint @@ -130,7 +130,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Git clone repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive fetch-depth: 0 @@ -150,7 +150,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Git clone repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive fetch-depth: 0 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 20c6f7b8..7e53c497 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ on: - '**.c' - '**.h' env: - DO_NOT_TRACK: 1 + DISABLE_TELEMETRY: 1 concurrency: group: tests-${{ github.ref }} cancel-in-progress: true @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive - name: Prepare environment @@ -45,7 +45,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive - name: Prepare environment @@ -90,7 +90,7 @@ jobs: find . -type f -name '*.log' -exec cp {} ../logs/ \; popd || exit 1 - name: Upload Artifacts - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v3 if: always() with: name: logs diff --git a/.github/workflows/trigger-learn-update.yml b/.github/workflows/trigger-learn-update.yml new file mode 100644 index 00000000..3d39ebab --- /dev/null +++ b/.github/workflows/trigger-learn-update.yml @@ -0,0 +1,37 @@ +--- +name: Trigger Netdata Learn documentation update +on: + push: + branches: + - master + paths: + - "**.mdx?" + - "packaging/installer/kickstart.sh" +concurrency: + group: learn-trigger-${{ github.ref }} + cancel-in-progress: true +jobs: + trigger-ingest: + name: Trigger Netdata Learn ingest workflow. + if: github.repository == 'netdata/netdata' + runs-on: ubuntu-latest + steps: + - name: Trigger Netdata Learn ingest workflow. + uses: benc-uk/workflow-dispatch@v1 + with: + token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }} + repo: netdata/learn + workflow: Ingest + ref: refs/heads/master + - name: Failure Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_COLOR: 'danger' + SLACK_FOOTER: '' + SLACK_ICON_EMOJI: ':github-actions:' + SLACK_TITLE: 'Triggering Netdata Learn documentation update failed:' + SLACK_USERNAME: 'GitHub Actions' + SLACK_MESSAGE: |- + ${{ github.repository }}: Failed to trigger Netdata Learn documentation update workflow. + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: failure() |