xref: /aosp_15_r20/external/mesa3d/docs/ci/index.rst (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1*61046927SAndroid Build Coastguard WorkerContinuous Integration
2*61046927SAndroid Build Coastguard Worker======================
3*61046927SAndroid Build Coastguard Worker
4*61046927SAndroid Build Coastguard WorkerGitLab CI
5*61046927SAndroid Build Coastguard Worker---------
6*61046927SAndroid Build Coastguard Worker
7*61046927SAndroid Build Coastguard WorkerGitLab provides a convenient framework for running commands in response to Git pushes.
8*61046927SAndroid Build Coastguard WorkerWe use it to test merge requests (MRs) before merging them (pre-merge testing),
9*61046927SAndroid Build Coastguard Workeras well as post-merge testing, for everything that hits ``main``
10*61046927SAndroid Build Coastguard Worker(this is necessary because we still allow commits to be pushed outside of MRs,
11*61046927SAndroid Build Coastguard Workerand even then the MR CI runs in the forked repository, which might have been
12*61046927SAndroid Build Coastguard Workermodified and thus is unreliable).
13*61046927SAndroid Build Coastguard Worker
14*61046927SAndroid Build Coastguard WorkerThe CI runs a number of tests, from trivial build-testing to complex GPU rendering:
15*61046927SAndroid Build Coastguard Worker
16*61046927SAndroid Build Coastguard Worker- Build testing for a number of configurations and platforms
17*61046927SAndroid Build Coastguard Worker- Sanity checks (``meson test``)
18*61046927SAndroid Build Coastguard Worker- Most drivers are also tested using several test suites, such as the
19*61046927SAndroid Build Coastguard Worker  `Vulkan/GL/GLES conformance test suite <https://github.com/KhronosGroup/VK-GL-CTS>`__,
20*61046927SAndroid Build Coastguard Worker  `Piglit <https://gitlab.freedesktop.org/mesa/piglit>`__, and others.
21*61046927SAndroid Build Coastguard Worker- Replay of application traces
22*61046927SAndroid Build Coastguard Worker
23*61046927SAndroid Build Coastguard WorkerA typical run takes between 20 and 30 minutes, although it can go up very quickly
24*61046927SAndroid Build Coastguard Workerif the GitLab runners are overwhelmed, which happens sometimes. When it does happen,
25*61046927SAndroid Build Coastguard Workernot much can be done besides waiting it out, or cancel it.
26*61046927SAndroid Build Coastguard WorkerYou can do your part by only running the jobs you care about by using `our
27*61046927SAndroid Build Coastguard Workertool <#running-specific-ci-jobs>`__.
28*61046927SAndroid Build Coastguard Worker
29*61046927SAndroid Build Coastguard WorkerDue to limited resources, we currently do not run the CI automatically
30*61046927SAndroid Build Coastguard Workeron every push; instead, we only run it automatically once the MR has
31*61046927SAndroid Build Coastguard Workerbeen assigned to ``Marge``, our merge bot.
32*61046927SAndroid Build Coastguard Worker
33*61046927SAndroid Build Coastguard WorkerIf you're interested in the details, the main configuration file is ``.gitlab-ci.yml``,
34*61046927SAndroid Build Coastguard Workerand it references a number of other files in ``.gitlab-ci/``.
35*61046927SAndroid Build Coastguard Worker
36*61046927SAndroid Build Coastguard WorkerIf the GitLab CI doesn't seem to be running on your fork (or MRs, as they run
37*61046927SAndroid Build Coastguard Workerin the context of your fork), you should check the "Settings" of your fork.
38*61046927SAndroid Build Coastguard WorkerUnder "CI / CD" → "General pipelines", make sure "Custom CI config path" is
39*61046927SAndroid Build Coastguard Workerempty (or set to the default ``.gitlab-ci.yml``), and that the
40*61046927SAndroid Build Coastguard Worker"Public pipelines" box is checked.
41*61046927SAndroid Build Coastguard Worker
42*61046927SAndroid Build Coastguard WorkerIf you're having issues with the GitLab CI, your best bet is to ask
43*61046927SAndroid Build Coastguard Workerabout it on ``#freedesktop`` on OFTC and tag `Daniel Stone
44*61046927SAndroid Build Coastguard Worker<https://gitlab.freedesktop.org/daniels>`__ (``daniels`` on IRC) or
45*61046927SAndroid Build Coastguard Worker`Emma Anholt <https://gitlab.freedesktop.org/anholt>`__ (``anholt`` on
46*61046927SAndroid Build Coastguard WorkerIRC).
47*61046927SAndroid Build Coastguard Worker
48*61046927SAndroid Build Coastguard WorkerThe three GitLab CI systems currently integrated are:
49*61046927SAndroid Build Coastguard Worker
50*61046927SAndroid Build Coastguard Worker
51*61046927SAndroid Build Coastguard Worker.. toctree::
52*61046927SAndroid Build Coastguard Worker   :maxdepth: 1
53*61046927SAndroid Build Coastguard Worker
54*61046927SAndroid Build Coastguard Worker   bare-metal
55*61046927SAndroid Build Coastguard Worker   LAVA
56*61046927SAndroid Build Coastguard Worker   docker
57*61046927SAndroid Build Coastguard Worker
58*61046927SAndroid Build Coastguard WorkerFarm management
59*61046927SAndroid Build Coastguard Worker---------------
60*61046927SAndroid Build Coastguard Worker
61*61046927SAndroid Build Coastguard Worker.. note::
62*61046927SAndroid Build Coastguard Worker   Never mix disabling/re-enabling a farm with any change that can affect a job
63*61046927SAndroid Build Coastguard Worker   that runs in another farm!
64*61046927SAndroid Build Coastguard Worker
65*61046927SAndroid Build Coastguard WorkerWhen the farm starts failing for any reason (power, network, out-of-space), it needs to be disabled by pushing separate MR with
66*61046927SAndroid Build Coastguard Worker
67*61046927SAndroid Build Coastguard Worker.. code-block:: sh
68*61046927SAndroid Build Coastguard Worker
69*61046927SAndroid Build Coastguard Worker   git mv .ci-farms{,-disabled}/$farm_name
70*61046927SAndroid Build Coastguard Worker
71*61046927SAndroid Build Coastguard WorkerAfter farm restore functionality can be enabled by pushing a new merge request, which contains
72*61046927SAndroid Build Coastguard Worker
73*61046927SAndroid Build Coastguard Worker.. code-block:: sh
74*61046927SAndroid Build Coastguard Worker
75*61046927SAndroid Build Coastguard Worker   git mv .ci-farms{-disabled,}/$farm_name
76*61046927SAndroid Build Coastguard Worker
77*61046927SAndroid Build Coastguard Worker.. warning::
78*61046927SAndroid Build Coastguard Worker   Pushing (``git push``) directly to ``main`` is forbidden; this change must
79*61046927SAndroid Build Coastguard Worker   be sent as a :ref:`Merge Request <merging>`.
80*61046927SAndroid Build Coastguard Worker
81*61046927SAndroid Build Coastguard WorkerApplication traces replay
82*61046927SAndroid Build Coastguard Worker-------------------------
83*61046927SAndroid Build Coastguard Worker
84*61046927SAndroid Build Coastguard WorkerThe CI replays application traces with various drivers in two different jobs. The first
85*61046927SAndroid Build Coastguard Workerjob replays traces listed in ``src/<driver>/ci/traces-<driver>.yml`` files and if any
86*61046927SAndroid Build Coastguard Workerof those traces fail the pipeline fails as well. The second job replays traces listed in
87*61046927SAndroid Build Coastguard Worker``src/<driver>/ci/restricted-traces-<driver>.yml`` and it is allowed to fail. This second
88*61046927SAndroid Build Coastguard Workerjob is only created when the pipeline is triggered by ``marge-bot`` or any other user that
89*61046927SAndroid Build Coastguard Workerhas been granted access to these traces.
90*61046927SAndroid Build Coastguard Worker
91*61046927SAndroid Build Coastguard WorkerA traces YAML file also includes a ``download-url`` pointing to a MinIO
92*61046927SAndroid Build Coastguard Workerinstance where to download the traces from. While the first job should always work with
93*61046927SAndroid Build Coastguard Workerpublicly accessible traces, the second job could point to an URL with restricted access.
94*61046927SAndroid Build Coastguard Worker
95*61046927SAndroid Build Coastguard WorkerRestricted traces are those that have been made available to Mesa developers without a
96*61046927SAndroid Build Coastguard Workerlicense to redistribute at will, and thus should not be exposed to the public. Failing to
97*61046927SAndroid Build Coastguard Workeraccess that URL would not prevent the pipeline to pass, therefore forks made by
98*61046927SAndroid Build Coastguard Workercontributors without permissions to download non-redistributable traces can be merged
99*61046927SAndroid Build Coastguard Workerwithout friction.
100*61046927SAndroid Build Coastguard Worker
101*61046927SAndroid Build Coastguard WorkerAs an aside, only maintainers of such non-redistributable traces are responsible for
102*61046927SAndroid Build Coastguard Workerensuring that replays are successful, since other contributors would not be able to
103*61046927SAndroid Build Coastguard Workerdownload and test them by themselves.
104*61046927SAndroid Build Coastguard Worker
105*61046927SAndroid Build Coastguard WorkerThose Mesa contributors that believe they could have permission to access such
106*61046927SAndroid Build Coastguard Workernon-redistributable traces can request permission to Daniel Stone <[email protected]>.
107*61046927SAndroid Build Coastguard Worker
108*61046927SAndroid Build Coastguard Workergitlab.freedesktop.org accounts that are to be granted access to these traces will be
109*61046927SAndroid Build Coastguard Workeradded to the OPA policy for the MinIO repository as per
110*61046927SAndroid Build Coastguard Workerhttps://gitlab.freedesktop.org/freedesktop/helm-gitlab-infra/-/commit/a3cd632743019f68ac8a829267deb262d9670958 .
111*61046927SAndroid Build Coastguard Worker
112*61046927SAndroid Build Coastguard WorkerSo the jobs are created in personal repositories, the name of the user's account needs
113*61046927SAndroid Build Coastguard Workerto be added to the rules attribute of the GitLab CI job that accesses the restricted
114*61046927SAndroid Build Coastguard Workeraccounts.
115*61046927SAndroid Build Coastguard Worker
116*61046927SAndroid Build Coastguard Worker.. toctree::
117*61046927SAndroid Build Coastguard Worker   :maxdepth: 1
118*61046927SAndroid Build Coastguard Worker
119*61046927SAndroid Build Coastguard Worker   local-traces
120*61046927SAndroid Build Coastguard Worker
121*61046927SAndroid Build Coastguard WorkerIntel CI
122*61046927SAndroid Build Coastguard Worker--------
123*61046927SAndroid Build Coastguard Worker
124*61046927SAndroid Build Coastguard WorkerThe Intel CI is not yet integrated into the GitLab CI.
125*61046927SAndroid Build Coastguard WorkerFor now, special access must be manually given (file a issue in
126*61046927SAndroid Build Coastguard Worker`the Intel CI configuration repo <https://gitlab.freedesktop.org/Mesa_CI/mesa_jenkins>`__
127*61046927SAndroid Build Coastguard Workerif you think you or Mesa would benefit from you having access to the Intel CI).
128*61046927SAndroid Build Coastguard WorkerResults can be seen on `mesa-ci.01.org <https://mesa-ci.01.org>`__
129*61046927SAndroid Build Coastguard Workerif you are *not* an Intel employee, but if you are you
130*61046927SAndroid Build Coastguard Workercan access a better interface on
131*61046927SAndroid Build Coastguard Worker`mesa-ci-results.jf.intel.com <http://mesa-ci-results.jf.intel.com>`__.
132*61046927SAndroid Build Coastguard Worker
133*61046927SAndroid Build Coastguard WorkerThe Intel CI runs a much larger array of tests, on a number of generations
134*61046927SAndroid Build Coastguard Workerof Intel hardware and on multiple platforms (X11, Wayland, DRM & Android),
135*61046927SAndroid Build Coastguard Workerwith the purpose of detecting regressions.
136*61046927SAndroid Build Coastguard WorkerTests include
137*61046927SAndroid Build Coastguard Worker`Crucible <https://gitlab.freedesktop.org/mesa/crucible>`__,
138*61046927SAndroid Build Coastguard Worker`VK-GL-CTS <https://github.com/KhronosGroup/VK-GL-CTS>`__,
139*61046927SAndroid Build Coastguard Worker`dEQP <https://android.googlesource.com/platform/external/deqp>`__,
140*61046927SAndroid Build Coastguard Worker`Piglit <https://gitlab.freedesktop.org/mesa/piglit>`__,
141*61046927SAndroid Build Coastguard Worker`Skia <https://skia.googlesource.com/skia>`__,
142*61046927SAndroid Build Coastguard Worker`VkRunner <https://github.com/Igalia/vkrunner>`__,
143*61046927SAndroid Build Coastguard Worker`WebGL <https://github.com/KhronosGroup/WebGL>`__,
144*61046927SAndroid Build Coastguard Workerand a few other tools.
145*61046927SAndroid Build Coastguard WorkerA typical run takes between 30 minutes and an hour.
146*61046927SAndroid Build Coastguard Worker
147*61046927SAndroid Build Coastguard WorkerIf you're having issues with the Intel CI, your best bet is to ask about
148*61046927SAndroid Build Coastguard Workerit on ``#dri-devel`` on OFTC and tag `Nico Cortes
149*61046927SAndroid Build Coastguard Worker<https://gitlab.freedesktop.org/ngcortes>`__ (``ngcortes`` on IRC).
150*61046927SAndroid Build Coastguard Worker
151*61046927SAndroid Build Coastguard Worker.. _CI-job-user-expectations:
152*61046927SAndroid Build Coastguard Worker
153*61046927SAndroid Build Coastguard WorkerCI job user expectations
154*61046927SAndroid Build Coastguard Worker------------------------
155*61046927SAndroid Build Coastguard Worker
156*61046927SAndroid Build Coastguard WorkerTo make sure that testing of one vendor's drivers doesn't block
157*61046927SAndroid Build Coastguard Workerunrelated work by other vendors, we require that a given driver's test
158*61046927SAndroid Build Coastguard Workerfarm produces a spurious failure no more than once a week.  If every
159*61046927SAndroid Build Coastguard Workerdriver had CI and failed once a week, we would be seeing someone's
160*61046927SAndroid Build Coastguard Workercode getting blocked on a spurious failure daily, which is an
161*61046927SAndroid Build Coastguard Workerunacceptable cost to the project.
162*61046927SAndroid Build Coastguard Worker
163*61046927SAndroid Build Coastguard WorkerTo ensure that, driver maintainers with CI enabled should watch the Flakes panel
164*61046927SAndroid Build Coastguard Workerof the `CI flakes dashboard
165*61046927SAndroid Build Coastguard Worker<https://ci-stats-grafana.freedesktop.org/d/Ae_TLIwVk/mesa-ci-quality-false-positives?orgId=1>`__,
166*61046927SAndroid Build Coastguard Workerparticularly the "Flake jobs" pane, to inspect jobs in their driver where the
167*61046927SAndroid Build Coastguard Workerautomatic retry of a failing job produced a success a second time.
168*61046927SAndroid Build Coastguard WorkerAdditionally, most CI reports test-level flakes to an IRC channel, and flakes
169*61046927SAndroid Build Coastguard Workerreported as NEW are not expected and could cause spurious failures in jobs.
170*61046927SAndroid Build Coastguard WorkerPlease track the NEW reports in jobs and add them as appropriate to the
171*61046927SAndroid Build Coastguard Worker``-flakes.txt`` file for your driver.
172*61046927SAndroid Build Coastguard Worker
173*61046927SAndroid Build Coastguard WorkerAdditionally, the test farm needs to be able to provide a short enough
174*61046927SAndroid Build Coastguard Workerturnaround time that we can get our MRs through marge-bot without the pipeline
175*61046927SAndroid Build Coastguard Workerbacking up.  As a result, we require that the test farm be able to handle a
176*61046927SAndroid Build Coastguard Workerwhole pipeline's worth of jobs in less than 15 minutes (to compare, the build
177*61046927SAndroid Build Coastguard Workerstage is about 10 minutes).  Given boot times and intermittent network delays,
178*61046927SAndroid Build Coastguard Workerthis generally means that the test runtime as reported by deqp-runner should be
179*61046927SAndroid Build Coastguard Workerkept to 10 minutes.
180*61046927SAndroid Build Coastguard Worker
181*61046927SAndroid Build Coastguard WorkerIf a test farm is short the HW to provide these guarantees, consider dropping
182*61046927SAndroid Build Coastguard Workertests to reduce runtime.  dEQP job logs print the slowest tests at the end of
183*61046927SAndroid Build Coastguard Workerthe run, and Piglit logs the runtime of tests in the results.json.bz2 in the
184*61046927SAndroid Build Coastguard Workerartifacts.  Or, you can add the following to your job to only run some fraction
185*61046927SAndroid Build Coastguard Worker(in this case, 1/10th) of the dEQP tests.
186*61046927SAndroid Build Coastguard Worker
187*61046927SAndroid Build Coastguard Worker.. code-block:: yaml
188*61046927SAndroid Build Coastguard Worker
189*61046927SAndroid Build Coastguard Worker   variables:
190*61046927SAndroid Build Coastguard Worker      DEQP_FRACTION: 10
191*61046927SAndroid Build Coastguard Worker
192*61046927SAndroid Build Coastguard Workerto just run 1/10th of the test list.
193*61046927SAndroid Build Coastguard Worker
194*61046927SAndroid Build Coastguard WorkerFor Collabora's LAVA farm, the `device types
195*61046927SAndroid Build Coastguard Worker<https://lava.collabora.dev/scheduler/device_types>`__ page can tell you how
196*61046927SAndroid Build Coastguard Workermany boards of a specific tag are currently available by adding the "Idle" and
197*61046927SAndroid Build Coastguard Worker"Busy" columns.  For bare-metal, a gitlab admin can look at the `runners
198*61046927SAndroid Build Coastguard Worker<https://gitlab.freedesktop.org/admin/runners>`__ page.  A pipeline should
199*61046927SAndroid Build Coastguard Workerprobably not create more jobs for a board type than there are boards, unless you
200*61046927SAndroid Build Coastguard Workerclearly have some short-runtime jobs.
201*61046927SAndroid Build Coastguard Worker
202*61046927SAndroid Build Coastguard WorkerIf a HW CI farm goes offline (network dies and all CI pipelines end up
203*61046927SAndroid Build Coastguard Workerstalled) or its runners are consistently spuriously failing (disk
204*61046927SAndroid Build Coastguard Workerfull?), and the maintainer is not immediately available to fix the
205*61046927SAndroid Build Coastguard Workerissue, please push through an MR disabling that farm's jobs according
206*61046927SAndroid Build Coastguard Workerto the `Farm Management <#farm-management>`__ instructions.
207*61046927SAndroid Build Coastguard Worker
208*61046927SAndroid Build Coastguard WorkerPersonal runners
209*61046927SAndroid Build Coastguard Worker----------------
210*61046927SAndroid Build Coastguard Worker
211*61046927SAndroid Build Coastguard WorkerMesa's CI is currently run primarily on packet.net's m1xlarge nodes
212*61046927SAndroid Build Coastguard Worker(2.2Ghz Sandy Bridge), with each job getting 8 cores allocated.  You
213*61046927SAndroid Build Coastguard Workercan speed up your personal CI builds (and marge-bot merges) by using a
214*61046927SAndroid Build Coastguard Workerfaster personal machine as a runner.  You can find the gitlab-runner
215*61046927SAndroid Build Coastguard Workerpackage in Debian, or use GitLab's own builds.
216*61046927SAndroid Build Coastguard Worker
217*61046927SAndroid Build Coastguard WorkerTo do so, follow `GitLab's instructions
218*61046927SAndroid Build Coastguard Worker<https://docs.gitlab.com/ee/ci/runners/runners_scope.html#create-a-project-runner-with-a-runner-authentication-token>`__
219*61046927SAndroid Build Coastguard Workerto register your personal GitLab runner in your Mesa fork.  Then, tell
220*61046927SAndroid Build Coastguard WorkerMesa how many jobs it should serve (``concurrent=``) and how many
221*61046927SAndroid Build Coastguard Workercores those jobs should use (``FDO_CI_CONCURRENT=``) by editing these
222*61046927SAndroid Build Coastguard Workerlines in ``/etc/gitlab-runner/config.toml``, for example:
223*61046927SAndroid Build Coastguard Worker
224*61046927SAndroid Build Coastguard Worker.. code-block:: toml
225*61046927SAndroid Build Coastguard Worker
226*61046927SAndroid Build Coastguard Worker   concurrent = 2
227*61046927SAndroid Build Coastguard Worker
228*61046927SAndroid Build Coastguard Worker   [[runners]]
229*61046927SAndroid Build Coastguard Worker     environment = ["FDO_CI_CONCURRENT=16"]
230*61046927SAndroid Build Coastguard Worker
231*61046927SAndroid Build Coastguard Worker
232*61046927SAndroid Build Coastguard WorkerDocker caching
233*61046927SAndroid Build Coastguard Worker--------------
234*61046927SAndroid Build Coastguard Worker
235*61046927SAndroid Build Coastguard WorkerThe CI system uses Docker images extensively to cache
236*61046927SAndroid Build Coastguard Workerinfrequently-updated build content like the CTS.  The `freedesktop.org
237*61046927SAndroid Build Coastguard WorkerCI templates
238*61046927SAndroid Build Coastguard Worker<https://gitlab.freedesktop.org/freedesktop/ci-templates/>`__ help us
239*61046927SAndroid Build Coastguard Workermanage the building of the images to reduce how frequently rebuilds
240*61046927SAndroid Build Coastguard Workerhappen, and trim down the images (stripping out manpages, cleaning the
241*61046927SAndroid Build Coastguard Workerapt cache, and other such common pitfalls of building Docker images).
242*61046927SAndroid Build Coastguard Worker
243*61046927SAndroid Build Coastguard WorkerWhen running a container job, the templates will look for an existing
244*61046927SAndroid Build Coastguard Workerbuild of that image in the container registry under
245*61046927SAndroid Build Coastguard Worker``MESA_IMAGE_TAG``.  If it's found it will be reused, and if
246*61046927SAndroid Build Coastguard Workernot, the associated ``.gitlab-ci/containers/<jobname>.sh`` will be run
247*61046927SAndroid Build Coastguard Workerto build it.  So, when developing any change to container build
248*61046927SAndroid Build Coastguard Workerscripts, you need to update the associated ``MESA_IMAGE_TAG`` to
249*61046927SAndroid Build Coastguard Workera new unique string.  We recommend using the current date plus some
250*61046927SAndroid Build Coastguard Workerstring related to your branch (so that if you rebase on someone else's
251*61046927SAndroid Build Coastguard Workercontainer update from the same day, you will get a Git conflict
252*61046927SAndroid Build Coastguard Workerinstead of silently reusing their container)
253*61046927SAndroid Build Coastguard Worker
254*61046927SAndroid Build Coastguard WorkerWhen developing a given change to your Docker image, you would have to
255*61046927SAndroid Build Coastguard Workerbump the tag on each ``git commit --amend`` to your development
256*61046927SAndroid Build Coastguard Workerbranch, which can get tedious.  Instead, you can navigate to the
257*61046927SAndroid Build Coastguard Worker`container registry
258*61046927SAndroid Build Coastguard Worker<https://gitlab.freedesktop.org/mesa/mesa/container_registry>`__ for
259*61046927SAndroid Build Coastguard Workeryour repository and delete the tag to force a rebuild.  When your code
260*61046927SAndroid Build Coastguard Workeris eventually merged to main, a full image rebuild will occur again
261*61046927SAndroid Build Coastguard Worker(forks inherit images from the main repo, but MRs don't propagate
262*61046927SAndroid Build Coastguard Workerimages from the fork into the main repo's registry).
263*61046927SAndroid Build Coastguard Worker
264*61046927SAndroid Build Coastguard WorkerBuilding locally using CI docker images
265*61046927SAndroid Build Coastguard Worker---------------------------------------
266*61046927SAndroid Build Coastguard Worker
267*61046927SAndroid Build Coastguard WorkerIt can be frustrating to debug build failures on an environment you
268*61046927SAndroid Build Coastguard Workerdon't personally have.  If you're experiencing this with the CI
269*61046927SAndroid Build Coastguard Workerbuilds, you can use Docker to use their build environment locally.  Go
270*61046927SAndroid Build Coastguard Workerto your job log, and at the top you'll see a line like::
271*61046927SAndroid Build Coastguard Worker
272*61046927SAndroid Build Coastguard Worker   Pulling docker image registry.freedesktop.org/anholt/mesa/debian/android_build:2020-09-11
273*61046927SAndroid Build Coastguard Worker
274*61046927SAndroid Build Coastguard WorkerWe'll use a volume mount to make our current Mesa tree be what the
275*61046927SAndroid Build Coastguard WorkerDocker container uses, so they'll share everything (their build will
276*61046927SAndroid Build Coastguard Workergo in _build, according to ``meson-build.sh``).  We're going to be
277*61046927SAndroid Build Coastguard Workerusing the image non-interactively so we use ``run --rm $IMAGE
278*61046927SAndroid Build Coastguard Workercommand`` instead of ``run -it $IMAGE bash`` (which you may also find
279*61046927SAndroid Build Coastguard Workeruseful for debug).  Extract your build setup variables from
280*61046927SAndroid Build Coastguard Worker.gitlab-ci.yml and run the CI meson build script:
281*61046927SAndroid Build Coastguard Worker
282*61046927SAndroid Build Coastguard Worker.. code-block:: sh
283*61046927SAndroid Build Coastguard Worker
284*61046927SAndroid Build Coastguard Worker   IMAGE=registry.freedesktop.org/anholt/mesa/debian/android_build:2020-09-11
285*61046927SAndroid Build Coastguard Worker   sudo docker pull $IMAGE
286*61046927SAndroid Build Coastguard Worker   sudo docker run --rm -v `pwd`:/mesa -w /mesa $IMAGE env PKG_CONFIG_PATH=/usr/local/lib/aarch64-linux-android/pkgconfig/:/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/pkgconfig/ GALLIUM_DRIVERS=freedreno UNWIND=disabled EXTRA_OPTION="-D android-stub=true -D llvm=disabled" DRI_LOADERS="-D glx=disabled -D gbm=disabled -D egl=enabled -D platforms=android" CROSS=aarch64-linux-android ./.gitlab-ci/meson-build.sh
287*61046927SAndroid Build Coastguard Worker
288*61046927SAndroid Build Coastguard WorkerAll you have left over from the build is its output, and a _build
289*61046927SAndroid Build Coastguard Workerdirectory.  You can hack on mesa and iterate testing the build with:
290*61046927SAndroid Build Coastguard Worker
291*61046927SAndroid Build Coastguard Worker.. code-block:: sh
292*61046927SAndroid Build Coastguard Worker
293*61046927SAndroid Build Coastguard Worker   sudo docker run --rm -v `pwd`:/mesa $IMAGE meson compile -C /mesa/_build
294*61046927SAndroid Build Coastguard Worker
295*61046927SAndroid Build Coastguard WorkerRunning specific CI jobs
296*61046927SAndroid Build Coastguard Worker------------------------
297*61046927SAndroid Build Coastguard Worker
298*61046927SAndroid Build Coastguard WorkerYou can use ``bin/ci/ci_run_n_monitor.py`` to run specific CI jobs. It
299*61046927SAndroid Build Coastguard Workerwill automatically take care of running all the jobs yours depends on,
300*61046927SAndroid Build Coastguard Workerand cancel the rest to avoid wasting resources.
301*61046927SAndroid Build Coastguard Worker
302*61046927SAndroid Build Coastguard WorkerSee ``bin/ci/ci_run_n_monitor.py --help`` for all the options.
303*61046927SAndroid Build Coastguard Worker
304*61046927SAndroid Build Coastguard WorkerThe ``--target`` argument takes a regex that you can use to select the
305*61046927SAndroid Build Coastguard Workerjobs names you want to run, e.g. ``--target 'zink.*'`` will run all the
306*61046927SAndroid Build Coastguard WorkerZink jobs, leaving the other drivers' jobs free for others to use.
307*61046927SAndroid Build Coastguard Worker
308*61046927SAndroid Build Coastguard WorkerNote that in fork pipelines, GitLab only adds the jobs for the files that have
309*61046927SAndroid Build Coastguard Workerchanged **since the last push**, so you might not get the jobs you expect.
310*61046927SAndroid Build Coastguard WorkerYou can work around that by adding a dummy change in a file core to what you're
311*61046927SAndroid Build Coastguard Workerworking on and then making a new push with that change, and removing that change
312*61046927SAndroid Build Coastguard Workerbefore you create the MR.
313*61046927SAndroid Build Coastguard Worker
314*61046927SAndroid Build Coastguard WorkerConformance Tests
315*61046927SAndroid Build Coastguard Worker-----------------
316*61046927SAndroid Build Coastguard Worker
317*61046927SAndroid Build Coastguard WorkerSome conformance tests require a special treatment to be maintained on GitLab CI.
318*61046927SAndroid Build Coastguard WorkerThis section lists their documentation pages.
319*61046927SAndroid Build Coastguard Worker
320*61046927SAndroid Build Coastguard Worker.. toctree::
321*61046927SAndroid Build Coastguard Worker  :maxdepth: 1
322*61046927SAndroid Build Coastguard Worker
323*61046927SAndroid Build Coastguard Worker  skqp
324*61046927SAndroid Build Coastguard Worker
325*61046927SAndroid Build Coastguard Worker
326*61046927SAndroid Build Coastguard WorkerUpdating GitLab CI Linux Kernel
327*61046927SAndroid Build Coastguard Worker-------------------------------
328*61046927SAndroid Build Coastguard Worker
329*61046927SAndroid Build Coastguard WorkerGitLab CI usually runs a bleeding-edge kernel. The following documentation has
330*61046927SAndroid Build Coastguard Workerinstructions on how to uprev Linux Kernel in the GitLab CI ecosystem.
331*61046927SAndroid Build Coastguard Worker
332*61046927SAndroid Build Coastguard Worker.. toctree::
333*61046927SAndroid Build Coastguard Worker  :maxdepth: 1
334*61046927SAndroid Build Coastguard Worker
335*61046927SAndroid Build Coastguard Worker  kernel
336*61046927SAndroid Build Coastguard Worker
337*61046927SAndroid Build Coastguard Worker
338*61046927SAndroid Build Coastguard WorkerReusing CI scripts for other projects
339*61046927SAndroid Build Coastguard Worker--------------------------------------
340*61046927SAndroid Build Coastguard Worker
341*61046927SAndroid Build Coastguard WorkerThe CI scripts in ``.gitlab-ci/`` can be reused for other projects, to
342*61046927SAndroid Build Coastguard Workerfacilitate reuse of the infrastructure, our scripts can be used as tools
343*61046927SAndroid Build Coastguard Workerto create containers and run tests on the available farms.
344*61046927SAndroid Build Coastguard Worker
345*61046927SAndroid Build Coastguard Worker.. envvar:: EXTRA_LOCAL_PACKAGES
346*61046927SAndroid Build Coastguard Worker
347*61046927SAndroid Build Coastguard Worker   Define extra Debian packages to be installed in the container.
348