[mom] Initial import (#638647).
aglitke
aglitke at fedoraproject.org
Tue Oct 25 19:39:41 UTC 2011
commit 160cac872ce936c8b4d3446426de8ea842c5874c
Author: Adam Litke <agl at us.ibm.com>
Date: Tue Oct 25 14:38:44 2011 -0500
Initial import (#638647).
.gitignore | 1 +
mom-initscript-fixes.patch | 27 +++++++++
mom-remove-useless-shebang.patch | 8 +++
mom-spec-fixes.patch | 120 ++++++++++++++++++++++++++++++++++++++
mom.spec | 118 +++++++++++++++++++++++++++++++++++++
sources | 1 +
6 files changed, 275 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..31f4e7b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/mom-0.2.1.tar.gz
diff --git a/mom-initscript-fixes.patch b/mom-initscript-fixes.patch
new file mode 100644
index 0000000..83d7879
--- /dev/null
+++ b/mom-initscript-fixes.patch
@@ -0,0 +1,27 @@
+diff -pur mom-0.2.1.orig/contrib/momd.init mom-0.2.1/contrib/momd.init
+--- mom-0.2.1.orig/contrib/momd.init 2010-09-29 09:55:23.000000000 -0500
++++ mom-0.2.1/contrib/momd.init 2010-10-26 05:59:29.538795267 -0500
+@@ -2,7 +2,7 @@
+ #
+ # momd - Dynamic control of virtualized system resources
+ #
+-# chkconfig: 345 98 2
++# chkconfig: - 98 2
+ # description: Memory Overcommitment Manager - Dynamic control of virtualized \
+ # system resources
+
+@@ -12,11 +12,10 @@
+ # Required-Stop: libvirtd
+ # Should-Start:
+ # Should-Stop:
+-# Default-Start: 3 4 5
++# Default-Start:
+ # Default-Stop: 0 1 2 6
+ # Short-Description: Memory Overcommitment Manager
+-# Description: Memory Overcommitment Manager - Dynamic control of virtualized
+-# system resources
++# Description: Dynamic control of virtualized system resources
+ ### END INIT INFO
+
+ # Source function library.
+
diff --git a/mom-remove-useless-shebang.patch b/mom-remove-useless-shebang.patch
new file mode 100644
index 0000000..a60f05b
--- /dev/null
+++ b/mom-remove-useless-shebang.patch
@@ -0,0 +1,8 @@
+diff -pur mom-0.2.1.orig/mom/Collectors/GuestNetworkDaemon.py mom-0.2.1/mom/Collectors/GuestNetworkDaemon.py
+--- mom-0.2.1.orig/mom/Collectors/GuestNetworkDaemon.py 2010-09-29 09:55:23.000000000 -0500
++++ mom-0.2.1/mom/Collectors/GuestNetworkDaemon.py 2010-10-26 11:02:38.908865326 -0500
+@@ -1,4 +1,3 @@
+-#! /usr/bin/env python
+ # Memory Overcommitment Manager
+ # Copyright (C) 2010 Adam Litke, IBM Corporation
+ #
diff --git a/mom-spec-fixes.patch b/mom-spec-fixes.patch
new file mode 100644
index 0000000..83f7c2e
--- /dev/null
+++ b/mom-spec-fixes.patch
@@ -0,0 +1,120 @@
+diff -pur mom-0.2.1.orig/contrib/mom.spec mom-0.2.1/contrib/mom.spec
+--- mom-0.2.1.orig/contrib/mom.spec 2011-01-07 09:51:58.200343996 -0600
++++ mom-0.2.1/contrib/mom.spec 2011-01-07 09:57:59.032344084 -0600
+@@ -1,24 +1,31 @@
+-# sitelib for noarch packages, sitearch for others (remove the unneeded one)
+ %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+
+-Name: mom
++Name: mom
+ Version: 0.2.1
+-Release: 1%{?dist}
++Release: 5%{?dist}
+ Summary: Dynamically manage system resources on virtualization hosts
+
+ Group: Applications/System
+ License: GPLv2
+ URL: http://wiki.github.com/aglitke/mom
+-Source0: http://github.com/downloads/aglitke/mom/mom-0.2.1.tar.gz
++Source0: http://github.com/downloads/aglitke/mom/%{name}-%{version}.tar.gz
+ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
++BuildArch: noarch
+ BuildRequires: python-devel
+-Requires: libvirt, libvirt-python
++
++# MOM makes use of libvirt by way of the python bindings to monitor and
++# interact with virtual machines.
++Requires: libvirt, libvirt-python
+
+ Requires(post): chkconfig
+ Requires(postun): initscripts
+ Requires(preun): chkconfig
+ Requires(preun): initscripts
+
++Patch0: mom-initscript-fixes.patch
++Patch1: mom-spec-fixes.patch
++Patch2: mom-remove-useless-shebang.patch
++
+ %description
+ MOM is a policy-driven tool that can be used to manage overcommitment on KVM
+ hosts. Using libvirt, MOM keeps track of active virtual machines on a host. At
+@@ -32,18 +39,29 @@ trigger reconfiguration of the system’
+ MOM supports control of memory ballooning and KSM but the architecture is
+ designed to accommodate new mechanisms such as cgroups.
+
++
++
+ %prep
+ %setup -q
+-
++%patch0 -p 1
++%patch1 -p 1
++%patch2 -p 1
+
+ %build
+-
++%{__python} setup.py build
+
+ %install
+ rm -rf $RPM_BUILD_ROOT
+-%{__python} setup.py install -O1 --root $RPM_BUILD_ROOT
+-mkdir -p $RPM_BUILD_ROOT/%_initddir
+-cp contrib/momd.init $RPM_BUILD_ROOT/%_initddir/momd
++%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
++install -Dp contrib/momd.init $RPM_BUILD_ROOT/%{_initrddir}/momd
++
++cp $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}/examples/mom-balloon+ksm.conf \
++ $RPM_BUILD_ROOT/%{_sysconfdir}/momd.conf
++
++# Correct the installed location of documentation files
++mv $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name} \
++ $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}-%{version}
++cp LICENSE README $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}-%{version}
+
+
+ %clean
+@@ -51,7 +69,6 @@ rm -rf $RPM_BUILD_ROOT
+
+
+ %post
+-# This adds the proper /etc/rc*.d links for the script
+ /sbin/chkconfig --add momd
+
+
+@@ -70,12 +87,32 @@ fi
+
+ %files
+ %defattr(-,root,root,-)
+-%(_bindir)/usr/sbin/momd
+-%_initddir/momd
+-%doc /usr/share/doc/mom/examples/*
++%{_sbindir}/momd
++%{_initrddir}/momd
+ %{python_sitelib}/*
++%config(noreplace) %{_sysconfdir}/momd.conf
++
++# The use of '_defaultdocdir' conflicts with 'doc'. Therefore, 'doc' MUST NOT
++# be used to include additional documentation files so long as this is in use.
++%{_defaultdocdir}/%{name}-%{version}/
+
+
+ %changelog
+-* Mon Sep 27 2010 Adam Litke <agl at us.ibm.com> - 0.2.1
++* Fri Jan 7 2011 Adam Litke <agl at us.ibm.com> - 0.2.1-5
++- Address review comments by Michael Schwendt
++- Fix use of _defaultdocdir macro
++- Add some comments to the spec file
++
++* Tue Oct 26 2010 Adam Litke <agl at us.ibm.com> - 0.2.1-4
++- Third round of package review comments
++- Remove useless shebang on non-executable python script
++
++* Tue Oct 26 2010 Adam Litke <agl at us.ibm.com> - 0.2.1-3
++- Second round of package review comments
++- Add a default config file: /etc/momd.conf
++
++* Wed Oct 13 2010 Adam Litke <agl at us.ibm.com> - 0.2.1-2
++- Address initial package review comments
++
++* Mon Sep 27 2010 Adam Litke <agl at us.ibm.com> - 0.2.1-1
+ - Initial package
diff --git a/mom.spec b/mom.spec
new file mode 100644
index 0000000..d98c120
--- /dev/null
+++ b/mom.spec
@@ -0,0 +1,118 @@
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+
+Name: mom
+Version: 0.2.1
+Release: 5%{?dist}
+Summary: Dynamically manage system resources on virtualization hosts
+
+Group: Applications/System
+License: GPLv2
+URL: http://wiki.github.com/aglitke/mom
+Source0: http://github.com/downloads/aglitke/mom/%{name}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildArch: noarch
+BuildRequires: python-devel
+
+# MOM makes use of libvirt by way of the python bindings to monitor and
+# interact with virtual machines.
+Requires: libvirt, libvirt-python
+
+Requires(post): chkconfig
+Requires(postun): initscripts
+Requires(preun): chkconfig
+Requires(preun): initscripts
+
+Patch0: mom-initscript-fixes.patch
+Patch1: mom-spec-fixes.patch
+Patch2: mom-remove-useless-shebang.patch
+
+%description
+MOM is a policy-driven tool that can be used to manage overcommitment on KVM
+hosts. Using libvirt, MOM keeps track of active virtual machines on a host. At
+a regular collection interval, data is gathered about the host and guests. Data
+can come from multiple sources (eg. the /proc interface, libvirt API calls, a
+client program connected to a guest, etc). Once collected, the data is
+organized for use by the policy evaluation engine. When started, MOM accepts a
+user-supplied overcommitment policy. This policy is regularly evaluated using
+the latest collected data. In response to certain conditions, the policy may
+trigger reconfiguration of the system’s overcommitment mechanisms. Currently
+MOM supports control of memory ballooning and KSM but the architecture is
+designed to accommodate new mechanisms such as cgroups.
+
+
+
+%prep
+%setup -q
+%patch0 -p 1
+%patch1 -p 1
+%patch2 -p 1
+
+%build
+%{__python} setup.py build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+install -Dp contrib/momd.init $RPM_BUILD_ROOT/%{_initrddir}/momd
+
+cp $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}/examples/mom-balloon+ksm.conf \
+ $RPM_BUILD_ROOT/%{_sysconfdir}/momd.conf
+
+# Correct the installed location of documentation files
+mv $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name} \
+ $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}-%{version}
+cp LICENSE README $RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}-%{version}
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%post
+/sbin/chkconfig --add momd
+
+
+%preun
+if [ $1 = 0 ] ; then
+ /sbin/service momd stop >/dev/null 2>&1
+ /sbin/chkconfig --del momd
+fi
+
+
+%postun
+if [ "$1" -ge "1" ] ; then
+ /sbin/service momd condrestart >/dev/null 2>&1 || :
+fi
+
+
+%files
+%defattr(-,root,root,-)
+%{_sbindir}/momd
+%{_initrddir}/momd
+%{python_sitelib}/*
+%config(noreplace) %{_sysconfdir}/momd.conf
+
+# The use of '_defaultdocdir' conflicts with 'doc'. Therefore, 'doc' MUST NOT
+# be used to include additional documentation files so long as this is in use.
+%{_defaultdocdir}/%{name}-%{version}/
+
+
+%changelog
+* Fri Jan 7 2011 Adam Litke <agl at us.ibm.com> - 0.2.1-5
+- Address review comments by Michael Schwendt
+- Fix use of _defaultdocdir macro
+- Add some comments to the spec file
+
+* Tue Oct 26 2010 Adam Litke <agl at us.ibm.com> - 0.2.1-4
+- Third round of package review comments
+- Remove useless shebang on non-executable python script
+
+* Tue Oct 26 2010 Adam Litke <agl at us.ibm.com> - 0.2.1-3
+- Second round of package review comments
+- Add a default config file: /etc/momd.conf
+
+* Wed Oct 13 2010 Adam Litke <agl at us.ibm.com> - 0.2.1-2
+- Address initial package review comments
+
+* Mon Sep 27 2010 Adam Litke <agl at us.ibm.com> - 0.2.1-1
+- Initial package
diff --git a/sources b/sources
index e69de29..7a59f50 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+e075926de3fbfc333ce5b54b527bfa79 mom-0.2.1.tar.gz
More information about the scm-commits
mailing list