The `manual.html' file had been deleted in r21718 ("Hydra/28: Rename "scheduler" to "evaluator"".)
CPQQFQMZ3W7ISBF6L6WP2BWQYUZ6HQQI2VANQNRRBWT6JRIKR3KAC <title>Introduction</title><section><title>About Hydra</title><para>Hydra is a tool for continuous integration testing and softwarerelease that uses a purely functional language to describe build jobsand their dependencies. Continuous integration is a simple techniqueto improve the quality of the software development process. Anautomated system continuously or periodically checks out the sourcecode of a project, builds it, runs tests, and produces reports for thedevelopers. Thus, various errors that might accidentally be committedinto the code base are automatically caught. Such a system allowsmore in-depth testing than what developers could feasibly do manually:<itemizedlist><listitem> <emphasis>Portability testing</emphasis>: Thesoftware may need to be built and tested on many differentplatforms. It is infeasible for each developer to do thisbefore every commit.</listitem><listitem> Likewise, many projects have very large test sets(e.g., regression tests in a compiler, or stress tests in aDBMS) that can take hours or days to run to completion.</listitem><listitem> Many kinds of static and dynamic analyses can beperformed as part of the tests, such as code coverage runs andstatic analyses.</listitem><listitem> It may also be necessary to build many different<emphasis>variants</emphasis> of the software. For instance,it may be necessary to verify that the component builds withvarious versions of a compiler.</listitem><listitem> Developers typically use incremental building totest their changes (since a full build may take too long), butthis is unreliable with many build management tools (such asMake), i.e., the result of the incremental build might differfrom a full build.</listitem><listitem> It ensures that the software can be built from thesources under revision control. Users of version managementsystems such as CVS and Subversion often forget to placesource files under revision control.</listitem><listitem> The machines on which the continuous integrationsystem runs ideally provides a clean, well-defined buildenvironment. If this environment is administered throughproper SCM techniques, then builds produced by the system canbe reproduced. In contrast, developer work environments aretypically not under any kind of SCM control.</listitem><listitem> In large projects, developers often work on aparticular component of the project, and do not build and testthe composition of those components (again since this islikely to take too long). To prevent the phenomenon of ``bigbang integration'', where components are only tested togethernear the end of the development process, it is important totest components together as soon as possible (hence<emphasis>continuous integration</emphasis>).</listitem><listitem> It allows software to be<emphasis>released</emphasis> by automatically creatingpackages that users can download and install. To do thismanually represents an often prohibitive amount of work, asone may want to produce releases for many different platforms:e.g., installers for Windows and Mac OS X, RPM or Debianpackages for certain Linux distributions, and so on.</listitem></itemizedlist></para><para>In its simplest form, a continuous integration tool sits in aloop building and releasing software components from a versionmanagement system. For each component, it performs thefollowing tasks:<itemizedlist><listitem>It obtains the latest version of the component'ssource code from the version management system.</listitem><listitem> It runs the component's build process (whichpresumably includes the execution of the component's testset).</listitem><listitem> It presents the results of the build (such as errorlogs and releases) to the developers, e.g., by producing a webpage.</listitem></itemizedlist>Examples of continuous integration tools include Jenkins,CruiseControl Tinderbox, Sisyphus, Anthill and BuildBot. Thesetools have various limitations.<itemizedlist>
<title>Introduction</title>
<listitem> They do not manage the <emphasis>buildenvironment</emphasis>. The build environment consists of thedependencies necessary to perform a build action, e.g.,compilers, libraries, etc. Setting up the environment istypically done manually, and without proper SCM control (so itmay be hard to reproduce a build at a later time). Manualmanagement of the environment scales poorly in the number ofconfigurations that must be supported. For instance, supposethat we want to build a component that requires a certaincompiler X. We then have to go to each machine and install X.If we later need a newer version of X, the process must berepeated all over again. An ever worse problem occurs ifthere are conflicting, mutually exclusive versions of thedependencies. Thus, simply installing the latest version isnot an option. Of course, we can install these components indifferent directories and manually pass the appropriate pathsto the build processes of the various components. But this isa rather tiresome and error-prone process.</listitem><listitem> They do not easily support <emphasis>variability in softwaresystems</emphasis>. A system may have a great deal of build-timevariability: optional functionality, whether to build a debug orproduction version, different versions of dependencies, and so on.(For instance, the Linux kernel now has over 2,600 build-timeconfiguration switches.) It is therefore important that a continuousintegration tool can easily select and test different instances fromthe configuration space of the system to reveal problems, such aserroneous interactions between features. In a continuous integrationsetting, it is also useful to test different combinations of versionsof subsystems, e.g., the head revision of a component against stablereleases of its dependencies, and vice versa, as this can revealvarious integration problems.</listitem></itemizedlist></para><para><emphasis>Hydra</emphasis>, is a continuous integration toolthat solves these problems. It is built on top of the <linkxlink:href="http://nixos.org/nix/">Nix package manager</link>,which has a purely functional language for describing packagebuild actions and their dependencies. This allows the buildenvironment for projects to be produced automatically anddeterministically, and variability in components to be expressednaturally using functions; and as such is an ideal fit for acontinuous build system.</para></section><section><title>About Us</title><para>Hydra is the successor of the Nix Buildfarm, which was developedin tandem with the Nix software deployment system. Nix wasoriginally developed at the Department of Information andComputing Sciences, Utrecht University by the TraCE project(2003-2008). The project was funded by the Software EngineeringResearch Program Jacquard to improve the support for variabilityin software systems. Funding for the development of Nix andHydra is now provided by the NIRICT LaQuSo Build Farm project.</para></section><section><title>About this Manual</title><para>This manual tells you how to install the Hydra buildfarmsoftware on your own server and how to operate that server usingits web interface.</para></section><section><title>License</title><para>Hydra is free software: you can redistribute it and/ormodify it under the terms of the GNU General Public License aspublished by the Free Software Foundation, either version 3 ofthe License, or (at your option) any later version.</para><para>Hydra is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<link xlink:href="http://www.gnu.org/licenses/">GNU GeneralPublic License</link> for more details.</para></section><section><title>Hydra at <literal>nixos.org</literal></title><para>The <literal>nixos.org</literal> installation of Hydra runs at<linkxlink:href="http://hydra.nixos.org/"><literal>http://hydra.nixos.org/</literal></link>.That installation is used to build software components from the<link xlink:href="http://nixos.org">Nix</link>,<link xlink:href="http://nixos.org/nixos">NixOS</link>,<link xlink:href="http://www.gnu.org/">GNU</link>,<link xlink:href="http://strategoxt.org">Stratego/XT</link>,and related projects.</para><para>If you are one of the developers on those projects, it is likelythat you will be using the NixOS Hydra server in some way. Ifyou need to administer automatic builds for your project, youshould pull the right strings to get an account on theserver. This manual will tell you how to set up new projects andbuild jobs within those projects and write a release.nix file todescribe the build process of your project to Hydra. You canskip the next chapter.</para><para>If your project does not yet have automatic builds within theNixOS Hydra server, it may actually be eligible. We are in theprocess of setting up a large buildfarm that should be able tosupport open source and academic software projects. Get intouch.</para></section><section><title>Hydra on your own buildfarm</title><para>If you need to run your own Hydra installation, <xreflinkend="chap-installation" /> explains how to download andinstall the system on your own server.</para></section>