[Tails-dev] Please review some vagrant optimizations [was: S…

Delete this message

Reply to this message
Author: anonym
Date:  
To: The Tails public development discussion list
Old-Topics: Re: [Tails-dev] Shipping a 686-pae kernel
Subject: [Tails-dev] Please review some vagrant optimizations [was: Shipping a 686-pae kernel]
06/09/12 11:51, intrigeri wrote:
> anonym wrote (06 Sep 2012 09:18:03 GMT) :
>> I forgot to say that this pushed the amount of RAM required to build
>> Tails in-memory to over 6 GiB (at least when using Vagrant) so
>> I pushed commit 974805d to bump it to 7 GiB.
>
> I don't use Vagrant (yet?) so I don't care that much, but for those
> who have 8GiB, going from 6 to 7 makes a huge difference. Perhaps 6.2
> or 6.5 or whatever would be enough?


True, but this is a moving target that will be annoying to keep
up-to-date. Ah well. It can be reverted if we push the optimizations
described below since they will make a 6 GiB tmpfs more than enough.

> Also, FWIW my libvirt -based build VM is given 6 GiB, no swap, builds
> fine inside a 6GB ramdisk, so perhaps the Vagrant build process could
> be optimized a bit?


Which optimizations do you use? I thought of the following:

* Save cache/{stages,packages}_bootstrap on disk and bind mount them
into the build dir. This saves ~200 MiB, and speeds up the build
quite significantly. OTOH is occupies that much extra disk space.
* Use aufs so that the tmpfs is the rw branch, and the Tails sources
is the ro branch. End result: we don't have to store a copy of the
Tails source in the tmpfs, which is ~344 MiB for me. The only
potential drawback is with performance; aufs itself has has some
performance overhead, and also the sources has to be read from disk.
However, linux' cache should take care of the latter if enough memory
is available so that it in theory becomes equivalent to copying the
sources into the tmpfs.

Here's a comparison of "maximum RAM usage / build time" for building
experimental with:

    no optimizations (7 GiB RAM): 6.12 GiB / 11m57.055s
    bootstrap cache:              5.87 GiB / 8m57.749s
    aufs trick:                   5.84 GiB / 12m7.156s
    bootstrap cache + aufs trick: 5,64 GiB / 8m40.086s


Both seem like great improvements to me both memory-wise and
(incidentally) time-wise. I've implemented this in feature/vagrant: the
aufs trick is always used when building in RAM, and the bootstrap cache
can be controlled with TAILS_BUILD_OPTIONS=(no)cache, (enabled by
default), and the TAILS_BUILD_OPTIONS=cleanall option also clears the
bootstrap packages + stage cache. The documentation about this also
pushed into that branch.

Any one familiar with vagrant (ague?), please have a look and test this.
Once feature/vagrant is merged into devel, we can also revert commit
974805d in feature/multikernel and instead merge in feature/vagrant.

Cheers!