summaryrefslogtreecommitdiffstats
path: root/doc/sphinx/arm/hammer.rst
blob: b8a5318d7c7839c7f857135078d7130e454f4853 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
.. _hammer:

Hammer Building Tool
====================

Hammer is a Python 3 script that lets users automate tasks related to building
Kea, such as setting up virtual machines, installing Kea dependencies,
compiling Kea with various options, running unit-tests and more. This
tool was created primarily for internal QA purposes at ISC and it is not
included in the Kea distribution; however, it is available in the Kea
git repository. This tool was developed primarily for internal purposes
and ISC cannot guarantee its proper operation. Administrators who decide to use it
should do so with care.

.. note::

   Use of this tool is completely optional. Everything it does can be
   done manually.

The first-time user is strongly encouraged to look at Hammer's built-in
help:

.. code-block:: console

   $ ./hammer.py --help

It will list available parameters.

Hammer is able to set up various operating systems running either in LXC
or in VirtualBox. For a list of supported systems, use the
``supported-systems`` command:

.. code-block:: console

   $ ./hammer.py supported-systems
   fedora:
     - 27: lxc, virtualbox
     - 28: lxc, virtualbox
     - 29: lxc, virtualbox
   centos:
     - 7: lxc, virtualbox
   rhel:
     - 8: virtualbox
   ubuntu:
     - 16.04: lxc, virtualbox
     - 18.04: lxc, virtualbox
     - 18.10: lxc, virtualbox
   debian:
     - 8: lxc, virtualbox
     - 9: lxc, virtualbox
   freebsd:
     - 11.2: virtualbox
     - 12.0: virtualbox

It is also possible to run the build locally, in the current system (if the OS
is supported).

First, the Hammer dependencies must be installed: Vagrant
and either VirtualBox or LXC. Hammer can install
Vagrant and the required Vagrant plugins using the command:

.. code-block:: console

   $ ./hammer.py ensure-hammer-deps

VirtualBox and LXC must be installed manually.

The basic functions provided by Hammer are to prepare the build environment
and perform the actual build, and to run the unit tests locally in the current
system. This can be achieved by running the command:

.. code-block:: console

   $ ./hammer.py build -p local

The scope of the process can be defined using the ``--with`` (``-w``) and ``--without``
(``-x``) options. By default, the ``build`` command builds Kea with
documentation, installs it locally, and runs unit tests.

To exclude the installation and generation of docs, type:

.. code-block:: console

   $ ./hammer.py build -p local -x install docs

The basic scope can be extended by mysql, pgsql, native-pkg,
radius, shell, and forge.

.. note::

   If building Kea locally, Hammer dependencies like Vagrant are
   not needed.

Hammer can be told to set up a new virtual machine with a specified
operating system, without the build:

.. code-block:: console

   $ ./hammer.py prepare-system -p virtualbox -s freebsd -r 12.0

This way, a system can be prepared for our own use. To get to such a system
using SSH, invoke:

.. code-block:: console

   $ ./hammer.py ssh -p virtualbox -s freebsd -r 12.0

It is possible to speed up subsequent Hammer builds via
`ccache <https://ccache.samba.org/>`__. During
compilation, ccache stores objects in a shared folder. In subsequent runs,
instead of doing an actual compilation, ccache returns the stored earlier
objects. The cache with these objects for reuse must be stored outside of VM
or LXC. To indicate the folder, the ``--ccache-dir``
parameter for Hammer must be included. In the indicated folder, there are separate stored objects for each target
operating system.

.. code-block:: console

   $ ./hammer.py build -p lxc -s ubuntu -r 18.04 --ccache-dir ~/kea-ccache

.. note::

   ccache is currently only supported for LXC in Hammer; support
   for VirtualBox may be added later.

For more information check:

.. code-block:: console

   $ ./hammer.py --help