forked from lix-project/hydra
Manual: Remove tabs, indent consistently
This commit is contained in:
parent
da26294fdb
commit
918fc5e6df
|
@ -16,8 +16,8 @@
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>Nix</listitem>
|
<listitem>Nix</listitem>
|
||||||
<listitem>either PostgreSQL or SQLite</listitem>
|
<listitem>either PostgreSQL or SQLite</listitem>
|
||||||
<listitem>many Perl packages, notably Catalyst,
|
<listitem>many Perl packages, notably Catalyst, EmailSender,
|
||||||
EmailSender, and NixPerl (see the <link
|
and NixPerl (see the <link
|
||||||
xlink:href="https://svn.nixos.org/repos/nix/nixpkgs/trunk/pkgs/development/tools/misc/hydra/default.nix">Hydra
|
xlink:href="https://svn.nixos.org/repos/nix/nixpkgs/trunk/pkgs/development/tools/misc/hydra/default.nix">Hydra
|
||||||
expression in Nixpkgs</link> for the complete
|
expression in Nixpkgs</link> for the complete
|
||||||
list).</listitem>
|
list).</listitem>
|
||||||
|
@ -29,31 +29,30 @@
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
For small projects, Hydra can be run on any reasonably
|
For small projects, Hydra can be run on any reasonably modern
|
||||||
modern machine. For individual projects you can even run
|
machine. For individual projects you can even run Hydra on a
|
||||||
Hydra on a laptop. However, the charm of a buildfarm server
|
laptop. However, the charm of a buildfarm server is usually that
|
||||||
is usually that it operates without disturbing the
|
it operates without disturbing the developer's working
|
||||||
developer's working environment and can serve releases over
|
environment and can serve releases over the internet. In
|
||||||
the internet. In conjunction you should typically have your
|
conjunction you should typically have your source code
|
||||||
source code administered in a version management system,
|
administered in a version management system, such as
|
||||||
such as subversion. Therefore, you will probably want to
|
subversion. Therefore, you will probably want to install a
|
||||||
install a server that is connected to the internet. To scale
|
server that is connected to the internet. To scale up to large
|
||||||
up to large and/or many projects, you will need at least a
|
and/or many projects, you will need at least a considerable
|
||||||
considerable amount of diskspace to store builds. Since
|
amount of diskspace to store builds. Since Hydra can schedule
|
||||||
Hydra can schedule multiple simultaneous build jobs, it can
|
multiple simultaneous build jobs, it can be useful to have a
|
||||||
be useful to have a multi-core machine, and/or attach
|
multi-core machine, and/or attach multiple build machines in a
|
||||||
multiple build machines in a network to the central Hydra
|
network to the central Hydra server.
|
||||||
server.
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Of course we think it is a good idea to use the <a
|
Of course we think it is a good idea to use the <a
|
||||||
href="http://nixos.org/nixos">NixOS</a> GNU/Linux
|
href="http://nixos.org/nixos">NixOS</a> GNU/Linux distribution
|
||||||
distribution for your buildfarm server. But this is not a
|
for your buildfarm server. But this is not a requirement. The
|
||||||
requirement. The Nix software deployment system can be
|
Nix software deployment system can be installed on any GNU/Linux
|
||||||
installed on any GNU/Linux distribution in parallel to the
|
distribution in parallel to the regular package management
|
||||||
regular package management system. Thus, you can use Hydra
|
system. Thus, you can use Hydra on a Debian, Fedora, SuSE, or
|
||||||
on a Debian, Fedora, SuSE, or Ubuntu system.
|
Ubuntu system.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
@ -63,8 +62,8 @@
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
If your server runs NixOS you are all set to continue with
|
If your server runs NixOS you are all set to continue with
|
||||||
installation of Hydra. Otherwise you first need to install
|
installation of Hydra. Otherwise you first need to install Nix.
|
||||||
Nix. The latest stable version can be found one <link
|
The latest stable version can be found one <link
|
||||||
xlink:href="http://nixos.org/nix/download.html">the Nix web
|
xlink:href="http://nixos.org/nix/download.html">the Nix web
|
||||||
site</link>, along with a manual, which includes installation
|
site</link>, along with a manual, which includes installation
|
||||||
instructions.
|
instructions.
|
||||||
|
@ -78,18 +77,19 @@
|
||||||
Hydra can be installed using Nixpkgs:
|
Hydra can be installed using Nixpkgs:
|
||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
nix-env -Ai hydra -f /path/to/nixpkgs</screen>
|
nix-env -Ai hydra -f /path/to/nixpkgs</screen>
|
||||||
|
|
||||||
This makes the tools available in your Nix user environment,
|
This makes the tools available in your Nix user environment,
|
||||||
<literal>$HOME/.nix-profile</literal> by default.
|
<literal>$HOME/.nix-profile</literal> by default.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Alternatively, the latest development snapshot can be
|
Alternatively, the latest development snapshot can be installed
|
||||||
installed by visiting the URL
|
by visiting the URL <link
|
||||||
<link xlink:href="http://hydra.nixos.org/view/hydra/unstable"><literal>http://hydra.nixos.org/view/hydra/unstable</literal></link>
|
xlink:href="http://hydra.nixos.org/view/hydra/unstable"><literal>http://hydra.nixos.org/view/hydra/unstable</literal></link>
|
||||||
and use the one-click install available at one of the build pages. You can also
|
and use the one-click install available at one of the build
|
||||||
install Hydra through the channel by performing the following commands:
|
pages. You can also install Hydra through the channel by
|
||||||
|
performing the following commands:
|
||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
nix-channel --add http://hydra.nixos.org/jobset/hydra/trunk/channel/latest
|
nix-channel --add http://hydra.nixos.org/jobset/hydra/trunk/channel/latest
|
||||||
|
@ -110,60 +110,60 @@ hydra-eval-jobs hydra-queue-runner hydra-update-gc-roots</screen>
|
||||||
<title>Creating the database</title>
|
<title>Creating the database</title>
|
||||||
<para>
|
<para>
|
||||||
Hydra stores its results in a database, which can be a
|
Hydra stores its results in a database, which can be a
|
||||||
PostgreSQL or SQLite database. The latter is easier to
|
PostgreSQL or SQLite database. The latter is easier to setup,
|
||||||
setup, but the former scales better.
|
but the former scales better.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>To setup a PostgreSQL
|
<para>
|
||||||
database with <emphasis>hydra</emphasis> as database name
|
To setup a PostgreSQL database with <emphasis>hydra</emphasis>
|
||||||
and user name, issue the following commands:
|
as database name and user name, issue the following commands:
|
||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
createdb hydra
|
createdb hydra
|
||||||
echo "CREATE USER hydra WITH PASSWORD '<your-password>' ;" | psql hydra
|
echo "CREATE USER hydra WITH PASSWORD '<your-password>' ;" | psql hydra
|
||||||
cat $prefix/share/hydra/sql/hydra-postgresql.sql | psql hydra
|
cat $prefix/share/hydra/sql/hydra-postgresql.sql | psql hydra
|
||||||
echo "GRANT ALL ON DATABASE hydra TO hydra;" | psql hydra</screen>
|
echo "GRANT ALL ON DATABASE hydra TO hydra;" | psql hydra</screen>
|
||||||
Note that <emphasis>$prefix</emphasis> is the location of
|
|
||||||
Hydra in the nix store.
|
Note that <emphasis>$prefix</emphasis> is the location of Hydra
|
||||||
|
in the nix store.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
For SQLite, the following command is all it takes to
|
For SQLite, the following command is all it takes to create the
|
||||||
create the database:
|
database:
|
||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
cat $prefix/share/hydra/sql/hydra-sqlite.sql | sqlite3 /path/to/hydra.sqlite
|
cat $prefix/share/hydra/sql/hydra-sqlite.sql | sqlite3 /path/to/hydra.sqlite</screen>
|
||||||
</screen>
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
To add a user <emphasis>root</emphasis> with <emphasis>admin</emphasis> privileges, execute:
|
To add a user <emphasis>root</emphasis> with
|
||||||
|
<emphasis>admin</emphasis> privileges, execute:
|
||||||
<screen>
|
<screen>
|
||||||
echo "INSERT INTO Users(userName, emailAddress, password) VALUES ('root', 'some@email.adress.com', '$(echo -n foobar | sha1sum | cut -c1-40)');" | psql hydra
|
echo "INSERT INTO Users(userName, emailAddress, password) VALUES ('root', 'some@email.adress.com', '$(echo -n foobar | sha1sum | cut -c1-40)');" | psql hydra
|
||||||
echo "INSERT INTO UserRoles(userName, role) values('root', 'admin');" | psql hydra
|
echo "INSERT INTO UserRoles(userName, role) values('root', 'admin');" | psql hydra</screen>
|
||||||
</screen>
|
|
||||||
For SQLite the same commands can be used, with
|
For SQLite the same commands can be used, with <command>psql
|
||||||
<command>psql hydra</command> replaced by
|
hydra</command> replaced by <command>sqlite3
|
||||||
<command>sqlite3 /path/to/hydra.sqlite</command>.
|
/path/to/hydra.sqlite</command>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Hydra uses an environment variable to know which database
|
Hydra uses an environment variable to know which database should
|
||||||
should be used, and a variable which point to a location
|
be used, and a variable which point to a location that holds
|
||||||
that holds some state. To set these variables for a
|
some state. To set these variables for a PostgreSQL database,
|
||||||
PostgreSQL database, add the following to the
|
add the following to the <filename>.profile</filename> of the
|
||||||
<filename>.profile</filename> of the user running the
|
user running the Hydra services.
|
||||||
Hydra services.
|
|
||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
export HYDRA_DBI="dbi:Pg:dbname=hydra;host=localhost;"
|
export HYDRA_DBI="dbi:Pg:dbname=hydra;host=localhost;"
|
||||||
export HYDRA_DATA=/var/lib/hydra</screen>
|
export HYDRA_DATA=/var/lib/hydra</screen>
|
||||||
|
|
||||||
Make sure that the <emphasis>HYDRA_DATA</emphasis>
|
Make sure that the <emphasis>HYDRA_DATA</emphasis> directory
|
||||||
directory exists and is writable for the user which will
|
exists and is writable for the user which will run the Hydra
|
||||||
run the Hydra services. For a SQLite database, the
|
services. For a SQLite database, the
|
||||||
<varname>HYDRA_DBI</varname> should be set to something
|
<varname>HYDRA_DBI</varname> should be set to something like
|
||||||
like <literal>dbi:SQLite:/path/to/hydra.sqlite</literal>
|
<literal>dbi:SQLite:/path/to/hydra.sqlite</literal>
|
||||||
|
|
||||||
</para>
|
</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
@ -181,34 +181,38 @@ hydra-server</screen>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <command>hydra-server</command> command launches the
|
The <command>hydra-server</command> command launches the web
|
||||||
web server. There are two other processes that come into
|
server. There are two other processes that come into play:
|
||||||
play:
|
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
The <emphasis>evaluator</emphasis> is responsible for
|
The <emphasis>evaluator</emphasis> is responsible for
|
||||||
peridically evaluating job sets, checking out their
|
peridically evaluating job sets, checking out their
|
||||||
dependencies off their version control systems (VCS),
|
dependencies off their version control systems (VCS), and
|
||||||
and queueing new builds if the result of the evaluation
|
queueing new builds if the result of the evaluation changed.
|
||||||
changed. It is launched by the
|
It is launched by the <command>hydra-evaluator</command>
|
||||||
<command>hydra-evaluator</command> command.
|
command.
|
||||||
</listitem>
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
The <emphasis>queue runner</emphasis> launches builds
|
The <emphasis>queue runner</emphasis> launches builds (using
|
||||||
(using Nix) as they are queued by the evaluator,
|
Nix) as they are queued by the evaluator, scheduling them
|
||||||
scheduling them onto the configured Nix hosts. It is
|
onto the configured Nix hosts. It is launched using the
|
||||||
launched using the
|
|
||||||
<command>hydra-queue-runner</command> command.
|
<command>hydra-queue-runner</command> command.
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
All three processes must be running for Hydra to be fully
|
All three processes must be running for Hydra to be fully
|
||||||
functional, though it's possible to temporarily stop any one
|
functional, though it's possible to temporarily stop any one of
|
||||||
of them for maintenance purposes, for instance.
|
them for maintenance purposes, for instance.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Local Variables:
|
||||||
|
indent-tabs-mode: nil
|
||||||
|
ispell-local-dictionary: "american"
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
|
@ -258,3 +258,10 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Local Variables:
|
||||||
|
indent-tabs-mode: nil
|
||||||
|
ispell-local-dictionary: "american"
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
Loading…
Reference in a new issue