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