While trying to write the script that will start my buildslaves,
this occurred to me as a possible appropriate building block:

lxc-execute-ephemeral-repeatedly --orig name [-d] [--log logfile] [-p
pidfile] [-- command-to-run]

This would run a new ephemeral container cloned from 'name', wait for
it to exit, and repeat forever.
Stopping the new ephemeral container is awkward; there's no one name
to pass to lxc-stop,
so to stop it, send a SIGHUP to the process with pid `cat pidfile`.

Example:
 given an image 'centos6slave' containing some custom command 'do-work.sh',
 set up two persistantly ephemeral virtual machines, one building and
one testing,
 let them run for five minutes, then shut them both down.
   lxc-execute-ephemeral-repeatedly --orig centos6slave -d -p
builder.pid -- do-work.sh --role=build
   lxc-execute-ephemeral-repeatedly --orig centos6slave -d -p
tester.pid -- do-work.sh --role=test
   sleep 600
   kill -HUP `cat builder.pid`
   kill -HUP `cat tester.pid`

I can probably build this on top of lxc-start-ephemeral.

I'll go code that now and try to use it.  (And probably come back with
something different.)

Just writing this message clarified what I want a bit, but comments
from non-imaginary readers
would also be welcome.  Especially on the crappy interface for
stopping one of these beasts.

(Alternately, I could go the libvirt approach and let buildbot manage them, but
adding the libvirt layer on top of things seems risky offhand at the moment.)

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users

Reply via email to