Add devices support on services

What does this MR do?

This MR is a continuation of !3560 (closed).

It adds support for the Docker executor to expose host devices to services. A new service_devices mapping in the runner config controls which devices are exposed to services based on the service images name.

Example: Expose /dev/kvm and /dev/dri to all images named "emulator" with any tag.

[runners.docker]
  [runners.docker.services_devices]
    "emulator:*" = ["/dev/kvm", "/dev/dri"]

I've updated this MR to the current state of main and integrated the review feedback from !3560 (closed) by @avonbertoldi including !3560 (comment 1188472177) and test-related requests (see below).

Why was this MR needed?

Services that require hardware resources have no access to the host and do not work. See !3560 (closed) for more details.

What's the best way to test this MR?

I have extended the test suite by unit tests (according to !3560 (comment 1188472187) & !3560 (comment 1188472190)) and an integration test (according to !3560 (comment 1198865781)).

What are the relevant issue numbers?

Close: #6208 (closed)

Edited by Sigurd Spieckermann

Merge request reports

Loading