From 67d49397d75018dceba370f8f5282b53b063913a Mon Sep 17 00:00:00 2001 From: Seungmin Kim <8457324+ehfd@users.noreply.github.com> Date: Fri, 5 Jul 2024 19:53:29 +0900 Subject: [PATCH] Control KasmVNC threads --- README.md | 2 +- docker-compose.yml | 2 ++ kasmvnc-entrypoint.sh | 1 + xgl.yml | 3 +++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ed505d9..811c0db 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ The default username is `ubuntu` for both the web authentication prompt and the There are two web interfaces that may be chosen in this container, the first being the default [Selkies-GStreamer](https://github.com/selkies-project/selkies-gstreamer) WebRTC HTML5 web interface (requires a TURN server or host networking for best performance), and the second being the fallback [KasmVNC](https://github.com/kasmtech/KasmVNC) WebSocket HTML5 web interface. While the KasmVNC interface does not support audio forwarding, it can be useful for troubleshooting the Selkies-GStreamer WebRTC interface or using this container in constrained environments. -The KasmVNC interface can be enabled in place of Selkies-GStreamer by setting `KASMVNC_ENABLE` to `true`. When using the KasmVNC interface, environment variables `SELKIES_ENABLE_BASIC_AUTH`, `SELKIES_BASIC_AUTH_USER`, `SELKIES_BASIC_AUTH_PASSWORD`, `SELKIES_ENABLE_RESIZE`, `SELKIES_ENABLE_HTTPS`, `SELKIES_HTTPS_CERT`, and `SELKIES_HTTPS_KEY`, used with Selkies-GStreamer, are also inherited. As with the Selkies-GStreamer WebRTC interface, the KasmVNC interface username and password will also be set to the environment variables `SELKIES_BASIC_AUTH_USER` and `SELKIES_BASIC_AUTH_PASSWORD`, also using `ubuntu` and the environment variable `PASSWD` by default if not set. +The KasmVNC interface can be enabled in place of Selkies-GStreamer by setting `KASMVNC_ENABLE` to `true`. `KASMVNC_THREADS` dictate how many threads it should use for frame encoding, defaulting to all frames when unset. When using the KasmVNC interface, environment variables `SELKIES_ENABLE_BASIC_AUTH`, `SELKIES_BASIC_AUTH_USER`, `SELKIES_BASIC_AUTH_PASSWORD`, `SELKIES_ENABLE_RESIZE`, `SELKIES_ENABLE_HTTPS`, `SELKIES_HTTPS_CERT`, and `SELKIES_HTTPS_KEY`, used with Selkies-GStreamer, are also inherited. As with the Selkies-GStreamer WebRTC interface, the KasmVNC interface username and password will also be set to the environment variables `SELKIES_BASIC_AUTH_USER` and `SELKIES_BASIC_AUTH_PASSWORD`, also using `ubuntu` and the environment variable `PASSWD` by default if not set. ### Running with Docker diff --git a/docker-compose.yml b/docker-compose.yml index f9155ed..1b4ba43 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,6 +36,8 @@ services: # Uncomment to enable KasmVNC instead of Selkies-GStreamer, `SELKIES_BASIC_AUTH_PASSWORD` is used for authentication with KasmVNC, defaulting to `PASSWD` if not provided # Uses: `SELKIES_ENABLE_BASIC_AUTH`, `SELKIES_BASIC_AUTH_USER`, `SELKIES_BASIC_AUTH_PASSWORD`, `SELKIES_ENABLE_RESIZE`, `SELKIES_ENABLE_HTTPS`, `SELKIES_HTTPS_CERT`, `SELKIES_HTTPS_KEY` # - KASMVNC_ENABLE=true + # Number of threads for encoding frames with KasmVNC, default value is all threads +# - name: KASMVNC_THREADS=auto ### # Selkies-GStreamer parameters, for additional configurations see `selkies-gstreamer --help` ### diff --git a/kasmvnc-entrypoint.sh b/kasmvnc-entrypoint.sh index 5c65c0f..266996d 100644 --- a/kasmvnc-entrypoint.sh +++ b/kasmvnc-entrypoint.sh @@ -26,6 +26,7 @@ yq -i " .desktop.resolution.height = ${DISPLAY_SIZEH} | .desktop.allow_resize = $(echo ${SELKIES_ENABLE_RESIZE-false} | tr '[:upper:]' '[:lower:]') | .desktop.pixel_depth = ${DISPLAY_CDEPTH} | +.encoding.rect_encoding_mode.rectangle_compress_threads = ${KASMVNC_THREADS-auto} | .network.interface = \"127.0.0.1\" | .network.websocket_port = 8082 | .network.ssl.require_ssl = $(echo ${SELKIES_ENABLE_HTTPS-false} | tr '[:upper:]' '[:lower:]') | diff --git a/xgl.yml b/xgl.yml index 9374b8e..a8006be 100644 --- a/xgl.yml +++ b/xgl.yml @@ -50,6 +50,9 @@ spec: # Uses: `SELKIES_ENABLE_BASIC_AUTH`, `SELKIES_BASIC_AUTH_USER`, `SELKIES_BASIC_AUTH_PASSWORD`, `SELKIES_ENABLE_RESIZE`, `SELKIES_ENABLE_HTTPS`, `SELKIES_HTTPS_CERT`, `SELKIES_HTTPS_KEY` # - name: KASMVNC_ENABLE # value: "true" + # Number of threads for encoding frames with KasmVNC, default value is all threads +# - name: KASMVNC_THREADS +# value: "auto" ### # Selkies-GStreamer parameters, for additional configurations see `selkies-gstreamer --help` ###