RFC: Explicitly passing device nodes to docker-shell container
This is split off from !1394 (closed).
Context: when using dockerized LAVA setup (https://git.lavasoftware.org/lava/pkg/docker-compose), and wanting to perform operations on LAVA device's /dev nodes in the container, these /dev nodes may be not readily/automagically availble.
Further info: Currently, LAVA device's /dev nodes get "shared" with a docker-shell container using self.trigger_share_device_with_container() call, which does some udev-related magic. This seems to assume: a) there's a forwarding mechanism of udev events between "host" and container; b) container runs udev, so these forwarded events will be processed (effectively replayed from host to container) and devices in the container created.
As we talk about "LAVA itself in a container", point a) above may be hard/unobvious. But point b) is not achievable in general case at all - there're plenty of docker images which don't have udev included. And it's one thing to say "docker-shell can use arbitrary docker image to perform arbitrary device operations" and "docker-shell may require adhocly prepared docker image to perform some operations". Let's shoot for the first option to still be available to people.
And then, we can't rely on some additional udev machinery to create needed device node in the container. Instead, we should share them explicitly. And Docker has native means to do that -
--device flag. This ticket is dedicated to discussing means to implement such a feature (selectable by a user, keeping the "udev" option available, and likely still the default).