@cryptotaxi247 / netdata-1 / commits / f292b0975

Fix regressions in cloud functionality (build, CI, claiming) (#8568)

Fixes regressions in the configure script and build introduced by last night's patch (underhood). Improved the CI/CD to test ACLK builds + Installer changes (ferroin). Removed TLS from libmosquitto. Fixed a problem with user accounts for claiming. (amoss) Co-authored-by: Austin S. Hemmelgarn <austin@netdata.cloud> Co-authored-by: Andrew Moss <1043609+amoss@users.noreply.github.com>

Timo committed Apr 1, 2020 at 17:31 UTC f292b0975dfd5c915d9ddcb19ceca3c5caa73508
6 files changed +72 -32
.github/workflows/build-and-install.yml
+6 -4
@@ -18,7 +18,6 @@ jobs:
18 - 'archlinux:latest'
19 - 'centos:8'
20 - 'centos:7'
21 - - 'centos:6'
21 - 'debian:bullseye'
22 - 'debian:buster'
23 - 'debian:stretch'
@@ -75,10 +74,13 @@ jobs:
74 PRE: ${{ matrix.pre }}
75 run: |
76 echo $PRE > ./prep-cmd.sh
78 - docker build . -f .github/dockerfiles/Dockerfile.build_test -t build_test --build-arg BASE=${{ matrix.distro }}
77 + docker build . -f .github/dockerfiles/Dockerfile.build_test -t test --build-arg BASE=${{ matrix.distro }}
78 - name: Regular build on ${{ matrix.distro }}
79 run: |
81 - docker run --rm -e PRE -w /netdata build_test /bin/sh -c 'autoreconf -ivf && ./configure && make -j2'
80 + docker run -w /netdata test /bin/sh -c 'autoreconf -ivf && ./configure && make -j2'
81 - name: netdata-installer on ${{ matrix.distro }}
82 run: |
84 - docker run --rm -e PRE -w /netdata build_test /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it'
83 + docker run -w /netdata test /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --disable-cloud'
84 + - name: netdata-installer on ${{ matrix.distro }}
85 + run: |
86 + docker run -w /netdata test /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --require-cloud'
claim/netdata-claim.sh.in
+1 -1
@@ -109,7 +109,7 @@ RELOAD=1
109 NETDATA_USER=netdata
110 [ -z "$EUID" ] && EUID="$(id -u)"
111
112 -CONF_USER=$(grep '^[^#]*run as user[ \t]*=' "${NETDATA_USER_CONFIG_DIR}/netdata.conf" 2>/dev/null)
112 +CONF_USER=$(grep '^[ #]*run as user[ ]*=' "${NETDATA_USER_CONFIG_DIR}/netdata.conf" 2>/dev/null)
113 if [ -n "$CONF_USER" ]; then
114 NETDATA_USER=$(echo "$CONF_USER" | sed 's/^[^=]*=[ \t]*//' | sed 's/[ \t]*$//')
115 fi
configure.ac
+23 -14
@@ -170,17 +170,13 @@ AC_ARG_ENABLE(
170 [AS_HELP_STRING([--disable-cloud],
171 [Disables all cloud functionality])],
172 [ enable_cloud="$enableval" ],
173 - [ enable_cloud="yes" ]
173 + [ enable_cloud="detect" ]
174 )
175
176 -AC_MSG_CHECKING([if cloud functionality should be enabled])
176 +aclk_required="${enable_cloud}"
177 if test "${enable_cloud}" = "no"; then
178 AC_DEFINE([DISABLE_CLOUD], [1], [disable netdata cloud functionality])
179 - aclk_required="no"
180 -else
181 - aclk_required="detect"
179 fi
183 -AC_MSG_RESULT([${enable_cloud}])
180
181 # -----------------------------------------------------------------------------
182 # netdata required checks
@@ -555,17 +551,30 @@ AM_CONDITIONAL([ENABLE_CAPABILITY], [test "${with_libcap}" = "yes"])
551 # -----------------------------------------------------------------------------
552 # ACLK
553
558 -if test "$enable_cloud" = "yes"; then
554 +AC_MSG_CHECKING([if cloud functionality should be enabled])
555 +AC_MSG_RESULT([${enable_cloud}])
556 +if test "$enable_cloud" != "no"; then
557 + # just to have all messages that can fail ACLK build in one place
558 + # so it is easier to see why it can't be built
559 + if test -n "${SSL_LIBS}"; then
560 + OPTIONAL_SSL_CFLAGS="${SSL_CFLAGS}"
561 + OPTIONAL_SSL_LIBS="${SSL_LIBS}"
562 + else
563 + AC_MSG_WARN([OpenSSL required for agent-cloud-link but not found. Try installing 'libssl-dev' or 'openssl-devel'.])
564 + fi
565 +
566 AC_MSG_CHECKING([if libmosquitto static lib is present (and builds)])
567 if test -f "externaldeps/mosquitto/libmosquitto.a"; then
561 - LIBS_SAVES="$LIBS"
562 - LIBS="externaldeps/mosquitto/libmosquitto.a"
563 - AC_LINK_IFELSE([AC_LANG_SOURCE([[int main (int argc, char **argv)) {
568 + LIBS_BKP="${LIBS}"
569 + LIBS="externaldeps/mosquitto/libmosquitto.a ${OPTIONAL_SSL_LIBS}"
570 + AC_LINK_IFELSE([AC_LANG_SOURCE([[#include "externaldeps/mosquitto/mosquitto.h"
571 + int main (int argc, char **argv) {
572 int m,mm,r;
573 mosquitto_lib_version(&m, &mm, &r);
566 - }]]),
574 + }]])],
575 [HAVE_libmosquitto_a="yes"],
568 - [HAVE_libmosquitto_a="no"]])
576 + [HAVE_libmosquitto_a="no"])
577 + LIBS="${LIBS_BKP}"
578 else
579 HAVE_libmosquitto_a="no"
580 AC_DEFINE([ACLK_NO_LIBMOSQ], [1], [Libmosquitto.a was not found during build.])
@@ -584,7 +593,7 @@ if test "$enable_cloud" = "yes"; then
593
594 if test "${build_target}" = "linux" -a "${aclk_required}" != "no"; then
595 if test "${have_libcap}" = "yes" -a "${with_libcap}" = "no"; then
587 - AC_MSG_ERROR([agent-cloud-link can't be built without libcap. Disable it by --disable-aclk or enable libcap])
596 + AC_MSG_ERROR([agent-cloud-link can't be built without libcap. Disable it by --disable-cloud or enable libcap])
597 fi
598 if test "${with_libcap}" = "yes"; then
599 LWS_LIBS+=" -lcap"
@@ -592,7 +601,7 @@ if test "$enable_cloud" = "yes"; then
601 fi
602
603 AC_MSG_CHECKING([if netdata agent-cloud-link can be enabled])
595 - if test "${HAVE_libmosquitto_a}" = "yes" -a "${HAVE_libwebsockets_a}" = "yes"; then
604 + if test "${HAVE_libmosquitto_a}" = "yes" -a "${HAVE_libwebsockets_a}" = "yes" -a -n "${SSL_LIBS}"; then
605 can_enable_aclk="yes"
606 else
607 can_enable_aclk="no"
netdata-installer.sh
+40 -11
@@ -193,7 +193,8 @@ USAGE: ${PROGRAM} [options]
193 This results in more frequent updates.
194 --disable-go Disable installation of go.d.plugin.
195 --enable-ebpf Enable eBPF Kernel plugin (Default: disabled, feature preview)
196 - --disable-cloud Disable all cloud functionality.
196 + --disable-cloud Disable all Netdata Cloud functionality.
197 + --require-cloud Fail the install if it can't build Netdata Cloud support.
198 --enable-plugin-freeipmi Enable the FreeIPMI plugin. Default: enable it when libipmimonitoring is available.
199 --disable-plugin-freeipmi
200 --disable-https Explicitly disable TLS support
@@ -280,8 +281,20 @@ while [ -n "${1}" ]; do
281 "--disable-go") NETDATA_DISABLE_GO=1 ;;
282 "--enable-ebpf") NETDATA_ENABLE_EBPF=1 ;;
283 "--disable-cloud")
283 - NETDATA_DISABLE_CLOUD=1
284 - NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--disable-cloud/} --disable-cloud"
284 + if [ -n "${NETDATA_REQUIRE_CLOUD}" ] ; then
285 + echo "Cloud explicitly enabled, ignoring --disable-cloud."
286 + else
287 + NETDATA_DISABLE_CLOUD=1
288 + NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--disable-cloud/} --disable-cloud"
289 + fi
290 + ;;
291 + "--require-cloud")
292 + if [ -n "${NETDATA_DISABLE_CLOUD}" ] ; then
293 + echo "Cloud explicitly disabled, ignoring --require-cloud."
294 + else
295 + NETDATA_REQUIRE_CLOUD=1
296 + NETDATA_CONFIGURE_OPTIONS="${NETDATA_CONFIGURE_OPTIONS//--enable-cloud/} --enable-cloud"
297 + fi
298 ;;
299 "--install")
300 NETDATA_PREFIX="${2}/netdata"
@@ -502,12 +515,20 @@ bundle_libmosquitto() {
515 then
516 run_ok "libmosquitto built and prepared."
517 else
505 - run_failed "Failed to build libmosquitto. The install process will continue, but you will not be able to connect this node to Netdata Cloud."
506 - defer_error_highlighted "Failed to build libmosquitto. The install process will continue, but you will not be able to connect this node to Netdata Cloud."
518 + run_failed "Failed to build libmosquitto."
519 + if [ -n "${NETDATA_REQUIRE_CLOUD}" ] ; then
520 + exit 1
521 + else
522 + defer_error_highlighted "Unable to fetch sources for libmosquitto. You will not be able to connect this node to Netdata Cloud."
523 + fi
524 fi
525 else
509 - run_failed "Unable to fetch sources for libmosquitto. The install process will continue, but you will not be able to connect this node to Netdata Cloud."
510 - defer_error_highlighted "Unable to fetch sources for libmosquitto. The install process will continue, but you will not be able to connect this node to Netdata Cloud."
526 + run_failed "Unable to fetch sources for libmosquitto."
527 + if [ -n "${NETDATA_REQUIRE_CLOUD}" ] ; then
528 + exit 1
529 + else
530 + defer_error_highlighted "Unable to fetch sources for libmosquitto. You will not be able to connect this node to Netdata Cloud."
531 + fi
532 fi
533 }
534
@@ -562,12 +583,20 @@ bundle_libwebsockets() {
583 then
584 run_ok "libwebsockets built and prepared."
585 else
565 - run_failed "Failed to build libwebsockets. The install process will continue, but you may not be able to connect this node to Netdata Cloud."
566 - defer_error_highlighted "Failed to build libwebsockets. The install process will continue, but you may not be able to connect this node to Netdata Cloud."
586 + run_failed "Failed to build libwebsockets."
587 + if [ -n "${NETDATA_REQUIRE_CLOUD}" ] ; then
588 + exit 1
589 + else
590 + defer_error_highlighted "Failed to build libwebsockets. You may not be able to connect this node to Netdata Cloud."
591 + fi
592 fi
593 else
569 - run_failed "Unable to fetch sources for libwebsockets. The install process will continue, but you may not be able to connect this node to Netdata Cloud."
570 - defer_error_highlighted "Unable to fetch sources for libwebsockets. The install process will continue, but you may not be able to connect this node to Netdata Cloud."
594 + run_failed "Unable to fetch sources for libwebsockets."
595 + if [ -n "${NETDATA_REQUIRE_CLOUD}" ] ; then
596 + exit 1
597 + else
598 + defer_error_highlighted "Unable to fetch sources for libwebsockets. You may not be able to connect this node to Netdata Cloud."
599 + fi
600 fi
601 }
602
packaging/mosquitto.checksums
+1 -1
@@ -1 +1 @@
1 -387faaf026b86d52dcba87e80b97946eb2775bcfcfdafaabc828b6e17f7bf5ea v.1.6.8_Netdata-3.tar.gz
1 +6af837c388b1bcd459220936c422b70a987c60f4d5f88b09eada43d713529284 v.1.6.8_Netdata-4.tar.gz
packaging/mosquitto.version
+1 -1
@@ -1 +1 @@
1 -v.1.6.8_Netdata-3
1 +v.1.6.8_Netdata-4