ci: add RPM packaging for cortex and neuron
- cortex.spec: gateway binary, cortex.service systemd unit, cortex.toml + models.toml config files - neuron.spec: neuron binary, neuron.service systemd unit, neuron.toml config file - Parallel CI: srpm-cortex and srpm-neuron jobs build SRPMs concurrently, then publish to separate COPR repos (helexa/cortex and helexa/neuron) - Shared cortex user/group across both packages - Example configs: cortex.example.toml, neuron.example.toml, models.example.toml Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
69
neuron.spec
Normal file
69
neuron.spec
Normal file
@@ -0,0 +1,69 @@
|
||||
Name: neuron
|
||||
Version: 0.1.0
|
||||
Release: 1%{?dist}
|
||||
Summary: Per-node GPU discovery and harness management daemon for cortex
|
||||
|
||||
License: GPL-3.0-or-later
|
||||
URL: https://git.lair.cafe/helexa/cortex
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
Source1: %{name}-%{version}-vendor.tar.gz
|
||||
|
||||
ExclusiveArch: x86_64
|
||||
|
||||
BuildRequires: rust >= 1.85
|
||||
BuildRequires: cargo
|
||||
BuildRequires: gcc
|
||||
BuildRequires: systemd-rpm-macros
|
||||
|
||||
Requires(pre): shadow-utils
|
||||
|
||||
%description
|
||||
Neuron is a per-node daemon for cortex inference clusters. It discovers
|
||||
local GPU hardware via nvidia-smi, manages inference harnesses (mistral.rs,
|
||||
llama.cpp), and exposes an HTTP API for model lifecycle management.
|
||||
|
||||
%prep
|
||||
%autosetup
|
||||
tar xf %{SOURCE1}
|
||||
mkdir -p .cargo
|
||||
cat > .cargo/config.toml << 'EOF'
|
||||
[source.crates-io]
|
||||
replace-with = "vendored-sources"
|
||||
|
||||
[source.vendored-sources]
|
||||
directory = "vendor"
|
||||
EOF
|
||||
|
||||
%build
|
||||
cargo build --release -p neuron
|
||||
|
||||
%install
|
||||
install -Dm755 target/release/neuron %{buildroot}%{_bindir}/neuron
|
||||
install -Dm644 data/neuron.service %{buildroot}%{_unitdir}/neuron.service
|
||||
install -dm750 %{buildroot}%{_sysconfdir}/cortex
|
||||
install -Dm640 neuron.example.toml %{buildroot}%{_sysconfdir}/cortex/neuron.toml
|
||||
|
||||
%pre
|
||||
getent group cortex >/dev/null || groupadd -r cortex
|
||||
getent passwd cortex >/dev/null || useradd -r -g cortex -d /var/lib/cortex -s /sbin/nologin cortex
|
||||
|
||||
%post
|
||||
%systemd_post neuron.service
|
||||
|
||||
%preun
|
||||
%systemd_preun neuron.service
|
||||
|
||||
%postun
|
||||
%systemd_postun_with_restart neuron.service
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%doc README.md
|
||||
%{_bindir}/neuron
|
||||
%{_unitdir}/neuron.service
|
||||
%dir %attr(750,root,cortex) %{_sysconfdir}/cortex
|
||||
%config(noreplace) %attr(640,root,cortex) %{_sysconfdir}/cortex/neuron.toml
|
||||
|
||||
%changelog
|
||||
* Tue Apr 15 2026 Rob Thijssen <grenade@rob.tn> - 0.1.0-1
|
||||
- Initial package
|
||||
Reference in New Issue
Block a user