cc-metric-collector/scripts/cc-metric-collector.spec

76 lines
2.3 KiB
RPMSpec
Raw Normal View History

2021-11-22 16:32:41 +01:00
Name: cc-metric-collector
Version: %{VERS}
2021-11-22 16:32:41 +01:00
Release: 1%{?dist}
Summary: Metric collection daemon from the ClusterCockpit suite
License: MIT
Source0: %{name}-%{version}.tar.gz
BuildRequires: go-toolset
2022-03-03 13:43:43 +01:00
BuildRequires: systemd-rpm-macros
Merge latest developments into main (#67) * Update configuration.md Add an additional receiver to have better alignment of components * Change default GpfsCollector command to `mmpmon` (#53) * Set default cmd to 'mmpmon' * Reuse looked up path * Cast const to string * Just download LIKWID to get the headers (#54) * Just download LIKWID to get the headers * Remove perl-Data-Dumper from BuildRequires, only required by LIKWID build * Add HttpReceiver as counterpart to the HttpSink (#49) * Use GBytes as unit for large memory numbers * Make maxForward configurable, save old name in meta in rename metrics and make the hostname tag key configurable * Single release action (#55) Building all RPMs and releasing in a single workflow * Makefile target to build binary-only Debian packages (#61) * Add 'install' and 'DEB' make targets to build binary-only Debian packages * Add control file for DEB builds * Use a single line for bash loop in make clean * Add config options for retry intervals of InfluxDB clients (#59) * Refactoring of LikwidCollector and metric units (#62) * Reduce complexity of LikwidCollector and allow metric units * Add unit to LikwidCollector docu and fix some typos * Make library path configurable * Use old metric name in Ganglia if rename has happened in the router (#60) * Use old metric name if rename has happened in the router * Also check for Ganglia renames for the oldname * Derived metrics (#57) * Add time-based derivatived (e.g. bandwidth) to some collectors * Add documentation * Add comments * Fix: Only compute rates with a valid previous state * Only compute rates with a valid previous state * Define const values for net/dev fields * Set default config values * Add comments * Refactor: Consolidate data structures * Refactor: Consolidate data structures * Refactor: Avoid struct deep copy * Refactor: Avoid redundant tag maps * Refactor: Use int64 type for absolut values Co-authored-by: Holger Obermaier <40787752+ho-ob@users.noreply.github.com> * Simplified iota usage * Move unit tag to meta data tags * Derived metrics (#65) * Add time-based derivatived (e.g. bandwidth) to some collectors * Add documentation * Add comments * Fix: Only compute rates with a valid previous state * Only compute rates with a valid previous state * Define const values for net/dev fields * Set default config values * Add comments * Refactor: Consolidate data structures * Refactor: Consolidate data structures * Refactor: Avoid struct deep copy * Refactor: Avoid redundant tag maps * Refactor: Use int64 type for absolut values * Update LustreCollector Co-authored-by: Holger Obermaier <40787752+ho-ob@users.noreply.github.com> * Meta to tags list and map for sinks (#63) * Change ccMetric->Influx functions * Use a meta_as_tags string list in config but create a lookup map afterwards * Add meta as tag logic to sampleSink * Fix staticcheck warnings (#66) Co-authored-by: Holger Obermaier <40787752+ho-ob@users.noreply.github.com>
2022-03-15 16:41:11 +01:00
# for header downloads
BuildRequires: wget
2021-11-22 16:32:41 +01:00
Provides: %{name} = %{version}
%description
Metric collection daemon from the ClusterCockpit suite
2021-11-22 16:32:41 +01:00
%global debug_package %{nil}
%prep
%autosetup
%build
make
%install
2022-02-14 15:20:38 +01:00
install -Dpm 0750 %{name} %{buildroot}%{_sbindir}/%{name}
install -Dpm 0600 config.json %{buildroot}%{_sysconfdir}/%{name}/%{name}.json
2022-02-14 15:20:38 +01:00
install -Dpm 0600 collectors.json %{buildroot}%{_sysconfdir}/%{name}/collectors.json
install -Dpm 0600 sinks.json %{buildroot}%{_sysconfdir}/%{name}/sinks.json
install -Dpm 0600 receivers.json %{buildroot}%{_sysconfdir}/%{name}/receivers.json
install -Dpm 0600 router.json %{buildroot}%{_sysconfdir}/%{name}/router.json
install -Dpm 0644 scripts/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
install -Dpm 0600 scripts/%{name}.config %{buildroot}%{_sysconfdir}/default/%{name}
2022-03-03 13:43:43 +01:00
install -Dpm 0644 scripts/%{name}.sysusers %{buildroot}%{_sysusersdir}/%{name}.conf
2021-11-22 16:32:41 +01:00
%check
# go test should be here... :)
%pre
%sysusers_create_package scripts/%{name}.sysusers
2021-11-22 16:32:41 +01:00
%post
%systemd_post %{name}.service
%preun
%systemd_preun %{name}.service
%files
2022-03-04 11:52:48 +01:00
# Binary
%attr(-,clustercockpit,clustercockpit) %{_sbindir}/%{name}
# Config
2021-11-22 16:32:41 +01:00
%dir %{_sysconfdir}/%{name}
2022-03-04 11:52:48 +01:00
%attr(0600,clustercockpit,clustercockpit) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.json
%attr(0600,clustercockpit,clustercockpit) %config(noreplace) %{_sysconfdir}/%{name}/collectors.json
%attr(0600,clustercockpit,clustercockpit) %config(noreplace) %{_sysconfdir}/%{name}/sinks.json
%attr(0600,clustercockpit,clustercockpit) %config(noreplace) %{_sysconfdir}/%{name}/receivers.json
%attr(0600,clustercockpit,clustercockpit) %config(noreplace) %{_sysconfdir}/%{name}/router.json
# Systemd
2021-11-22 16:32:41 +01:00
%{_unitdir}/%{name}.service
%{_sysconfdir}/default/%{name}
2022-03-03 13:43:43 +01:00
%{_sysusersdir}/%{name}.conf
2021-11-22 16:32:41 +01:00
%changelog
2022-03-03 13:43:43 +01:00
* Thu Mar 03 2022 Thomas Gruber - 0.3
- Add clustercockpit user installation
2022-02-14 15:20:38 +01:00
* Mon Feb 14 2022 Thomas Gruber - 0.2
- Add component specific configuration files
- Add %attr to config files
2021-11-22 16:40:17 +01:00
* Mon Nov 22 2021 Thomas Gruber - 0.1
- Initial spec file