merged split packaging (-lib and -vs) from master, add a 3rd one for lxc
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 26 Jun 2012 07:36:41 +0000 (09:36 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 26 Jun 2012 07:36:41 +0000 (09:36 +0200)
1  2 
Makefile
nodemanager-lib.spec
nodemanager-lxc.spec
nodemanager-vs.spec
setup-lib.py
setup-lxc.py

diff --combined Makefile
+++ b/Makefile
@@@ -5,29 -5,38 +5,49 @@@
  # Mark Huang <mlhuang@cs.princeton.edu>
  # Copyright (C) 2006 The Trustees of Princeton University
  #
- # $Id: Makefile,v 1.2 2006/11/13 20:04:44 mlhuang Exp $
- #
  
  # autoconf compatible variables
  datadir := /usr/share
  bindir := /usr/bin
  
- all: forward_api_calls
-       python setup.py build
+ lib: forward_api_calls
+       python setup-lib.py build
+ vs: 
+       python setup-vs.py build
++lxc: 
++      python setup-lxc.py build
 +
  forward_api_calls: forward_api_calls.c
        $(CC) -Wall -Os -o $@ $?
        strip $@
  
- install:
-       python setup.py install \
+ install-lib:
+       python setup-lib.py install \
+           --install-purelib=$(DESTDIR)/$(datadir)/NodeManager \
+           --install-platlib=$(DESTDIR)/$(datadir)/NodeManager \
+           --install-scripts=$(DESTDIR)/$(bindir)
+       install -m 444 README $(DESTDIR)/$(datadir)/NodeManager
+ install-vs:
+       python setup-vs.py install \
+           --install-purelib=$(DESTDIR)/$(datadir)/NodeManager \
+           --install-platlib=$(DESTDIR)/$(datadir)/NodeManager \
+           --install-scripts=$(DESTDIR)/$(bindir)
+       install -m 444 README $(DESTDIR)/$(datadir)/NodeManager
++install-lxc:
++      python setup-lxc.py install \
 +          --install-purelib=$(DESTDIR)/$(datadir)/NodeManager \
 +          --install-platlib=$(DESTDIR)/$(datadir)/NodeManager \
 +          --install-scripts=$(DESTDIR)/$(bindir)
 +      install -m 444 README $(DESTDIR)/$(datadir)/NodeManager
 +
  clean:
-       python setup.py clean
+       python setup-lib.py clean
+       python setup-vs.py clean
++      python setup-lxc.py clean
        rm -f forward_api_calls *.pyc build
  
  .PHONY: all install clean
@@@ -58,8 -67,7 +78,8 @@@ ifeq (,$(NODEURL)
        @echo "  e.g. make sync NODE=vnode01.inria.fr"
        @exit 1
  else
 -      +$(RSYNC) ./ $(NODEURL)/usr/share/NodeManager/
 +      +$(RSYNC) --exclude sshsh ./ $(NODEURL)/usr/share/NodeManager/
 +      +$(RSYNC) ./sshsh $(NODEURL)/bin/
        +$(RSYNC) ./initscripts/nm $(NODEURL)/etc/init.d/nm
        ssh -i $(NODE).key.rsa root@$(NODE) service nm restart
  endif
diff --combined nodemanager-lib.spec
@@@ -1,13 -1,12 +1,13 @@@
  %define slicefamily %{pldistro}-%{distroname}-%{_arch}
  
- %define name NodeManager
+ %define name nodemanager-lib
 -%define version 2.0
 -%define taglevel 37
 +%define version 2.1
 +%define taglevel 3
  
  %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
 +%global python_sitearch %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" )
  
- Summary: PlanetLab Node Manager
+ Summary: PlanetLab Node Manager Library
  Name: %{name}
  Version: %{version}
  Release: %{release}
@@@ -24,24 -23,16 +24,16 @@@ URL: %{SCMURL
  # not possible because of forward_api_calls
  #BuildArch: noarch
  
- # old name
- #Obsoletes: sidewinder, sidewinder-common
  # Uses function decorators
  Requires: python >= 2.4
  # connecting PLC
  Requires: python-pycurl
  # Signed tickets
  Requires: gnupg
- # vserver-sliceimage or lxc-sliceimage to be added explicitly in nodeimage.pkgs
- # we do need the slice images in any case
- Requires: sliceimage-%{slicefamily}
- # our interface to the vserver patch
- #Requires: util-vserver >= 0.30.208-17
- # vserver.py
- #Requires: util-vserver-python > 0.3-16
  # sioc/plnet
  Requires: pyplnet >= 4.3
+ # we do need the slice images in any case
+ Requires: sliceimage-%{slicefamily}
  
  %description
  The PlanetLab Node Manager manages all aspects of PlanetLab node and
@@@ -49,19 -40,20 +41,21 @@@ slice management once the node has bee
  the Boot Manager. It periodically contacts its management authority
  for configuration updates. It provides an XML-RPC API for performing
  local operations on slices.
+ nodemanager-lib only provides a skeleton and needs as a companion
+ either nodemanager-vs or nodemanager-lxc
  
  %prep
  %setup -q
  
  %build
  # make manages the C and Python stuff
- %{__make} %{?_smp_mflags}
+ %{__make} %{?_smp_mflags} lib
  
  %install
  # make manages the C and Python stuff
  rm -rf $RPM_BUILD_ROOT
- %{__make} %{?_smp_mflags} install DESTDIR="$RPM_BUILD_ROOT"
+ %{__make} %{?_smp_mflags} install-lib DESTDIR="$RPM_BUILD_ROOT"
 +PYTHON_SITEARCH=`python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib(1)'`
  
  # install the sliver initscript (that triggers the slice initscript if any)
  mkdir -p $RPM_BUILD_ROOT/usr/share/NodeManager/sliver-initscripts/
@@@ -75,8 -67,6 +69,8 @@@ chmod 755 $RPM_BUILD_ROOT/%{_initrddir}
  install -d -m 755 $RPM_BUILD_ROOT/var/lib/nodemanager
  
  install -D -m 644 logrotate/nodemanager $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/nodemanager
 +install -D -m 755 sshsh $RPM_BUILD_ROOT/bin/sshsh
 +install -D -m 644 bwlimitlxc.py ${RPM_BUILD_ROOT}/${PYTHON_SITEARCH}/bwlimitlxc.py
  
  ##########
  %post
@@@ -134,19 -124,8 +128,19 @@@ rm -rf $RPM_BUILD_ROO
  %{_initrddir}/
  %{_sysconfdir}/logrotate.d/nodemanager
  /var/lib/
 +/bin/sshsh
 +%{python_sitearch}/bwlimitlxc.py*
  
  %changelog
 +* Mon Jun 25 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.1-3
 +- renamed bwlimit as bwlimitlxc to avoid conflicts with util-vserver-pl
 +- purpose being to be able to run this branch on vserver nodes as well
 +
 +* Thu Jun 21 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.1-2
 +- merged nodemanager-2.0-37 in 2.1/lxc_devel and add initscript support to lxc
 +- passes tests with lxc but won't build against vs due to conflict
 +- as bwlimit.py also ships with util-vserver-pl
 +
  * Thu Jun 21 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.0-37
  - refactoring: isolate initscript functionality
  - aimed at making initscript implementation with lxc straightforward
  * Sun Jun 03 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.0-36
  - /var/log/nodemanager shows duration of mainloop
  
 +* Fri Apr 13 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.1-1
 +- first working draft for dealing with libvirt/lxc on f16 nodes
 +- not expected to work with mainline nodes (use 2.0 for that for now)
 +
  * Fri Apr 13 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.0-35
  - remove Requires to deprecated vserver-* rpms, use sliceimage-* instead
  
diff --combined nodemanager-lxc.spec
index 0000000,0000000..f672601
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,55 @@@
++# we define this in a separate specfile because we cannot produce all the 3 packages
++# nodemanager-lib nodemanager-vs nodemanager-lxc in a single build
++
++%define slicefamily %{pldistro}-%{distroname}-%{_arch}
++
++%define name nodemanager-lxc
++%define version 2.1
++%define taglevel 3
++
++%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
++
++Summary: PlanetLab Node Manager Plugin for lxc nodes
++Name: %{name}
++Version: %{version}
++Release: %{release}
++License: PlanetLab
++Group: System Environment/Daemons
++Source0: %{name}-%{version}.tar.gz
++BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
++
++Vendor: PlanetLab
++Packager: PlanetLab Central <support@planet-lab.org>
++Distribution: PlanetLab %{plrelease}
++URL: %{SCMURL}
++
++# we use libvirt
++Requires: libvirt-python
++# the common package for nodemanager
++Requires: nodemanager-lib
++# the lxc-specific tools for using slice images
++Requires: lxc-sliceimage
++
++%description
++nodemanager-lxc provides the lxc code for the PlanetLab Node Manager.
++
++%prep
++%setup -q
++
++%build
++# make manages the C and Python stuff
++%{__make} %{?_smp_mflags} lxc
++
++%install
++# make manages the C and Python stuff
++rm -rf $RPM_BUILD_ROOT
++%{__make} %{?_smp_mflags} install-lxc DESTDIR="$RPM_BUILD_ROOT"
++
++%clean
++rm -rf $RPM_BUILD_ROOT
++
++%files
++%defattr(-,root,root,-)
++%{_datadir}/NodeManager/
++
++%changelog
diff --combined nodemanager-vs.spec
index 0000000,514349b..e0575c6
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,60 +1,60 @@@
 -# nodemanager-lib nodemanager-vs nodemanager-vs in a single build
+ # we define this in a separate specfile because we cannot produce all the 3 packages
 -%define version 2.0
 -%define taglevel 37
++# nodemanager-lib nodemanager-vs nodemanager-lxc in a single build
+ %define slicefamily %{pldistro}-%{distroname}-%{_arch}
+ %define name nodemanager-vs
 -# Uses function decorators
 -Requires: nodemanager-lib
 -# vserver-sliceimage or lxc-sliceimage to be added explicitly in nodeimage.pkgs
 -Requires: vserver-sliceimage
++%define version 2.1
++%define taglevel 3
+ %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
+ Summary: PlanetLab Node Manager Plugin for vserver nodes
+ Name: %{name}
+ Version: %{version}
+ Release: %{release}
+ License: PlanetLab
+ Group: System Environment/Daemons
+ Source0: %{name}-%{version}.tar.gz
+ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+ Vendor: PlanetLab
+ Packager: PlanetLab Central <support@planet-lab.org>
+ Distribution: PlanetLab %{plrelease}
+ URL: %{SCMURL}
+ # old name, when all came as a single package with vserver wired in
+ Obsoletes: NodeManager
 -# vserver.py
+ # our interface to the vserver patch
+ Requires: util-vserver >= 0.30.208-17
++# and the planetlab utilities
+ Requires: util-vserver-python > 0.3-16
++# the common package for nodemanager
++Requires: nodemanager-lib
++# the vserver-specific tools for using slice images
++Requires: vserver-sliceimage
+ %description
+ nodemanager-vs provides the vserver code for the PlanetLab Node Manager.
+ %prep
+ %setup -q
+ %build
+ # make manages the C and Python stuff
+ %{__make} %{?_smp_mflags} vs
+ %install
+ # make manages the C and Python stuff
+ rm -rf $RPM_BUILD_ROOT
+ %{__make} %{?_smp_mflags} install-vs DESTDIR="$RPM_BUILD_ROOT"
+ %clean
+ rm -rf $RPM_BUILD_ROOT
+ %files
+ %defattr(-,root,root,-)
+ %{_datadir}/NodeManager/
+ %changelog
diff --combined setup-lib.py
@@@ -14,8 -14,6 +14,8 @@@ setup
          'api',
          'api_calls',
          'bwmon',
 +        'bwlimitlxc',
 +        'cgroups',
          'conf_files',
          'config',
          'controller',
@@@ -29,9 -27,6 +29,6 @@@
          'nodemanager',
          'plcapi',
          'safexmlrpc',
-         'sliver_libvirt',
-         'sliver_lxc',
-         'sliver_vs',
          'slivermanager',
          'ticket',
          'tools',
diff --combined setup-lxc.py
index 0000000,0000000..7948e0f
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,20 @@@
++#!/usr/bin/python
++#
++# Setup script for the Node Manager application
++#
++# Mark Huang <mlhuang@cs.princeton.edu>
++# Copyright (C) 2006 The Trustees of Princeton University
++#
++
++from distutils.core import setup, Extension
++
++setup(
++    py_modules=[
++        'sliver_libvirt',
++        'sliver_lxc',
++        ],
++    scripts = [
++        ],
++    packages =[
++        ],
++    )