zhipengl 07a07c6bcc Implement Pci Interrupt Affinity Agent
Create an agent which runs on each worker node to do pci interrupt
affinity work.
nova-sriov installed by this new package instead of old nova-utils.

Below test done and pass, see detailed test spec in story link.
1) deployment test with/without openstack application
2) Periodic audit pci irq affinity
3) Remove VM without sriov pci port
4) Remove VM with sriov pci port
5) Add VM without sriov pci port
6) Add VM with sriov pci port
7) Add VM without pci_irq_affinity_mask
8) Add VM without cpu policy set
9) VM resize test
10) Remove one pci port for VM

Code framework is like below
+------------+        +--------------+        +------------+
|            |        |              |        |            |
|            |        |              |        |            |
|  Agent.py  | -----> | affinity.py  | -----> | driver.py  |
|            |        |              |        |            |
|   Daemon   |        |    Conduct   |        |   Drv      |
|            |        |              |        |            |
+------------+        +--------------+        +------------+

Story: 2004600
Task: 28850
Depends-on: https://review.opendev.org/#/c/640263/
Depends-on: https://review.opendev.org/#/c/654415/
Change-Id: Ie668036efe4d0013fed8cd45805f0321692c76f0
Signed-off-by: zhipengl <zhipengs.liu@intel.com>
2019-05-10 01:43:27 +00:00

71 lines
2.1 KiB
RPMSpec

Summary: StarlingX PCI Interrupt Affinity Agent Package
Name: pci-irq-affinity-agent
Version: 1.0
Release: %{tis_patch_ver}%{?_tis_dist}
License: Apache-2.0
Group: base
Packager: StarlingX
URL: unknown
Source0: %{name}-%{version}.tar.gz
Requires: python-novaclient
BuildRequires: python-setuptools
BuildRequires: systemd-devel
%description
StarlingX PCI Interrupt Affinity Agent Package
%define local_etc_initd /etc/init.d/
%define local_etc_pmond /etc/pmon.d/
%define pythonroot /usr/lib64/python2.7/site-packages
%define debug_package %{nil}
%prep
%setup
# Remove bundled egg-info
rm -rf *.egg-info
%build
%{__python} setup.py build
%install
%{__python} setup.py install --root=%{buildroot} \
--install-lib=%{pythonroot} \
--prefix=/usr \
--install-data=/usr/share \
--single-version-externally-managed
%{__install} -d -m 755 %{buildroot}%{local_etc_initd}
%{__install} -p -D -m 755 pci-irq-affinity-agent %{buildroot}%{local_etc_initd}/pci-irq-affinity-agent
%{__install} -d -m 755 %{buildroot}%{local_etc_pmond}
%{__install} -p -D -m 644 pci-irq-affinity-agent.conf %{buildroot}%{local_etc_pmond}/pci-irq-affinity-agent.conf
%{__install} -p -D -m 644 pci-irq-affinity-agent.service %{buildroot}%{_unitdir}/pci-irq-affinity-agent.service
%{__install} -d %{buildroot}%{_bindir}
%{__install} -p -D -m 755 nova-sriov %{buildroot}%{_bindir}/nova-sriov
%{__install} -d %{buildroot}%{_sysconfdir}/pci_irq_affinity
%{__install} -p -D -m 600 config.ini %{buildroot}%{_sysconfdir}/pci_irq_affinity/config.ini
%post
/usr/bin/systemctl enable pci-irq-affinity-agent.service >/dev/null 2>&1
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc LICENSE
%{local_etc_initd}/pci-irq-affinity-agent
%{local_etc_pmond}/pci-irq-affinity-agent.conf
%{_unitdir}/pci-irq-affinity-agent.service
%{pythonroot}/pci_irq_affinity/*
%{pythonroot}/pci_irq_affinity_agent-%{version}*.egg-info
%{_bindir}/pci-irq-affinity-agent
%{_bindir}/nova-sriov
%config(noreplace) %{_sysconfdir}/pci_irq_affinity/config.ini