aboutsummaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
Diffstat (limited to 'ci')
-rw-r--r--ci/barometer-build.sh24
-rw-r--r--ci/barometer-upload-artifact.sh74
-rwxr-xr-xci/install_dependencies.sh32
-rw-r--r--ci/utility/collectd.spec.patch95
-rwxr-xr-xci/utility/collectd_build_rpm.sh10
-rwxr-xr-xci/utility/package-list.sh2
-rw-r--r--ci/utility/rpms_list9
7 files changed, 212 insertions, 34 deletions
diff --git a/ci/barometer-build.sh b/ci/barometer-build.sh
new file mode 100644
index 00000000..ded45187
--- /dev/null
+++ b/ci/barometer-build.sh
@@ -0,0 +1,24 @@
+# This script is used by the barometer-daily CI job in gitlab.
+# It builds and packages collectd as an RPM
+# After this script is run, the barometer-daily job runs the
+# barometer-upload-artifact.sh script.
+set -x
+
+OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
+OPNFV_ARTIFACT_URL="$GS_URL/$OPNFV_ARTIFACT_VERSION/"
+
+# log info to console
+echo "Starting the build of Barometer RPMs"
+echo "------------------------------------"
+echo
+
+./install_dependencies.sh
+./build_rpm.sh
+cp utility/rpms_list $WORKSPACE
+
+# save information regarding artifact into file
+(
+ echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
+ echo "OPNFV_ARTIFACT_URL=$OPNFV_ARTIFACT_URL"
+) > $WORKSPACE/opnfv.properties
+
diff --git a/ci/barometer-upload-artifact.sh b/ci/barometer-upload-artifact.sh
new file mode 100644
index 00000000..f05dc2af
--- /dev/null
+++ b/ci/barometer-upload-artifact.sh
@@ -0,0 +1,74 @@
+#!/bin/bash
+set -o nounset
+set -o pipefail
+
+RPM_LIST=$WORKSPACE/rpms_list
+RPM_WORKDIR=$WORKSPACE/rpmbuild
+RPM_DIR=$RPM_WORKDIR/RPMS/x86_64/
+cd $WORKSPACE/
+
+# source the opnfv.properties to get ARTIFACT_VERSION
+source $WORKSPACE/opnfv.properties
+
+# Check if all the appropriate RPMs were generated
+echo "Checking if all the Barometer RPMs were created"
+echo "-----------------------------------------------"
+echo
+
+if [ -d $RPM_DIR ]
+then
+ ls $RPM_DIR > list_of_gen_pack
+else
+ echo "Can't access folder $RPM_DIR with rpm packages"
+ echo "Barometer nightly build FAILED"
+ exit 1
+fi
+
+for PACKAGENAME in `cat $RPM_LIST`
+do
+ if ! grep -q $PACKAGENAME list_of_gen_pack
+ then
+ echo "$PACKAGENAME is missing"
+ echo "Barometer nightly build FAILED"
+ exit 2
+ fi
+done
+
+#remove the file you no longer need.
+rm list_of_gen_pack
+
+echo "Uploading the barometer RPMs to artifacts.opnfv.org"
+echo "---------------------------------------------------"
+echo
+
+gsutil -m cp -r $RPM_DIR/* gs://$OPNFV_ARTIFACT_URL > $WORKSPACE/gsutil.log 2>&1
+
+# Check if the RPMs were pushed
+gsutil ls gs://$OPNFV_ARTIFACT_URL > /dev/null 2>&1
+if [[ $? -ne 0 ]]; then
+ echo "Problem while uploading barometer RPMs to gs://$OPNFV_ARTIFACT_URL!"
+ echo "Check log $WORKSPACE/gsutil.log on the appropriate build server"
+ exit 1
+else
+ # upload property files only if build is successful
+ gsutil cp $WORKSPACE/opnfv.properties gs://$OPNFV_ARTIFACT_URL/opnfv.properties > gsutil.properties.log 2>&1
+ gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
+fi
+
+gsutil -m setmeta \
+ -h "Cache-Control:private, max-age=0, no-transform" \
+ gs://$OPNFV_ARTIFACT_URL/*.rpm > /dev/null 2>&1
+
+gsutil -m setmeta \
+ -h "Content-Type:text/html" \
+ -h "Cache-Control:private, max-age=0, no-transform" \
+ gs://$GS_URL/latest.properties \
+ gs://$OPNFV_ARTIFACT_URL/opnfv.properties > /dev/null 2>&1
+
+echo
+echo "--------------------------------------------------------"
+echo "Done!"
+echo "Artifact is available at $OPNFV_ARTIFACT_URL"
+
+#cleanup the RPM repo from the build machine.
+rm -rf $RPM_WORKDIR
diff --git a/ci/install_dependencies.sh b/ci/install_dependencies.sh
index 87f8163f..40437804 100755
--- a/ci/install_dependencies.sh
+++ b/ci/install_dependencies.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2017 Intel Corporation
+# Copyright 2017-21 Anuket, Intel Corporation and others
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -16,24 +16,18 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $DIR/utility/package-list.sh
-# For collectd
-sudo yum install -y yum-utils
-sudo yum install -y epel-release
-sudo yum-builddep -y collectd
-
-sudo yum -y install autoconf automake flex bison libtool pkg-config
-
-sudo yum -y install git
-
-sudo yum -y install rpm-build \
- libcap-devel xfsprogs-devel iptables-devel \
- libmemcached-devel gtk2-devel libvirt-devel
-
-# For DMA component
-sudo yum -y install hiredis-devel
-
-# For intel-cmt-cat
-sudo yum -y install wget
+# Reuse build_base_machine.sh for this distro, to install the required packages
+# Detect OS name and version from systemd based os-release file
+. /etc/os-release
+distro_dir="$DIR/../systems/$ID/$VERSION_ID"
+
+# build base system using OS specific scripts
+if [ -d "$distro_dir" ] && [ -e "$distro_dir/build_base_machine.sh" ]; then
+ sudo $distro_dir/build_base_machine.sh || ( echo "$distro_dir/build_base_machine.sh failed" && exit 1 )
+else
+ "$distro_dir is not supported"
+ exit 1
+fi
# For RPM build
mkdir -p $RPM_WORKDIR/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
diff --git a/ci/utility/collectd.spec.patch b/ci/utility/collectd.spec.patch
new file mode 100644
index 00000000..026e96ff
--- /dev/null
+++ b/ci/utility/collectd.spec.patch
@@ -0,0 +1,95 @@
+diff --git a/contrib/redhat/collectd.spec b/contrib/redhat/collectd.spec
+index 4721d47f..ca9929db 100644
+--- a/contrib/redhat/collectd.spec
++++ b/contrib/redhat/collectd.spec
+@@ -96,6 +96,7 @@
+ %define with_mbmon 0%{!?_without_mbmon:1}
+ %define with_mcelog 0%{!?_without_mcelog:1}
+ %define with_md 0%{!?_without_md:1}
++%define with_mdevents 0%{!?_without_mdevents:1}
+ %define with_memcachec 0%{!?_without_memcachec:1}
+ %define with_memcached 0%{!?_without_memcached:1}
+ %define with_memory 0%{!?_without_memory:1}
+@@ -112,7 +113,7 @@
+ %define with_notify_nagios 0%{!?_without_notify_nagios:1}
+ %define with_ntpd 0%{!?_without_ntpd:1}
+ %define with_numa 0%{!?_without_numa:1}
+-%define with_nut 0%{!?_without_nut:1}
++%define with_nut 0%{!?_without_nut:0}
+ %define with_olsrd 0%{!?_without_olsrd:1}
+ %define with_openldap 0%{!?_without_openldap:1}
+ %define with_openvpn 0%{!?_without_openvpn:1}
+@@ -154,7 +155,7 @@
+ %define with_uptime 0%{!?_without_uptime:1}
+ %define with_users 0%{!?_without_users:1}
+ %define with_uuid 0%{!?_without_uuid:1}
+-%define with_varnish 0%{!?_without_varnish:1}
++%define with_varnish 0%{!?_without_varnish:0}
+ %define with_virt 0%{!?_without_virt:1}
+ %define with_vmem 0%{!?_without_vmem:1}
+ %define with_vserver 0%{!?_without_vserver:1}
+@@ -195,7 +196,7 @@
+ # plugin intel_pmu disabled, requires libjevents
+ %define with_intel_pmu 0%{!?_without_intel_pmu:0}
+ # plugin intel_rdt disabled, requires intel-cmt-cat
+-%define with_intel_rdt 0%{!?_without_intel_rdt:0}
++%define with_intel_rdt 0%{!?_without_intel_rdt:1}
+ # plugin mic disabled, requires Mic
+ %define with_mic 0%{!?_without_mic:0}
+ # plugin netapp disabled, requires libnetapp
+@@ -643,7 +644,7 @@ The modbus plugin collects values from Modbus/TCP enabled devices
+ Summary: MySQL plugin for collectd
+ Group: System Environment/Daemons
+ Requires: %{name}%{?_isa} = %{version}-%{release}
+-BuildRequires: mysql-devel
++BuildRequires: mariadb-connector-c-devel
+ %description mysql
+ MySQL querying plugin. This plugin provides data of issued commands, called
+ handlers and database traffic.
+@@ -1503,6 +1504,12 @@ Collectd utilities
+ %define _with_md --disable-md
+ %endif
+
++%if %{with_mdevents}
++%define _with_mdevents --enable-mdevents
++%else
++%define _with_mdevents --disable-mdevents
++%endif
++
+ %if %{with_memcachec}
+ %define _with_memcachec --enable-memcachec
+ %else
+@@ -2117,6 +2124,7 @@ Collectd utilities
+ %{?_with_grpc} \
+ %{?_with_hddtemp} \
+ %{?_with_hugepages} \
++ --disable-infiniband \
+ %{?_with_intel_pmu} \
+ %{?_with_intel_rdt} \
+ %{?_with_interface} \
+@@ -2137,6 +2145,7 @@ Collectd utilities
+ %{?_with_mbmon} \
+ %{?_with_mcelog} \
+ %{?_with_md} \
++ %{?_with_mdevents} \
+ %{?_with_memcachec} \
+ %{?_with_memcached} \
+ %{?_with_memory} \
+@@ -2146,6 +2155,7 @@ Collectd utilities
+ %{?_with_multimeter} \
+ %{?_with_mysql} \
+ %{?_with_netapp} \
++ --disable-netstat_udp \
+ %{?_with_netlink} \
+ %{?_with_network} \
+ %{?_with_nfs} \
+@@ -2453,6 +2463,9 @@ fi
+ %if %{with_md}
+ %{_libdir}/%{name}/md.so
+ %endif
++%if %{with_mdevents}
++%{_libdir}/%{name}/mdevents.so
++%endif
+ %if %{with_memcached}
+ %{_libdir}/%{name}/memcached.so
+ %endif
diff --git a/ci/utility/collectd_build_rpm.sh b/ci/utility/collectd_build_rpm.sh
index db797869..a261c292 100755
--- a/ci/utility/collectd_build_rpm.sh
+++ b/ci/utility/collectd_build_rpm.sh
@@ -32,14 +32,14 @@ make dist
cp $COLLECTD_DIR/collectd-$VERSION.tar.bz2 $RPM_WORKDIR/SOURCES/
+git apply $DIR/collectd.spec.patch
+
sed --regexp-extended \
--in-place=".bak" \
- --expression="s/Version:\s+\S+$/Version: $VERSION/g" \
+ --expression="s/Version:\s+\S+$/Version: $VERSION/g" \
$COLLECTD_DIR/contrib/redhat/collectd.spec
-sed --regexp-extended \
- --in-place \
- --expression="s/without_intel_rdt:[0-9]/without_intel_rdt:1/g" \
- $COLLECTD_DIR/contrib/redhat/collectd.spec
+dnf builddep -y $COLLECTD_DIR/contrib/redhat/collectd.spec
rpmbuild --define "_topdir $RPM_WORKDIR" -bb $COLLECTD_DIR/contrib/redhat/collectd.spec
+
diff --git a/ci/utility/package-list.sh b/ci/utility/package-list.sh
index 1eb6f8d2..019893d3 100755
--- a/ci/utility/package-list.sh
+++ b/ci/utility/package-list.sh
@@ -25,4 +25,4 @@ CMTCAT_BRANCH=8b27ad757e86a01bc51eafcb9e600605ff1beca4
CMTCAT_VERSION="v1.1.0"
COLLECTD_REPO=https://github.com/collectd/collectd.git
-COLLECTD_BRANCH=collectd-5.10
+COLLECTD_BRANCH=collectd-5.12
diff --git a/ci/utility/rpms_list b/ci/utility/rpms_list
index 9607c5ab..eda3f435 100644
--- a/ci/utility/rpms_list
+++ b/ci/utility/rpms_list
@@ -15,8 +15,6 @@ collectd-debuginfo
collectd-disk
collectd-dns
collectd-email
-collectd-gmond
-collectd-gps
collectd-hddtemp
collectd-intel_rdt
collectd-ipmi
@@ -24,34 +22,27 @@ collectd-iptables
collectd-java
collectd-log_logstash
collectd-lua
-collectd-lvm
collectd-memcachec
-collectd-modbus
-collectd-mqtt
collectd-mysql
collectd-netlink
collectd-nginx
collectd-notify_desktop
collectd-notify_email
-collectd-nut
collectd-openldap
collectd-ovs_events
collectd-ovs_stats
collectd-perl
collectd-php-collection
collectd-pinba
-collectd-ping
collectd-postgresql
collectd-python
collectd-redis
collectd-rrdcached
collectd-rrdtool
collectd-sensors
-collectd-smart
collectd-snmp
collectd-snmp_agent
collectd-utils
-collectd-varnish
collectd-virt
collectd-write_http
collectd-write_prometheus