My Opinions - Cloud Computing2019-06-27T08:37:09+02:00Roberto Di Cosmourn:md5:c8a43aaf386e3687a6403e215311a126DotclearOptimising the disk footprint of GNU/Linux distributions for the Cloudurn:md5:2fd4b82f0adf62d3d6ecc7b8fa5065b22013-02-08T12:59:47+00:002013-02-08T15:02:59+00:00Roberto Di CosmoCloud Computing<p>Did you know that the standard, off the shelf GNU/Linux instances you can get on Amazon are usually largely bigger than waht you actually need?
Well, our well established Mancoosi tools can help you (again!).</p> <p>Quinton, Rouvoy and Duchien remarked in <a href="http://dl.acm.org/citation.cfm?doid=2168697.2168699" hreflang="en">their recent work presented at CloudPC 2012</a> that the stock virtual machine images pre-installed with some GNU/Linux distribution contain a lot of packages that you do not really need for your standard use, even when this particular image is advertised specifically for your precise purpose.
As a consequence, you end up paying for storage that you do not need at all, just to save a copy of your nice instance.</p>
<p>After seeing a presentation on this issue by <a href="http://chercheurs.lille.inria.fr/~cquinton/index.html" hreflang="en">Clement Quinton</a>, that visited <a href="http://www.irill.org" hreflang="en">Irill</a> recently, we decided to see with <a href="http://mancoosi.org/~abate/" hreflang="en">Pietro</a> how strightforward it is to use our Mancoosi tools to solve this issue.</p>
<p>Well, it turns out that this is basically a trivial task, that can simply become a one-liner.</p>
<p>First of all, make sure that you have installed, on your Debian box, the following pieces of code from the Mancoosi project:</p>
<ol>
<li><strong>aspcud</strong>, version 1.7 or later, from <a href="http://www.cs.uni-potsdam.de/wv/aspcud/" hreflang="en">http://www.cs.uni-potsdam.de/wv/aspcud/</a> and make sure the executable aspcud is the aspcud-full one (the aspcud version in Debian experimental, as of 2012.10.24-1 is fine);</li>
</ol>
<ol>
<li><strong>ceve</strong>, which is one of the applications compiled by default in the Dose library from <a href="https://gforge.inria.fr/projects/dose/" hreflang="en">https://gforge.inria.fr/projects/dose/</a> (the version of ceve in Debian as of 1.4-2 is not recent enough)</li>
</ol>
<ol>
<li><strong>cudf_solution_checker</strong> from <a href="https://gforge.inria.fr/projects/misc-competitio/" hreflang="en">https://gforge.inria.fr/projects/misc-competitio/</a></li>
</ol>
<p>Then just checkout the script <a href="https://github.com/rdicosmo/ami-thinner/blob/master/thinnit.sh" hreflang="en">thinnit.sh</a> from its <a href="https://github.com/rdicosmo/ami-thinner" hreflang="en">git repository</a>, and you can now ask interesting questions like:</p>
<ul>
<li><strong>what is the smallest installation containing all packages needed to make an apache2 web server using Debian testing</strong>? The answer is, <strong>you need 154 packages, totalling 181Mb of disk space once installed</strong>, and the list of these packages is left in a CUDF file named <strong>thinned.cudf</strong></li>
</ul>
<pre>./thinnit.sh /var/lib/apt/lists/ftp.fr.debian.org_debian_dists_testing_main_binary-amd64_Packages apache2
<snip>
-181008,-154</pre>
<ul>
<li><strong>and if I want tomcat and php</strong>? Then <strong>you need 176 packages, for a total of 258Mb</strong>, and the list of these packages is left in a CUDF file named <strong>thinned.cudf</strong></li>
</ul>
<pre>./thinnit.sh /var/lib/apt/lists/ftp.fr.debian.org_debian_dists_testing_main_binary-amd64_Packages "tomcat6,php5"
<snip>
-258482,-176</pre>
<p>Well, I think you get the idea... and by the way you can modify the script to play with<a href="http://www.mancoosi.org/misc-2012/results/index.html" hreflang="en"> the full rich user preference language supported by the entrants of the latest MISC competition</a>!</p>
<p>And the good news is... on a stock laptop all this takes less then 10 seconds.</p>
<p>Please let us know if you use this code, and... enjoy!</p>
<p><strong>Acknowledgement:</strong> if this is just one line, now, it is because of all the wonderful people that worked on Mancoosi and participated in MISC over the past years.</p>
<p>There are so many to thank that it wont fit in the blog entry, but you can find them on the <a href="http://www.mancoosi.org" hreflang="en">Mancoosi website</a>, on the list of participants to the<a href="http://www.mancoosi.org/misc/" hreflang="en"> MISC competition</a>, and mentioned in my previous posts on<a href="http://www.dicosmo.org/MyOpinions/index.php/Mancoosi" hreflang="en"> Mancoosi tools</a>.</p>