Accepting request 1068670 from home:ojkastl_buildservice:Branch_server_monitoring

- fix boo#1208752
- adjust packaging to build webassets locally, outside of OBS
  * to get the UI working, newer versions of prometheus need the
    react app assets
  * as running `npm install` inside of OBS is not possible, the
    required dependencies need to be prepared outside of OBS
  * added a PACKAGING_README.md file, that explains how the new
    web-ui-*.tar.gz and npm_licenses.tar.bz2 tarballs can be
    created
- update to 2.42.0:

OBS-URL: https://build.opensuse.org/request/show/1068670
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/golang-github-prometheus-prometheus?expand=0&rev=64
This commit is contained in:
Witek Bedyk 2023-03-02 11:51:02 +00:00 committed by Git OBS Bridge
parent 80c7fe49de
commit 0c7e891396
10 changed files with 123 additions and 21 deletions

30
Makefile Normal file
View File

@ -0,0 +1,30 @@
NAME = prometheus
SPEC = golang-github-prometheus-prometheus.spec
default: clean tar
clean:
rm -f $(NAME)-*.tar $(NAME)-*.tar.gz
tar:
osc service disabledrun
@version=$$( awk '/^Version:/ {print $$2;exit;}' $(SPEC) ) && \
echo "Package version is $$version" && \
basename=$(NAME)-$$version && \
tar=$$basename.tar && \
web_ui=web-ui-$$version.tar && \
wd=$$(pwd) && \
tmpdir=$$(mktemp -d -p /tmp) && \
cd $$tmpdir && \
tar -zxf $$wd/$$tar.gz && \
cd $$basename && \
make assets npm_licenses assets-compress && \
tar -cf $$wd/$$web_ui web/ui/static/react && \
find web/ui/static -type f -name '*.gz' -exec tar -rf $$wd/$$web_ui "{}" \; && \
tar -rf $$wd/$$web_ui web/ui/embed.go && \
cd .. && \
echo "Creating web assets tarball" && \
mv $$basename/npm_licenses.tar.bz2 $$wd && \
cd $$wd && \
gzip -f $$web_ui && \
rm -rf $$tmpdir

9
PACKAGING_README.md Normal file
View File

@ -0,0 +1,9 @@
# Packaging prometheus
In addition to the source code in the tarball, this package also
needs the assets for the web UI. These can be generated by the
`Makefile` that is present in this package.
To do that, you need to have `make` and `npm` installed locally.
For the OBS workflow you also need `obs-service-go_modules` as well
as `obs-service-tar_scm` and `obs-service-recompress`.

View File

@ -4,7 +4,7 @@
<param name="scm">git</param>
<param name="exclude">.git</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="revision">v2.41.0</param>
<param name="revision">v2.42.0</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="match-tag">v2*</param>
</service>
@ -12,10 +12,7 @@
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
<service name="set_version" mode="disabled">
<param name="basename">prometheus</param>
</service>
<service name="go_modules" mode="disabled">
<param name="archive">prometheus-2.41.0.tar.gz</param>
<param name="archive">prometheus-2.42.0.tar.gz</param>
</service>
</services>

View File

@ -1,3 +1,56 @@
-------------------------------------------------------------------
Tue Feb 28 15:44:01 UTC 2023 - Johannes Kastl <kastl@b1-systems.de>
- fix boo#1208752
- adjust packaging to build webassets locally, outside of OBS
* to get the UI working, newer versions of prometheus need the
react app assets
* as running `npm install` inside of OBS is not possible, the
required dependencies need to be prepared outside of OBS
* added a PACKAGING_README.md file, that explains how the new
web-ui-*.tar.gz and npm_licenses.tar.bz2 tarballs can be
created
-------------------------------------------------------------------
Thu Feb 2 07:19:41 UTC 2023 - Johannes Kastl <kastl@b1-systems.de>
- update to 2.42.0:
This release comes with a bunch of feature coverage for native
histograms and breaking changes.
If you are trying native histograms already, we recommend you
remove the `wal` directory when upgrading.
Because the old WAL record for native histograms is not
backward compatible in v2.42.0, this will lead to some data
loss for the latest data.
Additionally, if you scrape "float histograms" or use recording
rules on native histograms in v2.42.0 (which writes float
histograms),
it is a one-way street since older versions do not support
float histograms.
* [CHANGE] **breaking** TSDB: Changed WAL record format for the
experimental native histograms. #11783
* [FEATURE] Add 'keep_firing_for' field to alerting rules.
#11827
* [FEATURE] Promtool: Add support of selecting timeseries for
TSDB dump. #11872
* [ENHANCEMENT] Agent: Native histogram support. #11842
* [ENHANCEMENT] Rules: Support native histograms in recording
rules. #11838
* [ENHANCEMENT] SD: Add container ID as a meta label for pod
targets for Kubernetes. #11844
* [ENHANCEMENT] SD: Add VM size label to azure service
discovery. #11650
* [ENHANCEMENT] Support native histograms in federation. #11830
* [ENHANCEMENT] TSDB: Add gauge histogram support.
#11783 #11840 #11814
* [ENHANCEMENT] TSDB/Scrape: Support FloatHistogram that
represents buckets as float64 values. #11522 #11817 #11716
* [ENHANCEMENT] UI: Show individual scrape pools on /targets
page. #11142
-------------------------------------------------------------------
Tue Jan 10 14:18:30 UTC 2023 - Johannes Kastl <kastl@b1-systems.de>

View File

@ -27,7 +27,7 @@
%endif
Name: golang-github-prometheus-prometheus
Version: 2.41.0
Version: 2.42.0
Release: 0
Summary: The Prometheus monitoring system and time series database
License: Apache-2.0
@ -35,12 +35,15 @@ Group: System/Monitoring
URL: https://prometheus.io/
# also includes web assets generated with `make assets`
Source: prometheus-%{version}.tar.gz
# generated after applying 0003-Bump-client_golang-to-1.12.1.patch
Source1: vendor.tar.gz
Source2: prometheus.service
Source3: prometheus.yml
Source4: prometheus.sysconfig
Source5: prometheus.firewall.xml
Source2: web-ui-%{version}.tar.gz
Source3: prometheus.service
Source4: prometheus.yml
Source5: prometheus.sysconfig
Source6: prometheus.firewall.xml
Source7: npm_licenses.tar.bz2
Source8: Makefile
Source9: PACKAGING_README.md
Patch1: 0001-Do-not-force-the-pure-Go-name-resolver.patch
# Lifted from Debian's prometheus package
Patch2: 0002-Default-settings.patch
@ -78,7 +81,8 @@ Prometheus's main features are:
- multiple modes of graphing and dashboarding support
%prep
%autosetup -a1 -p1 -n prometheus-%{version}
%setup -q -a1 -n prometheus-%{version}
%autosetup -D -a2 -p1 -n prometheus-%{version}
%build
%goprep github.com/prometheus/prometheus
@ -87,9 +91,9 @@ GOPATH=%{_builddir}/go promu build -v
%install
install -D -m0755 %{_builddir}/prometheus-%{version}/prometheus %{buildroot}/%{_bindir}/prometheus
install -D -m0755 %{_builddir}/prometheus-%{version}/promtool %{buildroot}/%{_bindir}/promtool
install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/prometheus.service
install -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/prometheus.service
install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/prometheus/prometheus.yml
install -D -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/prometheus/prometheus.yml
install -d -m 0755 %{buildroot}%{_sbindir}
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcprometheus
@ -98,16 +102,18 @@ install -m 0755 -d %{buildroot}%{_datarootdir}/prometheus
cp -fr console_libraries/ consoles/ %{buildroot}%{_datarootdir}/prometheus
install -m 0755 -d %{buildroot}%{_fillupdir}
install -m 0644 %{SOURCE4} %{buildroot}%{_fillupdir}/sysconfig.prometheus
install -m 0644 %{SOURCE5} %{buildroot}%{_fillupdir}/sysconfig.prometheus
%if 0%{?suse_version} == 1500 && 0%{?sle_version} < 150300
install -m 0755 -d %{buildroot}%{_prefix}/lib/firewalld/services/
install -m 0644 %{SOURCE5} %{buildroot}%{_prefix}/lib/firewalld/services/prometheus.xml
install -m 0644 %{SOURCE6} %{buildroot}%{_prefix}/lib/firewalld/services/prometheus.xml
%endif
install -Dd -m 0750 %{buildroot}%{_localstatedir}/lib/prometheus
install -Dd -m 0750 %{buildroot}%{_localstatedir}/lib/prometheus/data
install -Dd -m 0750 %{buildroot}%{_localstatedir}/lib/prometheus/metrics
install -D -m0644 %{SOURCE7} %{buildroot}/%{_defaultlicensedir}/%{name}/npm_licenses.tar.bz2
%gofilelist
%fdupes %{buildroot}/%{_prefix}
@ -135,6 +141,7 @@ install -Dd -m 0750 %{buildroot}%{_localstatedir}/lib/prometheus/metrics
%defattr(-,root,root,-)
%doc README.md
%license LICENSE
%license %{_defaultlicensedir}/%{name}
%{_bindir}/prometheus
%{_bindir}/promtool
%{_unitdir}/prometheus.service

3
npm_licenses.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:be250b0fed039b63c1eb6be3e0fd088c012b38b4b99fe0251de236e26c90fd68
size 150687

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:54335745a205d2e117e0f6dfd24e1f361e94aa0ed2ad671a63de9fa817789bb1
size 6295431

3
prometheus-2.42.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:76cb8451cda26e3ca965ee4e1ff6d1568465f09b497b883027a6e42fcbace5db
size 6329585

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:db00f0c8609146ea5f60a56cee773d8d0ed35f7c203cd85880cbbce1be9ad0d8
size 12555170
oid sha256:b80508113f08dc052576587658024c96973c8cc7a9843707f2a1d4963d43f6ef
size 12072331

3
web-ui-2.42.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d56177129390906641bb69926fb1bafc015e201c12849cbedd8aa0dc72d79ef
size 9128064