Blob Blame History Raw
%global srcname nodepool

%global nfsmountable 1

Name:           nodepool
Version:        3.12.0
Release:        1%{?dist}
Summary:        Nodepool management for a distributed test infrastructure

License:        ASL 2.0
# Use gitea because tarball published by openstack doesn't have symlinks.
# It's also smaller as it doesn't contain built html bundles.
Source1:        nodepool-launcher.service
Source2:        nodepool-builder.service
Source10:       nodepool.yaml
Source11:       secure.conf
Source12:       launcher-logging.yaml
Source13:       builder-logging.yaml
Source14:       sudoer

BuildArch:      noarch

Requires:       ansible
Requires:       python3-pbr
Requires:       python3-pyyaml
Requires:       python3-paramiko
Requires:       python3-daemon
Requires:       python3-extras
Requires:       python3-statsd
Requires:       python3-prettytable
Requires:       python3-six
Requires:       python3-os-client-config
Requires:       python3-openstacksdk
Requires:       diskimage-builder
Requires:       python3-voluptuous
Requires:       python3-kazoo
Requires:       python3-paste
Requires:       python3-webob
Requires:       python3-kubernetes
Requires:       python3-openshift
Requires:       python3-boto3
Requires:       python3-google-api-client

BuildRequires:  python3-devel
BuildRequires:  python3-pbr
BuildRequires:  python3-setuptools
BuildRequires:  systemd

Nodepool is a service used by the OpenStack CI team to deploy and manage a pool
of devstack images on a cloud server for use in OpenStack project testing.

%package launcher
Summary:        Nodepool launcher service
Requires:       nodepool

%description launcher
Nodepool launcher service.

%package builder
Summary:        Nodepool builder service
Requires:       nodepool
Requires:       yum-utils
Requires:       sudo
Requires:       qemu-img

%description builder
Nodepool builder service.

%package doc
Summary:        Nodepool documentation
BuildRequires:  python3-zuul-sphinx
BuildRequires:  python3-sphinx
BuildRequires:  python3-voluptuous
BuildRequires:  python3-kazoo
BuildRequires:  python3-zuul-sphinx
BuildRequires:  python3-snowballstemmer
BuildRequires:  python3-sphinxcontrib-programoutput
BuildRequires:  python3-sphinxcontrib-httpdomain
BuildRequires:  python3-reno
%description doc
Nodepool documentation.

%autosetup -n nodepool -p1
rm requirements.txt test-requirements.txt
rm -Rf nodepool/tests

PBR_VERSION=%{version} %{__python3} build
# Make the Nodepool directory a repo to satisfy python-reno
git init /builddir/build/BUILD/nodepool
pushd /builddir/build/BUILD/nodepool
git config ""
git config "Your Name"
git add -A .
git commit -m"Initial commit"
PBR_VERSION=%{version} SPHINX_DEBUG=1 sphinx-build-3 -b html doc/source build/html
rm -Rf /builddir/build/BUILD/nodepool/.git

PBR_VERSION=%{version} %{__python3} install --skip-build --root %{buildroot}

# Copy non python modules over
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/nodepool-launcher.service
install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/nodepool-builder.service
install -p -D -m 0644 %{SOURCE10} %{buildroot}%{_sysconfdir}/nodepool/nodepool.yaml
install -p -D -m 0640 %{SOURCE11} %{buildroot}%{_sysconfdir}/nodepool/secure.conf
install -p -D -m 0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/nodepool/launcher-logging.yaml
install -p -D -m 0644 %{SOURCE13} %{buildroot}%{_sysconfdir}/nodepool/builder-logging.yaml
install -p -D -m 0644 %{SOURCE14} %{buildroot}%{_sysconfdir}/sudoers.d/nodepool
install -p -d -m 0755 %{buildroot}%{_sysconfdir}/nodepool/scripts
install -p -d -m 0755 %{buildroot}%{_sysconfdir}/nodepool/elements
install -p -d -m 0750 %{buildroot}%{_sharedstatedir}/nodepool
install -p -d -m 0750 %{buildroot}%{_sharedstatedir}/nodepool/dib
install -p -d -m 0750 %{buildroot}%{_sharedstatedir}/nodepool/.config/openstack
install -p -d -m 0750 %{buildroot}%{_localstatedir}/log/nodepool
install -p -d -m 0755 %{buildroot}%{_localstatedir}/cache/nodepool/dib_cache
install -p -d -m 0755 %{buildroot}%{_localstatedir}/cache/nodepool/dib_tmp

getent group nodepool >/dev/null || groupadd -r nodepool
if ! getent passwd nodepool >/dev/null; then
  useradd -r -g nodepool -G nodepool -d %{_sharedstatedir}/nodepool -s /sbin/nologin -c "Nodepool Daemon" nodepool
exit 0

%post launcher
%systemd_post nodepool-launcher.service
%post builder
%systemd_post nodepool-builder.service

%preun launcher
%systemd_preun nodepool-launcher.service
%preun builder
%systemd_preun nodepool-builder.service

%postun launcher
%systemd_postun nodepool-launcher.service
%postun builder
%systemd_postun nodepool-builder.service

%config(noreplace) %attr(0644, root, root) %{_sysconfdir}/nodepool/nodepool.yaml
%config(noreplace) %attr(0644, root, nodepool) %{_sysconfdir}/nodepool/secure.conf
%dir %{_sysconfdir}/nodepool/scripts
%dir %{_sysconfdir}/nodepool/elements
%dir %attr(0755, nodepool, nodepool) %{_localstatedir}/log/nodepool
%attr(0755, nodepool, nodepool) %{_sharedstatedir}/nodepool

%files launcher
%config(noreplace) %attr(0644, root, root) %{_sysconfdir}/nodepool/launcher-logging.yaml

%files builder
%config(noreplace) %attr(0644, root, root) %{_sysconfdir}/nodepool/builder-logging.yaml
%attr(0755, nodepool, nodepool) %{_localstatedir}/cache/nodepool

%files doc
%doc LICENSE build/html

* Tue May 26 2020 Miro Hron훾ok <> - 3.12.0-1
- Rebuilt for Python 3.9

* Mon Mar 09 2020 Fabien Boucher <> - 3.12.0-1
- Bump to 3.12.0

* Wed Jan 29 2020 Fedora Release Engineering <> - 3.10.0-2
- Rebuilt for

* Tue Dec 24 2019 Fabien Boucher <> - 3.10.0-1
- Bump to 3.10.0

* Fri Oct 11 2019 Fabien Boucher <> - 3.9.0-1
- Import 3.9.0 packaging from Software Factory

* Thu Oct 03 2019 Miro Hron훾ok <> - 3.0.0-7
- Rebuilt for Python 3.8.0rc1 (#1748018)

* Mon Aug 19 2019 Miro Hron훾ok <> - 3.0.0-6
- Rebuilt for Python 3.8

* Thu Jul 25 2019 Fedora Release Engineering <> - 3.0.0-5
- Rebuilt for

* Fri Feb 01 2019 Fedora Release Engineering <> - 3.0.0-4
- Rebuilt for

* Fri Jul 13 2018 Fedora Release Engineering <> - 3.0.0-3
- Rebuilt for

* Tue Jun 19 2018 Miro Hron훾ok <> - 3.0.0-2
- Rebuilt for Python 3.7

* Mon Apr 02 2018 Tristan Cacqueray <> - 3.0.0-1
- Import from software factory repository