Blame SPECS/grafana-pcp.spec

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