Sync from SUSE:SLFO:1.1 kepler revision ff1ca1bf080d41a61e06bd445797784f

This commit is contained in:
Adrian Schröter 2024-10-17 13:54:19 +02:00
commit b4dbbd795a
10 changed files with 200 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,9 @@
Index: kepler-0.7.11/pkg/bpf/gen.go
===================================================================
--- kepler-0.7.11.orig/pkg/bpf/gen.go
+++ kepler-0.7.11/pkg/bpf/gen.go
@@ -1,3 +1,3 @@
package bpf
-//go:generate go run github.com/cilium/ebpf/cmd/bpf2go@v0.15.0 kepler ../../bpf/kepler.bpf.c -- -I../../bpf/include
+//go:generate bpf2go kepler ../../bpf/kepler.bpf.c -- -I../../bpf/include

View File

@ -0,0 +1,29 @@
Index: kepler-0.7.11/pkg/collector/stats/utils.go
===================================================================
--- kepler-0.7.11.orig/pkg/collector/stats/utils.go
+++ kepler-0.7.11/pkg/collector/stats/utils.go
@@ -36,7 +36,7 @@ import (
)
const (
- CPUModelDataPath = "/var/lib/kepler/data/cpus.yaml"
+ CPUModelDataPath = "/usr/share/kepler/data/cpus.yaml"
CPUPmuNamePath = "/sys/devices/cpu/caps/pmu_name"
CPUTopologyPath = "/sys/devices/system/cpu/cpu%d/topology/physical_package_id"
)
Index: kepler-0.7.11/pkg/config/config.go
===================================================================
--- kepler-0.7.11.orig/pkg/config/config.go
+++ kepler-0.7.11/pkg/config/config.go
@@ -141,9 +141,9 @@ var (
)
// return local path to power model weight
-// e.g., /var/lib/kepler/data/acpi_AbsPowerModel.json
+// e.g., /usr/share/kepler/data/model_weight/acpi_AbsPowerModel.json
func GetDefaultPowerModelURL(modelOutputType, energySource string) string {
- return fmt.Sprintf("/var/lib/kepler/data/%s_%sModel.json", energySource, modelOutputType)
+ return fmt.Sprintf("/usr/share/kepler/data/model_weight/%s_%sModel.json", energySource, modelOutputType)
}
func logBoolConfigs() {

23
_service Normal file
View File

@ -0,0 +1,23 @@
<services>
<service name="obs_scm" mode="manual">
<param name="url">https://github.com/sustainable-computing-io/kepler.git</param>
<param name="scm">git</param>
<param name="exclude">.git</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="revision">v0.7.11</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="changesgenerate">enable</param>
</service>
<service name="tar" mode="buildtime"/>
<service name="recompress" mode="buildtime">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
<service name="set_version" mode="manual">
<param name="basename">kepler</param>
</service>
<service name="go_modules" mode="manual">
<param name="archive">kepler-0.7.11.obscpio</param>
</service>
</services>

4
_servicedata Normal file
View File

@ -0,0 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/sustainable-computing-io/kepler.git</param>
<param name="changesrevision">4e92b14aa583e864afdd3e7dbe41789580e5130e</param></service></servicedata>

BIN
kepler-0.7.11.obscpio (Stored with Git LFS) Normal file

Binary file not shown.

4
kepler.changes Normal file
View File

@ -0,0 +1,4 @@
-------------------------------------------------------------------
Tue Oct 8 10:55:24 UTC 2024 - Witek Bedyk <witold.bedyk@suse.com>
- Initial package, version 0.7.11

4
kepler.obsinfo Normal file
View File

@ -0,0 +1,4 @@
name: kepler
version: 0.7.11
mtime: 1720623083
commit: bf1f62d8c580aa742d4ae90dedaff70044be9b78

98
kepler.spec Normal file
View File

@ -0,0 +1,98 @@
#
# spec file for package kepler
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: kepler
Version: 0.7.11
Release: 0
Summary: Kubernetes-based Efficient Power Level Exporter
License: Apache-2.0 and (GPL-2.0-only or BSD-2-Clause) and GPL-2.0-only
Group: System/Monitoring
URL: https://github.com/sustainable-computing-io/kepler/
Source0: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
Patch1: 0001-use-local-bpf2go.patch
Patch2: 0002-change-data-path.patch
BuildRequires: bpf2go
BuildRequires: clang
BuildRequires: golang(API) >= 1.21
BuildRequires: llvm
BuildRequires: llvm-devel
BuildRequires: zlib-devel
Recommends: cpuid
%{?systemd_ordering}
%description
Kubernetes-based Efficient Power Level Exporter
%prep
%autosetup -a1 -p1 -n kepler-%{version}
%build
%ifnarch ppc64
export GOFLAGS="-buildmode=pie"
%endif
go generate ./pkg/bpf
go build -o %{name} ./cmd/exporter/exporter.go
echo -n "true" > ./ENABLE_PROCESS_METRICS
%install
install -d %{buildroot}%{_sysconfdir}/%{name}
install -d %{buildroot}%{_datadir}/%{name}/data
install -d %{buildroot}%{_sysconfdir}/%{name}/%{name}.config
install -D -m755 ./%{name} %{buildroot}%{_bindir}/%{name}
install -D -m644 ./packaging/rpm/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
install -D -m644 ./ENABLE_PROCESS_METRICS %{buildroot}%{_sysconfdir}/%{name}/%{name}.config/ENABLE_PROCESS_METRICS
install -D -m644 ./data/cpus.yaml %{buildroot}%{_datadir}/%{name}/data/cpus.yaml
install -D -m644 ./data/model_weight/acpi_AbsPowerModel.json %{buildroot}%{_datadir}/%{name}/data/model_weight/acpi_AbsPowerModel.json
install -D -m644 ./data/model_weight/acpi_DynPowerModel.json %{buildroot}%{_datadir}/%{name}/data/model_weight/acpi_DynPowerModel.json
install -D -m644 ./data/model_weight/intel_rapl_AbsPowerModel.json %{buildroot}%{_datadir}/%{name}/data/model_weight/intel_rapl_AbsPowerModel.json
install -D -m644 ./data/model_weight/intel_rapl_DynPowerModel.json %{buildroot}%{_datadir}/%{name}/data/model_weight/intel_rapl_DynPowerModel.json
%pre
%service_add_pre %{name}.service
%post
%service_add_post %{name}.service
%preun
%service_del_preun %{name}.service
%postun
%service_del_postun %{name}.service
%files
%license LICENSE-APACHE
%license LICENSE-BSD2
%license LICENSE-GPL2
%dir /%{_sysconfdir}/%{name}
%dir /%{_sysconfdir}/%{name}/%{name}.config
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/data
%dir %{_datadir}/%{name}/data/model_weight
%{_bindir}/%{name}
%{_unitdir}/%{name}.service
%config /%{_sysconfdir}/%{name}/%{name}.config/ENABLE_PROCESS_METRICS
%{_datadir}/kepler/data/cpus.yaml
%{_datadir}/kepler/data/model_weight/acpi_AbsPowerModel.json
%{_datadir}/kepler/data/model_weight/acpi_DynPowerModel.json
%{_datadir}/kepler/data/model_weight/intel_rapl_AbsPowerModel.json
%{_datadir}/kepler/data/model_weight/intel_rapl_DynPowerModel.json
%changelog

BIN
vendor.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.