Blame SPECS/grafana-pcp.spec

3bf19c
%global grafanapcp_arches %{lua: go_arches = {}
3bf19c
  for arch in rpm.expand("%{go_arches}"):gmatch("%S+") do
3bf19c
    go_arches[arch] = 1
3bf19c
  end
3bf19c
  for arch in rpm.expand("%{nodejs_arches}"):gmatch("%S+") do
3bf19c
    if go_arches[arch] then
3bf19c
      print(arch .. " ")
3bf19c
  end
3bf19c
end}
3bf19c
3bf19c
# Specify if the frontend and dashboards will be compiled as part of the build or are attached
3bf19c
# as a webpack tarball (in case of an unsuitable nodejs or jsonnet version on the build system)
3bf19c
%define compile_frontend 0
3bf19c
60f275
Name:           grafana-pcp
4fb649
Version:        3.1.0
60f275
Release:        1%{?dist}
60f275
Summary:        Performance Co-Pilot Grafana Plugin
60f275
License:        ASL 2.0
3bf19c
URL:            https://github.com/performancecopilot/grafana-pcp
3bf19c
3bf19c
Source0:        https://github.com/performancecopilot/grafana-pcp/archive/v%{version}/%{name}-%{version}.tar.gz
3bf19c
Source1:        grafana-pcp-vendor-%{version}.tar.xz
3bf19c
%if %{compile_frontend} == 0
3bf19c
# Source2 contains the precompiled frontend and dashboards
3bf19c
Source2:        grafana-pcp-webpack-%{version}.tar.gz
3bf19c
%endif
3bf19c
Source3:        Makefile
4fb649
Source4:        build_frontend.sh
4fb649
Source5:        list_bundled_nodejs_packages.py
4fb649
4fb649
Patch1:         001-remove-unused-frontend-crypto.patch
3bf19c
3bf19c
# Intersection of go_arches and nodejs_arches
3bf19c
ExclusiveArch:  %{grafanapcp_arches}
3bf19c
3bf19c
BuildRequires:  systemd-rpm-macros, golang, go-srpm-macros
3bf19c
%if 0%{?fedora} >= 31
3bf19c
BuildRequires:  go-rpm-macros
3bf19c
%endif
4fb649
3bf19c
%if %{compile_frontend}
4fb649
BuildRequires:  make, nodejs >= 1:14, yarnpkg, golang-github-google-jsonnet
3bf19c
%endif
3bf19c
3bf19c
# omit golang debugsource, see BZ 995136 and related
3bf19c
%global         dwz_low_mem_die_limit 0
3bf19c
%global         _debugsource_template %{nil}
3bf19c
3bf19c
%global         install_dir %{_sharedstatedir}/grafana/plugins/performancecopilot-pcp-app
3bf19c
4fb649
Requires:       grafana >= 7.5.9
3bf19c
Suggests:       pcp >= 5.2.2
60f275
Suggests:       redis >= 5.0.0
60f275
Suggests:       bpftrace >= 0.9.2
60f275
60f275
# Obsolete old webapps
0fc7f8
Obsoletes: pcp-webjs <= 4.3.4
0fc7f8
Obsoletes: pcp-webapp-blinkenlights <= 4.3.4
0fc7f8
Obsoletes: pcp-webapp-grafana <= 4.3.4
0fc7f8
Obsoletes: pcp-webapp-graphite <= 4.3.4
0fc7f8
Obsoletes: pcp-webapp-vector <= 4.3.4
60f275
3bf19c
# vendored golang and node.js build dependencies
3bf19c
# this is for security purposes, if nodejs-foo ever needs an update,
3bf19c
# affected packages can be easily identified.
3bf19c
# Note: generated by the Makefile (see README.md)
4fb649
Provides: bundled(golang(github.com/grafana/grafana-plugin-sdk-go)) = 0.105.0
4fb649
Provides: bundled(golang(github.com/stretchr/testify)) = 1.7.0
4fb649
Provides: bundled(npm(@babel/plugin-transform-modules-commonjs)) = 7.14.5
4fb649
Provides: bundled(npm(@grafana/data)) = 7.5.9
4fb649
Provides: bundled(npm(@grafana/runtime)) = 7.5.9
4fb649
Provides: bundled(npm(@grafana/toolkit)) = 7.5.9
4fb649
Provides: bundled(npm(@grafana/ui)) = 7.5.9
4fb649
Provides: bundled(npm(@testing-library/jest-dom)) = 5.4.0
4fb649
Provides: bundled(npm(@testing-library/react)) = 10.4.9
4fb649
Provides: bundled(npm(@types/blueimp-md5)) = 2.18.0
3bf19c
Provides: bundled(npm(@types/d3-selection)) = 1.4.3
4fb649
Provides: bundled(npm(@types/enzyme)) = 3.10.8
3bf19c
Provides: bundled(npm(@types/enzyme-adapter-react-16)) = 1.0.6
3bf19c
Provides: bundled(npm(@types/expect-puppeteer)) = 3.3.1
4fb649
Provides: bundled(npm(@types/jest)) = 26.0.15
3bf19c
Provides: bundled(npm(@types/jest-environment-puppeteer)) = 4.4.1
4fb649
Provides: bundled(npm(@types/lodash)) = 4.14.170
3bf19c
Provides: bundled(npm(@types/memoize-one)) = 5.1.2
3bf19c
Provides: bundled(npm(@types/react-autosuggest)) = 9.3.14
4fb649
Provides: bundled(npm(@types/react-redux)) = 7.1.16
3bf19c
Provides: bundled(npm(@types/redux)) = 3.6.0
3bf19c
Provides: bundled(npm(@types/redux-persist)) = 4.3.1
3bf19c
Provides: bundled(npm(@types/redux-persist-transform-filter)) = 0.0.4
3bf19c
Provides: bundled(npm(babel-plugin-remove-object-properties)) = 1.0.2
3bf19c
Provides: bundled(npm(blueimp-md5)) = 2.18.0
4fb649
Provides: bundled(npm(core-js)) = 2.6.12
3bf19c
Provides: bundled(npm(d3-flame-graph)) = 3.1.1
4fb649
Provides: bundled(npm(d3-selection)) = 1.4.2
3bf19c
Provides: bundled(npm(emotion)) = 10.0.27
3bf19c
Provides: bundled(npm(enzyme)) = 3.11.0
4fb649
Provides: bundled(npm(enzyme-adapter-react-16)) = 1.15.6
4fb649
Provides: bundled(npm(eslint-plugin-prettier)) = 3.3.1
3bf19c
Provides: bundled(npm(jest-date-mock)) = 1.0.8
4fb649
Provides: bundled(npm(jest-puppeteer)) = 5.0.4
4fb649
Provides: bundled(npm(lodash)) = 4.17.21
3bf19c
Provides: bundled(npm(loglevel)) = 1.7.1
3bf19c
Provides: bundled(npm(loglevel-plugin-prefix)) = 0.8.4
3bf19c
Provides: bundled(npm(memoize-one)) = 4.1.0
3bf19c
Provides: bundled(npm(monaco-editor)) = 0.20.0
3bf19c
Provides: bundled(npm(monaco-editor-webpack-plugin)) = 1.9.0
4fb649
Provides: bundled(npm(prettier-plugin-organize-imports)) = 2.1.0
4fb649
Provides: bundled(npm(puppeteer)) = 10.0.0
4fb649
Provides: bundled(npm(react-autosuggest)) = 10.1.0
3bf19c
Provides: bundled(npm(react-monaco-editor)) = 0.36.0
4fb649
Provides: bundled(npm(react-redux)) = 7.2.4
4fb649
Provides: bundled(npm(react-use)) = 15.3.8
3bf19c
Provides: bundled(npm(redux)) = 3.7.2
3bf19c
Provides: bundled(npm(redux-persist)) = 4.10.2
3bf19c
Provides: bundled(npm(redux-thunk)) = 2.3.0
3bf19c
Provides: bundled(npm(utility-types)) = 3.10.0
60f275
60f275
60f275
%description
60f275
This Grafana plugin for Performance Co-Pilot includes datasources for
60f275
scalable time series from pmseries(1) and Redis, live PCP metrics and
60f275
bpftrace scripts from pmdabpftrace(1), as well as several dashboards.
60f275
60f275
%prep
3bf19c
%setup -q -T -D -b 0
3bf19c
%setup -q -T -D -b 1
3bf19c
%if %{compile_frontend} == 0
3bf19c
%setup -q -T -D -b 2
3bf19c
%endif
3bf19c
4fb649
%patch1 -p1
4fb649
3bf19c
# Set up Go build subdir and links
3bf19c
mkdir -p %{_builddir}/src/github.com/performancecopilot
3bf19c
ln -s %{_builddir}/%{name}-%{version} \
3bf19c
    %{_builddir}/src/github.com/performancecopilot/grafana-pcp
60f275
60f275
3bf19c
%build
3bf19c
# Build frontend datasources
3bf19c
%if %{compile_frontend}
4fb649
%{SOURCE4}
3bf19c
%endif
3bf19c
3bf19c
# Build backend datasource
3bf19c
cd %{_builddir}/src/github.com/performancecopilot/grafana-pcp
3bf19c
export GOPATH=%{_builddir}
3bf19c
%gobuild -o dist/datasources/redis/pcp_redis_datasource_$(go env GOOS)_$(go env GOARCH) ./pkg
60f275
60f275
60f275
%install
60f275
install -d -m 755 %{buildroot}/%{install_dir}
60f275
cp -a dist/* %{buildroot}/%{install_dir}
60f275
3bf19c
%postun
3bf19c
# uninstall of old package
3bf19c
%systemd_postun_with_restart grafana-server.service
3bf19c
3bf19c
%posttrans
3bf19c
# install or upgrade of new package
3bf19c
if [ -x /usr/bin/systemctl ]; then
3bf19c
  /usr/bin/systemctl try-restart grafana-server.service || :
3bf19c
fi
3bf19c
3bf19c
3bf19c
%check
3bf19c
# Test frontend datasources
3bf19c
%if %{compile_frontend}
3bf19c
yarn test
3bf19c
%endif
3bf19c
3bf19c
# Test backend datasource
3bf19c
cd %{_builddir}/src/github.com/performancecopilot/grafana-pcp
3bf19c
export GOPATH=%{_builddir}
3bf19c
%gotest ./pkg/...
3bf19c
3bf19c
60f275
%files
60f275
%{install_dir}
60f275
60f275
%license LICENSE NOTICE
60f275
%doc README.md
60f275
3bf19c
60f275
%changelog
4fb649
* Fri Jun 25 2021 Andreas Gerstmayr <agerstmayr@redhat.com> 3.1.0-1
4fb649
- update to 3.1.0 tagged upstream community sources, see CHANGELOG
4fb649
- remove unused cryptographic implementations
4fb649
3bf19c
* Fri Jan 22 2021 Andreas Gerstmayr <agerstmayr@redhat.com> 3.0.2-1
3bf19c
- update to 3.0.2 tagged upstream community sources, see CHANGELOG
3bf19c
3bf19c
* Wed Dec 23 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 3.0.1-1
3bf19c
- update to 3.0.1 tagged upstream community sources, see CHANGELOG
3bf19c
3bf19c
* Thu Nov 26 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 3.0.0-1
3bf19c
- update to 3.0.0 tagged upstream community sources, see CHANGELOG
3bf19c
- bundle golang dependencies and (optionally) node.js dependencies
3bf19c
3bf19c
* Fri Aug 07 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 2.0.2-3
3bf19c
- bpftrace: show process name and PID in flame graphs
3bf19c
3bf19c
* Fri Jul 24 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 2.0.2-2
3bf19c
- vector: do not show all cgroups in the container overview dashboard in case no containers are present on the system
3bf19c
0fc7f8
* Mon May 11 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 2.0.2-1
0fc7f8
- update to upstream version 2.0.2, see CHANGELOG
0fc7f8
0fc7f8
* Tue Jan 28 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.5-3
0fc7f8
- redis: pass correct timespec to pmproxy (fixes empty graphs for large time ranges)
0fc7f8
0fc7f8
* Tue Jan 07 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.5-2
0fc7f8
- redis: support wildcards in metric names
0fc7f8
- redis: fix legend and label support
0fc7f8
60f275
* Mon Dec 16 2019 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.5-1
60f275
- upgrade to upstream 1.0.5
60f275
- flame graphs: clean flame graph stacks every 5s (reduces CPU load)
60f275
- general: implement PCP version checks
60f275
- redis: set default sample interval to 60s (fixes empty graph borders)
60f275
60f275
* Mon Dec 16 2019 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.3-2
60f275
- remove node_modules/node-notifier directory from webpack (due to licensing issues)
60f275
- upgrade copy-webpack-plugin, terser-webpack-plugin and remove uglifyjs-webpack-plugin to mitigate XSS vulnerability in serialize-javascript dependency
60f275
60f275
* Tue Nov 26 2019 Nathan Scott <nathans@redhat.com> 1.0.3-1
60f275
- fix flame graph dependency (flamegraph.destroy error in javascript console)
60f275
60f275
* Tue Nov 12 2019 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.2-1
60f275
- handle counter wraps (overflows)
60f275
- convert time based counters to time utilization
60f275
- flame graphs: aggregate stack counts by selected time range in the Grafana UI
60f275
- flame graphs: add option to hide idle stacks
60f275
- vector: fix container dropdown in query editor
60f275
- vector: remove container setting from datasource settings page
60f275
- redis: fix value transformations (e.g. rate conversation of counters)
60f275
- request more datapoints from the datasource to fill the borders of the graph panel
60f275
60f275
* Fri Oct 11 2019 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.0-1
60f275
- bpftrace: support for Flame Graphs
60f275
- bpftrace: context-sensitive auto completion for bpftrace probes, builtin variables and functions incl. help texts
60f275
- bpftrace: parse output of bpftrace scripts (e.g. using `printf()`) as CSV and display it in the Grafana table panel
60f275
- bpftrace: sample dashboards (BPFtrace System Analysis, BPFtrace Flame Graphs)
60f275
- vector: table output: show instance name in left column
60f275
- vector: table output: support non-matching instance names (cells of metrics which don't have the specific instance will be blank)
60f275
- vector & bpftrace: if the metric/script gets changed in the query editor, immeditately stop polling the old metric/deregister the old script
60f275
- vector & bpftrace: improve pmwebd compatibility
60f275
- misc: help texts for all datasources (visible with the **[ ? ]** button in the query editor)
60f275
- misc: renamed PCP Live to PCP Vector
60f275
- misc: logos for all datasources
60f275
- misc: improved error handling
60f275
60f275
* Fri Aug 16 2019 Andreas Gerstmayr <agerstmayr@redhat.com> 0.0.7-1
60f275
- converted into a Grafana app plugin, renamed to grafana-pcp
60f275
- redis: support for instance domains, labels, autocompletion, automatic rate conversation
60f275
- live and bpftrace: initial commit of datasources
60f275
60f275
* Tue Jun 11 2019 Mark Goodwin <mgoodwin@redhat.com> 0.0.6-1
60f275
- renamed package to grafana-pcp-redis, updated README, etc
60f275
60f275
* Wed Jun 05 2019 Mark Goodwin <mgoodwin@redhat.com> 0.0.5-1
60f275
- renamed package to grafana-pcp-datasource, README, etc
60f275
60f275
* Fri May 17 2019 Mark Goodwin <mgoodwin@redhat.com> 0.0.4-1
60f275
- add suggested pmproxy URL in config html
60f275
- updated instructions and README.md now that grafana is in Fedora
60f275
60f275
* Fri Apr 12 2019 Mark Goodwin <mgoodwin@redhat.com> 0.0.3-1
60f275
- require grafana v6.1.3 or later
60f275
- install directory is now below /var/lib/grafana/plugins
60f275
60f275
* Wed Mar 20 2019 Mark Goodwin <mgoodwin@redhat.com> 0.0.2-1
60f275
- initial version