remove bwlimitlxc, and use plnode-utils instead
[nodemanager.git] / nodemanager-lib.spec
1 %define slicefamily %{pldistro}-%{distroname}-%{_arch}
2
3 %define name nodemanager-lib
4 %define version 2.1
5 %define taglevel 6
6
7 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
8 %global python_sitearch %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" )
9
10 Summary: PlanetLab Node Manager Library
11 Name: %{name}
12 Version: %{version}
13 Release: %{release}
14 License: PlanetLab
15 Group: System Environment/Daemons
16 Source0: %{name}-%{version}.tar.gz
17 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
18
19 Vendor: PlanetLab
20 Packager: PlanetLab Central <support@planet-lab.org>
21 Distribution: PlanetLab %{plrelease}
22 URL: %{SCMURL}
23
24 # not possible because of forward_api_calls
25 #BuildArch: noarch
26
27 # Uses function decorators
28 Requires: python >= 2.4
29 # connecting PLC
30 Requires: python-pycurl
31 # Signed tickets
32 Requires: gnupg
33 # sioc/plnet
34 Requires: pyplnet >= 4.3
35 # we do need the slice images in any case
36 Requires: sliceimage-%{slicefamily}
37 # for bwlimit
38 Requires: plnode-utils
39
40 %description
41 The PlanetLab Node Manager manages all aspects of PlanetLab node and
42 slice management once the node has been initialized and configured by
43 the Boot Manager. It periodically contacts its management authority
44 for configuration updates. It provides an XML-RPC API for performing
45 local operations on slices.
46 nodemanager-lib only provides a skeleton and needs as a companion
47 either nodemanager-vs or nodemanager-lxc
48
49 %prep
50 %setup -q
51
52 %build
53 # make manages the C and Python stuff
54 %{__make} %{?_smp_mflags} lib
55
56 %install
57 # make manages the C and Python stuff
58 rm -rf $RPM_BUILD_ROOT
59 %{__make} %{?_smp_mflags} install-lib DESTDIR="$RPM_BUILD_ROOT"
60 PYTHON_SITEARCH=`python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib(1)'`
61
62 # install the sliver initscript (that triggers the slice initscript if any)
63 mkdir -p $RPM_BUILD_ROOT/usr/share/NodeManager/sliver-initscripts/
64 rsync -av sliver-initscripts/ $RPM_BUILD_ROOT/usr/share/NodeManager/sliver-initscripts/
65 chmod 755 $RPM_BUILD_ROOT/usr/share/NodeManager/sliver-initscripts/
66
67 mkdir -p $RPM_BUILD_ROOT/%{_initrddir}/
68 rsync -av initscripts/ $RPM_BUILD_ROOT/%{_initrddir}/
69 chmod 755 $RPM_BUILD_ROOT/%{_initrddir}/*
70
71 install -d -m 755 $RPM_BUILD_ROOT/var/lib/nodemanager
72
73 install -D -m 644 logrotate/nodemanager $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/nodemanager
74 install -D -m 755 sshsh $RPM_BUILD_ROOT/bin/sshsh
75 install -D -m 644 bwlimitlxc.py ${RPM_BUILD_ROOT}/${PYTHON_SITEARCH}/bwlimitlxc.py
76
77 ##########
78 %post
79 # tmp - handle file renamings; old names are from 2.0-8
80 renamings="
81 /var/lib/misc/bwmon.dat@/var/lib/nodemanager/bwmon.pickle
82 /root/sliver_mgr_db.pickle@/var/lib/nodemanager/database.pickle
83 /var/log/getslivers.txt@/var/lib/nodemanager/getslivers.txt
84 /var/log/nm@/var/log/nodemanager
85 /var/log/nm.daemon@/var/log/nodemanager.daemon
86 /var/run/nm.pid@/var/run/nodemanager.pid
87 /tmp/sliver_mgr.api@/tmp/nodemanager.api
88 /etc/logrotate.d/nm@/etc/logrotate.d/nodemanager
89 "
90 for renaming in $renamings; do
91   old=$(echo $renaming | cut -d@ -f1)
92   new=$(echo $renaming | cut -d@ -f2)
93   newdir=$(dirname $new)
94   if [ -e "$old" -a ! -e "$new" ] ; then
95       mkdir -p $newdir
96       mv -f $old $new
97   fi
98 done
99 #
100 chkconfig --add conf_files
101 chkconfig conf_files on
102 chkconfig --add nm
103 chkconfig nm on
104 chkconfig --add fuse-pl
105 chkconfig fuse-pl on
106 if [ "$PL_BOOTCD" != "1" ] ; then
107         service nm restart
108         service fuse-pl restart
109 fi
110
111 ##########
112 %preun
113 # 0 = erase, 1 = upgrade
114 if [ $1 -eq 0 ] ; then
115     chkconfig fuse-pl off
116     chkconfig --del fuse-pl
117     chkconfig nm off
118     chkconfig --del nm
119     chkconfig conf_files off
120     chkconfig --del conf_files
121 fi
122
123 %clean
124 rm -rf $RPM_BUILD_ROOT
125
126 %files
127 %defattr(-,root,root,-)
128 %{_datadir}/NodeManager/
129 %{_bindir}/forward_api_calls
130 %{_initrddir}/
131 %{_sysconfdir}/logrotate.d/nodemanager
132 /var/lib/
133 /bin/sshsh
134 %{python_sitearch}/bwlimitlxc.py*
135
136 %changelog
137 * Mon Jul 09 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.1-6
138 - set LD_PRELOAD for linux-containers nodes
139
140 * Thu Jun 28 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.1-5
141 - first complete version for vs and lxc - functional but not thoroughly tested though
142
143 * Tue Jun 26 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.1-4
144 - split packaging in 3 (lib, lxc, vs)
145 - this tag will only work with lxc though
146
147 * Tue Jun 26 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.0-38
148 - split packaging, nodemanager-vs (obsoletes NodeManager) and nodemanager-lib
149
150 * Mon Jun 25 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.1-3
151 - renamed bwlimit as bwlimitlxc to avoid conflicts with util-vserver-pl
152 - purpose being to be able to run this branch on vserver nodes as well
153
154 * Thu Jun 21 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.1-2
155 - merged nodemanager-2.0-37 in 2.1/lxc_devel and add initscript support to lxc
156 - passes tests with lxc but won't build against vs due to conflict
157 - as bwlimit.py also ships with util-vserver-pl
158
159 * Thu Jun 21 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.0-37
160 - refactoring: isolate initscript functionality
161 - aimed at making initscript implementation with lxc straightforward
162 - show stack trace when module loading fails
163 - accounts.py renamed into account.py for consistency
164
165 * Sun Jun 03 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.0-36
166 - /var/log/nodemanager shows duration of mainloop
167
168 * Fri Apr 13 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.1-1
169 - first working draft for dealing with libvirt/lxc on f16 nodes
170 - not expected to work with mainline nodes (use 2.0 for that for now)
171
172 * Fri Apr 13 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.0-35
173 - remove Requires to deprecated vserver-* rpms, use sliceimage-* instead
174
175 * Fri Dec 09 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.0-34
176 - Added memory scheduling to core scheduler
177 - Core scheduler will now attempt to schedule cores on the same CPU to a slice, if a slice uses multiple cores
178
179 * Thu Jul 07 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.0-33
180 - tweaked log policy for the core scheduler
181 - curlwrapper has an optional verbose mode
182
183 * Mon Jun 06 2011 Baris Metin <bmetin@verivue.com> - nodemanager-2.0-32
184 - fixes for hmac and omf_control tags
185 - optional besteffort flag to core scheduler
186 - logrotate entry for /var/log/nodemanager.daemon
187 - a template for bash initscripts
188
189 * Tue Mar 22 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.0-31
190 - rename initscript_body into initscript_code
191 - fix generic vinit for broken bash syntax &>>
192
193 * Mon Mar 21 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.0-30
194 - new initscript_body slice tag, with stop and restart
195 - generic vinit script live updated
196 - new coresched module
197 - protect against non-existing vsys scripts
198 - use Config. instead of globals
199
200 * Sun Feb 20 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.0-29
201 - more robust reservation plugin
202
203 * Thu Feb 17 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.0-28
204 - bind-mount slice's .ssh into sliver for omf-friendly slices - no need to use dotsshmount (vsys) anymore
205 - reservation plugin more robust
206
207 * Tue Feb 01 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.0-27
208 - pass device to bwlimit
209
210 * Tue Jan 25 2011 S.Çağlar Onur <caglar@cs.princeton.edu> - nodemanager-2.0-26
211 - start to use /etc/vservers/<guest>/sysctl/<id>/{setting,value} files as new kernels don't support old syntax
212
213 * Tue Jan 04 2011 S.Çağlar Onur <caglar@cs.princeton.edu> - nodemanager-2.0-25
214 - Catch all exceptions for sfa plugin
215
216 * Wed Dec 22 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - nodemanager-2.0-24
217 - Handle exception AttributeError: ComponentAPI instance has no attribute 'get_registry'
218
219 * Mon Nov 29 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - nodemanager-2.0-23
220 - Use networks key if interfaces is missing to solve the incompatibility between new NM and old API
221
222 * Mon Nov 29 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - nodemanager-2.0-22
223 - plugins/sliverauth.py improvements
224
225 * Mon Oct 11 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - nodemanager-2.0-21
226 - Disable sfagids plugin
227
228 * Mon Oct 11 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - nodemanager-2.0-20
229 - Re-tag nodemanager to include conflicted commits
230
231 * Thu Sep 23 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.0-19
232 - hotfix - make the UpdateSliceTag for ssh_key really incremental (was storming the API)
233 - sfagids plugin deleted
234 - band-aid patch for lack of GetSliceFamily removed
235
236 * Mon Aug 23 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - nodemanager-2.0-18
237
238 * Fri Jul 16 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodemanager-2.0-17
239 - revert curlwrapper to former forking-curl version
240 - fixes in the omf plugin for ssh key location and node hrn
241 - set umask 0022 in tools.daemon
242
243 * Thu Jul 08 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - nodemanager-2.0-16
244 - configure omf-resctl for keys
245
246 * Mon Jul 05 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - NodeManager-2.0-15
247 - fix key generation
248
249 * Mon Jul 05 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - NodeManager-2.0-14
250 - name changes and fix typos
251
252 * Mon Jun 28 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - NodeManager-2.0-13
253 - remove config and options parameters from start function
254
255 * Sat Jun 26 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - NodeManager-2.0-12
256 - working version of reservable nodes
257 - sliverauth generates an ssh keypair and export pub part as 'ssh_key' tag
258 - dismantled the -s|--startup option (no convincing need for that)
259 - simpler and more robust init.d/nm
260 - initscript content management through replace_file_with_string
261 - sliverauth uses replace_file_with_string
262 - curlwrapper has a debug mode
263
264 * Wed Jun 23 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - NodeManager-2.0-11
265 - pretty-printing/normalized python code - hopefully neutral
266
267 * Tue Jun 22 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - NodeManager-2.0-10
268 - (1) unconditionnally install and chkconfig-like a generic 'vinit' service
269 - that triggers /etc/init.d/vinit.slice if present and executable
270 - (2) install the slice-provided initscript (as per the initscript tag) as
271 - /etc/init.d/vinit.slice
272 - (3) as a result the initscript are now triggered by rc as part of the
273 - standard vserver .. start, properly attached to the vserver,
274 - and properly killed upon vserver .. stop
275 - (4) this works best with util-vserver-pl 0.3-31 or 0.4-12
276
277 * Wed Jun 16 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - NodeManager-2.0-9
278 - fix for 64bits nodes: add newline to the personality files that instruct util-vserver to create 32bits slivers
279 - basic/partial support from reservable nodes through the 'reservation plugin' (not fully working yet)
280 - plugins can set 'persistent_data' to receive the latests know GetSlivers in case the connection is down
281 - cleanup: moved runtime files in /var/lib/nodemanager, and logs as /var/log/nodemanager* (see specfile)
282 - cleanup: some modules renamed (e.g. nm.py becomes nodemanager.py)
283 - cleanup: nodemanger now is a class; however plugins are still dumb modules
284 - cleanup: does not depend on obsolete Set
285
286 * Fri May 14 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - NodeManager-2.0-8
287 - tagging before RC
288
289 * Wed May 12 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - NodeManager-2.0-7
290 - Fix typos in plugins/drl.py and doc/NMAPI.xml.in
291 - Added some precautions to the slice id-saving code
292 - Added log message to code that records the slice id
293
294 * Mon Apr 26 2010 Sapan Bhatia <sapanb@cs.princeton.edu> - NodeManager-2.0-6
295 - This version changes the location of the slice id for components such as PlanetFlow to look up. Previously this piece
296 - of information was stored in the 'vserver name' field of the per-vserver context structure in the kernel but we needed
297 - to move it elsewhere since Daniel decided to use that for something else (the vserver name... pedantic!).
298
299 * Wed Apr 14 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - NodeManager-2.0-5
300 - fix log_call in plugins/drl.py
301
302 * Fri Apr 02 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - NodeManager-2.0-4
303 - protect against nodes in migrated PLC's not having the hrn tag yet
304
305 * Fri Mar 12 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - NodeManager-2.0-3
306 - new omf-resctl and drl plugins
307 - specialaccount optimized to overwrite authorized keys only upon changes
308 - codemux plugin has support for a new 'ip' setting
309 - mainloop to display ordered modules&plugins at all times
310
311 * Thu Feb 11 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - NodeManager-2.0-2
312 - modules and plugins have a priority
313 - specialaccounts appears soon in the priority chain
314 - logger.log_call logs process output, and has a timeout
315 - vuser{add,del} run through bash -x
316 - nm initscript has support for 'service nm restartverbose'
317 - logs reviewed for consistency
318 - use hashlib module instead of sha when available
319
320 * Fri Jan 29 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - NodeManager-2.0-1
321 - first working version of 5.0:
322 - pld.c/, db-config.d/ and nodeconfig/ scripts should now sit in the module they belong to
323 - nodefamily is 3-fold with pldistro-fcdistro-arch
324 - relies on GetSlivers to expose 'GetSliceFamily' for slivers
325 - (in addition to the 'vref' tag that's still exposed too)
326 - logging reviewed for more convenience
327 - support for 'service nm restartdebug'
328 - make sync knows how to publish uncommitted code on a test node
329
330 * Tue Jan 12 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - NodeManager-1.8-23
331 - emergency tag - make the setting of hmac by the sliverauth plugin more robust
332
333 * Mon Jan 11 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - NodeManager-1.8-22
334 - support for f10 and f12 in the vref slice tag
335
336 * Sat Jan 09 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - NodeManager-1.8-21
337 - build on fedora12
338 - uses slicename 'sfacm' instead of 'genicw'
339
340 * Fri Oct 30 2009 Sapan Bhatia <sapanb@cs.princeton.edu> - NodeManager-1.8-20
341 - This tag is identical to 1.8-19. The main addition is PLC-controllable vsys scripts. The reason I am
342 - retagging is to eliminate any confusion associated with the -19 tag which was (temporarily) modified a few
343 - days ago.
344
345 * Tue Oct 27 2009 Sapan Bhatia <sapanb@cs.princeton.edu> - NodeManager-1.8-19
346 - This patch makes vsys scripts PLC-configurable. Previously, vsys scripts needed to be
347 - self-contained. With this change, they will be able to refer to the attributes associated with a
348 - slice.
349
350 * Thu Oct 22 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - NodeManager-1.8-18
351 - fix for syntax error
352
353 * Wed Oct 21 2009 anil vengalil <avengali@sophia.inria.fr> - NodeManager-1.8-17
354 - -fixed problem with sioc import at the build side
355 - -bwlimit.set() now accepts the device and does not asume that it is eth0
356
357 * Tue Oct 20 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - NodeManager-1.8-16
358 - - don't hardcode the device name (depends on util-vserver-pl change rev. 15385)
359
360 * Fri Oct 09 2009 Marc Fiuczynski <mef@cs.princeton.edu> - NodeManager-1.8-15
361 - The seed for random previously was the meaning of life (i.e., 42) but
362 - that resulted in a not so random choice for the hmac.  This
363 - implementation now uses a random.seed that is based on the current
364 - time.
365
366 * Tue Oct 06 2009 Marc Fiuczynski <mef@cs.princeton.edu> - NodeManager-1.8-14
367 - Minor fix such that sliverauth.py makes a more specific call to
368 - GetSliceTags that include that specific tagname it is looking for.
369
370 * Sat Sep 19 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - NodeManager-1.8-13
371 - Fix bug that prevented 'OVERRIDES' for working correctly.
372
373 * Tue Sep 08 2009 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - NodeManager-1.8-12
374 - Increase disk limits to 10G per sliver
375 - Sanity check slice for home directory before starting (hack)
376 - Check codemux arguments
377
378 * Thu Aug 06 2009 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - NodeManager-1.8-11
379 - * Fix Delegation
380 - * Move plcapi in plugin-api GetSlivers() calls.
381 - * Persistent Authcheck and resync session when auth failure
382
383 * Tue Aug 04 2009 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - NodeManager-1.8-10
384 - Disabling sliverauth module.  Not ready for deployment.
385
386 * Mon Aug 03 2009 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - NodeManager-1.8-9
387 - Fixing overrides semantics.
388
389 * Mon Aug 03 2009 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - NodeManager-1.8-8
390 - Generalized plugins
391 - Fixed initscript start up bug.
392
393 * Tue Jun 30 2009 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - NodeManager-1.8-7
394 - * Fix delegation authentication problem
395 - * Can now disable codemux using _default slice, and setting tag {codemux: -1}
396
397 * Tue May 26 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - NodeManager-1.8-4
398 - * Rerun initscripts when slice goes from disabled to enabled.
399
400 * Tue May 26 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - NodeManager-1.8-4
401 - * Update session key when out of synch with PLC
402 - * PLCDefaults uses tagname
403
404 * Fri Apr 17 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - NodeManager-1.8-3
405 - log invokations of vsys
406
407 * Fri Mar 27 2009 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - NodeManager-1.8-2
408
409 * Tue Mar 24 2009 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - NodeManager-1.8-1
410
411 * Wed Apr 02 2008 Faiyaz Ahmed <faiyaza@cs.prineton.edu - NodeManager-1.7.4
412 - Codemux supports multiple hosts mapping to single slice
413 - Fixed bug in delegation support where tickets delivered weren't
414   being passed to sm.deliver_ticket().
415 * Fri Mar 28 2008 Faiyaz Ahmed <faiyaza@cs.prineton.edu - NodeManager-1.7.3
416 - Codemux now configured via slice attribute (host,port)
417 - Support for multiple vserver reference images (including different archs)
418 - Mom BW emails are sent to list defined by MyPLC's config
419 - Sirius BW loans honored correctly.  Fixed.
420 - BW totals preserved for dynamic slices so as not to game the system.
421 * Thu Feb 14 2008 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - NodeManager-1.7-1 NodeManager-1.7-2
422 - Configures vsys via vsys slice attribute {name: vsys, value: script}
423 - CPU reservations are now calculated via percentages instead of shares
424 - BW totals preserved for dynamic slices
425 - Closes bug where node cap sets off bw slice alarms for all slices.
426
427 * Wed Oct 03 2007 Faiyaz Ahmed <faiyaza@cs.princeton.edu> .
428 - Switched to SVN.
429
430 * Mon Nov 13 2006 Mark Huang <mlhuang@paris.CS.Princeton.EDU> - 
431 - Initial build.