diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-08-12 07:26:17 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-08-12 07:26:17 +0000 |
commit | 7877a98bd9c00db5e81dd2f8c734cba2bab20be7 (patch) | |
tree | d18b767250f7c7ced9b8abe2ece784ac1fe24d3e /packaging | |
parent | Releasing debian version 1.35.1-2. (diff) | |
download | netdata-7877a98bd9c00db5e81dd2f8c734cba2bab20be7.tar.xz netdata-7877a98bd9c00db5e81dd2f8c734cba2bab20be7.zip |
Merging upstream version 1.36.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging')
29 files changed, 260 insertions, 234 deletions
diff --git a/packaging/PLATFORM_SUPPORT.md b/packaging/PLATFORM_SUPPORT.md index a629f61de..068f0aecc 100644 --- a/packaging/PLATFORM_SUPPORT.md +++ b/packaging/PLATFORM_SUPPORT.md @@ -57,16 +57,16 @@ to work on these platforms with minimal user effort. | Docker | 19.03 or newer | x86\_64, i386, ARMv7, AArch64, POWER8+ | See our [Docker documentation](/packaging/docker/README.md) for more info on using Netdata on Docker | | Debian | 11.x | x86\_64, i386, ARMv7, AArch64 | | | Debian | 10.x | x86\_64, i386, ARMv7, AArch64 | | -| Debian | 9.x | x86\_64, i386, ARMv7, AArch64 | | | Fedora | 36 | x86\_64, ARMv7, AArch64 | | | Fedora | 35 | x86\_64, ARMv7, AArch64 | | +| openSUSE | Leap 15.4 | x86\_64, AArch64 | | | openSUSE | Leap 15.3 | x86\_64, AArch64 | | +| Oracle Linux | 9.x | x86\_64, AArch64 | | | Oracle Linux | 8.x | x86\_64, AArch64 | | | Red Hat Enterprise Linux | 9.x | x86\_64, AArch64 | | | Red Hat Enterprise Linux | 8.x | x86\_64, AArch64 | | | Red Hat Enterprise Linux | 7.x | x86\_64 | | | Ubuntu | 22.04 | x86\_64, ARMv7, AArch64 | | -| Ubuntu | 21.10 | x86\_64, i386, ARMv7, AArch64 | | | Ubuntu | 20.04 | x86\_64, i386, ARMv7, AArch64 | | | Ubuntu | 18.04 | x86\_64, i386, ARMv7, AArch64 | | @@ -146,14 +146,13 @@ This is a list of platforms that we have supported in the recent past but no lon | -------- | ------- | ----- | | Alpine Linux | 3.12 | EOL as of 2022-05-01 | | Alpine Linux | 3.11 | EOL as of 2021-11-01 | -| Fedora 34 | EOL as of 2022-06-07 | +| Debian | 9.x | EOL as of 2022-06-30 | +| Fedora | 34 | EOL as of 2022-06-07 | | Fedora | 33 | EOL as of 2021-11-30 | -| Fedora | 32 | EOL as of 2021-05-25 | | FreeBSD | 11-STABLE | EOL as of 2021-10-30 | | openSUSE | Leap 15.2 | EOL as of 2021-12-01 | +| Ubuntu | 21.10 | EOL as of 2022-07-31 | | Ubuntu | 21.04 | EOL as of 2022-01-01 | -| Ubuntu | 20.10 | EOL as of 2021-07-22 | -| Ubuntu | 16.04 | EOL as of 2021-04-02 | ## Static builds diff --git a/packaging/bundle-judy.sh b/packaging/bundle-judy.sh deleted file mode 100755 index 2c0f3214e..000000000 --- a/packaging/bundle-judy.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -JUDY_TARBALL="v$(cat "${1}/packaging/judy.version").tar.gz" -JUDY_BUILD_PATH="${1}/externaldeps/libJudy/libjudy-$(cat "${1}/packaging/judy.version")" - -mkdir -p "${1}/externaldeps/libJudy" || exit 1 -curl -sSL --connect-timeout 10 --retry 3 "https://github.com/netdata/libjudy/archive/${JUDY_TARBALL}" > "${JUDY_TARBALL}" || exit 1 -sha256sum -c "${1}/packaging/judy.checksums" || exit 1 -tar -xzf "${JUDY_TARBALL}" -C "${1}/externaldeps/libJudy" || exit 1 -OLDPWD="${PWD}" -cd "${JUDY_BUILD_PATH}" || exit 1 -libtoolize --force --copy || exit 1 -aclocal || exit 1 -autoheader || exit 1 -automake --add-missing --force --copy --include-deps || exit 1 -autoconf || exit 1 -./configure --disable-dependency-tracking || exit 1 -make -C src || exit 1 -ar -r src/libJudy.a src/Judy*/*.o || exit 1 -cd "${OLDPWD}" || exit 1 - -cp -a "${JUDY_BUILD_PATH}/src/libJudy.a" "${1}/externaldeps/libJudy" || exit 1 -cp -a "${JUDY_BUILD_PATH}/src/Judy.h" "${1}/externaldeps/libJudy" || exit 1 diff --git a/packaging/docker/Dockerfile b/packaging/docker/Dockerfile index 194fa536b..287c592bb 100644 --- a/packaging/docker/Dockerfile +++ b/packaging/docker/Dockerfile @@ -8,8 +8,6 @@ FROM netdata/builder:latest as builder # One of 'nightly' or 'stable' ARG RELEASE_CHANNEL=nightly -ENV JUDY_VER 1.0.5 - ARG CFLAGS ENV CFLAGS=$CFLAGS @@ -18,6 +16,10 @@ ARG EXTRA_INSTALL_OPTS ENV EXTRA_INSTALL_OPTS=$EXTRA_INSTALL_OPTS +ARG DEBUG_BUILD + +ENV DEBUG_BUILD=$DEBUG_BUILD + # Copy source COPY . /opt/netdata.git WORKDIR /opt/netdata.git @@ -26,7 +28,7 @@ WORKDIR /opt/netdata.git RUN chmod +x netdata-installer.sh && \ cp -rp /deps/* /usr/local/ && \ /bin/echo -e "INSTALL_TYPE='oci'\nPREBUILT_ARCH='$(uname -m)'" > ./system/.install-type && \ - CFLAGS="-O2 -pipe" ./netdata-installer.sh --dont-wait --dont-start-it --use-system-protobuf \ + CFLAGS="$(packaging/docker/gen-cflags.sh)" ./netdata-installer.sh --dont-wait --dont-start-it --use-system-protobuf \ ${EXTRA_INSTALL_OPTS} --one-time-build "$([ "$RELEASE_CHANNEL" = stable ] && echo --stable-channel)" # files to one directory diff --git a/packaging/docker/README.md b/packaging/docker/README.md index dcce9a4a1..e3697fdaa 100644 --- a/packaging/docker/README.md +++ b/packaging/docker/README.md @@ -11,7 +11,7 @@ you get set up quickly, and doesn't install anything permanent on the system, wh See our full list of Docker images at [Docker Hub](https://hub.docker.com/r/netdata/netdata). -Starting with v1.30, Netdata collects anonymous usage information by default and sends it to a self hosted PostHog instance within the Netdata infrastructure. Read +Starting with v1.30, Netdata collects anonymous usage information by default and sends it to a self-hosted PostHog instance within the Netdata infrastructure. Read about the information collected, and learn how to-opt, on our [anonymous statistics](/docs/anonymous-statistics.md) page. @@ -133,12 +133,12 @@ You can control how the health checks run by using the environment variable `NET In most cases, the default behavior of checking the `/api/v1/info` endpoint will be sufficient. If you are using a configuration which -disables the web server or restricts access to certain API's, you will +disables the web server or restricts access to certain APIs, you will need to use a non-default configuration for health checks to work. ## Configure Agent containers -If you started an Agent container using one of the [recommended methods](#create-a-new-netdata-agent-container) and you +If you started an Agent container using one of the [recommended methods](#create-a-new-netdata-agent-container), and you want to edit Netdata's configuration, you must first use `docker exec` to attach to the container. Replace `netdata` with the name of your container. @@ -153,6 +153,9 @@ to restart the container: `docker restart netdata`. ### Host-editable configuration +> **Warning**: [edit-config](/docs/configure/nodes.md#the-netdata-config-directory) script doesn't work when executed on +> the host system. + If you want to make your container's configuration directory accessible from the host system, you need to use a [volume](https://docs.docker.com/storage/bind-mounts/) rather than a bind mount. The following commands create a temporary `netdata_tmp` container, which is used to populate a `netdataconfig` directory, which is then mounted inside @@ -222,7 +225,7 @@ volumes: You can change the hostname of a Docker container, and thus the name that appears in the local dashboard and in Netdata Cloud, when creating a new container. If you want to change the hostname of a Netdata container _after_ you started it, -you can safely stop and remove it. You configuration and metrics data reside in persistent volumes and are reattached to +you can safely stop and remove it. Your configuration and metrics data reside in persistent volumes and are reattached to the recreated container. If you use `docker-run`, use the `--hostname` option with `docker run`. @@ -251,7 +254,7 @@ how you created the container. ### Add or remove other volumes -Some of the volumes are optional depending on how you use Netdata: +Some volumes are optional depending on how you use Netdata: - If you don't want to use the apps.plugin functionality, you can remove the mounts of `/etc/passwd` and `/etc/group` (they are used to get proper user and group names for the monitored host) to get slightly better security. @@ -367,6 +370,42 @@ services: - DOCKER_USR=root ``` +### Docker container network interfaces monitoring + +Netdata can map a virtual interface in the system namespace to an interface inside a Docker container +when using network [bridge](https://docs.docker.com/network/bridge/) driver. To do this, the Netdata container needs +additional privileges: + +- the host PID mode. This turns on sharing between container and the host operating system the PID + address space (needed to get list of PIDs from `cgroup.procs` file). + +- `SYS_ADMIN` capability (needed to execute `setns()`). + +**docker run**: + +```bash +docker run -d --name=netdata \ + ... + --pid=host \ + --cap-add SYS_ADMIN \ + ... + netdata/netdata +``` + +**docker compose**: + +```yaml +version: '3' +services: + netdata: + image: netdata/netdata + container_name: netdata + pid: host + cap_add: + - SYS_ADMIN + ... +``` + ### Pass command line options to Netdata Since we use an [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint) directive, you can provide @@ -384,7 +423,7 @@ email address for [Let's Encrypt](https://letsencrypt.org/) before starting. ### Caddyfile -This file needs to be placed in `/opt` with name `Caddyfile`. Here you customize your domain and you need to provide +This file needs to be placed in `/opt` with name `Caddyfile`. Here you customize your domain, and you need to provide your email address to obtain a Let's Encrypt certificate. Certificate renewal will happen automatically and will be executed internally by the caddy server. @@ -450,10 +489,10 @@ You may either use the command line tools available or take advantage of our Tra ### Inside Netdata organization, using Travis CI -To enable Travis CI integration on your own repositories (Docker and Github), you need to be part of the Netdata +To enable Travis CI integration on your own repositories (Docker and GitHub), you need to be part of the Netdata organization. -Once you have contacted the Netdata owners to setup you up on Github and Travis, execute the following steps +Once you have contacted the Netdata owners to setup you up on GitHub and Travis, execute the following steps - Preparation - Have Netdata forked on your personal GitHub account @@ -478,7 +517,7 @@ Once you have contacted the Netdata owners to setup you up on Github and Travis, - While in Travis settings, under Netdata repository settings in the Environment Variables section, you need to add the following: - - `DOCKER_USERNAME` and `DOCKER_PWD` variables so that Travis can login to your Docker Hub account and publish + - `DOCKER_USERNAME` and `DOCKER_PWD` variables so that Travis can log in to your Docker Hub account and publish Docker images there. - `REPOSITORY` variable to `NETDATA_DEVELOPER/netdata`, where `NETDATA_DEVELOPER` is your GitHub handle again. - `GITHUB_TOKEN` variable with the token generated on the preparation step, for Travis workflows to function diff --git a/packaging/docker/gen-cflags.sh b/packaging/docker/gen-cflags.sh new file mode 100755 index 000000000..3a80b7358 --- /dev/null +++ b/packaging/docker/gen-cflags.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ -n "${CFLAGS}" ]; then + echo "${CFLAGS}" +elif [ -n "${DEBUG_BUILD}" ]; then + echo "-Og -ggdb -pipe" +else + echo "-O2 -pipe" +fi diff --git a/packaging/go.d.checksums b/packaging/go.d.checksums index 8af2e9367..4c73aecd8 100644 --- a/packaging/go.d.checksums +++ b/packaging/go.d.checksums @@ -1,16 +1,16 @@ -edf078050016c8411f593aa7e00c5879316073468af178d7c607f44f27ae57a6 *config.tar.gz -2b20f8f6a7cc7d233b3e08ef61260dabf603eeb2cb9ab9055af3e4855fa25da1 *go.d.plugin-v0.32.3.darwin-amd64.tar.gz -7ac588f24c75d2b2f969a5257f8178ddc6dd18c16bef7bf412c44a63e2299192 *go.d.plugin-v0.32.3.freebsd-386.tar.gz -a60fd241c48de208ba0f8bdc796b0cc6a4d9a4ae710a1eb69ad2b8d640b7918b *go.d.plugin-v0.32.3.freebsd-amd64.tar.gz -1a52a6d3303de79614934101c3c556c0e4509767992aef4ac005e730a3f9dc9a *go.d.plugin-v0.32.3.freebsd-arm.tar.gz -c8328d5abfa48a6d4e0d7f886cced2232f1c0a7d46f1bc601efdf672beaa0333 *go.d.plugin-v0.32.3.freebsd-arm64.tar.gz -d57674085cf572fdd97db303f7821ac33ce9f7613b67ea30bbb4851418518c2b *go.d.plugin-v0.32.3.linux-386.tar.gz -e14dd0c90649dae44d17c4f071c28e80f30e8f6d9cfd1e45f0a5a626bc8b96d2 *go.d.plugin-v0.32.3.linux-amd64.tar.gz -fc21e1078b4ebdbe6751e6b777ff24c4459252075bbac4c9634e5654d693af6e *go.d.plugin-v0.32.3.linux-arm.tar.gz -e4e6693a14bb7e9575c1c9cde0997d97b9b21a49659cad479a93f99681d9b57a *go.d.plugin-v0.32.3.linux-arm64.tar.gz -a718d54f5d562ff85fcecf9d6bfdb7e6edfed64456aca7174e67bafc4c617f19 *go.d.plugin-v0.32.3.linux-mips.tar.gz -5c34aab28e9e70ccc06ff947b9d5a5372f409330a1d6ffc40be8e49d6c695bb6 *go.d.plugin-v0.32.3.linux-mips64.tar.gz -5a4fe1c0d11a46d4cc6162284dc03e2a2732d2c636d7951a99b92088f85280fc *go.d.plugin-v0.32.3.linux-mips64le.tar.gz -c19b7342ec8fac12f8a8de1a667ae784a15ca9621db59fc0369623b2986001e2 *go.d.plugin-v0.32.3.linux-mipsle.tar.gz -5afcab0a8d6e9d5f6eeee6fc0a9ee11a82a8048a3bf8806d66f6c0792eb2080d *go.d.plugin-v0.32.3.linux-ppc64.tar.gz -cb286bcf1e8e4e0dc2590a4aad0a9403b8da808f7c8d7b1a2fbd9a06f8de2dba *go.d.plugin-v0.32.3.linux-ppc64le.tar.gz +c2ad4897acf97555c3874dd301bc6cc76e2e99fa0fdcad469c0869ea70cefaef *config.tar.gz +3d04b65ceb9925f5fac684d54bc6641c0b52314e25d73dae002cc102fe07cd2d *go.d.plugin-v0.35.0.darwin-amd64.tar.gz +7311c4900f2cf24c9f49e5a5dd26d113b2c7b19a5db68dc64643fea1e0f95d29 *go.d.plugin-v0.35.0.freebsd-386.tar.gz +bb9bc9f82cf80ef35df14f1426f91861f749287bccfe54bf8b50da9a28bc434a *go.d.plugin-v0.35.0.freebsd-amd64.tar.gz +e1c7d5670a59348b7adaa16da1445896f5714fef0b8e1d9036729779f6a35fc0 *go.d.plugin-v0.35.0.freebsd-arm.tar.gz +8e129fd490fcf2f6999131e5fe9a48feb50532c2f2dd811204761cc8d7e87649 *go.d.plugin-v0.35.0.freebsd-arm64.tar.gz +a2b01aff7e078aa1ecc1f8a291ea02e8cfdd5fab4c9eaa0d776b606901c1fc51 *go.d.plugin-v0.35.0.linux-386.tar.gz +4aefa432b75bf81ef3cd787740d2ce29ceb3293c749acdd67038ef5a30214a36 *go.d.plugin-v0.35.0.linux-amd64.tar.gz +fd4fb4ffff203235f62e3d668d8b6aabe084fd711c865c4dd0bed7a002b3a671 *go.d.plugin-v0.35.0.linux-arm.tar.gz +005dd629ce9045e8bfb4e710b7aed898f6a39017d37a3d16957665cde0a70a84 *go.d.plugin-v0.35.0.linux-arm64.tar.gz +3a80c16a35e76d7a620b5e7bba8eced78cc44cc9803b8f41814b6c8516d0bfbd *go.d.plugin-v0.35.0.linux-mips.tar.gz +c1da9fec36aefde1af3ac0d70fc64bdc2726e6f5c0434f636e8e114d83f155c4 *go.d.plugin-v0.35.0.linux-mips64.tar.gz +77c0ec5867a1bbe6cc2b718aa00be8b112ca90b951fdd47e1d93218a514863ce *go.d.plugin-v0.35.0.linux-mips64le.tar.gz +740ad96ba6089f82a711863f063f1b4228b279c16eb85638e93c427a410ae719 *go.d.plugin-v0.35.0.linux-mipsle.tar.gz +65fade14e33ccf7323a752a8dd6507cf5ec9db05bd66de8d09ffb24b21b300dd *go.d.plugin-v0.35.0.linux-ppc64.tar.gz +5b6d3b289fa3ec6a3276e896530ed7760b94105870bc52662ed2d8369122e599 *go.d.plugin-v0.35.0.linux-ppc64le.tar.gz diff --git a/packaging/go.d.version b/packaging/go.d.version index 2c768c559..ab4e51c67 100644 --- a/packaging/go.d.version +++ b/packaging/go.d.version @@ -1 +1 @@ -v0.32.3 +v0.35.0 diff --git a/packaging/installer/dependencies/arch.sh b/packaging/installer/dependencies/arch.sh index fbad75406..dc37bcb9a 100755 --- a/packaging/installer/dependencies/arch.sh +++ b/packaging/installer/dependencies/arch.sh @@ -24,7 +24,6 @@ declare -a package_tree=( libuv lz4 openssl - judy libelf git pkgconfig diff --git a/packaging/installer/dependencies/centos.sh b/packaging/installer/dependencies/centos.sh index eea71ca32..f5f478ac1 100755 --- a/packaging/installer/dependencies/centos.sh +++ b/packaging/installer/dependencies/centos.sh @@ -139,9 +139,6 @@ validate_tree_centos() { echo >&2 " > Updating libarchive ..." dnf ${opts} install libarchive - echo >&2 " > Installing Judy-devel directly ..." - dnf ${opts} install http://mirror.centos.org/centos/8/PowerTools/x86_64/os/Packages/Judy-devel-1.0.5-18.module_el8.3.0+757+d382997d.x86_64.rpm - dnf makecache --refresh elif [[ $(os_version) =~ ^7(\..*)?$ ]]; then package_manager=yum echo >&2 " > Checking for EPEL ..." diff --git a/packaging/installer/dependencies/debian.sh b/packaging/installer/dependencies/debian.sh index e8c2d0c6c..61ff3e4aa 100755 --- a/packaging/installer/dependencies/debian.sh +++ b/packaging/installer/dependencies/debian.sh @@ -31,7 +31,6 @@ package_tree=" libuv1-dev liblz4-dev libssl-dev - libjudy-dev libelf-dev python python3 diff --git a/packaging/installer/dependencies/fedora.sh b/packaging/installer/dependencies/fedora.sh index 62a129f4c..4cfe7cbb1 100755 --- a/packaging/installer/dependencies/fedora.sh +++ b/packaging/installer/dependencies/fedora.sh @@ -43,7 +43,6 @@ declare -a package_tree=( libuv-devel lz4-devel openssl-devel - Judy-devel elfutils-libelf-devel git pkgconfig diff --git a/packaging/installer/dependencies/freebsd.sh b/packaging/installer/dependencies/freebsd.sh index f9c53f428..6afaca337 100755 --- a/packaging/installer/dependencies/freebsd.sh +++ b/packaging/installer/dependencies/freebsd.sh @@ -9,7 +9,6 @@ DONT_WAIT=0 package_tree=" git - gcc autoconf autoconf-archive autogen @@ -26,7 +25,6 @@ package_tree=" libuv liblz4 openssl - Judy python3 " diff --git a/packaging/installer/dependencies/gentoo.sh b/packaging/installer/dependencies/gentoo.sh index ae1a4af27..ae82cf3b3 100755 --- a/packaging/installer/dependencies/gentoo.sh +++ b/packaging/installer/dependencies/gentoo.sh @@ -28,7 +28,6 @@ package_tree=" dev-libs/libuv app-arch/lz4 dev-libs/openssl - dev-libs/judy virtual/libelf dev-lang/python dev-libs/libuv diff --git a/packaging/installer/dependencies/ol.sh b/packaging/installer/dependencies/ol.sh index 8d0feb3f5..020bf63cc 100755 --- a/packaging/installer/dependencies/ol.sh +++ b/packaging/installer/dependencies/ol.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # Package tree used for installing netdata on distribution: -# << Oracle Linux: [8] >> +# << Oracle Linux: [8, 9] >> set -e @@ -90,13 +90,17 @@ check_flags() { } validate_tree_ol() { - opts= if [ "${NON_INTERACTIVE}" -eq 1 ]; then echo >&2 "Running in non-interactive mode" opts="-y" fi + # shellcheck disable=SC1091 + source /etc/os-release + + # shellcheck disable=SC2153 + version="$(echo "${VERSION}" | cut -f 1 -d '.')" echo >&2 " > Checking for config-manager ..." if ! dnf config-manager &> /dev/null; then @@ -106,9 +110,17 @@ validate_tree_ol() { fi echo " > Checking for CodeReady Builder ..." - if ! dnf repolist | grep ol8_codeready_builder; then - if prompt "CodeReadyBuilder not found, shall I install it?"; then - dnf ${opts} config-manager --set-enabled ol8_codeready_builder || enable_repo + if [[ "${version}" =~ ^8(\..*)?$ ]]; then + if ! dnf repolist enabled | grep ol8_codeready_builder; then + if prompt "CodeReadyBuilder not found, shall I install it?"; then + dnf ${opts} config-manager --set-enabled ol8_codeready_builder || enable_repo + fi + fi + elif [[ "${version}" =~ ^9(\..*)?$ ]]; then + if ! dnf repolist enabled | grep ol9_codeready_builder; then + if prompt "CodeReadyBuilder not found, shall I install it?"; then + dnf ${opts} config-manager --set-enabled ol9_codeready_builder || enable_repo + fi fi fi diff --git a/packaging/installer/dependencies/opensuse.sh b/packaging/installer/dependencies/opensuse.sh index 7c5b840e7..51a6d909e 100755 --- a/packaging/installer/dependencies/opensuse.sh +++ b/packaging/installer/dependencies/opensuse.sh @@ -29,7 +29,6 @@ declare -a package_tree=( libuv-devel liblz4-devel libopenssl-devel - judy-devel libelf-devel git tar diff --git a/packaging/installer/dependencies/ubuntu.sh b/packaging/installer/dependencies/ubuntu.sh index 2bf116a11..b99098821 100755 --- a/packaging/installer/dependencies/ubuntu.sh +++ b/packaging/installer/dependencies/ubuntu.sh @@ -31,7 +31,6 @@ package_tree=" libuv1-dev liblz4-dev libssl-dev - libjudy-dev libelf-dev python3 " diff --git a/packaging/installer/install-required-packages.sh b/packaging/installer/install-required-packages.sh index 8855acebd..da3cf5e4a 100755 --- a/packaging/installer/install-required-packages.sh +++ b/packaging/installer/install-required-packages.sh @@ -20,7 +20,6 @@ fi PACKAGES_NETDATA=${PACKAGES_NETDATA-1} PACKAGES_NETDATA_PYTHON=${PACKAGES_NETDATA_PYTHON-0} PACKAGES_NETDATA_PYTHON3=${PACKAGES_NETDATA_PYTHON3-1} -PACKAGES_NETDATA_PYTHON_MYSQL=${PACKAGES_NETDATA_PYTHON_MYSQL-0} PACKAGES_NETDATA_PYTHON_POSTGRES=${PACKAGES_NETDATA_PYTHON_POSTGRES-0} PACKAGES_NETDATA_PYTHON_MONGO=${PACKAGES_NETDATA_PYTHON_MONGO-0} PACKAGES_DEBUG=${PACKAGES_DEBUG-0} @@ -98,20 +97,16 @@ Supported installers (IN): Supported packages (you can append many of them): - netdata-all all packages required to install netdata - including mysql client, postgres client, + including postgres client, node.js, python, sensors, etc - netdata minimum packages required to install netdata - (no mysql client, includes python) + (includes python) - python install python - python3 install python3 - - python-mysql install MySQLdb - (for monitoring mysql, will install python3 version - if python3 is enabled or detected) - - python-postgres install psycopg2 (for monitoring postgres, will install python3 version if python3 is enabled or detected) @@ -670,13 +665,6 @@ declare -A pkg_automake=( ['default']="automake" ) -# required to bundle libJudy -declare -A pkg_libtool=( - ['gentoo']="sys-devel/libtool" - ['clearlinux']="c-basic" - ['default']="libtool" -) - # Required to build libwebsockets and libmosquitto on some systems. declare -A pkg_cmake=( ['gentoo']="dev-util/cmake" @@ -717,13 +705,6 @@ declare -A pkg_bridge_utils=( ['default']="bridge-utils" ) -declare -A pkg_chrony=( - ['gentoo']="net-misc/chrony" - ['clearlinux']="time-server-basic" - ['macos']="WARNING|" - ['default']="chrony" -) - declare -A pkg_curl=( ['gentoo']="net-misc/curl" ['sabayon']="net-misc/curl" @@ -960,55 +941,6 @@ declare -A pkg_python=( ['centos-8']="python2" ) -declare -A pkg_python_mysqldb=( - ['alpine']="py-mysqldb" - ['arch']="mysql-python" - ['centos']="MySQL-python" - ['debian']="python-mysqldb" - ['gentoo']="dev-python/mysqlclient" - ['sabayon']="dev-python/mysqlclient" - ['rhel']="MySQL-python" - ['suse']="python-PyMySQL" - ['clearlinux']="WARNING|" - ['default']="python-mysql" - - # exceptions - ['fedora-24']="python2-mysql" - ['ol-8']="WARNING|" -) - -declare -A pkg_python3_mysqldb=( - ['alpine']="WARNING|" - ['arch']="WARNING|" - ['centos']="WARNING|" - ['debian']="python3-mysqldb" - ['gentoo']="dev-python/mysqlclient" - ['sabayon']="dev-python/mysqlclient" - ['rhel']="WARNING|" - ['ol']="WARNING|" - ['suse']="WARNING|" - ['clearlinux']="WARNING|" - ['macos']="WARNING|" - ['default']="WARNING|" - - # exceptions - ['debian-6']="WARNING|" - ['debian-7']="WARNING|" - ['debian-8']="WARNING|" - ['ubuntu-12.04']="WARNING|" - ['ubuntu-12.10']="WARNING|" - ['ubuntu-13.04']="WARNING|" - ['ubuntu-13.10']="WARNING|" - ['ubuntu-14.04']="WARNING|" - ['ubuntu-14.10']="WARNING|" - ['ubuntu-15.04']="WARNING|" - ['ubuntu-15.10']="WARNING|" - ['centos-7']="python36-mysql" - ['centos-8']="python38-mysql" - ['rhel-7']="python36-mysql" - ['rhel-8']="python38-mysql" -) - declare -A pkg_python_psycopg2=( ['alpine']="py-psycopg2" ['arch']="python2-psycopg2" @@ -1173,17 +1105,6 @@ declare -A pkg_openssl=( ['default']="openssl-devel" ) -declare -A pkg_judy=( - ['debian']="libjudy-dev" - ['ubuntu']="libjudy-dev" - ['suse']="judy-devel" - ['gentoo']="dev-libs/judy" - ['arch']="judy" - ['freebsd']="Judy" - ['fedora']="Judy-devel" - ['default']="NOTREQUIRED" -) - declare -A pkg_python3=( ['gentoo']="dev-lang/python" ['sabayon']="dev-lang/python:3.4" @@ -1341,16 +1262,15 @@ packages() { require_cmd git || suitable_package git require_cmd find || suitable_package find - require_cmd gcc || + require_cmd gcc || require_cmd clang || require_cmd gcc-multilib || suitable_package gcc - require_cmd g++ || suitable_package gxx + require_cmd g++ || require_cmd clang++ || suitable_package gxx require_cmd make || suitable_package make require_cmd autoconf || suitable_package autoconf suitable_package autoconf-archive require_cmd autogen || suitable_package autogen require_cmd automake || suitable_package automake - require_cmd libtoolize || suitable_package libtool require_cmd pkg-config || suitable_package pkg-config require_cmd cmake || suitable_package cmake @@ -1422,7 +1342,6 @@ packages() { suitable_package libuv suitable_package lz4 suitable_package openssl - suitable_package judy fi # ------------------------------------------------------------------------- @@ -1441,7 +1360,6 @@ packages() { # suitable_package python-requests # suitable_package python-pip - [ "${PACKAGES_NETDATA_PYTHON_MYSQL}" -ne 0 ] && suitable_package python-mysqldb [ "${PACKAGES_NETDATA_PYTHON_POSTGRES}" -ne 0 ] && suitable_package python-psycopg2 fi @@ -1455,7 +1373,6 @@ packages() { # suitable_package python3-requests # suitable_package python3-pip - [ "${PACKAGES_NETDATA_PYTHON_MYSQL}" -ne 0 ] && suitable_package python3-mysqldb [ "${PACKAGES_NETDATA_PYTHON_POSTGRES}" -ne 0 ] && suitable_package python3-psycopg2 fi @@ -1591,6 +1508,13 @@ validate_tree_ol() { EOF fi fi + elif [[ "${version}" =~ ^9(\..*)?$ ]]; then + echo " > Checking for CodeReady Builder ..." + if ! run ${sudo} dnf repolist enabled | grep -q codeready; then + if prompt "CodeReady Builder not enabled, shall I enable it?"; then + run ${sudo} dnf config-manager --set-enabled ol9_codeready_builder + fi + fi fi } @@ -1635,9 +1559,6 @@ validate_tree_centos() { echo >&2 " > Updating libarchive ..." run ${sudo} yum ${opts} install libarchive - echo >&2 " > Installing Judy-devel directly ..." - run ${sudo} yum ${opts} install http://mirror.centos.org/centos/8/PowerTools/x86_64/os/Packages/Judy-devel-1.0.5-18.module_el8.3.0+757+d382997d.x86_64.rpm - elif [[ "${version}" =~ ^7(\..*)?$ ]]; then echo >&2 " > Checking for EPEL ..." if ! rpm -qa | grep epel-release > /dev/null; then @@ -1992,7 +1913,7 @@ EOF remote_log() { # log success or failure on our system # to help us solve installation issues - curl > /dev/null 2>&1 -Ss --max-time 3 "https://registry.my-netdata.io/log/installer?status=${1}&error=${2}&distribution=${distribution}&version=${version}&installer=${package_installer}&tree=${tree}&detection=${detection}&netdata=${PACKAGES_NETDATA}&python=${PACKAGES_NETDATA_PYTHON}&python3=${PACKAGES_NETDATA_PYTHON3}&mysql=${PACKAGES_NETDATA_PYTHON_MYSQL}&postgres=${PACKAGES_NETDATA_PYTHON_POSTGRES}&pymongo=${PACKAGES_NETDATA_PYTHON_MONGO}&sensors=${PACKAGES_NETDATA_SENSORS}&database=${PACKAGES_NETDATA_DATABASE}&ebpf=${PACKAGES_NETDATA_EBPF}&firehol=${PACKAGES_FIREHOL}&fireqos=${PACKAGES_FIREQOS}&iprange=${PACKAGES_IPRANGE}&update_ipsets=${PACKAGES_UPDATE_IPSETS}&demo=${PACKAGES_NETDATA_DEMO_SITE}" + curl > /dev/null 2>&1 -Ss --max-time 3 "https://registry.my-netdata.io/log/installer?status=${1}&error=${2}&distribution=${distribution}&version=${version}&installer=${package_installer}&tree=${tree}&detection=${detection}&netdata=${PACKAGES_NETDATA}&python=${PACKAGES_NETDATA_PYTHON}&python3=${PACKAGES_NETDATA_PYTHON3}&postgres=${PACKAGES_NETDATA_PYTHON_POSTGRES}&pymongo=${PACKAGES_NETDATA_PYTHON_MONGO}&sensors=${PACKAGES_NETDATA_SENSORS}&database=${PACKAGES_NETDATA_DATABASE}&ebpf=${PACKAGES_NETDATA_EBPF}&firehol=${PACKAGES_FIREHOL}&fireqos=${PACKAGES_FIREQOS}&iprange=${PACKAGES_IPRANGE}&update_ipsets=${PACKAGES_UPDATE_IPSETS}&demo=${PACKAGES_NETDATA_DEMO_SITE}" } if [ -z "${1}" ]; then @@ -2055,12 +1976,10 @@ while [ -n "${1}" ]; do PACKAGES_NETDATA=1 if [ "${pv}" -eq 2 ]; then PACKAGES_NETDATA_PYTHON=1 - PACKAGES_NETDATA_PYTHON_MYSQL=1 PACKAGES_NETDATA_PYTHON_POSTGRES=1 PACKAGES_NETDATA_PYTHON_MONGO=1 else PACKAGES_NETDATA_PYTHON3=1 - PACKAGES_NETDATA_PYTHON3_MYSQL=1 PACKAGES_NETDATA_PYTHON3_POSTGRES=1 PACKAGES_NETDATA_PYTHON3_MONGO=1 fi @@ -2084,16 +2003,6 @@ while [ -n "${1}" ]; do PACKAGES_NETDATA_PYTHON3=1 ;; - python-mysql | mysql-python | mysqldb | netdata-mysql) - if [ "${pv}" -eq 2 ]; then - PACKAGES_NETDATA_PYTHON=1 - PACKAGES_NETDATA_PYTHON_MYSQL=1 - else - PACKAGES_NETDATA_PYTHON3=1 - PACKAGES_NETDATA_PYTHON3_MYSQL=1 - fi - ;; - python-postgres | postgres-python | psycopg2 | netdata-postgres) if [ "${pv}" -eq 2 ]; then PACKAGES_NETDATA_PYTHON=1 @@ -2133,12 +2042,10 @@ while [ -n "${1}" ]; do PACKAGES_NETDATA=1 if [ "${pv}" -eq 2 ]; then PACKAGES_NETDATA_PYTHON=1 - PACKAGES_NETDATA_PYTHON_MYSQL=1 PACKAGES_NETDATA_PYTHON_POSTGRES=1 PACKAGES_NETDATA_PYTHON_MONGO=1 else PACKAGES_NETDATA_PYTHON3=1 - PACKAGES_NETDATA_PYTHON3_MYSQL=1 PACKAGES_NETDATA_PYTHON3_POSTGRES=1 PACKAGES_NETDATA_PYTHON3_MONGO=1 fi diff --git a/packaging/installer/kickstart.sh b/packaging/installer/kickstart.sh index a1079c3fd..10f6b9664 100755 --- a/packaging/installer/kickstart.sh +++ b/packaging/installer/kickstart.sh @@ -16,12 +16,21 @@ DISCUSSIONS_URL="https://github.com/netdata/netdata/discussions" DOCS_URL="https://learn.netdata.cloud/docs/" FORUM_URL="https://community.netdata.cloud/" KICKSTART_OPTIONS="${*}" -KICKSTART_SOURCE="$(realpath "$0")" +KICKSTART_SOURCE="$( + self=${0} + while [ -L "${self}" ] + do + cd "${self%/*}" || exit 1 + self=$(readlink "${self}") + done + cd "${self%/*}" || exit 1 + echo "$(pwd -P)/${self##*/}" +)" PACKAGES_SCRIPT="https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/install-required-packages.sh" PATH="${PATH}:/usr/local/bin:/usr/local/sbin" PUBLIC_CLOUD_URL="https://app.netdata.cloud" REPOCONFIG_URL_PREFIX="https://packagecloud.io/netdata/netdata-repoconfig/packages" -REPOCONFIG_VERSION="1-1" +REPOCONFIG_VERSION="1-2" START_TIME="$(date +%s)" STATIC_INSTALL_ARCHES="x86_64 armv7l aarch64 ppc64le" TELEMETRY_URL="https://posthog.netdata.cloud/capture/" @@ -696,11 +705,17 @@ update() { return 0 fi + if [ "${INTERACTIVE}" -eq 0 ]; then + opts="--non-interactive" + else + opts="--interactive" + fi + export NETDATA_SAVE_WARNINGS=1 export NETDATA_PROPAGATE_WARNINGS=1 # shellcheck disable=SC2090 export NETDATA_WARNINGS="${NETDATA_WARNINGS}" - if run ${ROOTCMD} "${updater}" --not-running-from-cron; then + if run ${ROOTCMD} "${updater}" ${opts} --not-running-from-cron; then progress "Updated existing install at ${ndprefix}" return 0 else @@ -771,6 +786,8 @@ uninstall() { } detect_existing_install() { + set_tmpdir + progress "Checking for existing installations of Netdata..." if pkg_installed netdata; then @@ -936,6 +953,8 @@ handle_existing_install() { } soft_disable_cloud() { + set_tmpdir + cloud_prefix="${INSTALL_PREFIX}/var/lib/netdata/cloud.d" run ${ROOTCMD} mkdir -p "${cloud_prefix}" @@ -1227,6 +1246,8 @@ try_package_install() { return 2 fi + set_tmpdir + if [ "${DRY_RUN}" -eq 1 ]; then progress "Would attempt to install using native packages..." else @@ -1585,6 +1606,7 @@ set_source_archive_urls() { } install_local_build_dependencies() { + set_tmpdir bash="$(command -v bash 2> /dev/null)" if [ -z "${bash}" ] || [ ! -x "${bash}" ]; then @@ -1665,6 +1687,8 @@ build_and_install() { } try_build_install() { + set_tmpdir + if [ "${DRY_RUN}" -eq 1 ]; then progress "Would attempt to install by building locally..." else diff --git a/packaging/installer/methods/freebsd.md b/packaging/installer/methods/freebsd.md index 12b55d6ad..3523157bd 100644 --- a/packaging/installer/methods/freebsd.md +++ b/packaging/installer/methods/freebsd.md @@ -20,7 +20,7 @@ This is how to install the latest Netdata version on FreeBSD: Install required packages (**need root permission**): ```sh -pkg install bash e2fsprogs-libuuid git curl autoconf automake pkgconf pidof Judy liblz4 libuv json-c cmake gmake +pkg install bash e2fsprogs-libuuid git curl autoconf automake pkgconf pidof liblz4 libuv json-c cmake gmake ``` Download Netdata: diff --git a/packaging/installer/methods/manual.md b/packaging/installer/methods/manual.md index aaf1451df..c47c2e364 100644 --- a/packaging/installer/methods/manual.md +++ b/packaging/installer/methods/manual.md @@ -25,9 +25,6 @@ and other operating systems and is regularly tested. You can find this tool [her - **Alpine** Linux and its derivatives - You have to install `bash` yourself, before using the installer. -- **Arch** Linux and its derivatives - - You need arch/aur for package Judy. - - **Gentoo** Linux and its derivatives - **Debian** Linux and its derivatives (including **Ubuntu**, **Mint**) @@ -67,16 +64,16 @@ This is how to do it by hand: ```sh # Debian / Ubuntu -apt-get install zlib1g-dev uuid-dev libuv1-dev liblz4-dev libjudy-dev libssl-dev libelf-dev libmnl-dev libprotobuf-dev protobuf-compiler gcc g++ make git autoconf autoconf-archive autogen automake pkg-config curl python cmake +apt-get install zlib1g-dev uuid-dev libuv1-dev liblz4-dev libssl-dev libelf-dev libmnl-dev libprotobuf-dev protobuf-compiler gcc g++ make git autoconf autoconf-archive autogen automake pkg-config curl python cmake # Fedora -dnf install zlib-devel libuuid-devel libuv-devel lz4-devel Judy-devel openssl-devel elfutils-libelf-devel libmnl-devel protobuf-devel protobuf-compiler gcc gcc-c++ make git autoconf autoconf-archive autogen automake pkgconfig curl findutils python cmake +dnf install zlib-devel libuuid-devel libuv-devel lz4-devel openssl-devel elfutils-libelf-devel libmnl-devel protobuf-devel protobuf-compiler gcc gcc-c++ make git autoconf autoconf-archive autogen automake pkgconfig curl findutils python cmake # CentOS / Red Hat Enterprise Linux -yum install autoconf automake curl gcc gcc-c++ git libmnl-devel libuuid-devel openssl-devel libuv-devel lz4-devel Judy-devel elfutils-libelf-devel protobuf protobuf-devel protobuf-compiler make nc pkgconfig python zlib-devel cmake +yum install autoconf automake curl gcc gcc-c++ git libmnl-devel libuuid-devel openssl-devel libuv-devel lz4-devel elfutils-libelf-devel protobuf protobuf-devel protobuf-compiler make nc pkgconfig python zlib-devel cmake # openSUSE -zypper install zlib-devel libuuid-devel libuv-devel liblz4-devel judy-devel libopenssl-devel libelf-devel libmnl-devel protobuf-devel gcc gcc-c++ make git autoconf autoconf-archive autogen automake pkgconfig curl findutils python cmake +zypper install zlib-devel libuuid-devel libuv-devel liblz4-devel libopenssl-devel libelf-devel libmnl-devel protobuf-devel gcc gcc-c++ make git autoconf autoconf-archive autogen automake pkgconfig curl findutils python cmake ``` Once Netdata is compiled, to run it the following packages are required (already installed using the above commands): @@ -117,7 +114,6 @@ Netdata DB engine can be enabled when these are installed (they are optional): | package | description| |:-----:|-----------| | `liblz4` | Extremely fast compression algorithm, version r129 or greater| -| `Judy` | General purpose dynamic array| | `openssl`| Cryptography and SSL/TLS toolkit| *Netdata will greatly benefit if you have the above packages installed, but it will still work without them.* @@ -175,8 +171,6 @@ yum install -y http://repo.okay.com.mx/centos/8/x86_64/release/okay-release-1-3. # Install Devel Packages yum install autoconf automake curl gcc git cmake libuuid-devel openssl-devel libuv-devel lz4-devel make nc pkgconfig python3 zlib-devel -# Install Judy-Devel directly -yum install -y http://mirror.centos.org/centos/8/PowerTools/x86_64/os/Packages/Judy-devel-1.0.5-18.module_el8.1.0+217+4d875839.x86_64.rpm ``` ## Install Netdata diff --git a/packaging/installer/methods/pfsense.md b/packaging/installer/methods/pfsense.md index f0d730036..e0556629c 100644 --- a/packaging/installer/methods/pfsense.md +++ b/packaging/installer/methods/pfsense.md @@ -25,7 +25,6 @@ pkg install -y pkgconf bash e2fsprogs-libuuid libuv nano Then run the following commands to download various dependencies from the FreeBSD repository. ```sh -pkg add http://pkg.freebsd.org/FreeBSD:12:amd64/latest/All/Judy-1.0.5_3.txz pkg add http://pkg.freebsd.org/FreeBSD:12:amd64/latest/All/json-c-0.15_1.txz pkg add http://pkg.freebsd.org/FreeBSD:12:amd64/latest/All/py38-certifi-2021.10.8.txz pkg add http://pkg.freebsd.org/FreeBSD:12:amd64/latest/All/py38-asn1crypto-1.4.0.txz diff --git a/packaging/installer/methods/source.md b/packaging/installer/methods/source.md index a25323f0c..d8f4f0bda 100644 --- a/packaging/installer/methods/source.md +++ b/packaging/installer/methods/source.md @@ -32,7 +32,6 @@ Additionally, the following build time features require additional dependencies: - dbengine metric storage: - liblz4 r129 or newer - OpenSSL 1.0 or newer (LibreSSL _amy_ work, but is largely untested). - - [libJudy](http://judy.sourceforge.net/) - Netdata Cloud support: - A working internet connection - A recent version of CMake diff --git a/packaging/installer/netdata-updater.sh b/packaging/installer/netdata-updater.sh index e4cb29a45..15b7deda8 100755 --- a/packaging/installer/netdata-updater.sh +++ b/packaging/installer/netdata-updater.sh @@ -28,7 +28,7 @@ # Author: Pavlos Emm. Katsoulakis <paul@netdata.cloud> # Author: Austin S. Hemmelgarn <austin@netdata.cloud> -# Next unused error code: U001A +# Next unused error code: U001B set -e @@ -266,10 +266,10 @@ str_in_list() { safe_sha256sum() { # Within the context of the installer, we only use -c option that is common between the two commands # We will have to reconsider if we start non-common options - if command -v sha256sum > /dev/null 2>&1; then - sha256sum "$@" - elif command -v shasum > /dev/null 2>&1; then + if command -v shasum > /dev/null 2>&1; then shasum -a 256 "$@" + elif command -v sha256sum > /dev/null 2>&1; then + sha256sum "$@" else fatal "I could not find a suitable checksum binary to use" U0002 fi @@ -420,7 +420,9 @@ self_update() { if _safe_download "https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/netdata-updater.sh" ./netdata-updater.sh; then chmod +x ./netdata-updater.sh || exit 1 export ENVIRONMENT_FILE="${ENVIRONMENT_FILE}" - exec ./netdata-updater.sh --not-running-from-cron --no-updater-self-update --tmpdir-path "$(pwd)" + force_update="" + [ "$NETDATA_FORCE_UPDATE" = "1" ] && force_update="--force-update" + exec ./netdata-updater.sh --not-running-from-cron --no-updater-self-update "$force_update" --tmpdir-path "$(pwd)" else error "Failed to download newest version of updater script, continuing with current version." fi @@ -551,7 +553,11 @@ update_build() { NEW_CHECKSUM="$(safe_sha256sum netdata-latest.tar.gz 2> /dev/null | cut -d' ' -f1)" tar -xf netdata-latest.tar.gz >&3 2>&3 rm netdata-latest.tar.gz >&3 2>&3 - cd "$(find . -maxdepth 1 -name "netdata-${path_version}*" | head -n 1)" || fatal "Failed to switch to build directory" U0017 + if [ -z "$path_version" ]; then + latest_tag="$(get_latest_version)" + path_version="$(echo "${latest_tag}" | cut -f 1 -d "-")" + fi + cd "$(find . -maxdepth 1 -type d -name "netdata-${path_version}*" | head -n 1)" || fatal "Failed to switch to build directory" U0017 RUN_INSTALLER=1 fi fi @@ -844,27 +850,30 @@ if [ -r "$(dirname "${ENVIRONMENT_FILE}")/.install-type" ]; then fi while [ -n "${1}" ]; do - if [ "${1}" = "--not-running-from-cron" ]; then - NETDATA_NOT_RUNNING_FROM_CRON=1 - shift 1 - elif [ "${1}" = "--no-updater-self-update" ]; then - NETDATA_NO_UPDATER_SELF_UPDATE=1 - shift 1 - elif [ "${1}" = "--force-update" ]; then - NETDATA_FORCE_UPDATE=1 - shift 1 - elif [ "${1}" = "--tmpdir-path" ]; then - NETDATA_TMPDIR_PATH="${2}" - shift 2 - elif [ "${1}" = "--enable-auto-updates" ]; then - enable_netdata_updater "${2}" - exit $? - elif [ "${1}" = "--disable-auto-updates" ]; then - disable_netdata_updater - exit $? - else - break - fi + case "${1}" in + --not-running-from-cron) NETDATA_NOT_RUNNING_FROM_CRON=1 ;; + --no-updater-self-update) NETDATA_NO_UPDATER_SELF_UPDATE=1 ;; + --force-update) NETDATA_FORCE_UPDATE=1 ;; + --non-interactive) INTERACTIVE=0 ;; + --interactive) INTERACTIVE=1 ;; + --tmpdir-path) + NETDATA_TMPDIR_PATH="${2}" + shift 1 + ;; + --enable-auto-updates) + enable_netdata_updater "${2}" + exit $? + ;; + --disable-auto-updates) + disable_netdata_updater + exit $? + ;; + *) + fatal "Unrecognized option ${1}" U001A + ;; + esac + + shift 1 done # Random sleep to alleviate stampede effect of Agents upgrading diff --git a/packaging/judy.checksums b/packaging/judy.checksums deleted file mode 100644 index 7d4665bc5..000000000 --- a/packaging/judy.checksums +++ /dev/null @@ -1 +0,0 @@ -e623a06bf091758b43f5cd97c3609f8109442d1a0441bc44819b60f2861c61b1 v1.0.5-netdata2.tar.gz diff --git a/packaging/judy.version b/packaging/judy.version deleted file mode 100644 index 934246c2d..000000000 --- a/packaging/judy.version +++ /dev/null @@ -1 +0,0 @@ -1.0.5-netdata2 diff --git a/packaging/makeself/build-static.sh b/packaging/makeself/build-static.sh index c7c5a4bcc..f9f635c79 100755 --- a/packaging/makeself/build-static.sh +++ b/packaging/makeself/build-static.sh @@ -15,30 +15,44 @@ if [ -z "${platform}" ]; then exit 1 fi +if command -v docker > /dev/null 2>&1; then + docker="docker" +elif command -v podman > /dev/null 2>&1; then + docker="podman" +else + echo "Could not find a usable OCI runtime, need either Docker or Podman." + exit 1 +fi + DOCKER_IMAGE_NAME="netdata/static-builder" if [ "${BUILDARCH}" != "$(uname -m)" ] && [ "$(uname -m)" = 'x86_64' ] && [ -z "${SKIP_EMULATION}" ]; then - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes || exit 1 + ${docker} run --rm --privileged multiarch/qemu-user-static --reset -p yes || exit 1 fi -if docker inspect "${DOCKER_IMAGE_NAME}" > /dev/null 2>&1; then - img_platform="$(docker image inspect netdata/static-builder --format '{{.Os}}/{{.Architecture}}/{{.Variant}}')" - if [ "${img_platform%'/'}" != "${platform}" ]; then - docker image rm "${DOCKER_IMAGE_NAME}" || exit 1 +if ${docker} inspect "${DOCKER_IMAGE_NAME}" > /dev/null 2>&1; then + if ${docker} image inspect "${DOCKER_IMAGE_NAME}" | grep -q 'Variant'; then + img_platform="$(${docker} image inspect "${DOCKER_IMAGE_NAME}" --format '{{.Os}}/{{.Architecture}}/{{.Variant}}')" + else + img_platform="$(${docker} image inspect "${DOCKER_IMAGE_NAME}" --format '{{.Os}}/{{.Architecture}}')" + fi + + if [ "${img_platform}" != "${platform}" ]; then + ${docker} image rm "${DOCKER_IMAGE_NAME}" || exit 1 fi fi -if ! docker inspect "${DOCKER_IMAGE_NAME}" > /dev/null 2>&1; then - docker pull --platform "${platform}" "${DOCKER_IMAGE_NAME}" +if ! ${docker} inspect "${DOCKER_IMAGE_NAME}" > /dev/null 2>&1; then + ${docker} pull --platform "${platform}" "${DOCKER_IMAGE_NAME}" fi # Run the build script inside the container if [ -t 1 ]; then - run docker run --rm -e BUILDARCH="${BUILDARCH}" -a stdin -a stdout -a stderr -i -t -v "$(pwd)":/netdata:rw \ + run ${docker} run --rm -e BUILDARCH="${BUILDARCH}" -a stdin -a stdout -a stderr -i -t -v "$(pwd)":/netdata:rw \ "${DOCKER_IMAGE_NAME}" \ /bin/sh /netdata/packaging/makeself/build.sh "${@}" else - run docker run --rm -e BUILDARCH="${BUILDARCH}" -v "$(pwd)":/netdata:rw \ + run ${docker} run --rm -e BUILDARCH="${BUILDARCH}" -v "$(pwd)":/netdata:rw \ -e GITHUB_ACTIONS="${GITHUB_ACTIONS}" "${DOCKER_IMAGE_NAME}" \ /bin/sh /netdata/packaging/makeself/build.sh "${@}" fi diff --git a/packaging/makeself/install-alpine-packages.sh b/packaging/makeself/install-alpine-packages.sh index 06bcd5622..d7974339e 100755 --- a/packaging/makeself/install-alpine-packages.sh +++ b/packaging/makeself/install-alpine-packages.sh @@ -24,6 +24,7 @@ apk add --no-cache -U \ git \ gnutls-dev \ gzip \ + jq \ libelf-static \ libmnl-dev \ libnetfilter_acct-dev \ diff --git a/packaging/makeself/jobs/90-netdata-runtime-check.sh b/packaging/makeself/jobs/90-netdata-runtime-check.sh new file mode 100755 index 000000000..a3c94ffcb --- /dev/null +++ b/packaging/makeself/jobs/90-netdata-runtime-check.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: GPL-3.0-or-later + +# shellcheck source=./packaging/makeself/functions.sh +. "${NETDATA_MAKESELF_PATH}"/functions.sh "${@}" || exit 1 + +dump_log() { + cat ./netdata.log +} + +wait_for() { + host="${1}" + port="${2}" + name="${3}" + timeout="30" + + if command -v nc > /dev/null ; then + netcat="nc" + elif command -v netcat > /dev/null ; then + netcat="netcat" + else + printf "Unable to find a usable netcat command.\n" + return 1 + fi + + printf "Waiting for %s on %s:%s ... " "${name}" "${host}" "${port}" + + sleep 30 + + i=0 + while ! ${netcat} -z "${host}" "${port}"; do + sleep 1 + if [ "$i" -gt "$timeout" ]; then + printf "Timed out!\n" + return 1 + fi + i="$((i + 1))" + done + printf "OK\n" +} + +trap dump_log EXIT + +"${NETDATA_INSTALL_PATH}/bin/netdata" -D > ./netdata.log 2>&1 & + +wait_for localhost 19999 netdata || exit 1 + +curl -sS http://127.0.0.1:19999/api/v1/info > ./response || exit 1 + +cat ./response + +jq '.version' ./response || exit 1 + +trap - EXIT diff --git a/packaging/version b/packaging/version index e8d43fec3..1ff1dd5d8 100644 --- a/packaging/version +++ b/packaging/version @@ -1 +1 @@ -v1.35.1 +v1.36.0 |