xref: /aosp_15_r20/external/mesa3d/docs/ci/docker.rst (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1*61046927SAndroid Build Coastguard WorkerDocker CI
2*61046927SAndroid Build Coastguard Worker=========
3*61046927SAndroid Build Coastguard Worker
4*61046927SAndroid Build Coastguard WorkerFor LLVMpipe and Softpipe CI, we run tests in a container containing
5*61046927SAndroid Build Coastguard WorkerVK-GL-CTS, on the shared GitLab runners provided by `freedesktop
6*61046927SAndroid Build Coastguard Worker<https://www.freedesktop.org>`__
7*61046927SAndroid Build Coastguard Worker
8*61046927SAndroid Build Coastguard WorkerSoftware architecture
9*61046927SAndroid Build Coastguard Worker---------------------
10*61046927SAndroid Build Coastguard Worker
11*61046927SAndroid Build Coastguard WorkerThe Docker containers are rebuilt using the shell scripts under
12*61046927SAndroid Build Coastguard Worker.gitlab-ci/container/ when the FDO\_DISTRIBUTION\_TAG changes in
13*61046927SAndroid Build Coastguard Worker.gitlab-ci.yml. The resulting images are around 1 GB, and are
14*61046927SAndroid Build Coastguard Workerexpected to change approximately weekly (though an individual
15*61046927SAndroid Build Coastguard Workerdeveloper working on them may produce many more images while trying to
16*61046927SAndroid Build Coastguard Workercome up with a working MR!).
17*61046927SAndroid Build Coastguard Worker
18*61046927SAndroid Build Coastguard Workergitlab-runner is a client that polls gitlab.freedesktop.org for
19*61046927SAndroid Build Coastguard Workeravailable jobs, with no inbound networking requirements.  Jobs can
20*61046927SAndroid Build Coastguard Workerhave tags, so we can have DUT-specific jobs that only run on runners
21*61046927SAndroid Build Coastguard Workerwith that tag marked in the GitLab UI.
22*61046927SAndroid Build Coastguard Worker
23*61046927SAndroid Build Coastguard WorkerSince dEQP takes a long time to run, we mark the job as "parallel" at
24*61046927SAndroid Build Coastguard Workersome level, which spawns multiple jobs from one definition, and then
25*61046927SAndroid Build Coastguard Workerdeqp-runner.sh takes the corresponding fraction of the test list for
26*61046927SAndroid Build Coastguard Workerthat job.
27*61046927SAndroid Build Coastguard Worker
28*61046927SAndroid Build Coastguard WorkerTo reduce dEQP runtime (or avoid tests with unreliable results), a
29*61046927SAndroid Build Coastguard Workerdeqp-runner.sh invocation can provide a list of tests to skip.  If
30*61046927SAndroid Build Coastguard Workeryour driver is not yet conformant, you can pass a list of expected
31*61046927SAndroid Build Coastguard Workerfailures, and the job will only fail on tests that aren't listed (look
32*61046927SAndroid Build Coastguard Workerat the job's log for which specific tests failed).
33*61046927SAndroid Build Coastguard Worker
34*61046927SAndroid Build Coastguard WorkerDUT requirements
35*61046927SAndroid Build Coastguard Worker----------------
36*61046927SAndroid Build Coastguard Worker
37*61046927SAndroid Build Coastguard WorkerIn addition to the general :ref:`CI-job-user-expectations`, using
38*61046927SAndroid Build Coastguard WorkerDocker requires:
39*61046927SAndroid Build Coastguard Worker
40*61046927SAndroid Build Coastguard Worker* DUTs must have a stable kernel and GPU reset (if applicable).
41*61046927SAndroid Build Coastguard Worker
42*61046927SAndroid Build Coastguard WorkerIf the system goes down during a test run, that job will eventually
43*61046927SAndroid Build Coastguard Workertime out and fail (default 1 hour).  However, if the kernel can't
44*61046927SAndroid Build Coastguard Workerreliably reset the GPU on failure, bugs in one MR may leak into
45*61046927SAndroid Build Coastguard Workerspurious failures in another MR.  This would be an unacceptable impact
46*61046927SAndroid Build Coastguard Workeron Mesa developers working on other drivers.
47*61046927SAndroid Build Coastguard Worker
48*61046927SAndroid Build Coastguard Worker* DUTs must be able to run Docker
49*61046927SAndroid Build Coastguard Worker
50*61046927SAndroid Build Coastguard WorkerThe Mesa gitlab-runner based test architecture is built around Docker,
51*61046927SAndroid Build Coastguard Workerso that we can cache the Debian package installation and CTS build
52*61046927SAndroid Build Coastguard Workerstep across multiple test runs.  Since the images are large and change
53*61046927SAndroid Build Coastguard Workerapproximately weekly, the DUTs also need to be running some script to
54*61046927SAndroid Build Coastguard Workerprune stale Docker images periodically in order to not run out of disk
55*61046927SAndroid Build Coastguard Workerspace as we rev those containers (perhaps `this script
56*61046927SAndroid Build Coastguard Worker<https://gitlab.com/gitlab-org/gitlab-runner/-/issues/2980#note_169233611>`__).
57*61046927SAndroid Build Coastguard Worker
58*61046927SAndroid Build Coastguard WorkerNote that Docker doesn't allow containers to be stored on NFS, and
59*61046927SAndroid Build Coastguard Workerdoesn't allow multiple Docker daemons to interact with the same
60*61046927SAndroid Build Coastguard Workernetwork block device, so you will probably need some sort of physical
61*61046927SAndroid Build Coastguard Workerstorage on your DUTs.
62*61046927SAndroid Build Coastguard Worker
63*61046927SAndroid Build Coastguard Worker* DUTs must be public
64*61046927SAndroid Build Coastguard Worker
65*61046927SAndroid Build Coastguard WorkerBy including your device in .gitlab-ci.yml, you're effectively letting
66*61046927SAndroid Build Coastguard Workeranyone on the internet run code on your device.  Docker containers may
67*61046927SAndroid Build Coastguard Workerprovide some limited protection, but how much you trust that and what
68*61046927SAndroid Build Coastguard Workeryou do to mitigate hostile access is up to you.
69*61046927SAndroid Build Coastguard Worker
70*61046927SAndroid Build Coastguard Worker* DUTs must expose the DRI device nodes to the containers.
71*61046927SAndroid Build Coastguard Worker
72*61046927SAndroid Build Coastguard WorkerObviously, to get access to the HW, we need to pass the render node
73*61046927SAndroid Build Coastguard Workerthrough.  This is done by adding ``devices = ["/dev/dri"]`` to the
74*61046927SAndroid Build Coastguard Worker``runners.docker`` section of /etc/gitlab-runner/config.toml.
75