|
![](https://seccdn.libravatar.org/avatar/dcfe7af74d8d03d1a0ebd18962b3b8f18e13cfb21df46c214faa00e234336c40?s=16&d=retro) |
97f8dbd |
# grafana
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
3557495 |
The grafana package
|
|
![](https://seccdn.libravatar.org/avatar/dcfe7af74d8d03d1a0ebd18962b3b8f18e13cfb21df46c214faa00e234336c40?s=16&d=retro) |
97f8dbd |
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
3557495 |
## Upgrade instructions
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
7f0368f |
* update `Version`, `Release`, `%changelog` and tarball NVRs in the specfile
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
7f0368f |
* create bundles and manifest: `make clean all`
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
6b8f02a |
* update specfile with contents of the `.manifest` file
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
3557495 |
* check if the default configuration has changed: `diff grafana-X.Y.Z/conf/defaults.ini distro-defaults.ini` and update `distro-defaults.ini` if necessary
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
8515ac3 |
* update the manpages patch in `002-manpages.patch` and other patches if required
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
7a1a656 |
* run local build: `rpkg local`
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
35e322c |
* run rpm linter: `rpkg lint -r grafana.rpmlintrc`
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
3557495 |
* run a scratch build: `fedpkg scratch-build --srpm`
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
8b048a5 |
* upload new source tarballs: `fedpkg new-sources *.tar.gz *.tar.xz`
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
7f0368f |
* commit new `sources` file
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
35e322c |
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
b3f6907 |
## Patches
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
35e322c |
* create the patch
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
35e322c |
* declare and apply (`%prep`) the patch in the specfile
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
35e322c |
* if the patch affects Go or Node.js dependencies, or the webpack
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
b3f6907 |
* add the patch to `PATCHES_PRE_VENDOR` or `PATCHES_PRE_WEBPACK` in the Makefile
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
7f0368f |
* create new tarballs
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
b3f6907 |
* update the specfile with new tarball name and contents of the `.manifest` file
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
35e322c |
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
b3f6907 |
### General guidelines
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
b3f6907 |
* aim to apply all patches in the specfile
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
b3f6907 |
* avoid rebuilding the tarballs
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
7f0368f |
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
b3f6907 |
Patches fall in several categories:
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
b3f6907 |
* modify dependency versions
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
b3f6907 |
* modify both sources and vendored dependencies (e.g. CVEs)
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
b3f6907 |
* modify the Node.js source (i.e. affect the webpack)
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
b3f6907 |
* some patches are conditional (e.g. FIPS)
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
b3f6907 |
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
b3f6907 |
Patches cannot be applied twice.
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
b3f6907 |
It is not possible to unconditionally apply all patches in the Makefile, and great care must be taken to include the required patches at the correct stage of the build.
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
8515ac3 |
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
8efab3c |
## Reproducible Bundles
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
8efab3c |
Run `./create_bundles_in_container.sh` to generate a reproducible vendor and webpack bundle.
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
8efab3c |
Alternatively, install the same software as in the container, create a bind mount from `/tmp/grafana-build` to the directory of this repository, and run `make`.
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
8efab3c |
The bind mount is required because Webpack stores absolute paths in the JS source maps, and also resolves symlinks (i.e. symlinking `/tmp/grafana-build` doesn't work).
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
8efab3c |
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
8515ac3 |
## Verification
|
|
![](https://seccdn.libravatar.org/avatar/cda1e1d3cdf499bdfed2d28b3f0e89cb7063e7f22bef82ccca08f0279a1525ba?s=16&d=retro) |
8515ac3 |
* compare the list of files with the upstream RPM at https://grafana.com/grafana/download
|