selkies-project / selkies-gstreamer

Open-Source Low-Latency Accelerated Linux WebRTC HTML5 Remote Desktop Streaming Platform for Self-Hosting, Containers, Kubernetes, or Cloud/HPC
https://selkies-project.github.io/selkies-gstreamer/
Mozilla Public License 2.0
375 stars 49 forks source link

Create base images #15

Closed danisla closed 7 months ago

danisla commented 2 years ago

To make this project easier to build on top of, create some base images for various use cases. The Dockerfile.example has many of the dependencies codified, but more purpose based images would be ideal.

Images Proposal

Base Images:

Example Images:

Entrypoint

It should be relatively simple for users to integrate the base image in their own projects.

The python app and all of it's dependencies (like pulseaudio) should run in the background.

Some options:

ehfd commented 2 years ago

I guess these two containers cover most of what is required for glx and vgl, and is intended to be used as a base containers for adding more applications in. DE was curated with MATE after testing the unintended side effects of Xfce and GNOME in a container, and each commit is assessed so that there are no unintended abnormalities introduced. It is currently widely used in industry and academic situations and issues are well addressed. https://github.com/ehfd/docker-nvidia-egl-desktop - can be used for AMD/Intel GPUs/software acceleration fallback, and has what the images/ubuntu/base and images/ubuntu/gpu container needs too dynamically. https://github.com/ehfd/docker-nvidia-glx-desktop However... I also need a co-maintainer to manage for a couple of years...

danisla commented 2 years ago

The goal of this repo is to be a multi-purpose streaming utility, not exclusive to the use case of full desktop environments. The glx and vgl images would not have any DE installed.

Do you have the side effects of Xfce and GNOME in a container documented somewhere, or would you be willing to help document them? It would be nice to show examples with multiple DEs and document their side-effects and tradeoffs. Ubuntu Mate is pretty heavy compared to other desktop environments which increases the image size significantly so I don't want that to be the only option.

I had considered making the software/gpu encoder dynamic in a single image, it's still a possibility. However the trade-off I'm making is image size. For full NVIDIA GPU support, this requires the CUDA toolkit, which is a very large dependency (~1GB). For those that don't need GPU, they can save a ton of space and image pull time by opting into a different image.

Maybe another base image would be an uber image that supports all encoders and detects the best encoder at startup time.

ehfd commented 2 years ago

Do you have the side effects of Xfce and GNOME in a container documented somewhere, or would you be willing to help document them? It would be nice to show examples with multiple DEs and document their side-effects and tradeoffs. Ubuntu Mate is pretty heavy compared to other desktop environments which increases the image size significantly, so I don't want that to be the only option.

Xfce is light if full desktop (xubuntu-desktop) is not installed. MATE is lighter in ubuntu-mate-desktop because the DE shares GTK+ libraries with utility packages whereas Xfce does not. For GNOME 3, lots of stuffs seem to be broken, where the largest issue is that it resizes the screen on its own to an incorrect resolution when there is no EDID. x11docker also does not support GNOME 3 confidently, which is another thing that showcases that GNOME inside a container is not trivial to implement with minimal configuration so far (I strongly advise against a GNOME base container in the current Xorg situation, maybe after Wayland is implemented).

I just left a link up there if anyone wants a full desktop environment, which requires assessing various utility packages for functionality.

ehfd commented 2 years ago

So far:

images/ubuntu/base: I polished it. But should add required packages including mesa's Vulkan and VA drivers for VAAPI in the future. images/ubuntu/gpu: This is basically the same thing as base except the base image should be cudagl. images/ubuntu/vgl: Install virtualgl, and use vglrun +wm to invoke the desktop environment. Same otherwise to gpu. images/ubuntu/glx: Now, this gets complicated. Should start from gpu and modify my entrypoint.sh.

images/examples/minimal-desktop: Xfce IS our minimal desktop right now. Combine with xfce-desktop. images/examples/gnome-desktop: This is buggy when a real monitor, and thus a real EDID, does not exist. Also, its reliance on systemd makes it extremely inadequate for containers.

LXDE, MATE, Xfce, LXQt, Lumina, Enlightenment, and some others are the only adequate DEs for containers.

GNOME and KDE will eventually be usable in Wayland, but I really don't recommend going for either now.

https://github.com/mviereck/x11docker#desktop-environments

ehfd commented 7 months ago

Closing this issue as docker-nvidia-glx-desktop and docker-nvidia-egl-desktop are now Selkies projects, and it's possible to integrate VirtualGL into the example container pretty easilly.