Merge ~cjwatson/launchpad:doc-services-build-farm into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: dda3bf3e3a99493ba55e9566be0ef2c24eacb9aa
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:doc-services-build-farm
Merge into: launchpad:master
Diff against target: 182 lines (+165/-0)
2 files modified
doc/reference/index.rst (+1/-0)
doc/reference/services/build-farm.rst (+164/-0)
Reviewer Review Type Date Requested Status
Ines Almeida Approve
Review via email: mp+452655@code.launchpad.net

Commit message

doc: Add high-level build farm documentation

Description of the change

Written collaboratively during a hackathon.

To post a comment you must log in.
Revision history for this message
Ines Almeida (ines-almeida) wrote :

Looks great!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/doc/reference/index.rst b/doc/reference/index.rst
2index 0fd2897..836b6f2 100644
3--- a/doc/reference/index.rst
4+++ b/doc/reference/index.rst
5@@ -15,6 +15,7 @@ Services
6 .. toctree::
7 :maxdepth: 1
8
9+ services/build-farm
10 services/signing
11
12 Possibly out-of-date
13diff --git a/doc/reference/services/build-farm.rst b/doc/reference/services/build-farm.rst
14new file mode 100644
15index 0000000..5dccb6b
16--- /dev/null
17+++ b/doc/reference/services/build-farm.rst
18@@ -0,0 +1,164 @@
19+Build farm
20+==========
21+
22+Short description
23+-----------------
24+Builds and tests software for Ubuntu and related systems.
25+
26+Detailed description
27+--------------------
28+The build farm builds packages, such as debs, snaps, charms, and other
29+formats for Ubuntu in a secure and isolated way.
30+
31+The build farm consists of a manager, a proxy for outbound communication,
32+and various builder regions.
33+Build jobs are created by other parts of Launchpad, such as a change to a
34+git repository resulting in snap recipe builds.
35+They are then scheduled onto builders as virtual machines by
36+``buildd-manager``.
37+
38+``buildd-manager`` continuously monitors all builders in the farm, and when
39+a builder is idle it chooses the next highest priority job for dispatch to
40+the idle builder.
41+It does this by using XML-RPC, passing relevant data to the builder, which
42+in turn fetches all ingredients for executing the build.
43+When a build has completed, ``buildd-manager`` gathers the resulting files
44+and injects them into Launchpad via an upload queue processor, and then the
45+builder is reset to a baseline state.
46+
47+The manner in which a build is executed is determined by the build type.
48+This typically involves invoking some external tools; ``sbuild`` for Ubuntu
49+package builds, ``snapcraft`` for snap builds, etc.
50+
51+Builders do not have direct access to the internet, but rather need to
52+acquire an authentication token to be able to access a restricted set of
53+URLs on the internet via a squid proxy.
54+
55+Builder regions are physically co-located and consist of machines of the
56+same architecture family.
57+Builder regions comprise per-architecture image builders, and each physical
58+location contains a ``launchpad-vbuilder-manage`` instance which handles
59+resets for all architectures within that location.
60+
61+Each builder region maintains clean VM images for its builders; these are
62+built using ``glance-simplestreams-sync``, which automatically and
63+periodically copies standard pre-built images from
64+``cloud-images.ubuntu.com``, and ``launchpad-buildd-image-modifier``, which
65+hooks into ``glance-simplestreams-sync`` to produce modified images with
66+``launchpad-buildd`` installed.
67+
68+Documentation
69+-------------
70+* `Documentation for launchpad-buildd <https://launchpad-buildd.readthedocs.io/en/latest/index.html>`_
71+* `Documentation for the Launchpad CI runner <https://lpci.readthedocs.io/en/latest/>`_
72+* `Documentation for Launchpad CI <https://help.launchpad.net/Code/ContinuousIntegration>`_
73+
74+Git repositories
75+----------------
76+* `buildd-manager <https://git.launchpad.net/launchpad/tree/lib/lp/buildmaster/>`_
77+* `launchpad-buildd <https://git.launchpad.net/launchpad-buildd>`_
78+* `Launchpad CI runner <https://git.launchpad.net/lpci>`_
79+* `glance-simplestreams-sync charm <https://git.launchpad.net/~launchpad/charm-glance-simplestreams-sync/tree/?h=scalingstack>`_
80+* `launchpad-buildd-image-modifier charm <https://git.launchpad.net/charm-launchpad-buildd-image-modifier>`_
81+* `launchpad-vbuilder-manage <https://git.launchpad.net/launchpad-vbuilder-manage>`_
82+
83+Bug trackers
84+------------
85+* https://bugs.launchpad.net/launchpad-project/+bugs?field.tag=soyuz-build
86+* https://bugs.launchpad.net/launchpad-buildd
87+* https://bugs.launchpad.net/lpci
88+* https://bugs.launchpad.net/charm-glance-simplestreams-sync
89+* https://bugs.launchpad.net/charm-launchpad-buildd-image-modifier
90+* https://bugs.launchpad.net/launchpad-vbuilder-manage
91+
92+Deployment
93+----------
94+* `Deployment of launchpad-buildd <https://launchpad-buildd.readthedocs.io/en/latest/how-to/deployment.html>`_
95+* `Production deployment notes for launchpad-buildd <https://launchpad-buildd.readthedocs.io/en/latest/explanation/deployment.html>`_
96+* `vbuilder Mojo spec <https://git.launchpad.net/~launchpad/launchpad-mojo-specs/+git/private/tree/vbuilder?h=vbuilder>`_
97+* `lp-builder-proxy Mojo spec <https://git.launchpad.net/launchpad-mojo-specs/tree/lp-builder-proxy/>`_
98+
99+Related specifications
100+----------------------
101+`LP113: Threat model for builds <https://docs.google.com/document/d/1im8CMxLRNxtt5H0zv461kSYSflN-YlxJ1UZG8_53D9A>`_
102+
103+Log files
104+---------
105+See https://wiki.canonical.com/Launchpad/FreshLogs.
106+
107+Production
108+~~~~~~~~~~
109+
110+buildd-manager
111+^^^^^^^^^^^^^^
112+
113+* ``rless buildd-manager.lp.internal::lp-logs/buildd-manager.log``
114+* ``rless buildd-manager.lp.internal::lp-logs/process-build-uploads.log``
115+* ``rless buildd-manager.lp.internal::lp-logs/buildd-retry-depwait.log``
116+
117+vbuilder-manage
118+^^^^^^^^^^^^^^^
119+
120+Builder reset logs.
121+Each celery worker has a different log file, named ``celery.ppareset-*.log``.
122+
123+* ``rsync -v vbuilder-manage-lcy02.lp.internal::vbuilder-manage-logs/``
124+* ``rsync -v vbuilder-manage-bos01.lp.internal::vbuilder-manage-logs/``
125+* ``rsync -v vbuilder-manage-bos02.lp.internal::vbuilder-manage-logs/``
126+* ``rsync -v vbuilder-manage-bos03.lp.internal::vbuilder-manage-logs/``
127+
128+builder-proxy (auth)
129+^^^^^^^^^^^^^^^^^^^^
130+
131+* ``rless builder-proxy-auth.lp.internal::rutabaga-logs/rutabaga-access.log``
132+* ``rless builder-proxy-auth.lp.internal::rutabaga-logs/rutabaga-error.log``
133+* ``rless builder-proxy-auth.lp.internal::rutabaga-logs/rutabaga-purge.log``
134+
135+builder-proxy (squid)
136+^^^^^^^^^^^^^^^^^^^^^
137+
138+* ``rless 10.131.48.38::squid-logs/access.log``
139+* ``rless 10.131.48.38::squid-logs/cache.log``
140+* ``rless 10.131.48.24::squid-logs/access.log``
141+* ``rless 10.131.48.24::squid-logs/cache.log``
142+
143+Staging
144+~~~~~~~
145+
146+buildd-manager
147+^^^^^^^^^^^^^^
148+
149+* ``rless 10.132.54.143::lp-logs/buildd-manager.log``
150+* ``rless 10.132.54.143::lp-logs/process-build-uploads.log``
151+* ``rless 10.132.54.143::lp-logs/buildd-retry-depwait.log``
152+
153+builder-proxy (auth)
154+^^^^^^^^^^^^^^^^^^^^
155+
156+* ``rless builder-proxy-auth.staging.lp.internal::rutabaga-logs/rutabaga-access.log``
157+* ``rless builder-proxy-auth.staging.lp.internal::rutabaga-logs/rutabaga-error.log``
158+* ``rless builder-proxy-auth.staging.lp.internal::rutabaga-logs/rutabaga-purge.log``
159+
160+builder-proxy (squid)
161+^^^^^^^^^^^^^^^^^^^^^
162+
163+* ``rless 10.132.224.179::squid-logs/access.log``
164+* ``rless 10.132.224.179::squid-logs/cache.log``
165+* ``rless 10.132.224.16::squid-logs/access.log``
166+* ``rless 10.132.224.16::squid-logs/cache.log``
167+
168+Monitoring
169+----------
170+The "Build farm" section of the `Launchpad dash <https://grafana.admin.canonical.com/d/oIhMaXhMk/launchpad-dash>`_.
171+
172+Search for "build" in https://git.launchpad.net/canonical-is-prometheus/tree/ols/launchpad.rules.
173+
174+Common support cases
175+--------------------
176+See `Launchpad's playbook for support rotation <https://wiki.canonical.com/Launchpad/SupportRotation#Builder>`_
177+
178+More information
179+----------------
180+
181+* `Live overview of Launchpad's build farm <https://launchpad.net/builders>`_
182+* `Launchpad services diagram <https://viewer.diagrams.net/?tags=%7B%7D&highlight=0000ff&edit=_blank&layers=1&nav=1&page-id=14glVH8XSJX-2FxTRWny#G1j-yk3c4mzYfMC79Y-uo9__u93pLWkiMi>`_

Subscribers

People subscribed via source and target branches

to status/vote changes: