[docker] Add collectd-6 12/72412/6
authorEmma Foley <efoley@redhat.com>
Wed, 21 Apr 2021 13:37:13 +0000 (14:37 +0100)
committerEmma Foley <efoley@redhat.com>
Thu, 3 Jun 2021 12:28:36 +0000 (13:28 +0100)
* Add instruction to docs/ for using
  docker/barometer-collectd-experimental/Dockerfile to build collectd
  version 6
* Add a new COLLECTD_FLAVOR to src/collectd/Makefile to configure
  tags for a collectd 6 build.
* Allow passing COLLECTD_CONFIG_CMD_ARGS to the collectd build
  For testing with new plugins for collectd-6, as un-ported plugins are
  disabled by default.
  This new option lets the ./configure command be run with extra args,
  e.g. --enable-cpu --enable-<my-newly-ported-plugin>, which means that
  plugin can be enabled for the PR that is being tested.
* Update flavor_image_name selection to include collectd-6

Change-Id: I55ee0bbcb5d89357b1ef11ab17c5b029603ecdf7
Signed-off-by: Emma Foley <efoley@redhat.com>
docker/ansible/roles/run_collectd/vars/main.yml
docs/release/userguide/installguide.docker.rst
src/collectd/Makefile
src/package-list.mk

index cebd0f4..ddfec14 100644 (file)
@@ -15,7 +15,8 @@
 
 default_flavor: "{{ flavor|default('stable')|string }}"
 flavor_image_name: "{{
-         'barometer-collectd-master' if (default_flavor == 'master') else
-         'barometer-collectd-experimental' if (default_flavor == 'experimental')
+         'barometer-collectd-latest' if (default_flavor == 'master' or default_flavor == 'latest') else
+         'barometer-collectd-experimental' if (default_flavor == 'experimental') else
+         'barometer-collectd-6' if (default_flavor == 'collectd-6')
          else 'barometer-collectd' }}"
 collectd_image_name: "{{ 'opnfv/' + flavor_image_name }}"
index ca113c6..f44ac99 100644 (file)
@@ -382,6 +382,44 @@ COLLECTD_PULL_REQUESTS should be a comma-delimited string of pull request IDs.
    proxy parameters should be passed only if system is behind an HTTP or HTTPS
    proxy server (same as for stable collectd container)
 
+Build collectd-6
+^^^^^^^^^^^^^^^^
+
+The barometer-collectd-experimental Dockerfile can be used to build
+collectd-6.0, which is currently under development. In order to do this, the
+``COLLECTD_FLAVOR`` build arg can be passed to the docker build command.
+The optional ``COLLECTD_PULL_REQUESTS`` arg can be passed as well, to test
+proposed patches to collectd.
+
+.. code:: bash
+
+   $ cd <BAROMETER_REPO_DIR>
+   $ sudo docker build -t opnfv/barometer-collectd-6 \
+     --build-arg COLLECTD_FLAVOR=collectd-6 \
+     --build-arg COLLECTD_PULL_REQUESTS=1234,5678 \
+     --network=host -f docker/barometer-collectd-experimental/Dockerfile .
+
+The instructions for running the collectd-6 container are the same as for the
+collectd-experimental container.
+
+There are a few useful build args that can be used to further customise the
+collectd-6 build::
+
+* COLLECTD_CONFIG_CMD_ARGS
+  For testing with new plugins for collectd-6, as un-ported plugins are
+  disabled by default.
+  This new option lets the ./configure command be run with extra args,
+  e.g. --enable-cpu --enable-<my-newly-ported-plugin>, which means that
+  plugin can be enabled for the PR that is being tested.
+
+* COLLECTD_TAG
+  This overrides the default tag selected by the flavors, and allows checking
+  out out an arbitrary branch (e.g. PR branch instead of using the
+  ``COLLECTD_PULL_REQUESTS`` arg, which rebases each PR on top of the
+  nominal branch.
+  To check out a PR, use the following args with the docker build command:
+  ``--build-arg COLLECTD_TAG=pull/<PR_ID>/head``
+
 Run the collectd stable docker image
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 .. code:: bash
index ec45f94..785614d 100644 (file)
@@ -1,7 +1,8 @@
 # makefile to manage collectd package
 #
 
-# Copyright 2016-2019 Intel Corporation and OPNFV. All rights reserved.
+# Copyright 2016-2021 Intel Corporation, Anuket and others.
+# All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-
 #
 # Contributors:
 #   Aihua Li, Huawei Technologies.
 #   Maryam Tahhan, Intel Corporation.
+#   Emma Foley, Red Hat.
 
 include ../mk/master.mk
 include ../package-list.mk
 
 WORK_DIR = collectd
 # $COLLECTD_TAG can contain "/", which is being replaced with "-" here
-TAG_DONE_FLAG := $(WORK_DIR)/.$(subst /,-,"$(COLLECTD_TAG)").done
+TAG_DONE_FLAG := $(WORK_DIR)/.$(subst /,-,$(COLLECTD_TAG)).done
 BUILD_CMD = ./build.sh
 CONFIG_CMD =
 CONFIG_CMD += ./configure
@@ -41,6 +42,183 @@ ifeq ($(XDG_CACHE_HOME_DIR),)
 XDG_CACHE_HOME_DIR = $(shell echo $$HOME)
 endif
 
+ifeq ($(COLLECTD_FLAVOR),collectd-6)
+CONFIG_CMD += --enable-cpu
+CONFIG_CMD += --enable-interface
+CONFIG_CMD += --enable-memory
+CONFIG_CMD += --enable-ping
+CONFIG_CMD += --enable-uptime
+
+CONFIG_CMD += --disable-aggregation
+CONFIG_CMD += --disable-amqp
+CONFIG_CMD += --disable-amqp1
+#CONFIG_CMD += --disable-apache
+#CONFIG_CMD += --disable-apcups
+#CONFIG_CMD += --disable-apple_sensors
+#CONFIG_CMD += --disable-aquaero
+CONFIG_CMD += --disable-barometer
+#CONFIG_CMD += --disable-battery
+#CONFIG_CMD += --disable-bind
+#CONFIG_CMD += --disable-buddyinfo
+#CONFIG_CMD += --disable-capabilities
+#CONFIG_CMD += --disable-ceph
+#CONFIG_CMD += --disable-cgroups
+#CONFIG_CMD += --disable-chrony
+CONFIG_CMD += --disable-check_uptime
+#CONFIG_CMD += --disable-connectivity
+#CONFIG_CMD += --disable-conntrack
+#CONFIG_CMD += --disable-contextswitch
+#CONFIG_CMD += --disable-cpufreq
+#CONFIG_CMD += --disable-cpusleep
+CONFIG_CMD += --disable-csv
+#CONFIG_CMD += --disable-curl
+#CONFIG_CMD += --disable-curl_json
+CONFIG_CMD += --disable-curl_xml
+#CONFIG_CMD += --disable-dbi
+#CONFIG_CMD += --disable-dcpmm
+#CONFIG_CMD += --disable-df
+#CONFIG_CMD += --disable-disk
+#CONFIG_CMD += --disable-dns
+#CONFIG_CMD += --disable-dpdkevents
+#CONFIG_CMD += --disable-dpdkstat
+#CONFIG_CMD += --disable-dpdk_telemetry
+#CONFIG_CMD += --disable-drbd
+#CONFIG_CMD += --disable-email
+#CONFIG_CMD += --disable-entropy
+#CONFIG_CMD += --disable-ethstat
+#CONFIG_CMD += --disable-exec
+#CONFIG_CMD += --disable-fhcount
+#CONFIG_CMD += --disable-filecount
+#CONFIG_CMD += --disable-fscache
+CONFIG_CMD += --disable-gmond
+#CONFIG_CMD += --disable-gps
+#CONFIG_CMD += --disable-gpu_nvidia
+CONFIG_CMD += --disable-grpc
+#CONFIG_CMD += --disable-hddtemp
+#CONFIG_CMD += --disable-hugepages
+#CONFIG_CMD += --disable-infiniband
+#CONFIG_CMD += --disable-intel_pmu
+#CONFIG_CMD += --disable-intel_rdt
+#CONFIG_CMD += --disable-ipc
+#CONFIG_CMD += --disable-ipmi
+#CONFIG_CMD += --disable-iptables
+#CONFIG_CMD += --disable-ipstats
+#CONFIG_CMD += --disable-ipvs
+#CONFIG_CMD += --disable-irq
+CONFIG_CMD += --disable-java
+#CONFIG_CMD += --disable-load
+#CONFIG_CMD += --disable-log_logstash
+#CONFIG_CMD += --disable-logfile
+#CONFIG_CMD += --disable-logparser
+#CONFIG_CMD += --disable-lpar
+CONFIG_CMD += --disable-lua
+#CONFIG_CMD += --disable-madwifi
+CONFIG_CMD += --disable-match_empty_counter
+CONFIG_CMD += --disable-match_hashed
+CONFIG_CMD += --disable-match_regex
+CONFIG_CMD += --disable-match_timediff
+CONFIG_CMD += --disable-match_value
+#CONFIG_CMD += --disable-mbmon
+#CONFIG_CMD += --disable-mcelog
+#CONFIG_CMD += --disable-md
+#CONFIG_CMD += --disable-mdevents
+#CONFIG_CMD += --disable-memcachec
+#CONFIG_CMD += --disable-memcached
+#CONFIG_CMD += --disable-mic
+CONFIG_CMD += --disable-modbus
+CONFIG_CMD += --disable-mqtt
+#CONFIG_CMD += --disable-multimeter
+#CONFIG_CMD += --disable-mysql
+#CONFIG_CMD += --disable-netapp
+#CONFIG_CMD += --disable-netlink
+#CONFIG_CMD += --disable-netstat_udp
+CONFIG_CMD += --disable-network
+#CONFIG_CMD += --disable-nfs
+#CONFIG_CMD += --disable-nginx
+#CONFIG_CMD += --disable-notify_desktop
+#CONFIG_CMD += --disable-notify_email
+#CONFIG_CMD += --disable-notify_nagios
+#CONFIG_CMD += --disable-ntpd
+#CONFIG_CMD += --disable-numa
+#CONFIG_CMD += --disable-nut
+#CONFIG_CMD += --disable-olsrd
+#CONFIG_CMD += --disable-onewire
+CONFIG_CMD += --disable-openldap
+#CONFIG_CMD += --disable-openvpn
+#CONFIG_CMD += --disable-oracle
+#CONFIG_CMD += --disable-ovs_events
+#CONFIG_CMD += --disable-ovs_stats
+#CONFIG_CMD += --disable-pcie_errors
+CONFIG_CMD += --disable-perl
+#CONFIG_CMD += --disable-pf
+#CONFIG_CMD += --disable-pinba
+CONFIG_CMD += --disable-postgresql
+#CONFIG_CMD += --disable-powerdns
+#CONFIG_CMD += --disable-processes
+#CONFIG_CMD += --disable-procevent
+#CONFIG_CMD += --disable-protocols
+CONFIG_CMD += --disable-python
+#CONFIG_CMD += --disable-redfish
+CONFIG_CMD += --disable-redis
+#CONFIG_CMD += --disable-routeros
+CONFIG_CMD += --disable-rrdcached
+CONFIG_CMD += --disable-rrdtool
+#CONFIG_CMD += --disable-sensors
+#CONFIG_CMD += --disable-serial
+#CONFIG_CMD += --disable-sigrok
+#CONFIG_CMD += --disable-slurm
+#CONFIG_CMD += --disable-smart
+CONFIG_CMD += --disable-snmp
+CONFIG_CMD += --disable-snmp_agent
+CONFIG_CMD += --disable-statsd
+#CONFIG_CMD += --disable-swap
+#CONFIG_CMD += --disable-synproxy
+#CONFIG_CMD += --disable-sysevent
+#CONFIG_CMD += --disable-syslog
+#CONFIG_CMD += --disable-table
+#CONFIG_CMD += --disable-tail
+#CONFIG_CMD += --disable-tail_csv
+#CONFIG_CMD += --disable-tape
+CONFIG_CMD += --disable-target_notification
+CONFIG_CMD += --disable-target_replace
+CONFIG_CMD += --disable-target_scale
+CONFIG_CMD += --disable-target_set
+CONFIG_CMD += --disable-target_v5upgrade
+#CONFIG_CMD += --disable-tcpconns
+#CONFIG_CMD += --disable-teamspeak2
+#CONFIG_CMD += --disable-ted
+#CONFIG_CMD += --disable-thermal
+CONFIG_CMD += --disable-threshold
+#CONFIG_CMD += --disable-tokyotyrant
+#CONFIG_CMD += --disable-turbostat
+#CONFIG_CMD += --disable-ubi
+#CONFIG_CMD += --disable-unixsock
+#CONFIG_CMD += --disable-users
+#CONFIG_CMD += --disable-uuid
+#CONFIG_CMD += --disable-varnish
+#CONFIG_CMD += --disable-virt
+#CONFIG_CMD += --disable-vmem
+#CONFIG_CMD += --disable-vserver
+#CONFIG_CMD += --disable-wireless
+CONFIG_CMD += --disable-write_graphite
+#CONFIG_CMD += --disable-write_http
+CONFIG_CMD += --disable-write_influxdb_udp
+CONFIG_CMD += --disable-write_kafka
+#CONFIG_CMD += --disable-write_log
+CONFIG_CMD += --disable-write_mongodb
+CONFIG_CMD += --disable-write_prometheus
+CONFIG_CMD += --disable-write_redis
+CONFIG_CMD += --disable-write_riemann
+CONFIG_CMD += --disable-write_sensu
+#CONFIG_CMD += --disable-write_stackdriver
+CONFIG_CMD += --disable-write_syslog
+CONFIG_CMD += --disable-write_tsdb
+#CONFIG_CMD += --disable-xencpu
+#CONFIG_CMD += --disable-zfs_arc
+#CONFIG_CMD += --disable-zone
+#CONFIG_CMD += --disable-zookeeper
+CONFIG_CMD += --enable-debug
+else
 CONFIG_CMD += --enable-syslog
 CONFIG_CMD += --enable-logfile
 CONFIG_CMD += --with-libpqos=$(LIBPQOS_DIR)
@@ -53,10 +231,14 @@ CONFIG_CMD += --enable-write_redis
 CONFIG_CMD += --disable-perl
 CONFIG_CMD += --with-librdkafka=/usr
 CONFIG_CMD += --disable-lvm
+endif
+
 ifdef WITH_DPDK
 CONFIG_CMD += LIBDPDK_CFLAGS='-mssse3'
 endif
 
+CONFIG_CMD += $(COLLECTD_CONFIG_CMD_ARGS)
+
 .PHONY: install force_install config force_make
 
 # install depends on make
@@ -66,6 +248,7 @@ all: force_make
        @echo "Finished making $(WORK_DIR)"
 
 config $(WORK_DIR)/Makefile: $(WORK_DIR)/configure
+       @echo "Configuring with: " $(CONFIG_CMD)
        $(AT)cd $(WORK_DIR); $(CONFIG_CMD)
        @echo "Configure done"
 
index 59e9a0a..b27cd57 100644 (file)
@@ -20,23 +20,35 @@ KAFKA_TAG ?= v1.5.2
 # collectd section
 COLLECTD_URL ?= https://github.com/collectd/collectd
 
-# there are 3 collectd flavors:
+# there are 4 collectd flavors:
 # -"stable" - based on stable collectd release
 # -"latest" - development version, based on main branch
 # -"experimental" - it is based on main branch as above and includes
 #                   set pull requests with experimental features
+# -"collectd-6" - based on the collectd 6.0 branch
 ifeq ($(COLLECTD_FLAVOR), stable)
-# using latest stable release
+# using the most recent stable release
        COLLECTD_TAG ?= collectd-5.12
        SAMPLE_CONF_VARIANT_NAME = collectd_sample_configs
-else
-# 'latest' and 'experimental' collectd flavors are both using
-# code from main branch
+endif
+ifeq ($(COLLECTD_FLAVOR), latest)
+# collectd code from main branch
        COLLECTD_TAG ?= main
        SAMPLE_CONF_VARIANT_NAME = collectd_sample_configs-latest
+endif
 ifeq ($(COLLECTD_FLAVOR), experimental)
 # 'experimental' flavor is using additional Pull Requests that
 # are put on top of main release
+       COLLECTD_TAG ?= main
+       SAMPLE_CONF_VARIANT_NAME = collectd_sample_configs-latest
        COLLECTD_USE_EXPERIMENTAL_PR ?= y
 endif #end of experimental-branch handling
-endif
+ifeq ($(COLLECTD_FLAVOR), collectd-6)
+# 'collectd-6' flavor is using collectd-6.0 branch
+       COLLECTD_TAG ?= collectd-6.0
+       SAMPLE_CONF_VARIANT_NAME = collectd_sample_configs-latest
+       COLLECTD_USE_EXPERIMENTAL_PR ?= y
+endif #end of collectd-6.0-branch handling
+
+@echo "Using COLLECTD_TAG: $(COLLECTD_TAG)"
+@echo "Using SAMPLE_CONF_VARIANT_NAME: $(SAMPLE_CONF_VARIANT_NAME)"