diff --git a/Makefile b/Makefile index 0fb702c8c..7aa13cf9c 100644 --- a/Makefile +++ b/Makefile @@ -2,11 +2,11 @@ NAME := $(or $(NAME),$(NAME),selenium) CURRENT_DATE := $(shell date '+%Y%m%d') BUILD_DATE := $(or $(BUILD_DATE),$(BUILD_DATE),$(CURRENT_DATE)) BASE_RELEASE := $(or $(BASE_RELEASE),$(BASE_RELEASE),selenium-4.23.0) -BASE_VERSION := $(or $(BASE_VERSION),$(BASE_VERSION),4.23.0) -BINDING_VERSION := $(or $(BINDING_VERSION),$(BINDING_VERSION),4.23.0) +BASE_VERSION := $(or $(BASE_VERSION),$(BASE_VERSION),4.23.1) +BINDING_VERSION := $(or $(BINDING_VERSION),$(BINDING_VERSION),4.23.1) BASE_RELEASE_NIGHTLY := $(or $(BASE_RELEASE_NIGHTLY),$(BASE_RELEASE_NIGHTLY),nightly) BASE_VERSION_NIGHTLY := $(or $(BASE_VERSION_NIGHTLY),$(BASE_VERSION_NIGHTLY),4.24.0-SNAPSHOT) -VERSION := $(or $(VERSION),$(VERSION),4.23.0) +VERSION := $(or $(VERSION),$(VERSION),4.23.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)) @@ -67,10 +67,12 @@ build: all ci: build test -base: +gen_certs: rm -rf ./Base/configs/node && mkdir -p ./Base/configs/node && cp -r ./charts/selenium-grid/configs/node ./Base/configs rm -rf ./Base/certs && cp -r ./charts/selenium-grid/certs ./Base ./Base/certs/gen-cert-helper.sh -d ./Base/certs + +base: gen_certs cd ./Base && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg VERSION=$(BASE_VERSION) --build-arg RELEASE=$(BASE_RELEASE) --build-arg AUTHORS=$(AUTHORS) -t $(NAME)/base:$(TAG_VERSION) . base_nightly: diff --git a/NodeDocker/Dockerfile b/NodeDocker/Dockerfile index 7afea04fd..0a069abcd 100644 --- a/NodeDocker/Dockerfile +++ b/NodeDocker/Dockerfile @@ -22,10 +22,11 @@ USER ${SEL_UID} EXPOSE 4444 COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-docker.sh \ - config.toml \ start-socat.sh \ /opt/bin/ +COPY --chown="${SEL_UID}:${SEL_GID}" config.toml /opt/selenium/ + COPY selenium-grid-docker.conf /etc/supervisor/conf.d/ ENV SE_OTEL_SERVICE_NAME="selenium-node-docker" diff --git a/NodeDocker/start-selenium-grid-docker.sh b/NodeDocker/start-selenium-grid-docker.sh index 46e829cee..ac03474a0 100755 --- a/NodeDocker/start-selenium-grid-docker.sh +++ b/NodeDocker/start-selenium-grid-docker.sh @@ -106,5 +106,5 @@ java ${JAVA_OPTS:-$SE_JAVA_OPTS} \ --subscribe-events tcp://"${SE_EVENT_BUS_HOST}":${SE_EVENT_BUS_SUBSCRIBE_PORT} \ --bind-host ${SE_BIND_HOST} \ --detect-drivers false \ - --config /opt/selenium/config.toml \ + --config /opt/selenium/${SE_NODE_DOCKER_CONFIG_FILENAME:-"config.toml"} \ ${SE_GRID_URL} ${SE_OPTS} diff --git a/README.md b/README.md index fbb035fa9..115a833f3 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ Talk to us at https://www.selenium.dev/support/ * [Video recording and uploading](#video-recording-and-uploading) * [Dynamic Grid](#dynamic-grid) * [Configuration example](#configuration-example) + * [Share volumes config of Dynamic Grid container to node browser containers](#share-volumes-config-of-dynamic-grid-container-to-node-browser-containers) * [Execution with Hub & Node roles](#execution-with-hub--node-roles) * [Execution with Standalone roles](#execution-with-standalone-roles) * [Using Dynamic Grid in different machines/VMs](#using-dynamic-grid-in-different-machinesvms) @@ -745,6 +746,36 @@ With the optional config key `host-config-keys` under section [docker] in a conf Valid key names for Docker host config can be found in the Docker API [documentation](https://docs.docker.com/engine/api/latest/#tag/Container/operation/ContainerCreate) or via the command `docker inspect` the node-docker container. +### Share volumes config of Dynamic Grid container to node browser containers + +In case you want to access download directory in node browser containers (e.g `/home/seluser/Downloads`) via volumes config of Dynamic Grid container, you can add the following config to the `config.toml` file + +```toml +[docker] +host-config-keys = ["Binds"] +``` + +Volumes config in docker compose file + +```dockerfile +services: + node-docker: + image: selenium/node-docker:latest + volumes: + - ./assets:/opt/selenium/assets + - ./config.toml:/opt/selenium/docker.toml + - ./downloads:/home/seluser/Downloads + - /var/run/docker.sock:/var/run/docker.sock + environment: + - SE_NODE_DOCKER_CONFIG_FILENAME=docker.toml +``` + +`/opt/selenium/config.toml` is the default path for the config file in all images. Once volumes config is shared to node browser containers, its `config.toml` could be overwritten by node-docker container config file. + +In this case, mount your `config.toml` file to `/opt/selenium/docker.toml` in node-docker container. And set the environment variable `SE_NODE_DOCKER_CONFIG_FILENAME=docker.toml` to specify that config file name for the startup script. + +Refer to example [docker-compose-v3-test-node-docker.yaml](./tests/docker-compose-v3-test-node-docker.yaml) + ### Execution with Hub & Node roles This can be expanded to a full Grid deployment, all components deployed individually. The overall diff --git a/tests/SeleniumTests/__init__.py b/tests/SeleniumTests/__init__.py index 5869dde03..fc839d55e 100644 --- a/tests/SeleniumTests/__init__.py +++ b/tests/SeleniumTests/__init__.py @@ -142,6 +142,8 @@ def setUp(self): options.set_capability('appium:adbExecTimeout', 120000) options.set_capability('appium:uiautomator2ServerInstallTimeout', 120000) options.set_capability('appium:appWaitDuration', 120000) + options.set_capability('appium:suppressKillServer', True) + options.set_capability('appium:allowDelayAdb', False) else: options.set_capability('platformName', 'Linux') start_time = time.time() diff --git a/tests/docker-compose-v3-test-node-docker.yaml b/tests/docker-compose-v3-test-node-docker.yaml index ca6776db7..a06a3afed 100644 --- a/tests/docker-compose-v3-test-node-docker.yaml +++ b/tests/docker-compose-v3-test-node-docker.yaml @@ -4,7 +4,7 @@ services: image: ${NAMESPACE}/node-docker:${TAG} volumes: - ./videos:/opt/selenium/assets - - ./videos/config.toml:/opt/selenium/config.toml + - ./videos/config.toml:/opt/selenium/docker.toml - /var/run/docker.sock:/var/run/docker.sock - ./videos/Downloads:/home/seluser/Downloads dns: @@ -16,6 +16,7 @@ services: depends_on: - selenium-hub environment: + - SE_NODE_DOCKER_CONFIG_FILENAME=docker.toml - SE_EVENT_BUS_HOST=selenium-hub - SE_EVENT_BUS_PUBLISH_PORT=4442 - SE_EVENT_BUS_SUBSCRIBE_PORT=4443