We are going to review line by line the content of a buildout
file. Buildout is a mature, well documented technology. You can find many
tutorials on www.buildout.org web
site and learn buidlout. The lines which you can read above are a copy of
the file
http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.69:/component/slapos/buildout.cfg
which was used during the bootstrap process.
The first section of a buildout is named [buildout]. It defines which
software is going to be built and how. In the case of SlapOS buildout, we
can first see that SlapOS buildout extends existing buildout definitions,
namely shacache-client, lxml-python and python2.7 itself.
It then define the parts variable which lists the sections which are
going to be required as part of the build process. A section in a buildout
file is defined by a name inside square brackets. [buildout],
[lxml-python], [slapos] and [versions] are the 4 sections of SlapOS
buildout file.
The find-links variable defines a repository of eggs. Eggs is a
standard distribution mechanism for python packages. Buildout itself is
written in python and can be extended using python language and eggs. Since
not all eggs are published in Python Packing Index (PyPI), it is sometimes
necessary to provide additional repositories of eggs. One should note here
that the find-links variable is a generic variable used by python
setuptools, the python module in charge of managing python
distributions.
We use the find-links variable in our case to override the default
buildout distribution with SlapOS's own buildout. SlapOS extends buildout
in various ways in order to solve some minor details of standard
buildout. SlapOS patches to standard buildout are not yet
integrated. However, since buildout profiles are self contained, it is
possible to specify which version of buildout to use (in the [versions]
section) and where to find that version through find-links, as long as
SlapOS's own version of buildout is published somewhere.
For buildout experts, SlapOS buildout extensions involve mainly support
of distributed network caching and small bug fixes.
The versions variable specifies which buildout section is used to
define specific verions of python distributions (eggs). Being able to
specify the version of each egg is required in order to make sure that the
exact same software is installed on every node of a distributed Cloud and
that no uncontrolled upgrade will happen.
The allow-hosts variable is used to specify explicitely which sources
of python distributions (eggs) are accepted. It is a useful variable to
make sure that the buildout process does not get interrupted by lost
connectivity to unreliable sites containing python distributions. By
specifying explicitely which sites are considered to be reliable, we can
quickly circumvent temporary failures of python distribution sites.