diff options
Diffstat (limited to 'documentation/test-manual/test-manual-understand-autobuilder.rst')
-rw-r--r-- | documentation/test-manual/test-manual-understand-autobuilder.rst | 140 |
1 files changed, 78 insertions, 62 deletions
diff --git a/documentation/test-manual/test-manual-understand-autobuilder.rst b/documentation/test-manual/test-manual-understand-autobuilder.rst index 8d3c844156..0809190b5b 100644 --- a/documentation/test-manual/test-manual-understand-autobuilder.rst +++ b/documentation/test-manual/test-manual-understand-autobuilder.rst | |||
@@ -10,7 +10,7 @@ Execution Flow within the Autobuilder | |||
10 | The “a-full” and “a-quick” targets are the usual entry points into the | 10 | The “a-full” and “a-quick” targets are the usual entry points into the |
11 | Autobuilder and it makes sense to follow the process through the system | 11 | Autobuilder and it makes sense to follow the process through the system |
12 | starting there. This is best visualised from the Autobuilder Console | 12 | starting there. This is best visualised from the Autobuilder Console |
13 | view (`https://autobuilder.yoctoproject.org/typhoon/#/console <#>`__). | 13 | view (:yocto_ab:`/typhoon/#/console`). |
14 | 14 | ||
15 | Each item along the top of that view represents some “target build” and | 15 | Each item along the top of that view represents some “target build” and |
16 | these targets are all run in parallel. The ‘full’ build will trigger the | 16 | these targets are all run in parallel. The ‘full’ build will trigger the |
@@ -20,32 +20,48 @@ each of those targets on a seperate buildbot worker. To understand the | |||
20 | configuration, you need to look at the entry on ``config.json`` file | 20 | configuration, you need to look at the entry on ``config.json`` file |
21 | within the ``yocto-autobuilder-helper`` repository. The targets are | 21 | within the ``yocto-autobuilder-helper`` repository. The targets are |
22 | defined in the ‘overrides’ section, a quick example could be qemux86-64 | 22 | defined in the ‘overrides’ section, a quick example could be qemux86-64 |
23 | which looks like:"qemux86-64" : { "MACHINE" : "qemux86-64", "TEMPLATE" : | 23 | which looks like:: |
24 | "arch-qemu", "step1" : { "extravars" : [ "IMAGE_FSTYPES_append = ' wic | 24 | |
25 | wic.bmap'" ] } },And to expand that, you need the “arch-qemu” entry from | 25 | "qemux86-64" : { |
26 | the “templates” section, which looks like:"arch-qemu" : { "BUILDINFO" : | 26 | "MACHINE" : "qemux86-64", |
27 | true, "BUILDHISTORY" : true, "step1" : { "BBTARGETS" : "core-image-sato | 27 | "TEMPLATE" : "arch-qemu", |
28 | core-image-sato-dev core-image-sato-sdk core-image-minimal | 28 | "step1" : { |
29 | core-image-minimal-dev core-image-sato:do_populate_sdk", "SANITYTARGETS" | 29 | "extravars" : [ |
30 | : "core-image-minimal:do_testimage core-image-sato:do_testimage | 30 | "IMAGE_FSTYPES_append = ' wic wic.bmap'" |
31 | core-image-sato-sdk:do_testimage core-image-sato:do_testsdk" }, "step2" | 31 | ] |
32 | : { "SDKMACHINE" : "x86_64", "BBTARGETS" : | 32 | } |
33 | "core-image-sato:do_populate_sdk core-image-minimal:do_populate_sdk_ext | 33 | }, |
34 | core-image-sato:do_populate_sdk_ext", "SANITYTARGETS" : | 34 | |
35 | "core-image-sato:do_testsdk core-image-minimal:do_testsdkext | 35 | And to expand that, you need the “arch-qemu” entry from |
36 | core-image-sato:do_testsdkext" }, "step3" : { "BUILDHISTORY" : false, | 36 | the “templates” section, which looks like:: |
37 | "EXTRACMDS" : ["${SCRIPTSDIR}/checkvnc; DISPLAY=:1 oe-selftest | 37 | |
38 | ${HELPERSTMACHTARGS} -j 15"], "ADDLAYER" : | 38 | "arch-qemu" : { |
39 | ["${BUILDDIR}/../meta-selftest"] } },Combining these two entries you can | 39 | "BUILDINFO" : true, |
40 | see that “qemux86-64” is a three step build where the | 40 | "BUILDHISTORY" : true, |
41 | ``bitbake BBTARGETS`` would be run, then ``bitbake | 41 | "step1" : { |
42 | SANITYTARGETS`` for each step; all for | 42 | "BBTARGETS" : "core-image-sato core-image-sato-dev core-image-sato-sdk core-image-minimal core-image-minimal-dev core-image-sato:do_populate_sdk", |
43 | "SANITYTARGETS" : "core-image-minimal:do_testimage core-image-sato:do_testimage core-image-sato-sdk:do_testimage core-image-sato:do_testsdk" | ||
44 | }, | ||
45 | "step2" : { | ||
46 | "SDKMACHINE" : "x86_64", | ||
47 | "BBTARGETS" : "core-image-sato:do_populate_sdk core-image-minimal:do_populate_sdk_ext core-image-sato:do_populate_sdk_ext", | ||
48 | "SANITYTARGETS" : "core-image-sato:do_testsdk core-image-minimal:do_testsdkext core-image-sato:do_testsdkext" | ||
49 | }, | ||
50 | "step3" : { | ||
51 | "BUILDHISTORY" : false, | ||
52 | "EXTRACMDS" : ["${SCRIPTSDIR}/checkvnc; DISPLAY=:1 oe-selftest ${HELPERSTMACHTARGS} -j 15"], | ||
53 | "ADDLAYER" : ["${BUILDDIR}/../meta-selftest"] | ||
54 | } | ||
55 | }, | ||
56 | |||
57 | Combining these two entries you can see that “qemux86-64” is a three step build where the | ||
58 | ``bitbake BBTARGETS`` would be run, then ``bitbake SANITYTARGETS`` for each step; all for | ||
43 | ``MACHINE=”qemx86-64”`` but with differing SDKMACHINE settings. In step | 59 | ``MACHINE=”qemx86-64”`` but with differing SDKMACHINE settings. In step |
44 | 1 an extra variable is added to the ``auto.conf`` file to enable wic | 60 | 1 an extra variable is added to the ``auto.conf`` file to enable wic |
45 | image generation. | 61 | image generation. |
46 | 62 | ||
47 | While not every detail of this is covered here, you can see how the | 63 | While not every detail of this is covered here, you can see how the |
48 | templating mechanism allows quite complex configurations to be built up | 64 | template mechanism allows quite complex configurations to be built up |
49 | yet allows duplication and repetition to be kept to a minimum. | 65 | yet allows duplication and repetition to be kept to a minimum. |
50 | 66 | ||
51 | The different build targets are designed to allow for parallelisation, | 67 | The different build targets are designed to allow for parallelisation, |
@@ -66,13 +82,13 @@ For each given target in a build, the Autobuilder executes several | |||
66 | steps. These are configured in ``yocto-autobuilder2/builders.py`` and | 82 | steps. These are configured in ``yocto-autobuilder2/builders.py`` and |
67 | roughly consist of: | 83 | roughly consist of: |
68 | 84 | ||
69 | 1. *Run ``clobberdir``* | 85 | #. *Run clobberdir*. |
70 | 86 | ||
71 | This cleans out any previous build. Old builds are left around to | 87 | This cleans out any previous build. Old builds are left around to |
72 | allow easier debugging of failed builds. For additional information, | 88 | allow easier debugging of failed builds. For additional information, |
73 | see ```clobberdir`` <#test-clobberdir>`__. | 89 | see :ref:`test-manual/test-manual-understand-autobuilder:clobberdir`. |
74 | 90 | ||
75 | 2. *Obtain yocto-autobuilder-helper* | 91 | #. *Obtain yocto-autobuilder-helper* |
76 | 92 | ||
77 | This step clones the ``yocto-autobuilder-helper`` git repository. | 93 | This step clones the ``yocto-autobuilder-helper`` git repository. |
78 | This is necessary to prevent the requirement to maintain all the | 94 | This is necessary to prevent the requirement to maintain all the |
@@ -80,12 +96,12 @@ roughly consist of: | |||
80 | matches the release being built so we can support older releases and | 96 | matches the release being built so we can support older releases and |
81 | still make changes in newer ones. | 97 | still make changes in newer ones. |
82 | 98 | ||
83 | 3. *Write layerinfo.json* | 99 | #. *Write layerinfo.json* |
84 | 100 | ||
85 | This transfers data in the Buildbot UI when the build was configured | 101 | This transfers data in the Buildbot UI when the build was configured |
86 | to the Helper. | 102 | to the Helper. |
87 | 103 | ||
88 | 4. *Call scripts/shared-repo-unpack* | 104 | #. *Call scripts/shared-repo-unpack* |
89 | 105 | ||
90 | This is a call into the Helper scripts to set up a checkout of all | 106 | This is a call into the Helper scripts to set up a checkout of all |
91 | the pieces this build might need. It might clone the BitBake | 107 | the pieces this build might need. It might clone the BitBake |
@@ -94,7 +110,7 @@ roughly consist of: | |||
94 | from the ``layerinfo.json`` file to help understand the | 110 | from the ``layerinfo.json`` file to help understand the |
95 | configuration. It will also use a local cache of repositories to | 111 | configuration. It will also use a local cache of repositories to |
96 | speed up the clone checkouts. For additional information, see | 112 | speed up the clone checkouts. For additional information, see |
97 | `Autobuilder Clone Cache <#test-autobuilder-clone-cache>`__. | 113 | :ref:`test-manual/test-manual-understand-autobuilder:Autobuilder Clone Cache`. |
98 | 114 | ||
99 | This step has two possible modes of operation. If the build is part | 115 | This step has two possible modes of operation. If the build is part |
100 | of a parent build, its possible that all the repositories needed may | 116 | of a parent build, its possible that all the repositories needed may |
@@ -114,7 +130,7 @@ roughly consist of: | |||
114 | available, it would clone from the cache and the upstreams as | 130 | available, it would clone from the cache and the upstreams as |
115 | necessary. This is considered the fallback mode. | 131 | necessary. This is considered the fallback mode. |
116 | 132 | ||
117 | 5. *Call scripts/run-config* | 133 | #. *Call scripts/run-config* |
118 | 134 | ||
119 | This is another call into the Helper scripts where its expected that | 135 | This is another call into the Helper scripts where its expected that |
120 | the main functionality of this target will be executed. | 136 | the main functionality of this target will be executed. |
@@ -137,8 +153,7 @@ special script that moves files to a special location, rather than | |||
137 | deleting them. Files in this location are deleted by an ``rm`` command, | 153 | deleting them. Files in this location are deleted by an ``rm`` command, |
138 | which is run under ``ionice -c 3``. For example, the deletion only | 154 | which is run under ``ionice -c 3``. For example, the deletion only |
139 | happens when there is idle IO capacity on the Worker. The Autobuilder | 155 | happens when there is idle IO capacity on the Worker. The Autobuilder |
140 | Worker Janitor runs this deletion. See `Autobuilder Worker | 156 | Worker Janitor runs this deletion. See :ref:`test-manual/test-manual-understand-autobuilder:Autobuilder Worker Janitor`. |
141 | Janitor <#test-autobuilder-worker-janitor>`__. | ||
142 | 157 | ||
143 | .. _test-autobuilder-clone-cache: | 158 | .. _test-autobuilder-clone-cache: |
144 | 159 | ||
@@ -150,8 +165,7 @@ on the Autobuilder. We therefore have a stash of commonly used | |||
150 | repositories pre-cloned on the Workers. Data is fetched from these | 165 | repositories pre-cloned on the Workers. Data is fetched from these |
151 | during clones first, then "topped up" with later revisions from any | 166 | during clones first, then "topped up" with later revisions from any |
152 | upstream when necesary. The cache is maintained by the Autobuilder | 167 | upstream when necesary. The cache is maintained by the Autobuilder |
153 | Worker Janitor. See `Autobuilder Worker | 168 | Worker Janitor. See :ref:`test-manual/test-manual-understand-autobuilder:Autobuilder Worker Janitor`. |
154 | Janitor <#test-autobuilder-worker-janitor>`__. | ||
155 | 169 | ||
156 | .. _test-autobuilder-worker-janitor: | 170 | .. _test-autobuilder-worker-janitor: |
157 | 171 | ||
@@ -159,8 +173,7 @@ Autobuilder Worker Janitor | |||
159 | -------------------------- | 173 | -------------------------- |
160 | 174 | ||
161 | This is a process running on each Worker that performs two basic | 175 | This is a process running on each Worker that performs two basic |
162 | operations, including background file deletion at IO idle (see `Target | 176 | operations, including background file deletion at IO idle (see :ref:`test-manual/test-manual-understand-autobuilder:Autobuilder Target Execution Overview`: Run clobberdir) and |
163 | Execution: clobberdir <#test-list-tgt-exec-clobberdir>`__) and | ||
164 | maintainenance of a cache of cloned repositories to improve the speed | 177 | maintainenance of a cache of cloned repositories to improve the speed |
165 | the system can checkout repositories. | 178 | the system can checkout repositories. |
166 | 179 | ||
@@ -181,7 +194,7 @@ Shared SSTATE_DIR | |||
181 | 194 | ||
182 | The Workers are all connected over NFS which allows the ``sstate`` | 195 | The Workers are all connected over NFS which allows the ``sstate`` |
183 | directory to be shared between them. This means once a Worker has built | 196 | directory to be shared between them. This means once a Worker has built |
184 | an artefact, all the others can benefit from it. Usage of the directory | 197 | an artifact, all the others can benefit from it. Usage of the directory |
185 | within the directory is designed for sharing over NFS. | 198 | within the directory is designed for sharing over NFS. |
186 | 199 | ||
187 | .. _test-resulttool: | 200 | .. _test-resulttool: |
@@ -198,7 +211,7 @@ Resulttool is part of OpenEmbedded-Core and is used to manipulate these | |||
198 | json results files. It has the ability to merge files together, display | 211 | json results files. It has the ability to merge files together, display |
199 | reports of the test results and compare different result files. | 212 | reports of the test results and compare different result files. |
200 | 213 | ||
201 | For details, see `https://wiki.yoctoproject.org/wiki/Resulttool <#>`__. | 214 | For details, see :yocto_wiki:`/wiki/Resulttool`. |
202 | 215 | ||
203 | .. _test-run-config-tgt-execution: | 216 | .. _test-run-config-tgt-execution: |
204 | 217 | ||
@@ -209,50 +222,46 @@ The ``scripts/run-config`` execution is where most of the work within | |||
209 | the Autobuilder happens. It runs through a number of steps; the first | 222 | the Autobuilder happens. It runs through a number of steps; the first |
210 | are general setup steps that are run once and include: | 223 | are general setup steps that are run once and include: |
211 | 224 | ||
212 | 1. Set up any ``buildtools-tarball`` if configured. | 225 | #. Set up any ``buildtools-tarball`` if configured. |
213 | 226 | ||
214 | 2. Call "buildhistory-init" if buildhistory is configured. | 227 | #. Call "buildhistory-init" if buildhistory is configured. |
215 | 228 | ||
216 | For each step that is configured in ``config.json``, it will perform the | 229 | For each step that is configured in ``config.json``, it will perform the |
217 | following: | 230 | following: |
218 | 231 | ||
219 | ## WRITER's question: What does "logging in as stepXa" and others refer | 232 | #. Add any layers that are specified using the |
220 | to below? ## | ||
221 | |||
222 | 1. Add any layers that are specified using the | ||
223 | ``bitbake-layers add-layer`` command (logging as stepXa) | 233 | ``bitbake-layers add-layer`` command (logging as stepXa) |
224 | 234 | ||
225 | 2. Call the ``scripts/setup-config`` script to generate the necessary | 235 | #. Call the ``scripts/setup-config`` script to generate the necessary |
226 | ``auto.conf`` configuration file for the build | 236 | ``auto.conf`` configuration file for the build |
227 | 237 | ||
228 | 3. Run the ``bitbake BBTARGETS`` command (logging as stepXb) | 238 | #. Run the ``bitbake BBTARGETS`` command (logging as stepXb) |
229 | 239 | ||
230 | 4. Run the ``bitbake SANITYTARGETS`` command (logging as stepXc) | 240 | #. Run the ``bitbake SANITYTARGETS`` command (logging as stepXc) |
231 | 241 | ||
232 | 5. Run the ``EXTRACMDS`` command, which are run within the BitBake build | 242 | #. Run the ``EXTRACMDS`` command, which are run within the BitBake build |
233 | environment (logging as stepXd) | 243 | environment (logging as stepXd) |
234 | 244 | ||
235 | 6. Run the ``EXTRAPLAINCMDS`` command(s), which are run outside the | 245 | #. Run the ``EXTRAPLAINCMDS`` command(s), which are run outside the |
236 | BitBake build environment (logging as stepXd) | 246 | BitBake build environment (logging as stepXd) |
237 | 247 | ||
238 | 7. Remove any layers added in `step | 248 | #. Remove any layers added in step |
239 | 1 <#test-run-config-add-layers-step>`__ using the | 249 | 1 using the ``bitbake-layers remove-layer`` command (logging as stepXa) |
240 | ``bitbake-layers remove-layer`` command (logging as stepXa) | ||
241 | 250 | ||
242 | Once the execution steps above complete, ``run-config`` executes a set | 251 | Once the execution steps above complete, ``run-config`` executes a set |
243 | of post-build steps, including: | 252 | of post-build steps, including: |
244 | 253 | ||
245 | 1. Call ``scripts/publish-artifacts`` to collect any output which is to | 254 | #. Call ``scripts/publish-artifacts`` to collect any output which is to |
246 | be saved from the build. | 255 | be saved from the build. |
247 | 256 | ||
248 | 2. Call ``scripts/collect-results`` to collect any test results to be | 257 | #. Call ``scripts/collect-results`` to collect any test results to be |
249 | saved from the build. | 258 | saved from the build. |
250 | 259 | ||
251 | 3. Call ``scripts/upload-error-reports`` to send any error reports | 260 | #. Call ``scripts/upload-error-reports`` to send any error reports |
252 | generated to the remote server. | 261 | generated to the remote server. |
253 | 262 | ||
254 | 4. Cleanup the build directory using | 263 | #. Cleanup the build directory using |
255 | ```clobberdir`` <#test-clobberdir>`__ if the build was successful, | 264 | :ref:`test-manual/test-manual-understand-autobuilder:clobberdir` if the build was successful, |
256 | else rename it to “build-renamed” for potential future debugging. | 265 | else rename it to “build-renamed” for potential future debugging. |
257 | 266 | ||
258 | .. _test-deploying-yp-autobuilder: | 267 | .. _test-deploying-yp-autobuilder: |
@@ -279,11 +288,18 @@ The standard ``config.json`` minimally attempts to allow substitution of | |||
279 | the paths. The Helper script repository includes a | 288 | the paths. The Helper script repository includes a |
280 | ``local-example.json`` file to show how you could override these from a | 289 | ``local-example.json`` file to show how you could override these from a |
281 | separate configuration file. Pass the following into the environment of | 290 | separate configuration file. Pass the following into the environment of |
282 | the Autobuilder:$ ABHELPER_JSON="config.json local-example.json"As | 291 | the Autobuilder:: |
283 | another example, you could also pass the following into the | 292 | |
284 | environment:$ ABHELPER_JSON="config.json /some/location/local.json"One | 293 | $ ABHELPER_JSON="config.json local-example.json" |
285 | issue users often run into is validation of the ``config.json`` files. A | 294 | |
295 | As another example, you could also pass the following into the | ||
296 | environment:: | ||
297 | |||
298 | $ ABHELPER_JSON="config.json /some/location/local.json" | ||
299 | |||
300 | One issue users often run into is validation of the ``config.json`` files. A | ||
286 | tip for minimizing issues from invalid json files is to use a Git | 301 | tip for minimizing issues from invalid json files is to use a Git |
287 | ``pre-commit-hook.sh`` script to verify the JSON file before committing | 302 | ``pre-commit-hook.sh`` script to verify the JSON file before committing |
288 | it. Create a symbolic link as follows:$ ln -s | 303 | it. Create a symbolic link as follows:: |
289 | ../../scripts/pre-commit-hook.sh .git/hooks/pre-commit | 304 | |
305 | $ ln -s ../../scripts/pre-commit-hook.sh .git/hooks/pre-commit | ||