From c8ce302b69e0c13db69e8e2dfa54f589fbbd865b Mon Sep 17 00:00:00 2001 From: veuxit <232229112+veuxit@users.noreply.github.com> Date: Tue, 10 Mar 2026 23:35:22 +0500 Subject: [PATCH] add: bpftune bpftune-nightly (#10320) * add: bpftune * oops * add: bpftune bpftune-git * Update anda/system/bpftune/git/bpftune-git.spec Co-authored-by: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> Signed-off-by: veuxit <232229112+veuxit@users.noreply.github.com> * Update anda/system/bpftune/git/bpftune-git.spec Co-authored-by: Gilver Signed-off-by: veuxit <232229112+veuxit@users.noreply.github.com> * GPLv2-only * GPLv2-only 2 * do not include LICENSE here and there * fix bpftune-git build * Update bpftune.spec Signed-off-by: madomado * Change rpm.version to rpm.global for versioning Signed-off-by: madomado * Update bpftune.spec Signed-off-by: madomado * git -> nightly * Update bpftune.spec Signed-off-by: madomado * fix build and versioning * nightly version * Update license Co-authored-by: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> Signed-off-by: veuxit <232229112+veuxit@users.noreply.github.com> * Update license 2 Co-authored-by: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> Signed-off-by: veuxit <232229112+veuxit@users.noreply.github.com> * fix versioning * pkg_devel_files --------- Signed-off-by: veuxit <232229112+veuxit@users.noreply.github.com> Signed-off-by: madomado Co-authored-by: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> Co-authored-by: Gilver Co-authored-by: madomado --- anda/system/bpftune/nightly/anda.hcl | 8 ++ .../bpftune/nightly/bpftune-nightly.spec | 104 ++++++++++++++++++ anda/system/bpftune/nightly/update.rhai | 7 ++ anda/system/bpftune/stable/anda.hcl | 5 + anda/system/bpftune/stable/bpftune.spec | 102 +++++++++++++++++ anda/system/bpftune/stable/update.rhai | 1 + 6 files changed, 227 insertions(+) create mode 100644 anda/system/bpftune/nightly/anda.hcl create mode 100644 anda/system/bpftune/nightly/bpftune-nightly.spec create mode 100644 anda/system/bpftune/nightly/update.rhai create mode 100644 anda/system/bpftune/stable/anda.hcl create mode 100644 anda/system/bpftune/stable/bpftune.spec create mode 100644 anda/system/bpftune/stable/update.rhai diff --git a/anda/system/bpftune/nightly/anda.hcl b/anda/system/bpftune/nightly/anda.hcl new file mode 100644 index 0000000000..5df483afdb --- /dev/null +++ b/anda/system/bpftune/nightly/anda.hcl @@ -0,0 +1,8 @@ +project pkg { + rpm { + spec = "bpftune-nightly.spec" + } + labels { + nightly = 1 + } +} diff --git a/anda/system/bpftune/nightly/bpftune-nightly.spec b/anda/system/bpftune/nightly/bpftune-nightly.spec new file mode 100644 index 0000000000..cc644c6efc --- /dev/null +++ b/anda/system/bpftune/nightly/bpftune-nightly.spec @@ -0,0 +1,104 @@ +# BPF-based auto-tuning SPEC file + +%define pcpdir /var/lib/pcp/pmdas + +%global ver 0.4-2 +%global releaseS %(echo '%ver' | sed -E 's/^[^-]+-//') +%define nameR bpftune + +%bcond_with openrc + +%global commit 4712347f2da0b7d4a5fbdb0d81d071c1704b3f20 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global commit_date 20260227 + +Name: bpftune-nightly +Version: %(echo '%ver' | sed 's/-/~/g')^%{commit_date}git.%{shortcommit} +Release: 1%?dist +Summary: BPF/tracing tools for auto-tuning Linux +License: GPL-2.0-only WITH Linux-syscall-note +Packager: veuxit +URL: https://github.com/oracle/bpftune +Conflicts: bpftune + +Source0: %{url}/archive/%{commit}/bpftune-%{commit}.tar.gz + +Group: Development/Tools +Requires: libbpf >= 0.6 +Requires: libnl3 +Requires: libcap +BuildRequires: libbpf-devel >= 0.6 +BuildRequires: libcap-devel +BuildRequires: bpftool >= 4.18 +BuildRequires: libnl3-devel +BuildRequires: clang >= 11 +BuildRequires: clang-libs >= 11 +BuildRequires: llvm >= 11 +BuildRequires: llvm-libs >= 11 +BuildRequires: python3-docutils + +%description +Service consisting of daemon (bpftune) and plugins which +support auto-tuning of Linux via BPF observability. + +%package devel +Requires: %{name} = %{evr} +Requires: libbpf-devel >= 0.6 +Requires: libcap-devel +Requires: bpftool +Requires: libnl3-devel + +%pkg_devel_files + +%package pcp-pmda +Summary: Performance Co-Pilot PMDA for bpftune +Requires: %{name} = %{evr} +Requires: pcp +Requires: python3-pcp + +%description pcp-pmda +The %{name}-pcp-pmda exports tunables and metrics from bpftune +to Performance Co-Pilot (PCP) + +%prep +%autosetup -n bpftune-%{commit} + +%build +%make_build + +%install +%make_install + +%post +%systemd_post bpftune.service + +%preun +%systemd_preun bpftune.service + +%postun +%systemd_postun_with_restart bpftune.service + +%files +%doc README.md TROUBLESHOOTING.md SECURITY.md +%license LICENSE.txt +%defattr(-,root,root) +%{_sysconfdir}/ld.so.conf.d/libbpftune.conf +%{_bindir}/bpftune +%{_unitdir}/bpftune.service +%{_libdir}/libbpftune.so.%(echo '%ver' | sed 's/-/./g') +%{_libdir}/bpftune/* +%{_mandir}/*/* +%if %{with openrc} +%{_sysconfdir}/conf.d/bpftune +%{_sysconfdir}/init.d/bpftune +%else +%exclude %{_sysconfdir}/conf.d/bpftune +%exclude %{_sysconfdir}/init.d/bpftune +%endif + +%files pcp-pmda +%{pcpdir}/%{nameR}/* + +%changelog +* Fri Mar 6 2026 veuxit - 0.4-2 +- Initial package release diff --git a/anda/system/bpftune/nightly/update.rhai b/anda/system/bpftune/nightly/update.rhai new file mode 100644 index 0000000000..b81c6e0199 --- /dev/null +++ b/anda/system/bpftune/nightly/update.rhai @@ -0,0 +1,7 @@ +rpm.global("commit", gh_commit("oracle/bpftune")); +if rpm.changed() { + rpm.release(); + rpm.global("commit_date", date()); + let v = gh("oracle/bpftune"); + rpm.global("ver", v); +} diff --git a/anda/system/bpftune/stable/anda.hcl b/anda/system/bpftune/stable/anda.hcl new file mode 100644 index 0000000000..55d17906c7 --- /dev/null +++ b/anda/system/bpftune/stable/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "bpftune.spec" + } +} diff --git a/anda/system/bpftune/stable/bpftune.spec b/anda/system/bpftune/stable/bpftune.spec new file mode 100644 index 0000000000..d36e41820e --- /dev/null +++ b/anda/system/bpftune/stable/bpftune.spec @@ -0,0 +1,102 @@ +# BPF-based auto-tuning SPEC file + +%global ver 0.4-2 +%global releaseS %(echo '%ver' | sed -E 's/^[^-]+-//') + +%define pcpdir /var/lib/pcp/pmdas +%define _sbindir /usr/sbin + +%undefine __brp_add_determinism + +%bcond_with openrc + +Name: bpftune +Version: %(echo '%ver' | sed 's/-/~/g') +Release: 1%?dist +Summary: BPF/tracing tools for auto-tuning Linux +License: GPL-2.0-only WITH Linux-syscall-note +Packager: veuxit +URL: https://github.com/oracle/bpftune +Conflicts: bpftune-nightly + +Source0: %{url}/archive/refs/tags/%{ver}.tar.gz + +Group: Development/Tools +Requires: libbpf >= 0.6 +Requires: libnl3 +Requires: libcap +BuildRequires: libbpf-devel >= 0.6 +BuildRequires: libcap-devel +BuildRequires: bpftool >= 4.18 +BuildRequires: libnl3-devel +BuildRequires: clang >= 11 +BuildRequires: clang-libs >= 11 +BuildRequires: llvm >= 11 +BuildRequires: llvm-libs >= 11 +BuildRequires: python3-docutils + +%description +Service consisting of daemon (bpftune) and plugins which +support auto-tuning of Linux via BPF observability. + +%package devel +Requires: %{name} = %{evr} +Requires: libbpf-devel >= 0.6 +Requires: libcap-devel +Requires: bpftool +Requires: libnl3-devel + +%pkg_devel_files + +%package pcp-pmda +Summary: Performance Co-Pilot PMDA for bpftune +Requires: %{name} = %{evr} +Requires: pcp +Requires: python3-pcp + +%description pcp-pmda +The %{name}-pcp-pmda exports tunables and metrics from bpftune +to Performance Co-Pilot (PCP) + +%prep +%autosetup -n %{name}-%{ver} + +%build +%make_build + +%install +%make_install + +%post +%systemd_post bpftune.service + +%preun +%systemd_preun bpftune.service + +%postun +%systemd_postun_with_restart bpftune.service + +%files +%doc README.md TROUBLESHOOTING.md SECURITY.md +%license LICENSE.txt +%defattr(-,root,root) +%{_sysconfdir}/ld.so.conf.d/libbpftune.conf +%{_sbindir}/bpftune +%{_unitdir}/bpftune.service +%{_libdir}/libbpftune.so.%(echo '%ver' | sed 's/-/./g') +%{_libdir}/bpftune/* +%{_mandir}/*/* +%if %{with openrc} +%{_sysconfdir}/conf.d/bpftune +%{_sysconfdir}/init.d/bpftune +%else +%exclude %{_sysconfdir}/conf.d/bpftune +%exclude %{_sysconfdir}/init.d/bpftune +%endif + +%files pcp-pmda +%{pcpdir}/%{name}/* + +%changelog +* Fri Mar 6 2026 veuxit - 0.4-2 +- Initial package release diff --git a/anda/system/bpftune/stable/update.rhai b/anda/system/bpftune/stable/update.rhai new file mode 100644 index 0000000000..eaae1cb979 --- /dev/null +++ b/anda/system/bpftune/stable/update.rhai @@ -0,0 +1 @@ +rpm.global("ver", gh("oracle/bpftune"));