← Back to team overview

yellow team mailing list archive

Re: [Merge] lp:~yellow/launchpad/lxcsetup into lp:launchpad

 

> A question about file_insert and file_append: are the files being
> modified long-lived?  If we are using file_append on a file and the user
> adds a new line to the end of the file then we will re-append another
> copy of our line(s) to that file.  Do those lines really have to be at
> the very beginning and very end?  Could we instead check to see if they
> exist anywhere in the file and append/prepend only if they don't?

The check is already done. However, I can improve the way it is done: file_insert checks only for the first line of the file, it could do it for the entire file, remove the line if present, put the line on top.
The order of the lines is important, for example in resolv.conf we need to make sure that the lxc bridge nameserver is the first.
s/file_insert/file_prepend: +1

> What purpose does the time.sleep(5) in stop_lxc serve?  Is it intended
> as a deadline for the instance to stop cleanly?  If so, it seems fine
> (if a little short).  We could increase it to account for the inevitable
> slow shutdowns that will sometimes happen and add a probe in a loop to
> see if the instance has actually stopped or not that can exit early if
> the instance stops before the timeout value is reached (much as you do
> in create_lxc).
> 
> On the other hand, since these are ephemeral instances, perhaps we don't
> really care to let them shut down cleanly, in that case we could just
> lxc-stop them without the poweroff.

I agree on creating a loop that checks if the container is stopped for, say, 60 seconds.
The lxc will be used as a template for ephemerals, or as a Launchpad environment for developers, so, in my opinion, lxc-stop is not sufficient.

Many thanks Benji for your detailed review, working on it.
-- 
https://code.launchpad.net/~yellow/launchpad/lxcsetup/+merge/89660
Your team Launchpad Yellow Squad is subscribed to branch lp:~yellow/launchpad/lxcsetup.


References