From c70621735d71c9862c5c030bca7152d6bb9b829c Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Wed, 10 Jan 2024 15:53:53 +0530 Subject: [PATCH] Update the condition to set ulimit for VNC and noVNC Signed-off-by: Viet Nguyen Duc --- Makefile | 4 +++- NodeBase/start-novnc.sh | 13 +++++++++++++ NodeBase/start-vnc.sh | 7 ++++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 6bd98fb51..46522b156 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ BASE_RELEASE := $(or $(BASE_RELEASE),$(BASE_RELEASE),selenium-4.16.0) BASE_VERSION := $(or $(BASE_VERSION),$(BASE_VERSION),4.16.1) BASE_RELEASE_NIGHTLY := $(or $(BASE_RELEASE_NIGHTLY),$(BASE_RELEASE_NIGHTLY),nightly) BASE_VERSION_NIGHTLY := $(or $(BASE_VERSION_NIGHTLY),$(BASE_VERSION_NIGHTLY),4.17.0-SNAPSHOT) -VERSION := $(or $(VERSION),$(VERSION),$(BASE_VERSION)) +VERSION := $(or $(VERSION),$(VERSION),4.16.1) TAG_VERSION := $(VERSION)-$(BUILD_DATE) CHART_VERSION_NIGHTLY := $(or $(CHART_VERSION_NIGHTLY),$(CHART_VERSION_NIGHTLY),1.0.0-nightly) NAMESPACE := $(or $(NAMESPACE),$(NAMESPACE),$(NAME)) @@ -36,6 +36,8 @@ all: hub \ standalone_docker \ video +build_nightly: + BASE_VERSION=$(BASE_VERSION_NIGHTLY) BASE_RELEASE=$(BASE_RELEASE_NIGHTLY) make build build: all diff --git a/NodeBase/start-novnc.sh b/NodeBase/start-novnc.sh index 670815942..c3cb4efa6 100755 --- a/NodeBase/start-novnc.sh +++ b/NodeBase/start-novnc.sh @@ -5,6 +5,19 @@ if [ "${START_XVFB:-$SE_START_XVFB}" = true ] ; then if [ "${START_VNC:-$SE_START_VNC}" = true ] ; then if [ "${START_NO_VNC:-$SE_START_NO_VNC}" = true ] ; then + + # Guard against unreasonably high nofile limits. See https://github.com/SeleniumHQ/docker-selenium/issues/2045 + ULIMIT=${SE_VNC_ULIMIT:-100000} + if [[ ${ULIMIT} -ge 100000 ]]; then + echo "Trying to update the open file descriptor limit from $(ulimit -n) to ${ULIMIT}." + ulimit -Sv ${ULIMIT} + if [ $? -eq 0 ]; then + echo "Successfully update the open file descriptor limit." + else + echo "The open file descriptor limit could not be updated." + fi + fi + /opt/bin/noVNC/utils/novnc_proxy --listen ${NO_VNC_PORT:-$SE_NO_VNC_PORT} --vnc localhost:${VNC_PORT:-$SE_VNC_PORT} else echo "noVNC won't start because SE_START_NO_VNC is false." diff --git a/NodeBase/start-vnc.sh b/NodeBase/start-vnc.sh index b5cfe3459..c4419b0a1 100755 --- a/NodeBase/start-vnc.sh +++ b/NodeBase/start-vnc.sh @@ -45,9 +45,10 @@ if [ "${START_XVFB:-$SE_START_XVFB}" = true ] ; then done # Guard against unreasonably high nofile limits. See https://github.com/SeleniumHQ/docker-selenium/issues/2045 - if [[ $(ulimit -n) -gt 200000 || ! -z "${SE_VNC_ULIMIT}" ]]; then - echo "Trying to update the open file descriptor limit from $(ulimit -n) to ${SE_VNC_ULIMIT:-65536}." - ulimit -n ${SE_VNC_ULIMIT:-65536} + ULIMIT=${SE_VNC_ULIMIT:-100000} + if [[ ${ULIMIT} -ge 100000 ]]; then + echo "Trying to update the open file descriptor limit from $(ulimit -n) to ${ULIMIT}." + ulimit -Sv ${ULIMIT} if [ $? -eq 0 ]; then echo "Successfully update the open file descriptor limit." else