fbo / rpms / nodepool

Forked from rpms/nodepool 4 years ago
Clone
b91f7a3
Name:           nodepool
b91f7a3
Version:        3.0.0
56ccbad
Release:        4%{?dist}
b91f7a3
Summary:        Node pool management for a distributed test infrastructure
b91f7a3
b91f7a3
License:        ASL 2.0
b91f7a3
URL:            https://zuul-ci.org
b91f7a3
Source0:        http://tarballs.openstack.org/nodepool/nodepool-%{version}.tar.gz
b91f7a3
Source1:        nodepool-launcher.service
b91f7a3
Source2:        nodepool-builder.service
b91f7a3
Source3:        nodepool.yaml
b91f7a3
Source4:        logging.conf
b91f7a3
Source5:        launcher-logging.yaml
b91f7a3
Source6:        builder-logging.yaml
b91f7a3
Source7:        nodepool.logrotate
b91f7a3
b91f7a3
BuildArch:      noarch
b91f7a3
b91f7a3
Requires:       python3
b91f7a3
Requires:       python3-pbr
b91f7a3
Requires:       python3-PyYAML
b91f7a3
Requires:       python3-daemon
b91f7a3
Requires:       python3-extras
b91f7a3
Requires:       python3-statsd
b91f7a3
Requires:       python3-sqlalchemy
b91f7a3
Requires:       python3-prettytable
b91f7a3
Requires:       python3-six
b91f7a3
Requires:       python3-voluptuous
b91f7a3
Requires:       python3-kazoo
b91f7a3
Requires:       python3-paste
b91f7a3
Requires:       python3-webob
b91f7a3
b91f7a3
BuildRequires:  python3-devel
b91f7a3
BuildRequires:  python3-pbr
b91f7a3
BuildRequires:  python3-setuptools
b91f7a3
b91f7a3
# Doc building requirements
b91f7a3
BuildRequires:  python3-sphinxcontrib-programoutput
b91f7a3
BuildRequires:  python3-sphinxcontrib-httpdomain
b91f7a3
BuildRequires:  python3-kazoo
b91f7a3
BuildRequires:  python3-daemon
b91f7a3
BuildRequires:  python3-extras
b91f7a3
BuildRequires:  python3-PyYAML
b91f7a3
BuildRequires:  python3-statsd
b91f7a3
BuildRequires:  python3-paste
b91f7a3
BuildRequires:  python3-webob
b91f7a3
BuildRequires:  python3-prettytable
b91f7a3
BuildRequires:  python3-voluptuous
b91f7a3
BuildRequires:  help2man
b91f7a3
b91f7a3
%{?systemd_requires}
b91f7a3
BuildRequires:  systemd
b91f7a3
b91f7a3
%description
b91f7a3
Nodepool is a service used by the OpenStack CI team to deploy and manage a pool
b91f7a3
of devstack images on a cloud server for use in OpenStack project testing.
b91f7a3
b91f7a3
b91f7a3
%package driver-openstack
b91f7a3
Summary:        Nodepool OpenStack driver
b91f7a3
Requires:       nodepool-launcher
b91f7a3
Requires:       python3-os-client-config
b91f7a3
Requires:       python3-shade
b91f7a3
Requires:       python3-paramiko
b91f7a3
b91f7a3
%description driver-openstack
b91f7a3
Nodepool OpenStack driver
b91f7a3
b91f7a3
b91f7a3
%package driver-static
b91f7a3
Summary:        Nodepool OpenStack driver
b91f7a3
Requires:       nodepool-launcher
b91f7a3
b91f7a3
%description driver-static
b91f7a3
Nodepool Static driver
b91f7a3
b91f7a3
b91f7a3
%package launcher
b91f7a3
Summary:        Nodepool launcher service
b91f7a3
Requires:       nodepool
b91f7a3
b91f7a3
%description launcher
b91f7a3
Nodepool launcher service
b91f7a3
b91f7a3
b91f7a3
%package builder
b91f7a3
Summary:        Nodepool builder service
b91f7a3
Requires:       nodepool
b91f7a3
Requires:       dnf-utils
b91f7a3
Requires:       sudo
b91f7a3
Requires:       qemu-img
b91f7a3
b91f7a3
%description builder
b91f7a3
Nodepool builder service
b91f7a3
b91f7a3
b91f7a3
%package doc
b91f7a3
Summary: The Nodepool documentation
b91f7a3
b91f7a3
%description doc
b91f7a3
The Nodepool documentation
b91f7a3
b91f7a3
b91f7a3
%prep
b91f7a3
%autosetup -n nodepool-%{version}
b91f7a3
rm -Rf *requirements.txt *.egg-info
b91f7a3
b91f7a3
# Remove test files
b91f7a3
rm -Rf nodepool/tests nodepool/driver/fake
b91f7a3
b91f7a3
# Remove interpreter
b91f7a3
find nodepool/ -type f -exec sed -i -e '/#!\/usr\/bin\/.*python.*/{1D}' {} \;
b91f7a3
b91f7a3
b91f7a3
%build
b91f7a3
PBR_VERSION=%{version} %py3_build
b91f7a3
PBR_VERSION=%{version} SPHINX_DEBUG=1 sphinx-build -b html doc/source build/html
b91f7a3
b91f7a3
rm -Rf build/html/.buildinfo
b91f7a3
b91f7a3
# Generate man pages
b91f7a3
mkdir man
b91f7a3
pushd man
b91f7a3
echo -e "#!/usr/bin/python3\nimport sys\nfrom nodepool.cmd.nodepoolcmd import main\nmain()" > nodepool
b91f7a3
echo -e "#!/usr/bin/python3\nimport sys\nfrom nodepool.cmd.launcher import main\nmain()" > nodepool-launcher
b91f7a3
echo -e "#!/usr/bin/python3\nimport sys\nfrom nodepool.cmd.builder import main\nmain()" > nodepool-builder
b91f7a3
chmod +x nodepool*
b91f7a3
# Test the command first to output missing BuildRequirements
b91f7a3
PYTHONPATH=../ ./nodepool-builder --help
b91f7a3
PYTHONPATH=../ ./nodepool-launcher --help
b91f7a3
PYTHONPATH=../ ./nodepool --help
b91f7a3
PYTHONPATH=../ help2man --no-info -o nodepool-builder.man ./nodepool-builder
b91f7a3
PYTHONPATH=../ help2man --no-info -o nodepool-launcher.man ./nodepool-launcher
b91f7a3
PYTHONPATH=../ help2man --no-info -o nodepool.man ./nodepool
b91f7a3
popd
b91f7a3
b91f7a3
b91f7a3
%install
b91f7a3
PBR_VERSION=%{version} %py3_install
b91f7a3
b91f7a3
# Remove executable bit from libraries
b91f7a3
find %{buildroot}%{python3_sitelib}/nodepool -type f -exec chmod -x {} \;
b91f7a3
b91f7a3
# Man pages
b91f7a3
install -p -D -m 0644 man/nodepool-builder.man %{buildroot}%{_mandir}/man1/nodepool-builder.1
b91f7a3
install -p -D -m 0644 man/nodepool-launcher.man %{buildroot}%{_mandir}/man1/nodepool-launcher.1
b91f7a3
install -p -D -m 0644 man/nodepool.man %{buildroot}%{_mandir}/man1/nodepool.1
b91f7a3
b91f7a3
# Service unit
b91f7a3
install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/nodepool-launcher.service
b91f7a3
install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/nodepool-builder.service
b91f7a3
b91f7a3
# Basic configuration
b91f7a3
install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/nodepool/nodepool.yaml
b91f7a3
install -p -d -m 0755 %{buildroot}%{_sysconfdir}/nodepool/elements
b91f7a3
touch %{buildroot}%{_sysconfdir}/nodepool/secure.conf
b91f7a3
install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/nodepool/logging.conf
b91f7a3
install -p -D -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/nodepool/launcher-logging.yaml
b91f7a3
install -p -D -m 0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/nodepool/builder-logging.yaml
b91f7a3
install -p -D -m 0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/logrotate.d/nodepool
b91f7a3
b91f7a3
# Service base directories
b91f7a3
install -p -d -m 0700 %{buildroot}%{_sharedstatedir}/nodepool
b91f7a3
install -p -d -m 0700 %{buildroot}%{_sharedstatedir}/nodepool/dib
b91f7a3
install -p -d -m 0700 %{buildroot}%{_sharedstatedir}/nodepool/.config/openstack
b91f7a3
install -p -d -m 0700 %{buildroot}%{_localstatedir}/log/nodepool
b91f7a3
install -p -d -m 0755 %{buildroot}%{_localstatedir}/cache/nodepool/dib_cache
b91f7a3
install -p -d -m 0755 %{buildroot}%{_localstatedir}/cache/nodepool/dib_tmp
b91f7a3
b91f7a3
b91f7a3
%pre
b91f7a3
getent group nodepool >/dev/null || groupadd -r nodepool
b91f7a3
if ! getent passwd nodepool >/dev/null; then
b91f7a3
  useradd -r -g nodepool -G nodepool -d %{_sharedstatedir}/nodepool -s /sbin/nologin -c "Nodepool Daemon" nodepool
b91f7a3
fi
b91f7a3
exit 0
b91f7a3
b91f7a3
b91f7a3
%post launcher
b91f7a3
%systemd_post nodepool-launcher.service
b91f7a3
%post builder
b91f7a3
%systemd_post nodepool-builder.service
b91f7a3
b91f7a3
%preun launcher
b91f7a3
%systemd_preun nodepool-launcher.service
b91f7a3
%preun builder
b91f7a3
%systemd_preun nodepool-builder.service
b91f7a3
b91f7a3
%postun launcher
b91f7a3
%systemd_postun nodepool-launcher.service
b91f7a3
%postun builder
b91f7a3
%systemd_postun nodepool-builder.service
b91f7a3
b91f7a3
b91f7a3
%files
b91f7a3
%license LICENSE
b91f7a3
%{_mandir}/man1/nodepool.1*
b91f7a3
%{_bindir}/nodepool
b91f7a3
%exclude %{python3_sitelib}/nodepool/driver/openstack
b91f7a3
%{python3_sitelib}/nodepool
b91f7a3
%{python3_sitelib}/nodepool-*.egg-info
b91f7a3
%dir %{_sysconfdir}/nodepool/elements
b91f7a3
%dir %{_sysconfdir}/nodepool/
b91f7a3
%config(noreplace) %{_sysconfdir}/nodepool/nodepool.yaml
b91f7a3
%config(noreplace) %{_sysconfdir}/nodepool/logging.conf
b91f7a3
%config(noreplace) %{_sysconfdir}/logrotate.d/nodepool
b91f7a3
%config(noreplace) %attr(0640, root, nodepool) %{_sysconfdir}/nodepool/secure.conf
b91f7a3
%attr(0750, nodepool, nodepool) %{_sharedstatedir}/nodepool
b91f7a3
%dir %attr(0750, nodepool, nodepool) %{_localstatedir}/log/nodepool
b91f7a3
b91f7a3
%files driver-openstack
b91f7a3
%license LICENSE
b91f7a3
%{python3_sitelib}/nodepool/driver/openstack
b91f7a3
b91f7a3
%files driver-static
b91f7a3
%license LICENSE
b91f7a3
%{python3_sitelib}/nodepool/driver/static
b91f7a3
b91f7a3
%files launcher
b91f7a3
%license LICENSE
b91f7a3
%{_mandir}/man1/nodepool-launcher.1*
b91f7a3
%{_bindir}/nodepool-launcher
b91f7a3
%config(noreplace) %attr(0644, root, root) %{_sysconfdir}/nodepool/launcher-logging.yaml
b91f7a3
%{_unitdir}/nodepool-launcher.service
b91f7a3
b91f7a3
%files builder
b91f7a3
%license LICENSE
b91f7a3
%{_mandir}/man1/nodepool-builder.1*
b91f7a3
%{_bindir}/nodepool-builder
b91f7a3
%config(noreplace) %{_sysconfdir}/nodepool/builder-logging.yaml
b91f7a3
%{_unitdir}/nodepool-builder.service
b91f7a3
%attr(0755, nodepool, nodepool) %{_localstatedir}/cache/nodepool
b91f7a3
b91f7a3
%files doc
b91f7a3
%license LICENSE
b91f7a3
%doc build/html
b91f7a3
b91f7a3
b91f7a3
%changelog
56ccbad
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-4
56ccbad
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
56ccbad
87eda44
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-3
87eda44
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
87eda44
7355e44
* Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 3.0.0-2
7355e44
- Rebuilt for Python 3.7
7355e44
b91f7a3
* Mon Apr 02 2018 Tristan Cacqueray <tdecacqu@redhat.com> - 3.0.0-1
b91f7a3
- Import from software factory repository