docker.rst revision 7ec681f3
17ec681f3SmrgDocker CI 27ec681f3Smrg========= 37ec681f3Smrg 47ec681f3SmrgFor llvmpipe and swrast CI, we run tests in a container containing 57ec681f3SmrgVK-GL-CTS, on the shared GitLab runners provided by `freedesktop 67ec681f3Smrg<http://freedesktop.org>`_ 77ec681f3Smrg 87ec681f3SmrgSoftware architecture 97ec681f3Smrg--------------------- 107ec681f3Smrg 117ec681f3SmrgThe Docker containers are rebuilt using the shell scripts under 127ec681f3Smrg.gitlab-ci/container/ when the FDO\_DISTRIBUTION\_TAG changes in 137ec681f3Smrg.gitlab-ci.yml. The resulting images are around 1 GB, and are 147ec681f3Smrgexpected to change approximately weekly (though an individual 157ec681f3Smrgdeveloper working on them may produce many more images while trying to 167ec681f3Smrgcome up with a working MR!). 177ec681f3Smrg 187ec681f3Smrggitlab-runner is a client that polls gitlab.freedesktop.org for 197ec681f3Smrgavailable jobs, with no inbound networking requirements. Jobs can 207ec681f3Smrghave tags, so we can have DUT-specific jobs that only run on runners 217ec681f3Smrgwith that tag marked in the GitLab UI. 227ec681f3Smrg 237ec681f3SmrgSince dEQP takes a long time to run, we mark the job as "parallel" at 247ec681f3Smrgsome level, which spawns multiple jobs from one definition, and then 257ec681f3Smrgdeqp-runner.sh takes the corresponding fraction of the test list for 267ec681f3Smrgthat job. 277ec681f3Smrg 287ec681f3SmrgTo reduce dEQP runtime (or avoid tests with unreliable results), a 297ec681f3Smrgdeqp-runner.sh invocation can provide a list of tests to skip. If 307ec681f3Smrgyour driver is not yet conformant, you can pass a list of expected 317ec681f3Smrgfailures, and the job will only fail on tests that aren't listed (look 327ec681f3Smrgat the job's log for which specific tests failed). 337ec681f3Smrg 347ec681f3SmrgDUT requirements 357ec681f3Smrg---------------- 367ec681f3Smrg 377ec681f3SmrgIn addition to the general :ref:`CI-farm-expectations`, using 387ec681f3SmrgDocker requires: 397ec681f3Smrg 407ec681f3Smrg* DUTs must have a stable kernel and GPU reset (if applicable). 417ec681f3Smrg 427ec681f3SmrgIf the system goes down during a test run, that job will eventually 437ec681f3Smrgtime out and fail (default 1 hour). However, if the kernel can't 447ec681f3Smrgreliably reset the GPU on failure, bugs in one MR may leak into 457ec681f3Smrgspurious failures in another MR. This would be an unacceptable impact 467ec681f3Smrgon Mesa developers working on other drivers. 477ec681f3Smrg 487ec681f3Smrg* DUTs must be able to run Docker 497ec681f3Smrg 507ec681f3SmrgThe Mesa gitlab-runner based test architecture is built around Docker, 517ec681f3Smrgso that we can cache the Debian package installation and CTS build 527ec681f3Smrgstep across multiple test runs. Since the images are large and change 537ec681f3Smrgapproximately weekly, the DUTs also need to be running some script to 547ec681f3Smrgprune stale Docker images periodically in order to not run out of disk 557ec681f3Smrgspace as we rev those containers (perhaps `this script 567ec681f3Smrg<https://gitlab.com/gitlab-org/gitlab-runner/issues/2980#note_169233611>`_). 577ec681f3Smrg 587ec681f3SmrgNote that Docker doesn't allow containers to be stored on NFS, and 597ec681f3Smrgdoesn't allow multiple Docker daemons to interact with the same 607ec681f3Smrgnetwork block device, so you will probably need some sort of physical 617ec681f3Smrgstorage on your DUTs. 627ec681f3Smrg 637ec681f3Smrg* DUTs must be public 647ec681f3Smrg 657ec681f3SmrgBy including your device in .gitlab-ci.yml, you're effectively letting 667ec681f3Smrganyone on the internet run code on your device. Docker containers may 677ec681f3Smrgprovide some limited protection, but how much you trust that and what 687ec681f3Smrgyou do to mitigate hostile access is up to you. 697ec681f3Smrg 707ec681f3Smrg* DUTs must expose the dri device nodes to the containers. 717ec681f3Smrg 727ec681f3SmrgObviously, to get access to the HW, we need to pass the render node 737ec681f3Smrgthrough. This is done by adding ``devices = ["/dev/dri"]`` to the 747ec681f3Smrg``runners.docker`` section of /etc/gitlab-runner/config.toml. 75