grafana-pcp/grafana-pcp.spec

331 lines
14 KiB
RPMSpec
Raw Normal View History

2022-07-04 11:40:02 +00:00
# Specify if the frontend will be compiled as part of the build or
# is attached as a webpack tarball (in case of an unsuitable nodejs version on the build system)
%define compile_frontend 0
2021-11-12 15:21:30 +00:00
2020-11-26 11:42:03 +00:00
%global grafanapcp_arches %{lua: go_arches = {}
for arch in rpm.expand("%{go_arches}"):gmatch("%S+") do
go_arches[arch] = 1
end
for arch in rpm.expand("%{nodejs_arches}"):gmatch("%S+") do
if go_arches[arch] then
print(arch .. " ")
end
end}
2022-07-04 11:40:02 +00:00
%global gomodulesmode GO111MODULE=auto
2020-11-26 11:42:03 +00:00
2019-08-30 09:56:40 +00:00
Name: grafana-pcp
2022-07-04 11:40:02 +00:00
Version: 5.0.0
Release: 3%{?dist}
Summary: Performance Co-Pilot Grafana Plugin
2019-08-30 09:56:40 +00:00
License: ASL 2.0
2020-11-26 11:42:03 +00:00
URL: https://github.com/performancecopilot/grafana-pcp
Source0: https://github.com/performancecopilot/grafana-pcp/archive/v%{version}/%{name}-%{version}.tar.gz
2021-11-12 15:21:30 +00:00
Source1: grafana-pcp-vendor-%{version}-1.tar.xz
# Note: In case there were no changes to this tarball, the NVR of this tarball
# lags behind the NVR of this package.
2020-11-26 11:42:03 +00:00
%if %{compile_frontend} == 0
# Source2 contains the precompiled frontend and dashboards
2021-11-12 15:21:30 +00:00
# Note: In case there were no changes to this tarball, the NVR of this tarball
# lags behind the NVR of this package.
Source2: grafana-pcp-webpack-%{version}-1.tar.gz
2020-11-26 11:42:03 +00:00
%endif
Source3: create_bundles.sh
Source4: build_frontend.sh
Source5: list_bundled_nodejs_packages.py
2022-07-04 11:40:02 +00:00
Source6: create_bundles_in_container.sh
2022-07-04 11:40:02 +00:00
Patch1: 0001-remove-unused-frontend-crypto.patch
2020-11-26 11:42:03 +00:00
# Intersection of go_arches and nodejs_arches
ExclusiveArch: %{grafanapcp_arches}
BuildRequires: systemd-rpm-macros
BuildRequires: golang
BuildRequires: go-srpm-macros
2020-11-26 11:42:03 +00:00
BuildRequires: go-rpm-macros
2020-11-26 11:42:03 +00:00
%if %{compile_frontend}
BuildRequires: make, nodejs >= 1:14, yarnpkg, golang-github-google-jsonnet
2020-11-26 11:42:03 +00:00
%endif
%global plugin_dir %{_sharedstatedir}/grafana/plugins/performancecopilot-pcp-app
%global install_dir %{_datadir}/performancecopilot-pcp-app
2020-11-26 11:42:03 +00:00
# grafana-pcp requires systemd-tmpfiles
%{?systemd_requires}
2022-07-08 11:36:41 +00:00
Requires: grafana >= 8.5.6
2020-11-26 11:42:03 +00:00
Suggests: pcp >= 5.2.2
Suggests: redis >= 5.0.0
Suggests: bpftrace >= 0.9.2
# Obsolete old webapps
2020-02-20 12:15:19 +00:00
Obsoletes: pcp-webjs <= 4.3.4
Obsoletes: pcp-webapp-blinkenlights <= 4.3.4
Obsoletes: pcp-webapp-grafana <= 4.3.4
Obsoletes: pcp-webapp-graphite <= 4.3.4
Obsoletes: pcp-webapp-vector <= 4.3.4
2019-08-30 09:56:40 +00:00
2020-11-26 11:42:03 +00:00
# vendored golang and node.js build dependencies
# this is for security purposes, if nodejs-foo ever needs an update,
# affected packages can be easily identified.
# Note: generated by the Makefile (see README.md)
2022-07-04 11:40:02 +00:00
Provides: bundled(golang(github.com/grafana/grafana-plugin-sdk-go)) = 0.128.0
Provides: bundled(golang(github.com/hashicorp/golang-lru)) = 0.5.4
Provides: bundled(golang(github.com/stretchr/testify)) = 1.7.0
2022-07-04 11:40:02 +00:00
Provides: bundled(npm(@babel/plugin-transform-modules-commonjs)) = 7.18.6
Provides: bundled(npm(@grafana/data)) = 8.5.6
Provides: bundled(npm(@grafana/runtime)) = 8.5.6
Provides: bundled(npm(@grafana/toolkit)) = 8.5.6
Provides: bundled(npm(@grafana/ui)) = 8.5.6
Provides: bundled(npm(@trivago/prettier-plugin-sort-imports)) = 3.2.0
Provides: bundled(npm(@types/blueimp-md5)) = 2.18.0
2022-07-04 11:40:02 +00:00
Provides: bundled(npm(@types/d3-selection)) = 2.0.1
Provides: bundled(npm(@types/enzyme)) = 3.10.8
2020-11-26 11:42:03 +00:00
Provides: bundled(npm(@types/enzyme-adapter-react-16)) = 1.0.6
2022-07-04 11:40:02 +00:00
Provides: bundled(npm(@types/jest)) = 26.0.24
Provides: bundled(npm(@types/lodash)) = 4.14.149
2020-11-26 11:42:03 +00:00
Provides: bundled(npm(@types/memoize-one)) = 5.1.2
2022-07-04 11:40:02 +00:00
Provides: bundled(npm(@types/react-autosuggest)) = 10.1.5
Provides: bundled(npm(@types/react-redux)) = 7.1.24
2020-11-26 11:42:03 +00:00
Provides: bundled(npm(@types/redux)) = 3.6.0
Provides: bundled(npm(@types/redux-persist)) = 4.3.1
Provides: bundled(npm(babel-plugin-remove-object-properties)) = 1.0.2
2021-11-12 15:21:30 +00:00
Provides: bundled(npm(blueimp-md5)) = 2.19.0
Provides: bundled(npm(core-js)) = 2.6.12
2022-07-04 11:40:02 +00:00
Provides: bundled(npm(cypress)) = 9.7.0
2020-11-26 11:42:03 +00:00
Provides: bundled(npm(d3-flame-graph)) = 3.1.1
Provides: bundled(npm(d3-selection)) = 1.4.2
2020-11-26 11:42:03 +00:00
Provides: bundled(npm(emotion)) = 10.0.27
Provides: bundled(npm(enzyme)) = 3.11.0
Provides: bundled(npm(enzyme-adapter-react-16)) = 1.15.6
2022-07-04 11:40:02 +00:00
Provides: bundled(npm(eslint-plugin-prettier)) = 4.0.0
2020-11-26 11:42:03 +00:00
Provides: bundled(npm(jest-date-mock)) = 1.0.8
Provides: bundled(npm(lodash)) = 4.17.21
2022-07-04 11:40:02 +00:00
Provides: bundled(npm(loglevel)) = 1.8.0
2020-11-26 11:42:03 +00:00
Provides: bundled(npm(loglevel-plugin-prefix)) = 0.8.4
Provides: bundled(npm(memoize-one)) = 4.1.0
2022-07-04 11:40:02 +00:00
Provides: bundled(npm(monaco-editor)) = 0.31.1
Provides: bundled(npm(monaco-editor-webpack-plugin)) = 7.0.1
2021-11-12 15:21:30 +00:00
Provides: bundled(npm(prettier-plugin-organize-imports)) = 2.3.4
Provides: bundled(npm(react-autosuggest)) = 10.1.0
2022-07-04 11:40:02 +00:00
Provides: bundled(npm(react-monaco-editor)) = 0.47.0
Provides: bundled(npm(react-redux)) = 7.2.8
Provides: bundled(npm(react-use)) = 17.3.2
Provides: bundled(npm(redux)) = 4.1.0
Provides: bundled(npm(redux-persist)) = 6.0.0
Provides: bundled(npm(redux-thunk)) = 2.4.1
2020-11-26 11:42:03 +00:00
Provides: bundled(npm(utility-types)) = 3.10.0
2019-08-30 09:56:40 +00:00
%description
2022-07-04 11:40:02 +00:00
This Grafana plugin for Performance Co-Pilot includes data sources for
scalable time series from pmseries(1) and Redis, live PCP metrics and
bpftrace scripts from pmdabpftrace(1), as well as several dashboards.
2019-08-30 09:56:40 +00:00
%prep
2020-11-26 11:42:03 +00:00
%setup -q -T -D -b 0
%setup -q -T -D -b 1
%if %{compile_frontend} == 0
%setup -q -T -D -b 2
%endif
%patch1 -p1
2019-08-30 09:56:40 +00:00
2020-11-26 11:42:03 +00:00
%build
2022-07-04 11:40:02 +00:00
# Build frontend data sources
2020-11-26 11:42:03 +00:00
%if %{compile_frontend}
%{SOURCE4}
2020-11-26 11:42:03 +00:00
%endif
2022-07-04 11:40:02 +00:00
# Build backend data source
2020-11-26 11:42:03 +00:00
%gobuild -o dist/datasources/redis/pcp_redis_datasource_$(go env GOOS)_$(go env GOARCH) ./pkg
2019-08-30 09:56:40 +00:00
%install
install -d -m 755 %{buildroot}/%{install_dir}
cp -a dist/* %{buildroot}/%{install_dir}
# On rpm-ostree based distributions, /var is exclusively reserved for application state.
# Grafana also supports installing plugins through the UI, therefore this RPM installs
# its content to /usr/share, and creates a symlink from /var to it using systemd-tmpfiles.
mkdir -p %{buildroot}%{_tmpfilesdir}
echo "L+ %{plugin_dir} - - - - %{install_dir}" > %{buildroot}%{_tmpfilesdir}/%{name}.conf
2020-11-26 11:42:03 +00:00
%postun
# uninstall of old package
%systemd_postun_with_restart grafana-server.service
%posttrans
# install or upgrade of new package
# create symlink after the previous package got removed
%tmpfiles_create %_tmpfilesdir/%{name}.conf
# restart Grafana after the previous package got removed
2020-11-26 11:42:03 +00:00
if [ -x /usr/bin/systemctl ]; then
/usr/bin/systemctl try-restart grafana-server.service || :
fi
%check
2022-07-04 11:40:02 +00:00
# Test frontend data sources
2020-11-26 11:42:03 +00:00
%if %{compile_frontend}
yarn test
%endif
2022-07-04 11:40:02 +00:00
# Test backend data source
2020-11-26 11:42:03 +00:00
%gotest ./pkg/...
2019-08-30 09:56:40 +00:00
%files
%{install_dir}
%{_tmpfilesdir}/%{name}.conf
# remove symlink when package is uninstalled
%ghost %{plugin_dir}
2019-08-30 09:56:40 +00:00
%license LICENSE NOTICE
%doc README.md
2020-11-26 11:42:03 +00:00
2019-08-30 09:56:40 +00:00
%changelog
* Mon Sep 19 2022 Andreas Gerstmayr <agerstmayr@redhat.com> 5.0.0-3
- install plugin in /usr/share and create symlink from /var using
systemd-tmpfiles to work on rpm-ostree based distributions
- drop makefile in favor of create_bundles.sh script
- replace plugin id patch with sed to catch future usages of the new
upstream plugin ids
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 5.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
2022-07-08 11:36:41 +00:00
* Fri Jul 08 2022 Andreas Gerstmayr <agerstmayr@redhat.com> 5.0.0-2
- bump required Grafana version to 8.5.6
2022-07-04 11:40:02 +00:00
* Thu Jul 07 2022 Andreas Gerstmayr <agerstmayr@redhat.com> 5.0.0-1
- update to 5.0.0 tagged upstream community sources, see CHANGELOG
- reverted the breaking change (change of internal plugin IDs) of upstream v5.0.0,
i.e. there are no breaking changes when performing this upgrade
- enable Go modules in build process
- make vendor and webpack tarballs reproducible
* Sat Jun 18 2022 Robert-André Mauchin <zebob.m@gmail.com> - 3.2.0-3
- Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327, CVE-2022-27191,
CVE-2022-29526, CVE-2022-30629
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
2021-11-12 15:21:30 +00:00
* Fri Nov 12 2021 Andreas Gerstmayr <agerstmayr@redhat.com> 3.2.0-1
- update to 3.2.0 tagged upstream community sources, see CHANGELOG
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jun 25 2021 Andreas Gerstmayr <agerstmayr@redhat.com> 3.1.0-1
- update to 3.1.0 tagged upstream community sources, see CHANGELOG
- remove unused cryptographic implementations
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
2021-01-22 17:19:01 +00:00
* Fri Jan 22 2021 Andreas Gerstmayr <agerstmayr@redhat.com> 3.0.2-1
- update to 3.0.2 tagged upstream community sources, see CHANGELOG
2020-12-23 13:48:21 +00:00
* Wed Dec 23 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 3.0.1-1
- update to 3.0.1 tagged upstream community sources, see CHANGELOG
2020-11-26 11:42:03 +00:00
* Thu Nov 26 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 3.0.0-1
- update to 3.0.0 tagged upstream community sources, see CHANGELOG
- bundle golang dependencies and (optionally) node.js dependencies
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
2020-02-25 13:59:08 +00:00
* Tue Feb 25 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 2.0.2-1
- vector, redis: remove autocompletion cache (PCP metrics can be added and removed dynamically)
2020-02-20 12:04:59 +00:00
* Thu Feb 20 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 2.0.1-1
- support for Grafana 6.6+, drop support for Grafana < 6.6
- vector, bpftrace: fix version checks on dashboard load (prevent multiple pmcd.version checks on dashboard load)
- vector, bpftrace: change datasource check box to red if URL is inaccessible
- redis: add tests
- flame graphs: support multidimensional eBPF maps (required to display e.g. the process name)
2020-02-20 12:15:19 +00:00
- dashboards: remove BCC metrics from Vector host overview (because the BCC PMDA is not installed by default)
2020-02-20 12:04:59 +00:00
- misc: update dependencies
- build: fix production build (implement workaround for https://github.com/systemjs/systemjs/issues/2117, https://github.com/grafana/grafana/issues/21785)
2020-01-29 15:32:24 +00:00
* Wed Jan 29 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.7-1
- redis: fix timespec (fixes empty graphs for large time ranges)
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
2020-01-07 15:04:19 +00:00
* Tue Jan 07 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.6-1
- redis: support wildcards in metric names
- redis: fix label support
- redis: fix legends
- redis: set default sample interval to 60s (fixes empty graph borders)
- build: upgrade copy-webpack-plugin to mitigate XSS vulnerability in the serialize-javascript transitive dependency
- build: remove deprecated uglify-webpack-plugin
* Thu Dec 12 2019 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.4-2
- remove node_modules/node-notifier directory from webpack (due to licensing issues)
2019-12-11 16:44:48 +00:00
* Wed Dec 11 2019 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.4-1
- flame graphs: clean flame graph stacks every 5s (reduces CPU load)
- general: implement PCP version checks
- build: remove weak dependency (doesn't work with Node.js 12)
- build: upgrade terser-webpack-plugin to mitigate XSS vulnerability in the serialize-javascript transitive dependency
2019-11-26 04:48:42 +00:00
* Tue Nov 26 2019 Nathan Scott <nathans@redhat.com> 1.0.3-1
- fix flame graph dependency (flamegraph.destroy error in javascript console)
2019-11-12 13:55:22 +00:00
* Tue Nov 12 2019 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.2-1
- handle counter wraps (overflows)
- convert time based counters to time utilization
- flame graphs: aggregate stack counts by selected time range in the Grafana UI
- flame graphs: add option to hide idle stacks
- vector: fix container dropdown in query editor
- vector: remove container setting from datasource settings page
- redis: fix value transformations (e.g. rate conversation of counters)
- request more datapoints from the datasource to fill the borders of the graph panel
2019-10-11 18:12:07 +00:00
* Fri Oct 11 2019 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.0-1
- bpftrace: support for Flame Graphs
- bpftrace: context-sensitive auto completion for bpftrace probes, builtin variables and functions incl. help texts
- bpftrace: parse output of bpftrace scripts (e.g. using `printf()`) as CSV and display it in the Grafana table panel
- bpftrace: sample dashboards (BPFtrace System Analysis, BPFtrace Flame Graphs)
- vector: table output: show instance name in left column
- vector: table output: support non-matching instance names (cells of metrics which don't have the specific instance will be blank)
- vector & bpftrace: if the metric/script gets changed in the query editor, immeditately stop polling the old metric/deregister the old script
- vector & bpftrace: improve pmwebd compatibility
- misc: help texts for all datasources (visible with the **[ ? ]** button in the query editor)
- misc: renamed PCP Live to PCP Vector
- misc: logos for all datasources
- misc: improved error handling
2019-08-30 09:56:40 +00:00
* Fri Aug 16 2019 Andreas Gerstmayr <agerstmayr@redhat.com> 0.0.7-1
- converted into a Grafana app plugin, renamed to grafana-pcp
- redis: support for instance domains, labels, autocompletion, automatic rate conversation
- live and bpftrace: initial commit of datasources
* Tue Jun 11 2019 Mark Goodwin <mgoodwin@redhat.com> 0.0.6-1
- renamed package to grafana-pcp-redis, updated README, etc
* Wed Jun 05 2019 Mark Goodwin <mgoodwin@redhat.com> 0.0.5-1
- renamed package to grafana-pcp-datasource, README, etc
* Fri May 17 2019 Mark Goodwin <mgoodwin@redhat.com> 0.0.4-1
- add suggested pmproxy URL in config html
- updated instructions and README.md now that grafana is in Fedora
* Fri Apr 12 2019 Mark Goodwin <mgoodwin@redhat.com> 0.0.3-1
- require grafana v6.1.3 or later
- install directory is now below /var/lib/grafana/plugins
* Wed Mar 20 2019 Mark Goodwin <mgoodwin@redhat.com> 0.0.2-1
- initial version