xref: /qemu/docs/devel/ci.rst (revision 159c5d17)
1==
2CI
3==
4
5QEMU has configurations enabled for a number of different CI services.
6The most up to date information about them and their status can be
7found at::
8
9   https://wiki.qemu.org/Testing/CI
10
11Jobs on Custom Runners
12======================
13
14Besides the jobs run under the various CI systems listed before, there
15are a number additional jobs that will run before an actual merge.
16These use the same GitLab CI's service/framework already used for all
17other GitLab based CI jobs, but rely on additional systems, not the
18ones provided by GitLab as "shared runners".
19
20The architecture of GitLab's CI service allows different machines to
21be set up with GitLab's "agent", called gitlab-runner, which will take
22care of running jobs created by events such as a push to a branch.
23Here, the combination of a machine, properly configured with GitLab's
24gitlab-runner, is called a "custom runner".
25
26The GitLab CI jobs definition for the custom runners are located under::
27
28  .gitlab-ci.d/custom-runners.yml
29
30Custom runners entail custom machines.  To see a list of the machines
31currently deployed in the QEMU GitLab CI and their maintainers, please
32refer to the QEMU `wiki <https://wiki.qemu.org/AdminContacts>`__.
33
34Machine Setup Howto
35-------------------
36
37For all Linux based systems, the setup can be mostly automated by the
38execution of two Ansible playbooks.  Create an ``inventory`` file
39under ``scripts/ci/setup``, such as this::
40
41  fully.qualified.domain
42  other.machine.hostname
43
44You may need to set some variables in the inventory file itself.  One
45very common need is to tell Ansible to use a Python 3 interpreter on
46those hosts.  This would look like::
47
48  fully.qualified.domain ansible_python_interpreter=/usr/bin/python3
49  other.machine.hostname ansible_python_interpreter=/usr/bin/python3
50
51Build environment
52~~~~~~~~~~~~~~~~~
53
54The ``scripts/ci/setup/build-environment.yml`` Ansible playbook will
55set up machines with the environment needed to perform builds and run
56QEMU tests.  This playbook consists on the installation of various
57required packages (and a general package update while at it).  It
58currently covers a number of different Linux distributions, but it can
59be expanded to cover other systems.
60
61The minimum required version of Ansible successfully tested in this
62playbook is 2.8.0 (a version check is embedded within the playbook
63itself).  To run the playbook, execute::
64
65  cd scripts/ci/setup
66  ansible-playbook -i inventory build-environment.yml
67
68Please note that most of the tasks in the playbook require superuser
69privileges, such as those from the ``root`` account or those obtained
70by ``sudo``.  If necessary, please refer to ``ansible-playbook``
71options such as ``--become``, ``--become-method``, ``--become-user``
72and ``--ask-become-pass``.
73