commit b4dbbd795a542ccc17806d9f0ca3e33ccc7b66fe00dbe8d761416fbd078c9053 Author: Adrian Schröter Date: Thu Oct 17 13:54:19 2024 +0200 Sync from SUSE:SLFO:1.1 kepler revision ff1ca1bf080d41a61e06bd445797784f diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/0001-use-local-bpf2go.patch b/0001-use-local-bpf2go.patch new file mode 100644 index 0000000..f81ecd1 --- /dev/null +++ b/0001-use-local-bpf2go.patch @@ -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 diff --git a/0002-change-data-path.patch b/0002-change-data-path.patch new file mode 100644 index 0000000..e1f296f --- /dev/null +++ b/0002-change-data-path.patch @@ -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() { diff --git a/_service b/_service new file mode 100644 index 0000000..3826d72 --- /dev/null +++ b/_service @@ -0,0 +1,23 @@ + + + https://github.com/sustainable-computing-io/kepler.git + git + .git + @PARENT_TAG@ + v0.7.11 + v(.*) + enable + + + + *.tar + gz + + + kepler + + + kepler-0.7.11.obscpio + + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..8a769de --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + https://github.com/sustainable-computing-io/kepler.git + 4e92b14aa583e864afdd3e7dbe41789580e5130e diff --git a/kepler-0.7.11.obscpio b/kepler-0.7.11.obscpio new file mode 100644 index 0000000..9096f42 --- /dev/null +++ b/kepler-0.7.11.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa082d4bcb75bb5d96598584be094b3a463df260e4577a10f6b9da4956ba3938 +size 58410510 diff --git a/kepler.changes b/kepler.changes new file mode 100644 index 0000000..3e59f04 --- /dev/null +++ b/kepler.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Tue Oct 8 10:55:24 UTC 2024 - Witek Bedyk + +- Initial package, version 0.7.11 diff --git a/kepler.obsinfo b/kepler.obsinfo new file mode 100644 index 0000000..0e19350 --- /dev/null +++ b/kepler.obsinfo @@ -0,0 +1,4 @@ +name: kepler +version: 0.7.11 +mtime: 1720623083 +commit: bf1f62d8c580aa742d4ae90dedaff70044be9b78 diff --git a/kepler.spec b/kepler.spec new file mode 100644 index 0000000..25431a8 --- /dev/null +++ b/kepler.spec @@ -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 diff --git a/vendor.tar.gz b/vendor.tar.gz new file mode 100644 index 0000000..7454a99 --- /dev/null +++ b/vendor.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f300bb4c6c7aa7f153143e8abc7728386aaef7df67051bb7d583c0a2fc600dd1 +size 8380464