From 93de6e883189231592149edfd226c64048f97640 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Fri, 8 Dec 2023 08:53:59 +0530 Subject: [PATCH 01/62] Update to Selenium 4.16.1 Signed-off-by: Viet Nguyen Duc --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 874a9b89b..8209db4c3 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,8 @@ NAME := $(or $(NAME),$(NAME),selenium) CURRENT_DATE := $(shell date '+%Y%m%d') BUILD_DATE := $(or $(BUILD_DATE),$(BUILD_DATE),$(CURRENT_DATE)) VERSION := $(or $(VERSION),$(VERSION),4.16.0) -BASE_VERSION := $(or $(BASE_VERSION),$(BASE_VERSION),4.16.0) -BASE_RELEASE := $(or $(BASE_RELEASE),$(BASE_RELEASE),selenium-$(BASE_VERSION)) +BASE_VERSION := $(or $(BASE_VERSION),$(BASE_VERSION),4.16.1) +BASE_RELEASE := $(or $(BASE_RELEASE),$(BASE_RELEASE),selenium-4.16.0) TAG_VERSION := $(VERSION)-$(BUILD_DATE) NAMESPACE := $(or $(NAMESPACE),$(NAMESPACE),$(NAME)) AUTHORS := $(or $(AUTHORS),$(AUTHORS),SeleniumHQ) From 3e191811006a80f292d07dfd52a9f69746abcc38 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Fri, 8 Dec 2023 17:13:43 +0700 Subject: [PATCH 02/62] feat(chart): Append subPath to ENV variable SE_NODE_GRID_URL (#2053) Signed-off-by: Viet Nguyen Duc --- charts/selenium-grid/templates/_helpers.tpl | 10 +++++++++ .../templates/node-configmap.yaml | 2 +- tests/charts/templates/render/dummy.yaml | 3 +++ tests/charts/templates/test.py | 22 +++++++++++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index 9e44267d9..48c18bb95 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -346,6 +346,16 @@ http://{{- if eq .Values.basicAuth.enabled true}}{{ .Values.basicAuth.username}} {{- end }} {{- end -}} +{{- define "seleniumGrid.url.subPath" -}} +{{- $subPath := "/" -}} +{{ if $.Values.isolateComponents }} + {{- $subPath = default $subPath $.Values.components.subPath -}} +{{- else -}} + {{- $subPath = default $subPath $.Values.hub.subPath -}} +{{- end -}} +{{ $subPath }} +{{- end -}} + {{/* Graphql Url of the hub or the router */}} diff --git a/charts/selenium-grid/templates/node-configmap.yaml b/charts/selenium-grid/templates/node-configmap.yaml index da4edab40..52e447d63 100644 --- a/charts/selenium-grid/templates/node-configmap.yaml +++ b/charts/selenium-grid/templates/node-configmap.yaml @@ -13,4 +13,4 @@ metadata: {{- end }} data: SE_DRAIN_AFTER_SESSION_COUNT: '{{- and (eq (include "seleniumGrid.useKEDA" .) "true") (eq .Values.autoscaling.scalingType "job") | ternary "1" "0" -}}' - SE_NODE_GRID_URL: '{{ include "seleniumGrid.url" .}}' + SE_NODE_GRID_URL: '{{ include "seleniumGrid.url" .}}{{ include "seleniumGrid.url.subPath" .}}' diff --git a/tests/charts/templates/render/dummy.yaml b/tests/charts/templates/render/dummy.yaml index 19ca7d6d9..52d672a8a 100644 --- a/tests/charts/templates/render/dummy.yaml +++ b/tests/charts/templates/render/dummy.yaml @@ -42,6 +42,9 @@ ingress: isolateComponents: true +components: + subPath: *gridAppRoot + chromeNode: affinity: *affinity diff --git a/tests/charts/templates/test.py b/tests/charts/templates/test.py index 1e751f4e3..f05c7629d 100644 --- a/tests/charts/templates/test.py +++ b/tests/charts/templates/test.py @@ -45,6 +45,28 @@ def test_ingress_nginx_annotations(self): count += 1 self.assertEqual(count, len(resources_name), "No ingress resources found") + def test_sub_path_append_to_node_grid_url(self): + resources_name = ['selenium-node-config'] + count = 0 + for doc in LIST_OF_DOCUMENTS: + if doc['metadata']['name'] in resources_name and doc['kind'] == 'ConfigMap': + logger.info(f"Assert subPath is appended to node grid url") + self.assertTrue(doc['data']['SE_NODE_GRID_URL'] == 'http://admin:admin@selenium-router.default:4444/selenium') + count += 1 + self.assertEqual(count, len(resources_name), "No node config resources found") + + def test_sub_path_set_to_grid_env_var(self): + resources_name = ['selenium-router'] + is_present = False + for doc in LIST_OF_DOCUMENTS: + if doc['metadata']['name'] in resources_name and doc['kind'] == 'Deployment': + logger.info(f"Assert subPath is set to grid ENV variable") + list_env = doc['spec']['template']['spec']['containers'][0]['env'] + for env in list_env: + if env['name'] == 'SE_SUB_PATH' and env['value'] == '/selenium': + is_present = True + self.assertTrue(is_present, "ENV variable SE_SUB_PATH is not populated") + if __name__ == '__main__': failed = False try: From 772d59204949dffa32dde5c9efcd31e8e3868d06 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Fri, 8 Dec 2023 20:15:50 +0700 Subject: [PATCH 03/62] Add script to generate chart CHANGELOG after released (#2054) Signed-off-by: Viet Nguyen Duc --- .github/workflows/helm-chart-release.yml | 15 +++++ charts/selenium-grid/CHANGELOG.md | 19 +++++- generate_chart_changelog.sh | 85 ++++++++++++++++++++++++ update_tag_in_docs_and_files.sh | 4 +- 4 files changed, 119 insertions(+), 4 deletions(-) create mode 100755 generate_chart_changelog.sh diff --git a/.github/workflows/helm-chart-release.yml b/.github/workflows/helm-chart-release.yml index 252ca1840..5d3ee3f2b 100644 --- a/.github/workflows/helm-chart-release.yml +++ b/.github/workflows/helm-chart-release.yml @@ -27,3 +27,18 @@ jobs: uses: helm/chart-releaser-action@v1.6.0 env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + + - name: Update chart CHANGELOG + run: ./generate_chart_changelog.sh + + - name: Commit files + run: | + git config --local user.email "selenium-ci@users.noreply.github.com" + git config --local user.name "Selenium CI Bot" + git commit -m "Update chart CHANGELOG [skip ci]" -a + + - name: Push changes + uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # master + with: + github_token: ${{ secrets.SELENIUM_CI_TOKEN }} + branch: trunk diff --git a/charts/selenium-grid/CHANGELOG.md b/charts/selenium-grid/CHANGELOG.md index 4f3e5f405..2642b79eb 100644 --- a/charts/selenium-grid/CHANGELOG.md +++ b/charts/selenium-grid/CHANGELOG.md @@ -1,6 +1,21 @@ -# Change Log +## :heavy_check_mark: selenium-grid-0.26.0 -All notable changes to this helm chart will be documented in this file. +- Chart is using image tag 4.16.0-20231206 + +### Added +- feat(chart): Add default annotations for ingress nginx controller (#2047) :: Viet Nguyen Duc +- feat: Video image with based FFmpeg-6.1 on Ubuntu-22.04 (#2042) :: Viet Nguyen Duc + +### Fixed +- bug(#1824): Container ENV SE_NODE_SESSION_TIMEOUT not take effect (#2044) :: Viet Nguyen Duc +- bug(#2038): Rollback io.opentelemetry 1.31.0 - add test tracing enabled (#2040) :: Viet Nguyen Duc + +### Changed +- Update tag in docs and files :: Selenium CI Bot +- Update chart CHANGELOG [skip ci] :: Viet Nguyen Duc +- test(chart): Parallel tests execution against autoscaling in Kubernetes (#2046) :: Viet Nguyen Duc +- test(chart): Chart template render and assert output (#2043) :: Viet Nguyen Duc +- test(chart): Add test for setting registry to pull images (#2036) :: Viet Nguyen Duc ## :heavy_check_mark: 0.25.3 diff --git a/generate_chart_changelog.sh b/generate_chart_changelog.sh new file mode 100755 index 000000000..4afaedfb6 --- /dev/null +++ b/generate_chart_changelog.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +# Specify the output file for the CHANGELOG +CHART_DIR="./charts/selenium-grid" +CHANGELOG_FILE="./charts/selenium-grid/CHANGELOG.md" +TAG_PATTERN="selenium-grid" + +# Get current chart app version +CHART_APP_VERSION=$(find . \( -type d -name .git -prune \) -o -type f -name 'Chart.yaml' -print0 | xargs -0 cat | grep ^appVersion | cut -d ':' -f 2 | tr -d '[:space:]') + +# Generate the changelog +generate_changelog() { + # Get a list of tags sorted by commit date + tags=($(git tag --sort=committerdate | grep "^$TAG_PATTERN")) + tags_size=${#tags[@]} + + # Check if there are tags + if [ ${#tags[@]} -eq 0 ]; then + commit_range="HEAD" + elif [ ${#tags[@]} -eq 1 ]; then + previous_tag="${tags[$tags_size-1]}" + current_tag="HEAD" + commit_range="${previous_tag}..${current_tag}" + else + previous_tag="${tags[$tags_size-2]}" + current_tag="${tags[$tags_size-1]}" + commit_range="${previous_tag}..${current_tag}" + fi + + # Get the changes for each section (Added, Removed, Fixed, Changed) + image_tag_changes=$(echo "Chart is using image tag $CHART_APP_VERSION" | sed -e 's/^/- /') + added_changes=$(git log --pretty=format:"%s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iE "^feat|^add" | sed -e 's/^/- /') + removed_changes=$(git log --pretty=format:"%s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iE "^remove|^deprecate|^delete" | sed -e 's/^/- /') + fixed_changes=$(git log --pretty=format:"%s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iE "^fix|^bug" | sed -e 's/^/- /') + changed_changes=$(git log --pretty=format:"%s :: %an" "$commit_range" -- "$CHART_DIR" | grep -iEv "^feat|^add|^remove|^deprecate|^delete|^fix|^bug" | sed -e 's/^/- /') + + if [[ $(cat $CHANGELOG_FILE) == *"${current_tag}"* ]]; then + echo "Changelog already generated for ${current_tag}" + exit 0 + fi + + # Create a temporary file + temp_file=$(mktemp) + + # Write to the temporary file + echo "## :heavy_check_mark: ${current_tag}" >> "$temp_file" + echo "" >> "$temp_file" + echo "$image_tag_changes" >> "$temp_file" + echo "" >> "$temp_file" + + if [ -n "$added_changes" ]; then + echo "### Added" >> "$temp_file" + echo "$added_changes" >> "$temp_file" + echo "" >> "$temp_file" + fi + + if [ -n "$removed_changes" ]; then + echo "### Removed" >> "$temp_file" + echo "$removed_changes" >> "$temp_file" + echo "" >> "$temp_file" + fi + + if [ -n "$fixed_changes" ]; then + echo "### Fixed" >> "$temp_file" + echo "$fixed_changes" >> "$temp_file" + echo "" >> "$temp_file" + fi + + if [ -n "$changed_changes" ]; then + echo "### Changed" >> "$temp_file" + echo "$changed_changes" >> "$temp_file" + echo "" >> "$temp_file" + fi + + # Append the existing content of CHANGELOG to the temporary file + cat "$CHANGELOG_FILE" >> "$temp_file" + + # Overwrite CHANGELOG with the content of the temporary file + mv "$temp_file" "$CHANGELOG_FILE" +} + +# Run the function to generate the changelog +generate_changelog + +echo "Changelog generated successfully at $CHANGELOG_FILE" diff --git a/update_tag_in_docs_and_files.sh b/update_tag_in_docs_and_files.sh index 3783f30f5..135b06b1a 100755 --- a/update_tag_in_docs_and_files.sh +++ b/update_tag_in_docs_and_files.sh @@ -11,14 +11,14 @@ echo -e "\033[0;32m LATEST_TAG -> ${LATEST_TAG}\033[0m" echo -e "\033[0;32m NEXT_TAG -> ${NEXT_TAG}\033[0m" # If you want to test this locally and you are using macOS, do `brew install gnu-sed` and change `sed` for `gsed`. -find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s/${LATEST_TAG}/${NEXT_TAG}/g" +find . \( -type d -name .git -prune \) -o -type f ! -name 'CHANGELOG.md' -print0 | xargs -0 sed -i "s/${LATEST_TAG}/${NEXT_TAG}/g" echo -e "\033[0;32m Updating date used in some docs and files...\033[0m" echo -e "\033[0;32m LATEST_DATE -> ${LATEST_DATE}\033[0m" echo -e "\033[0;32m NEXT_DATE -> ${NEXT_DATE}\033[0m" # If you want to test this locally and you are using macOS, do `brew install gnu-sed` and change `sed` for `gsed`. -find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i "s/${LATEST_DATE}/${NEXT_DATE}/g" +find . \( -type d -name .git -prune \) -o -type f ! -name 'CHANGELOG.md' -print0 | xargs -0 sed -i "s/${LATEST_DATE}/${NEXT_DATE}/g" # Bump chart version and appVersion if next tag is different if [ "$latest_chart_app_version" == $LATEST_TAG ] && [ "$latest_chart_app_version" != "$NEXT_TAG" ]; then From 0b663b30c1fb8db2ec8b42aed84012debdc71e1b Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Fri, 8 Dec 2023 23:17:18 +0700 Subject: [PATCH 04/62] Update to Selenium 4.16.1 [deploy] (#2055) --- Makefile | 2 +- tests/SeleniumTests/__init__.py | 34 +++++++++++++++++++++------------ 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 8209db4c3..5df2eb27e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ NAME := $(or $(NAME),$(NAME),selenium) CURRENT_DATE := $(shell date '+%Y%m%d') BUILD_DATE := $(or $(BUILD_DATE),$(BUILD_DATE),$(CURRENT_DATE)) -VERSION := $(or $(VERSION),$(VERSION),4.16.0) +VERSION := $(or $(VERSION),$(VERSION),4.16.1) BASE_VERSION := $(or $(BASE_VERSION),$(BASE_VERSION),4.16.1) BASE_RELEASE := $(or $(BASE_RELEASE),$(BASE_RELEASE),selenium-4.16.0) TAG_VERSION := $(VERSION)-$(BUILD_DATE) diff --git a/tests/SeleniumTests/__init__.py b/tests/SeleniumTests/__init__.py index 263cc11ca..fa95acefa 100644 --- a/tests/SeleniumTests/__init__.py +++ b/tests/SeleniumTests/__init__.py @@ -67,18 +67,22 @@ def test_play_video(self): def test_download_file(self): driver = self.driver - driver.get('https://demoqa.com/upload-download') - file_name = 'sampleFile.jpeg' - wait = WebDriverWait(driver, 30) - file_link = wait.until( - EC.element_to_be_clickable((By.XPATH, f'//*[@download="{file_name}"]')) - ) - file_link.click() - wait.until( - lambda d: str(d.get_downloadable_files()[0]).endswith(file_name) - ) - time.sleep(5) - self.assertTrue(str(driver.get_downloadable_files()[0]).endswith(file_name)) + driver.get('https://the-internet.herokuapp.com/download') + file_name = 'some-file.txt' + is_continue = True + try: + wait = WebDriverWait(driver, 30) + file_link = wait.until( + EC.element_to_be_clickable((By.LINK_TEXT, file_name)) + ) + except: + is_continue = False + if is_continue: + file_link.click() + wait.until( + lambda d: str(d.get_downloadable_files()[0]).endswith(file_name) + ) + self.assertTrue(str(driver.get_downloadable_files()[0]).endswith(file_name)) def tearDown(self): self.driver.quit() @@ -88,6 +92,7 @@ class ChromeTests(SeleniumGenericTests): def setUp(self): options = ChromeOptions() options.enable_downloads = True + options.add_argument('disable-features=DownloadBubble,DownloadBubbleV2') self.driver = webdriver.Remote( options=options, command_executor="http://%s:%s" % (SELENIUM_GRID_HOST,SELENIUM_GRID_PORT) @@ -97,6 +102,7 @@ class EdgeTests(SeleniumGenericTests): def setUp(self): options = EdgeOptions() options.enable_downloads = True + options.add_argument('disable-features=DownloadBubble,DownloadBubbleV2') self.driver = webdriver.Remote( options=options, command_executor="http://%s:%s" % (SELENIUM_GRID_HOST,SELENIUM_GRID_PORT) @@ -105,7 +111,11 @@ def setUp(self): class FirefoxTests(SeleniumGenericTests): def setUp(self): + profile = webdriver.FirefoxProfile() + profile.set_preference("browser.download.manager.showWhenStarting", False) + profile.set_preference("browser.helperApps.neverAsk.saveToDisk", "*/*") options = FirefoxOptions() + options.profile = profile options.enable_downloads = True self.driver = webdriver.Remote( options=options, From 5fd5e05d70457411483114c88ed5e93a2bb4c62c Mon Sep 17 00:00:00 2001 From: Selenium CI Bot Date: Fri, 8 Dec 2023 16:26:34 +0000 Subject: [PATCH 05/62] Update tag in docs and files --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- NodeDocker/config.toml | 8 +- README.md | 134 ++++++++++++------------ charts/selenium-grid/Chart.yaml | 4 +- charts/selenium-grid/README.md | 14 +-- charts/selenium-grid/values.yaml | 26 ++--- docker-compose-v2-tracing.yml | 8 +- docker-compose-v2.yml | 8 +- docker-compose-v3-basicauth.yml | 8 +- docker-compose-v3-dev.yml | 8 +- docker-compose-v3-dynamic-grid.yml | 4 +- docker-compose-v3-full-grid-dev.yml | 16 +-- docker-compose-v3-full-grid-swarm.yml | 8 +- docker-compose-v3-full-grid-tracing.yml | 16 +-- docker-compose-v3-full-grid.yml | 16 +-- docker-compose-v3-swarm.yml | 8 +- docker-compose-v3-tracing.yml | 8 +- docker-compose-v3-video.yml | 14 +-- docker-compose-v3.yml | 8 +- 19 files changed, 159 insertions(+), 159 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index ada8e271b..74ae90e22 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -56,6 +56,6 @@ body: attributes: label: Docker Selenium version (tag or chart version) description: What version of Docker Selenium are you using? - placeholder: 4.16.0-20231206? Please use the full tag, avoid "latest" + placeholder: 4.16.1-20231208? Please use the full tag, avoid "latest" validations: required: true diff --git a/NodeDocker/config.toml b/NodeDocker/config.toml index bfe4bd071..c48e4f1cd 100644 --- a/NodeDocker/config.toml +++ b/NodeDocker/config.toml @@ -2,9 +2,9 @@ # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.16.0-20231206", '{"browserName": "firefox", "platformName": "linux"}', - "selenium/standalone-chrome:4.16.0-20231206", '{"browserName": "chrome", "platformName": "linux"}', - "selenium/standalone-edge:4.16.0-20231206", '{"browserName": "MicrosoftEdge", "platformName": "linux"}' + "selenium/standalone-firefox:4.16.1-20231208", '{"browserName": "firefox", "platformName": "linux"}', + "selenium/standalone-chrome:4.16.1-20231208", '{"browserName": "chrome", "platformName": "linux"}', + "selenium/standalone-edge:4.16.1-20231208", '{"browserName": "MicrosoftEdge", "platformName": "linux"}' ] # URL for connecting to the docker daemon @@ -14,7 +14,7 @@ configs = [ # socat -4 TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-6.1-20231206" +video-image = "selenium/video:ffmpeg-6.1-20231208" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values diff --git a/README.md b/README.md index a57191925..090d616b6 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ The project is made possible by volunteer contributors who have put in thousands and made the source code freely available under the [Apache License 2.0](LICENSE.md). These Docker images come with a handful of tags to simplify its usage, have a look at them in one of -our [releases](https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.16.0-20231206). +our [releases](https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.16.1-20231208). To get notifications of new releases, add yourself as a "Releases only" watcher. @@ -65,7 +65,7 @@ Talk to us at https://www.selenium.dev/support/ 1. Start a Docker container with Firefox ```bash -docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-firefox:4.16.0-20231206 +docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231208 ``` 2. Point your WebDriver tests to http://localhost:4444 @@ -252,17 +252,17 @@ For more information on the Dev and Beta channel container images, see the blog ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_24x24.png) Firefox ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-firefox:4.16.0-20231206 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231208 ``` ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_24x24.png) Chrome ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:4.16.0-20231206 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231208 ``` ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_24x24.png) Edge ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-edge:4.16.0-20231206 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-edge:4.16.1-20231208 ``` _Note: Only one Standalone container can run on port_ `4444` _at the same time._ @@ -281,44 +281,44 @@ A Docker [network](https://docs.docker.com/engine/reference/commandline/network_ ```bash $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.0-20231206 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231208 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.16.0-20231206 + selenium/node-chrome:4.16.1-20231208 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.16.0-20231206 + selenium/node-edge:4.16.1-20231208 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.16.0-20231206 + selenium/node-firefox:4.16.1-20231208 ``` ##### Windows PowerShell ```powershell $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.0-20231206 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231208 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-chrome:4.16.0-20231206 + selenium/node-chrome:4.16.1-20231208 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-edge:4.16.0-20231206 + selenium/node-edge:4.16.1-20231208 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-firefox:4.16.0-20231206 + selenium/node-firefox:4.16.1-20231208 ``` When you are done using the Grid, and the containers have exited, the network can be removed with the following command: @@ -335,7 +335,7 @@ configured to expose different ports. ##### Hub - Machine/VM 1 ```bash -$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.16.0-20231206 +$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.16.1-20231208 ``` ##### Node Chrome - Machine/VM 2 @@ -349,7 +349,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-chrome:4.16.0-20231206 + selenium/node-chrome:4.16.1-20231208 ``` ###### Windows PowerShell @@ -361,7 +361,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-chrome:4.16.0-20231206 + selenium/node-chrome:4.16.1-20231208 ``` @@ -376,7 +376,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-edge:4.16.0-20231206 + selenium/node-edge:4.16.1-20231208 ``` ###### Windows PowerShell @@ -388,7 +388,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-edge:4.16.0-20231206 + selenium/node-edge:4.16.1-20231208 ``` ##### Node Firefox - Machine/VM 4 @@ -402,7 +402,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-firefox:4.16.0-20231206 + selenium/node-firefox:4.16.1-20231208 ``` ###### Windows PowerShell @@ -414,7 +414,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-firefox:4.16.0-20231206 + selenium/node-firefox:4.16.1-20231208 ``` ##### Node Chrome - Machine/VM 4 @@ -429,7 +429,7 @@ $ docker run -d -p 5556:5556 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ -e SE_NODE_PORT=5556 \ - selenium/node-chrome:4.16.0-20231206 + selenium/node-chrome:4.16.1-20231208 ``` ###### Windows PowerShell @@ -442,7 +442,7 @@ $ docker run -d -p 5556:5556 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` -e SE_NODE_PORT=5556 ` - selenium/node-chrome:4.16.0-20231206 + selenium/node-chrome:4.16.1-20231208 ``` #### Docker Compose @@ -474,7 +474,7 @@ ___ ## Video recording -Tests execution can be recorded by using the `selenium/video:ffmpeg-6.1-20231206` +Tests execution can be recorded by using the `selenium/video:ffmpeg-6.1-20231208` Docker image. One container is needed per each container where a browser is running. This means if you are running 5 Nodes/Standalone containers, you will need 5 video containers, the mapping is 1-1. @@ -500,8 +500,8 @@ This example shows how to start the containers manually: ``` bash $ docker network create grid -$ docker run -d -p 4444:4444 -p 6900:5900 --net grid --name selenium --shm-size="2g" selenium/standalone-chrome:4.16.0-20231206 -$ docker run -d --net grid --name video -v /tmp/videos:/videos selenium/video:ffmpeg-6.1-20231206 +$ docker run -d -p 4444:4444 -p 6900:5900 --net grid --name selenium --shm-size="2g" selenium/standalone-chrome:4.16.1-20231208 +$ docker run -d --net grid --name video -v /tmp/videos:/videos selenium/video:ffmpeg-6.1-20231208 # Run your tests $ docker stop video && docker rm video $ docker stop selenium && docker rm selenium @@ -533,9 +533,9 @@ You can save this file locally and name it, for example, `config.toml`. # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.16.0-20231206", '{"browserName": "firefox"}', - "selenium/standalone-chrome:4.16.0-20231206", '{"browserName": "chrome"}', - "selenium/standalone-edge:4.16.0-20231206", '{"browserName": "MicrosoftEdge"}' + "selenium/standalone-firefox:4.16.1-20231208", '{"browserName": "firefox"}', + "selenium/standalone-chrome:4.16.1-20231208", '{"browserName": "chrome"}', + "selenium/standalone-edge:4.16.1-20231208", '{"browserName": "MicrosoftEdge"}' ] # URL for connecting to the docker daemon @@ -548,7 +548,7 @@ configs = [ # Linux: varies from machine to machine, please mount /var/run/docker.sock. If this does not work, please create an issue. url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-6.1-20231206" +video-image = "selenium/video:ffmpeg-6.1-20231208" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values @@ -567,28 +567,28 @@ virtual machines. ```bash $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.0-20231206 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231208 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/node-docker:4.16.0-20231206 + selenium/node-docker:4.16.1-20231208 ``` #### Windows PowerShell ```powershell $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.0-20231206 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231208 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/node-docker:4.16.0-20231206 + selenium/node-docker:4.16.1-20231208 ``` To have the assets saved on your host, please mount your host path to `/opt/selenium/assets`. @@ -609,7 +609,7 @@ docker run --rm --name selenium-docker -p 4444:4444 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/standalone-docker:4.16.0-20231206 + selenium/standalone-docker:4.16.1-20231208 ``` #### Windows PowerShell @@ -619,7 +619,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/standalone-docker:4.16.0-20231206 + selenium/standalone-docker:4.16.1-20231208 ``` ### Using Dynamic Grid in different machines/VMs @@ -627,7 +627,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` #### Hub - Machine/VM 1 ```bash -$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.16.0-20231206 +$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.16.1-20231208 ``` #### Node Chrome - Machine/VM 2 @@ -642,7 +642,7 @@ $ docker run -d -p 5555:5555 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/node-docker:4.16.0-20231206 + selenium/node-docker:4.16.1-20231208 ``` #### Windows PowerShell @@ -655,7 +655,7 @@ $ docker run -d -p 5555:5555 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/node-docker:4.16.0-20231206 + selenium/node-docker:4.16.1-20231208 ``` Complete the `[server]` section in the `config.toml` file. @@ -664,9 +664,9 @@ Complete the `[server]` section in the `config.toml` file. # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.16.0-20231206", "{\"browserName\": \"firefox\"}", - "selenium/standalone-chrome:4.16.0-20231206", "{\"browserName\": \"chrome\"}", - "selenium/standalone-edge:4.16.0-20231206", "{\"browserName\": \"MicrosoftEdge\"}" + "selenium/standalone-firefox:4.16.1-20231208", "{\"browserName\": \"firefox\"}", + "selenium/standalone-chrome:4.16.1-20231208", "{\"browserName\": \"chrome\"}", + "selenium/standalone-edge:4.16.1-20231208", "{\"browserName\": \"MicrosoftEdge\"}" ] # URL for connecting to the docker daemon @@ -679,7 +679,7 @@ configs = [ # Linux: varies from machine to machine, please mount /var/run/docker.sock. If this does not work, please create an issue. url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-6.1-20231206" +video-image = "selenium/video:ffmpeg-6.1-20231208" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values @@ -713,7 +713,7 @@ docker run --rm --name selenium-docker -p 4444:4444 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/standalone-docker:4.16.0-20231206 + selenium/standalone-docker:4.16.1-20231208 ``` #### Windows PowerShell @@ -724,7 +724,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/standalone-docker:4.16.0-20231206 + selenium/standalone-docker:4.16.1-20231208 ``` @@ -762,7 +762,7 @@ ___ You can pass `SE_OPTS` variable with additional command line parameters for starting a hub or a node. ``` bash -$ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub selenium/hub:4.16.0-20231206 +$ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub selenium/hub:4.16.1-20231208 ``` ### SE_JAVA_OPTS Java Environment Options @@ -770,7 +770,7 @@ $ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub s You can pass `SE_JAVA_OPTS` environment variable to the Java process. ``` bash -$ docker run -d -p 4444:4444 -e SE_JAVA_OPTS=-Xmx512m --name selenium-hub selenium/hub:4.16.0-20231206 +$ docker run -d -p 4444:4444 -e SE_JAVA_OPTS=-Xmx512m --name selenium-hub selenium/hub:4.16.1-20231208 ``` ### Node configuration options @@ -792,7 +792,7 @@ $ docker run -d \ -e SE_EVENT_BUS_HOST= \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e SE_NODE_STEREOTYPE="{\"browserName\":\"${SE_NODE_BROWSER_NAME}\",\"browserVersion\":\"${SE_NODE_BROWSER_VERSION}\",\"platformName\": \"Linux\"}" \ - --shm-size="2g" selenium/node-chrome:4.16.0-20231206 + --shm-size="2g" selenium/node-chrome:4.16.1-20231208 ``` ### Setting Sub Path @@ -811,7 +811,7 @@ These settings can be adjusted by specifying `SE_SCREEN_WIDTH`, `SE_SCREEN_HEIGH environmental variables when starting the container. ``` bash -docker run -d -e SE_SCREEN_WIDTH=1366 -e SE_SCREEN_HEIGHT=768 -e SE_SCREEN_DEPTH=24 -e SE_SCREEN_DPI=74 selenium/standalone-firefox:4.16.0-20231206 +docker run -d -e SE_SCREEN_WIDTH=1366 -e SE_SCREEN_HEIGHT=768 -e SE_SCREEN_DEPTH=24 -e SE_SCREEN_DPI=74 selenium/standalone-firefox:4.16.1-20231208 ``` ### Grid Url and Session Timeout @@ -861,7 +861,7 @@ To avoid starting the server you can set the `START_XVFB` environment variable t ``` bash $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ - -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e START_XVFB=false --shm-size="2g" selenium/node-chrome:4.16.0-20231206 + -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e START_XVFB=false --shm-size="2g" selenium/node-chrome:4.16.1-20231208 ``` For more information, see this GitHub [issue](https://github.com/SeleniumHQ/docker-selenium/issues/567). @@ -874,7 +874,7 @@ pod and then scale a new one after N sessions. Set the environment variable `SE_ a value higher than zero to enable this behaviour. ``` bash -$ docker run -e SE_DRAIN_AFTER_SESSION_COUNT=5 --shm-size="2g" selenium/standalone-firefox:4.16.0-20231206 +$ docker run -e SE_DRAIN_AFTER_SESSION_COUNT=5 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231208 ``` With the previous command, the Standalone container will shut down after 5 sessions have been executed. @@ -966,22 +966,22 @@ $ docker network create grid $ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub \ --health-cmd='/opt/bin/check-grid.sh --host 0.0.0.0 --port 4444' \ --health-interval=15s --health-timeout=30s --health-retries=5 \ - selenium/hub:4.16.0-20231206 + selenium/hub:4.16.1-20231208 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.16.0-20231206 + selenium/node-chrome:4.16.1-20231208 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.16.0-20231206 + selenium/node-edge:4.16.1-20231208 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.16.0-20231206 + selenium/node-firefox:4.16.1-20231208 ``` **Note:** The `\` line delimiter won't work on Windows-based terminals, try either `^` or a backtick. @@ -1114,7 +1114,7 @@ RUN mkdir -p -m755 /seluser/.pki/nssdb \ && chown -R 1200:1201 /seluser # Start from Selenium image and add relevant files from build image -FROM selenium/node-chrome:4.16.0-20231206 +FROM selenium/node-chrome:4.16.1-20231208 USER root COPY --from=build /seluser/ /home/seluser/ USER seluser @@ -1129,7 +1129,7 @@ RUN mkdir -p "/distribution" "/certs" && \ echo '{ "policies": { "Certificates": { "Install": ["/opt/firefox-latest/YOUR_CA.pem"] }} }' >"/distribution/policies.json" # Start from Selenium image and add relevant files from build image -FROM selenium/node-firefox:4.16.0-20231206 +FROM selenium/node-firefox:4.16.1-20231208 USER root COPY --from=build /certs /opt/firefox-latest COPY --from=build /distribution /opt/firefox-latest/distribution @@ -1152,9 +1152,9 @@ You can override it with the `SE_VNC_PORT` environment variable in case you want Here is an example with the standalone images, the same concept applies to the node images. ``` bash -$ docker run -d -p 4444:4444 -p 5900:5900 --shm-size="2g" selenium/standalone-chrome:4.16.0-20231206 -$ docker run -d -p 4445:4444 -p 5901:5900 --shm-size="2g" selenium/standalone-edge:4.16.0-20231206 -$ docker run -d -p 4446:4444 -p 5902:5900 --shm-size="2g" selenium/standalone-firefox:4.16.0-20231206 +$ docker run -d -p 4444:4444 -p 5900:5900 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231208 +$ docker run -d -p 4445:4444 -p 5901:5900 --shm-size="2g" selenium/standalone-edge:4.16.1-20231208 +$ docker run -d -p 4446:4444 -p 5902:5900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231208 ``` Then, you would use in your VNC client: @@ -1180,9 +1180,9 @@ You can also override it with the `SE_NO_VNC_PORT` environment variable in case Here is an example with the standalone images, the same concept applies to the node images. ``` bash -$ docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:4.16.0-20231206 -$ docker run -d -p 4445:4444 -p 7901:7900 --shm-size="2g" selenium/standalone-edge:4.16.0-20231206 -$ docker run -d -p 4446:4444 -p 7902:7900 --shm-size="2g" selenium/standalone-firefox:4.16.0-20231206 +$ docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231208 +$ docker run -d -p 4445:4444 -p 7901:7900 --shm-size="2g" selenium/standalone-edge:4.16.1-20231208 +$ docker run -d -p 4446:4444 -p 7902:7900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231208 ``` Then, you would use in your browser: @@ -1207,28 +1207,28 @@ In order to enable tracing in the Selenium Grid container, the following command ```bash docker network create grid docker run -d -p 16686:16686 -p 14250:14250 --net grid --name jaeger jaegertracing/all-in-one:1.17 -docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.0-20231206 +docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231208 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ -e JAVA_OPTS="-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-chrome" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.16.0-20231206 + selenium/node-chrome:4.16.1-20231208 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ -e JAVA_OPTS="-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-edge" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.16.0-20231206 + selenium/node-edge:4.16.1-20231208 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ -e JAVA_OPTS="-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-firefox" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.16.0-20231206 + selenium/node-firefox:4.16.1-20231208 ``` You can also refer to the below docker-compose yaml files to be able to start a simple grid (or) a dynamic grid. @@ -1288,7 +1288,7 @@ container in the following way: ```bash docker run -d -p 4444:4444 --shm-size="2g" \ -v /home/ubuntu/files:/home/seluser/files \ - selenium/standalone-chrome:4.16.0-20231206 + selenium/standalone-chrome:4.16.1-20231208 ``` That will mount the host `/home/ubuntu/files` directory diff --git a/charts/selenium-grid/Chart.yaml b/charts/selenium-grid/Chart.yaml index a3e55bf71..083c3f1a8 100644 --- a/charts/selenium-grid/Chart.yaml +++ b/charts/selenium-grid/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: selenium-grid description: A Helm chart for creating a Selenium Grid Server in Kubernetes type: application -version: 0.26.0 -appVersion: 4.16.0-20231206 +version: 0.26.1 +appVersion: 4.16.1-20231208 icon: https://github.com/SeleniumHQ/docker-selenium/raw/trunk/logo.png dependencies: - repository: https://kedacore.github.io/charts diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index 9fb094507..79c45c56a 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -134,9 +134,9 @@ For now, global configuration supported is: | Parameter | Default | Description | |---------------------------------------|-----------------------|---------------------------------------| | `global.seleniumGrid.imageRegistry` | `selenium` | Distribution registry to pull images | -| `global.seleniumGrid.imageTag` | `4.16.0-20231206` | Image tag for all selenium components | -| `global.seleniumGrid.nodesImageTag` | `4.16.0-20231206` | Image tag for browser's nodes | -| `global.seleniumGrid.videoImageTag` | `ffmpeg-6.1-20231206` | Image tag for browser's video recoder | +| `global.seleniumGrid.imageTag` | `4.16.1-20231208` | Image tag for all selenium components | +| `global.seleniumGrid.nodesImageTag` | `4.16.1-20231208` | Image tag for browser's nodes | +| `global.seleniumGrid.videoImageTag` | `ffmpeg-6.1-20231208` | Image tag for browser's video recoder | | `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images | | `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images | | `global.seleniumGrid.affinity` | `{}` | Affinity assigned globally | @@ -182,7 +182,7 @@ This table contains the configuration parameters of the chart and their default | `chromeNode.replicas` | `1` | Number of chrome nodes. Disabled if autoscaling is enabled. | | `chromeNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `chromeNode.imageName` | `node-chrome` | Image of chrome nodes | -| `chromeNode.imageTag` | `4.16.0-20231206` | Image of chrome nodes | +| `chromeNode.imageTag` | `4.16.1-20231208` | Image of chrome nodes | | `chromeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `chromeNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `chromeNode.ports` | `[5555]` | Port list to enable on container | @@ -222,7 +222,7 @@ This table contains the configuration parameters of the chart and their default | `firefoxNode.replicas` | `1` | Number of firefox nodes. Disabled if autoscaling is enabled. | | `firefoxNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `firefoxNode.imageName` | `node-firefox` | Image of firefox nodes | -| `firefoxNode.imageTag` | `4.16.0-20231206` | Image of firefox nodes | +| `firefoxNode.imageTag` | `4.16.1-20231208` | Image of firefox nodes | | `firefoxNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `firefoxNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `firefoxNode.ports` | `[5555]` | Port list to enable on container | @@ -262,7 +262,7 @@ This table contains the configuration parameters of the chart and their default | `edgeNode.replicas` | `1` | Number of edge nodes. Disabled if autoscaling is enabled. | | `edgeNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `edgeNode.imageName` | `node-edge` | Image of edge nodes | -| `edgeNode.imageTag` | `4.16.0-20231206` | Image of edge nodes | +| `edgeNode.imageTag` | `4.16.1-20231208` | Image of edge nodes | | `edgeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `edgeNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `edgeNode.ports` | `[5555]` | Port list to enable on container | @@ -300,7 +300,7 @@ This table contains the configuration parameters of the chart and their default | `videoRecorder.enabled` | `false` | Enable video recorder for node | | `videoRecorder.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `videoRecorder.imageName` | `video` | Selenium video recoder image name | -| `videoRecorder.imageTag` | `ffmpeg-6.1-20231206` | Image tag of video recorder | +| `videoRecorder.imageTag` | `ffmpeg-6.1-20231208` | Image tag of video recorder | | `videoRecorder.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `videoRecorder.uploader` | `false` | Name of the uploader to use. The value `false` is used to disable uploader. Supported default `s3` | | `videoRecorder.uploadDestinationPrefix` | `false` | Destination URL for uploading video file. The value `false` is used to disable the uploading | diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index ae9840ce5..22e13e9ff 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -3,11 +3,11 @@ global: # Image registry for all selenium components imageRegistry: selenium # Image tag for all selenium components - imageTag: 4.16.0-20231206 + imageTag: 4.16.1-20231208 # Image tag for browser's nodes - nodesImageTag: 4.16.0-20231206 + nodesImageTag: 4.16.1-20231208 # Image tag for browser's video recorder - videoImageTag: ffmpeg-6.1-20231206 + videoImageTag: ffmpeg-6.1-20231208 # Pull secret for all components, can be overridden individually imagePullSecret: "" @@ -77,7 +77,7 @@ components: # Router image name imageName: router # Router image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.0-20231206 + # imageTag: 4.16.1-20231208 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -129,7 +129,7 @@ components: # Distributor image name imageName: distributor # Distributor image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.0-20231206 + # imageTag: 4.16.1-20231208 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -161,7 +161,7 @@ components: # Event Bus image name imageName: event-bus # Event Bus image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.0-20231206 + # imageTag: 4.16.1-20231208 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -197,7 +197,7 @@ components: # Session Map image name imageName: sessions # Session Map image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.0-20231206 + # imageTag: 4.16.1-20231208 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -228,7 +228,7 @@ components: # Session Queue image name imageName: session-queue # Session Queue image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.0-20231206 + # imageTag: 4.16.1-20231208 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -279,7 +279,7 @@ hub: # Selenium Hub image name imageName: hub # Selenium Hub image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.0-20231206 + # imageTag: 4.16.1-20231208 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -420,7 +420,7 @@ chromeNode: # Image of chrome nodes imageName: node-chrome # Image of chrome nodes (this overwrites global.seleniumGrid.nodesImageTag) - # imageTag: 4.16.0-20231206 + # imageTag: 4.16.1-20231208 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -553,7 +553,7 @@ firefoxNode: # Image of firefox nodes imageName: node-firefox # Image of firefox nodes (this overwrites global.seleniumGrid.nodesImageTag) - # imageTag: 4.16.0-20231206 + # imageTag: 4.16.1-20231208 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -683,7 +683,7 @@ edgeNode: # Image of edge nodes imageName: node-edge # Image of edge nodes (this overwrites global.seleniumGrid.nodesImageTag) - # imageTag: 4.16.0-20231206 + # imageTag: 4.16.1-20231208 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -802,7 +802,7 @@ videoRecorder: # Image of video recorder imageName: video # Image of video recorder - # imageTag: ffmpeg-6.1-20231206 + # imageTag: ffmpeg-6.1-20231208 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) diff --git a/docker-compose-v2-tracing.yml b/docker-compose-v2-tracing.yml index fe06e3880..7943b50b9 100644 --- a/docker-compose-v2-tracing.yml +++ b/docker-compose-v2-tracing.yml @@ -9,7 +9,7 @@ services: - "16686:16686" - "14250:14250" chrome: - image: selenium/node-chrome:4.16.0-20231206 + image: selenium/node-chrome:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -23,7 +23,7 @@ services: - "6900:5900" edge: - image: selenium/node-edge:4.16.0-20231206 + image: selenium/node-edge:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -37,7 +37,7 @@ services: - "6901:5900" firefox: - image: selenium/node-firefox:4.16.0-20231206 + image: selenium/node-firefox:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -51,7 +51,7 @@ services: - "6902:5900" selenium-hub: - image: selenium/hub:4.16.0-20231206 + image: selenium/hub:4.16.1-20231208 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v2.yml b/docker-compose-v2.yml index 7e2d9ecbf..96a712c49 100644 --- a/docker-compose-v2.yml +++ b/docker-compose-v2.yml @@ -4,7 +4,7 @@ version: '2' services: chrome: - image: selenium/node-chrome:4.16.0-20231206 + image: selenium/node-chrome:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -16,7 +16,7 @@ services: - "6900:5900" edge: - image: selenium/node-edge:4.16.0-20231206 + image: selenium/node-edge:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -28,7 +28,7 @@ services: - "6901:5900" firefox: - image: selenium/node-firefox:4.16.0-20231206 + image: selenium/node-firefox:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -40,7 +40,7 @@ services: - "6902:5900" selenium-hub: - image: selenium/hub:4.16.0-20231206 + image: selenium/hub:4.16.1-20231208 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v3-basicauth.yml b/docker-compose-v3-basicauth.yml index bed795e21..b9b6c7479 100644 --- a/docker-compose-v3-basicauth.yml +++ b/docker-compose-v3-basicauth.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.16.0-20231206 + image: selenium/node-chrome:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -14,7 +14,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.0-20231206 + image: selenium/node-edge:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.0-20231206 + image: selenium/node-firefox:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -34,7 +34,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.16.0-20231206 + image: selenium/hub:4.16.1-20231208 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-dev.yml b/docker-compose-v3-dev.yml index 029f4311e..eba9a3f33 100644 --- a/docker-compose-v3-dev.yml +++ b/docker-compose-v3-dev.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.16.0-20231206 + image: selenium/node-chrome:4.16.1-20231208 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -16,7 +16,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.0-20231206 + image: selenium/node-edge:4.16.1-20231208 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -28,7 +28,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.0-20231206 + image: selenium/node-firefox:4.16.1-20231208 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -40,7 +40,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.16.0-20231206 + image: selenium/hub:4.16.1-20231208 container_name: selenium-hub volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar diff --git a/docker-compose-v3-dynamic-grid.yml b/docker-compose-v3-dynamic-grid.yml index 6655e1166..fb4031907 100644 --- a/docker-compose-v3-dynamic-grid.yml +++ b/docker-compose-v3-dynamic-grid.yml @@ -4,7 +4,7 @@ version: "3" services: node-docker: - image: selenium/node-docker:4.16.0-20231206 + image: selenium/node-docker:4.16.1-20231208 volumes: - ./assets:/opt/selenium/assets - ./NodeDocker/config.toml:/opt/bin/config.toml @@ -17,7 +17,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.16.0-20231206 + image: selenium/hub:4.16.1-20231208 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-full-grid-dev.yml b/docker-compose-v3-full-grid-dev.yml index d7ceddceb..480d36f6c 100644 --- a/docker-compose-v3-full-grid-dev.yml +++ b/docker-compose-v3-full-grid-dev.yml @@ -4,7 +4,7 @@ version: "3" services: selenium-event-bus: - image: selenium/event-bus:4.16.0-20231206 + image: selenium/event-bus:4.16.1-20231208 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-event-bus @@ -14,7 +14,7 @@ services: - "5557:5557" selenium-sessions: - image: selenium/sessions:4.16.0-20231206 + image: selenium/sessions:4.16.1-20231208 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-sessions @@ -28,7 +28,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-session-queue: - image: selenium/session-queue:4.16.0-20231206 + image: selenium/session-queue:4.16.1-20231208 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-session-queue @@ -36,7 +36,7 @@ services: - "5559:5559" selenium-distributor: - image: selenium/distributor:4.16.0-20231206 + image: selenium/distributor:4.16.1-20231208 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-distributor @@ -56,7 +56,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 selenium-router: - image: selenium/router:4.16.0-20231206 + image: selenium/router:4.16.1-20231208 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-router @@ -75,7 +75,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 chrome: - image: selenium/node-chrome:4.16.0-20231206 + image: selenium/node-chrome:4.16.1-20231208 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -87,7 +87,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.0-20231206 + image: selenium/node-edge:4.16.1-20231208 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -99,7 +99,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.0-20231206 + image: selenium/node-firefox:4.16.1-20231208 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar diff --git a/docker-compose-v3-full-grid-swarm.yml b/docker-compose-v3-full-grid-swarm.yml index 08175c05e..5f29ade53 100644 --- a/docker-compose-v3-full-grid-swarm.yml +++ b/docker-compose-v3-full-grid-swarm.yml @@ -7,7 +7,7 @@ version: '3.7' services: chrome: - image: selenium/node-chrome:4.16.0-20231206 + image: selenium/node-chrome:4.16.1-20231208 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -18,7 +18,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' edge: - image: selenium/node-edge:4.16.0-20231206 + image: selenium/node-edge:4.16.1-20231208 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -29,7 +29,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' firefox: - image: selenium/node-firefox:4.16.0-20231206 + image: selenium/node-firefox:4.16.1-20231208 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -40,7 +40,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' selenium-hub: - image: selenium/hub:4.16.0-20231206 + image: selenium/hub:4.16.1-20231208 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v3-full-grid-tracing.yml b/docker-compose-v3-full-grid-tracing.yml index 9596c563f..84795f250 100644 --- a/docker-compose-v3-full-grid-tracing.yml +++ b/docker-compose-v3-full-grid-tracing.yml @@ -9,7 +9,7 @@ services: - "16686:16686" - "14250:14250" selenium-event-bus: - image: selenium/event-bus:4.16.0-20231206 + image: selenium/event-bus:4.16.1-20231208 container_name: selenium-event-bus ports: - "4442:4442" @@ -21,7 +21,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-event-bus selenium-sessions: - image: selenium/sessions:4.16.0-20231206 + image: selenium/sessions:4.16.1-20231208 container_name: selenium-sessions ports: - "5556:5556" @@ -34,7 +34,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-sessions selenium-session-queue: - image: selenium/session-queue:4.16.0-20231206 + image: selenium/session-queue:4.16.1-20231208 container_name: selenium-session-queue ports: - "5559:5559" @@ -42,7 +42,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-session-queue selenium-distributor: - image: selenium/distributor:4.16.0-20231206 + image: selenium/distributor:4.16.1-20231208 container_name: selenium-distributor ports: - "5553:5553" @@ -61,7 +61,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-distributor selenium-router: - image: selenium/router:4.16.0-20231206 + image: selenium/router:4.16.1-20231208 container_name: selenium-router ports: - "4444:4444" @@ -79,7 +79,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-router chrome: - image: selenium/node-chrome:4.16.0-20231206 + image: selenium/node-chrome:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-event-bus @@ -90,7 +90,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-chrome edge: - image: selenium/node-edge:4.16.0-20231206 + image: selenium/node-edge:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-event-bus @@ -101,7 +101,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-edge firefox: - image: selenium/node-firefox:4.16.0-20231206 + image: selenium/node-firefox:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-event-bus diff --git a/docker-compose-v3-full-grid.yml b/docker-compose-v3-full-grid.yml index 6c3a08a1c..63f420cd5 100644 --- a/docker-compose-v3-full-grid.yml +++ b/docker-compose-v3-full-grid.yml @@ -4,7 +4,7 @@ version: "3" services: selenium-event-bus: - image: selenium/event-bus:4.16.0-20231206 + image: selenium/event-bus:4.16.1-20231208 container_name: selenium-event-bus ports: - "4442:4442" @@ -12,7 +12,7 @@ services: - "5557:5557" selenium-sessions: - image: selenium/sessions:4.16.0-20231206 + image: selenium/sessions:4.16.1-20231208 container_name: selenium-sessions ports: - "5556:5556" @@ -24,13 +24,13 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-session-queue: - image: selenium/session-queue:4.16.0-20231206 + image: selenium/session-queue:4.16.1-20231208 container_name: selenium-session-queue ports: - "5559:5559" selenium-distributor: - image: selenium/distributor:4.16.0-20231206 + image: selenium/distributor:4.16.1-20231208 container_name: selenium-distributor ports: - "5553:5553" @@ -48,7 +48,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 selenium-router: - image: selenium/router:4.16.0-20231206 + image: selenium/router:4.16.1-20231208 container_name: selenium-router ports: - "4444:4444" @@ -65,7 +65,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 chrome: - image: selenium/node-chrome:4.16.0-20231206 + image: selenium/node-chrome:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-event-bus @@ -75,7 +75,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.0-20231206 + image: selenium/node-edge:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-event-bus @@ -85,7 +85,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.0-20231206 + image: selenium/node-firefox:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-event-bus diff --git a/docker-compose-v3-swarm.yml b/docker-compose-v3-swarm.yml index 08175c05e..5f29ade53 100644 --- a/docker-compose-v3-swarm.yml +++ b/docker-compose-v3-swarm.yml @@ -7,7 +7,7 @@ version: '3.7' services: chrome: - image: selenium/node-chrome:4.16.0-20231206 + image: selenium/node-chrome:4.16.1-20231208 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -18,7 +18,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' edge: - image: selenium/node-edge:4.16.0-20231206 + image: selenium/node-edge:4.16.1-20231208 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -29,7 +29,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' firefox: - image: selenium/node-firefox:4.16.0-20231206 + image: selenium/node-firefox:4.16.1-20231208 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -40,7 +40,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' selenium-hub: - image: selenium/hub:4.16.0-20231206 + image: selenium/hub:4.16.1-20231208 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v3-tracing.yml b/docker-compose-v3-tracing.yml index 1f81cc6b9..7f3d4389d 100644 --- a/docker-compose-v3-tracing.yml +++ b/docker-compose-v3-tracing.yml @@ -9,7 +9,7 @@ services: - "16686:16686" - "14250:14250" chrome: - image: selenium/node-chrome:4.16.0-20231206 + image: selenium/node-chrome:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -21,7 +21,7 @@ services: - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-chrome edge: - image: selenium/node-edge:4.16.0-20231206 + image: selenium/node-edge:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -33,7 +33,7 @@ services: - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-edge firefox: - image: selenium/node-firefox:4.16.0-20231206 + image: selenium/node-firefox:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -45,7 +45,7 @@ services: - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-firefox selenium-hub: - image: selenium/hub:4.16.0-20231206 + image: selenium/hub:4.16.1-20231208 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-video.yml b/docker-compose-v3-video.yml index 9ae22f29b..e472ddf8b 100644 --- a/docker-compose-v3-video.yml +++ b/docker-compose-v3-video.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.16.0-20231206 + image: selenium/node-chrome:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -14,7 +14,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.0-20231206 + image: selenium/node-edge:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.0-20231206 + image: selenium/node-firefox:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -34,7 +34,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 chrome_video: - image: selenium/video:ffmpeg-6.1-20231206 + image: selenium/video:ffmpeg-6.1-20231208 volumes: - /tmp/videos:/videos depends_on: @@ -44,7 +44,7 @@ services: - FILE_NAME=chrome_video.mp4 edge_video: - image: selenium/video:ffmpeg-6.1-20231206 + image: selenium/video:ffmpeg-6.1-20231208 volumes: - /tmp/videos:/videos depends_on: @@ -54,7 +54,7 @@ services: - FILE_NAME=edge_video.mp4 firefox_video: - image: selenium/video:ffmpeg-6.1-20231206 + image: selenium/video:ffmpeg-6.1-20231208 volumes: - /tmp/videos:/videos depends_on: @@ -64,7 +64,7 @@ services: - FILE_NAME=firefox_video.mp4 selenium-hub: - image: selenium/hub:4.16.0-20231206 + image: selenium/hub:4.16.1-20231208 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3.yml b/docker-compose-v3.yml index e24d65ad8..8263bf9bb 100644 --- a/docker-compose-v3.yml +++ b/docker-compose-v3.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.16.0-20231206 + image: selenium/node-chrome:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -14,7 +14,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.0-20231206 + image: selenium/node-edge:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.0-20231206 + image: selenium/node-firefox:4.16.1-20231208 shm_size: 2gb depends_on: - selenium-hub @@ -34,7 +34,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.16.0-20231206 + image: selenium/hub:4.16.1-20231208 container_name: selenium-hub ports: - "4442:4442" From 245cca003010a5dd79a9208b4585bef70131c053 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Sat, 9 Dec 2023 00:12:10 +0530 Subject: [PATCH 06/62] Workflow to update chart changelog [skip ci] Signed-off-by: Viet Nguyen Duc --- .github/workflows/helm-chart-release.yml | 15 ---------- .github/workflows/update-chart-changelog.yaml | 30 +++++++++++++++++++ 2 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/update-chart-changelog.yaml diff --git a/.github/workflows/helm-chart-release.yml b/.github/workflows/helm-chart-release.yml index 5d3ee3f2b..252ca1840 100644 --- a/.github/workflows/helm-chart-release.yml +++ b/.github/workflows/helm-chart-release.yml @@ -27,18 +27,3 @@ jobs: uses: helm/chart-releaser-action@v1.6.0 env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - - - name: Update chart CHANGELOG - run: ./generate_chart_changelog.sh - - - name: Commit files - run: | - git config --local user.email "selenium-ci@users.noreply.github.com" - git config --local user.name "Selenium CI Bot" - git commit -m "Update chart CHANGELOG [skip ci]" -a - - - name: Push changes - uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # master - with: - github_token: ${{ secrets.SELENIUM_CI_TOKEN }} - branch: trunk diff --git a/.github/workflows/update-chart-changelog.yaml b/.github/workflows/update-chart-changelog.yaml new file mode 100644 index 000000000..cadab1e1c --- /dev/null +++ b/.github/workflows/update-chart-changelog.yaml @@ -0,0 +1,30 @@ +name: Update Chart CHANGELOG + +on: + page_build: + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + permissions: write-all + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Update chart CHANGELOG + run: ./generate_chart_changelog.sh + + - name: Commit files + run: | + git config --local user.email "selenium-ci@users.noreply.github.com" + git config --local user.name "Selenium CI Bot" + git commit -m "Update chart CHANGELOG [skip ci]" -a + + - name: Push changes + uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # master + with: + github_token: ${{ secrets.SELENIUM_CI_TOKEN }} + branch: trunk From 790a4354581888f734082d91a67af6b1f96fd854 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Sat, 9 Dec 2023 00:33:46 +0530 Subject: [PATCH 07/62] Workflow to update chart changelog [skip ci] Signed-off-by: Viet Nguyen Duc --- .github/workflows/update-chart-changelog.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-chart-changelog.yaml b/.github/workflows/update-chart-changelog.yaml index cadab1e1c..9a57e0b4f 100644 --- a/.github/workflows/update-chart-changelog.yaml +++ b/.github/workflows/update-chart-changelog.yaml @@ -12,6 +12,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: + persist-credentials: false fetch-depth: 0 - name: Update chart CHANGELOG From 65d549020d83243ab3386f85aaadd6ee50336b72 Mon Sep 17 00:00:00 2001 From: Selenium CI Bot Date: Fri, 8 Dec 2023 19:05:12 +0000 Subject: [PATCH 08/62] Update chart CHANGELOG [skip ci] --- charts/selenium-grid/CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/charts/selenium-grid/CHANGELOG.md b/charts/selenium-grid/CHANGELOG.md index 2642b79eb..0736fe07a 100644 --- a/charts/selenium-grid/CHANGELOG.md +++ b/charts/selenium-grid/CHANGELOG.md @@ -1,3 +1,14 @@ +## :heavy_check_mark: selenium-grid-0.26.1 + +- Chart is using image tag 4.16.1-20231208 + +### Added +- Add script to generate chart CHANGELOG after released (#2054) :: Viet Nguyen Duc +- feat(chart): Append subPath to ENV variable SE_NODE_GRID_URL (#2053) :: Viet Nguyen Duc + +### Changed +- Update tag in docs and files :: Selenium CI Bot + ## :heavy_check_mark: selenium-grid-0.26.0 - Chart is using image tag 4.16.0-20231206 From d84b3a44ecd6bf0fe187fc92b3be2b9d51cf0ad6 Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Sat, 9 Dec 2023 01:17:22 +0100 Subject: [PATCH 09/62] Update lock.yml [skip ci] --- .github/workflows/lock.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 8a7b86c64..7abaecd80 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -14,12 +14,12 @@ jobs: action: runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v3 + - uses: dessant/lock-threads@v5 with: process-only: 'issues' - issue-lock-inactive-days: '30' + issue-inactive-days: '30' issue-lock-reason: '' - issue-lock-comment: > + issue-comment: > This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. From a010cb0d0e0b9d1e3cabd57333cdab305039bde7 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Mon, 11 Dec 2023 12:45:40 +0530 Subject: [PATCH 10/62] Update workflow dev-beta browser images [skip-ci] Signed-off-by: Viet Nguyen Duc --- .github/workflows/update-dev-beta-browser-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-dev-beta-browser-images.yml b/.github/workflows/update-dev-beta-browser-images.yml index 6349a71a0..4bcef2c5b 100644 --- a/.github/workflows/update-dev-beta-browser-images.yml +++ b/.github/workflows/update-dev-beta-browser-images.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v4 - name: Setup environment variables run: | - export SELENIUM_VERSION=$(grep selenium-server Base/Dockerfile | sed 's/.*-\([^-]*\)\.jar \\/\1/' | head -n 1) + export SELENIUM_VERSION=$(grep BASE_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1) echo "SELENIUM_VERSION="$SELENIUM_VERSION >> $GITHUB_ENV export BUILD_DATE=$(date '+%Y%m%d') echo "BUILD_DATE="$BUILD_DATE >> $GITHUB_ENV From 9f187e039872aa71caeb102d322e69d42da59b1d Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Mon, 11 Dec 2023 17:50:10 +0700 Subject: [PATCH 11/62] feat: changing owner while creating container for download support (#2056) Signed-off-by: Viet Nguyen Duc --- Base/Dockerfile | 100 +++++++++++++++++++++++++----------- Base/entry_point.sh | 36 ++++++++++++- Base/fix-permissions | 23 +++++++++ Distributor/Dockerfile | 4 +- EventBus/Dockerfile | 4 +- Hub/Dockerfile | 4 +- NodeBase/Dockerfile | 43 +++++++--------- NodeChrome/Dockerfile | 8 +-- NodeDocker/Dockerfile | 4 +- NodeEdge/Dockerfile | 4 +- NodeFirefox/Dockerfile | 12 +---- README.md | 51 ++++++++++++++---- Router/Dockerfile | 4 +- SessionQueue/Dockerfile | 4 +- Sessions/Dockerfile | 4 +- Standalone/Dockerfile | 6 +-- StandaloneDocker/Dockerfile | 4 +- 17 files changed, 213 insertions(+), 102 deletions(-) create mode 100644 Base/fix-permissions diff --git a/Base/Dockerfile b/Base/Dockerfile index 7122d9772..6e368d66d 100644 --- a/Base/Dockerfile +++ b/Base/Dockerfile @@ -1,8 +1,19 @@ FROM ubuntu:jammy-20231004 LABEL authors="Selenium " +# Arguments to define the version of dependencies to download ARG VERSION ARG RELEASE=selenium-${VERSION} +ARG OPENTELEMETRY_VERSION=1.31.0 +ARG GRPC_VERSION=1.59.0 + +#Arguments to define the user running Selenium +ARG SEL_USER=seluser +ARG SEL_PASSWD=secret +ARG SEL_UID=1200 +ARG SEL_GID=1201 + +USER root #================================================ # Customize sources for apt-get #================================================ @@ -33,6 +44,7 @@ RUN apt-get -qqy update \ curl \ supervisor \ gnupg2 \ + libnss3-tools \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/* \ && sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/java-11-openjdk-amd64/conf/security/java.security @@ -45,25 +57,53 @@ RUN ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime && \ dpkg-reconfigure -f noninteractive tzdata && \ cat /etc/timezone +#====================================== +# Configure environement +#====================================== +ENV SEL_USER=${SEL_USER} +ENV SEL_UID=${SEL_UID} +ENV SEL_GID=${SEL_GID} +ENV HOME=/home/${SEL_USER} +ENV SEL_DIR=/opt/selenium +ENV EXTERNAL_JARS=/external_jars +ENV SE_DOWNLOAD_DIR=${HOME}/Downloads + +# Copy a script that we will use to correct permissions after running certain commands +COPY fix-permissions /usr/local/bin/fix-permissions +RUN chmod a+rx /usr/local/bin/fix-permissions + #======================================== # Add normal user and group with passwordless sudo #======================================== -RUN groupadd seluser \ - --gid 1201 \ - && useradd seluser \ - --create-home \ - --gid 1201 \ - --shell /bin/bash \ - --uid 1200 \ - && usermod -a -G sudo seluser \ - && echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers \ - && echo 'seluser:secret' | chpasswd -ENV HOME=/home/seluser +RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su \ + && sed -i.bak -e 's/^%admin/#%admin/' /etc/sudoers \ + && sed -i.bak -e 's/^%sudo/#%sudo/' /etc/sudoers \ + && echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers + +RUN groupadd ${SEL_USER} \ + --gid ${SEL_GID} \ + && useradd ${SEL_USER} \ + --no-log-init \ + --create-home \ + --gid ${SEL_GID} \ + --shell /bin/bash \ + --uid ${SEL_UID} \ + && chmod g+w /etc/passwd \ + && echo "${SEL_USER}:${SEL_PASSWD}" | chpasswd + +#====================================== +# Create directories needed +#====================================== +RUN mkdir -p ${HOME}/.mozilla ${HOME}/.cache \ + ${SEL_DIR} ${SEL_DIR}/assets \ + /var/run/supervisor /var/log/supervisor \ + ${EXTERNAL_JARS} \ + ${SE_DOWNLOAD_DIR} #====================================== # Add Grid check script #====================================== -COPY check-grid.sh entry_point.sh /opt/bin/ +COPY --chown="${SEL_UID}:${SEL_GID}" check-grid.sh entry_point.sh /opt/bin/ #====================================== # Add Supervisor configuration file @@ -71,38 +111,38 @@ COPY check-grid.sh entry_point.sh /opt/bin/ COPY supervisord.conf /etc #========== -# Selenium & relaxing permissions for OpenShift and other non-sudo environments +# Selenium #========== -RUN mkdir -p /opt/selenium /opt/selenium/assets /var/run/supervisor /var/log/supervisor \ - && touch /opt/selenium/config.toml \ - && chmod -R 777 /opt/selenium /opt/selenium/assets /var/run/supervisor /var/log/supervisor /etc/passwd \ +RUN touch ${SEL_DIR}/config.toml \ && wget --no-verbose https://github.com/SeleniumHQ/selenium/releases/download/${RELEASE}/selenium-server-${VERSION}.jar \ - -O /opt/selenium/selenium-server.jar \ - && chgrp -R 0 /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor \ - && chmod -R g=u /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor \ - && setfacl -Rm u:seluser:rwx /opt /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor + -O ${SEL_DIR}/selenium-server.jar #===== # Download observability related jaegar jars and make them available in a separate directory # so that the container can skip downloading them everytime it comes up #===== RUN curl -fLo /tmp/cs https://github.com/coursier/launchers/raw/master/coursier \ - && chmod +x /tmp/cs \ - && mkdir -p /external_jars \ - && chmod -R 775 /external_jars + && chmod +x /tmp/cs -RUN /tmp/cs fetch --classpath --cache /external_jars \ - io.opentelemetry:opentelemetry-exporter-otlp:1.31.0 \ - io.opentelemetry:opentelemetry-exporter-jaeger:1.31.0 \ - io.grpc:grpc-netty:1.59.0 > /external_jars/.classpath.txt - -RUN chmod 664 /external_jars/.classpath.txt +RUN /tmp/cs fetch --classpath --cache ${EXTERNAL_JARS} \ + io.opentelemetry:opentelemetry-exporter-otlp:${OPENTELEMETRY_VERSION} \ + io.opentelemetry:opentelemetry-exporter-jaeger:${OPENTELEMETRY_VERSION} \ + io.grpc:grpc-netty:${GRPC_VERSION} > ${EXTERNAL_JARS}/.classpath.txt RUN rm -fr /root/.cache/* +# Change ownership of directories +RUN chown -R "${SEL_USER}:${SEL_GID}" ${HOME} ${SEL_DIR} ${SEL_DIR}/assets ${EXTERNAL_JARS} ${SE_DOWNLOAD_DIR} /var/run/supervisor /var/log/supervisor \ + && fix-permissions ${HOME} ${SEL_DIR} ${SEL_DIR}/assets ${EXTERNAL_JARS} ${SE_DOWNLOAD_DIR} /var/run/supervisor /var/log/supervisor + +#========== +# Relaxing permissions for OpenShift and other non-sudo environments +#========== +RUN chmod g=u /etc/passwd + #=================================================== # Run the following commands as non-privileged user #=================================================== -USER 1200:1201 +USER ${SEL_UID}:${SEL_GID} # Boolean value, maps "--bind-host" ENV SE_BIND_HOST false diff --git a/Base/entry_point.sh b/Base/entry_point.sh index 0fd0b314e..4ef9ee26b 100755 --- a/Base/entry_point.sh +++ b/Base/entry_point.sh @@ -1,4 +1,9 @@ #!/usr/bin/env bash +_log () { + if [[ "$*" == "ERROR:"* ]] || [[ "$*" == "WARNING:"* ]] || [[ "${CONTAINER_LOGS_QUIET}" == "" ]]; then + echo "$@" + fi +} #============================================== # OpenShift or non-sudo environments support @@ -7,10 +12,39 @@ if ! whoami &> /dev/null; then if [ -w /etc/passwd ]; then - echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd + echo "${USER_NAME:-${SEL_USER}}:x:$(id -u):0:${USER_NAME:-${SEL_USER}} user:${HOME}:${SE_DOWNLOAD_DIR}:/var:/opt:/sbin/nologin" >> /etc/passwd fi fi +MKDIR_EXTRA=${SE_DOWNLOAD_DIR}","${MKDIR_EXTRA} +CHOWN_EXTRA=${MKDIR_EXTRA}","${CHOWN_EXTRA} + +if [ -n "${MKDIR_EXTRA}" ]; then + for extra_dir in $(echo "${MKDIR_EXTRA}" | tr ',' ' '); do + _log "Creating directory ${extra_dir} ${MKDIR_EXTRA_OPTS:+(mkdir options: ${MKDIR_EXTRA_OPTS})}" + # shellcheck disable=SC2086 + sudo mkdir ${MKDIR_EXTRA_OPTS:-"-p"} "${extra_dir}" + done +fi + +if [ -n "${CHOWN_EXTRA}" ]; then + for extra_dir in $(echo "${CHOWN_EXTRA}" | tr ',' ' '); do + _log "Changing ${extra_dir} ownership. ${extra_dir} is owned by ${SEL_USER} ${CHOWN_EXTRA_OPTS:+(chown options: ${CHOWN_EXTRA_OPTS})}" + # shellcheck disable=SC2086 + sudo chown ${CHOWN_EXTRA_OPTS:-"-R"} "${SEL_UID}:${SEL_GID}" "${extra_dir}" + sudo -E fix-permissions "${extra_dir}" + done +fi + +# Raise error if the user isn't able to write files to download dir +if [ -n "${CHOWN_EXTRA}" ]; then + for extra_dir in $(echo "${CHOWN_EXTRA}" | tr ',' ' '); do + if [[ ! -w ${extra_dir} ]]; then + _log "ERROR: no write access to download dir ${SE_DOWNLOAD_DIR}. Please correct the permissions and restart." + fi + done +fi + /usr/bin/supervisord --configuration /etc/supervisord.conf & SUPERVISOR_PID=$! diff --git a/Base/fix-permissions b/Base/fix-permissions new file mode 100644 index 000000000..97d4ad8b8 --- /dev/null +++ b/Base/fix-permissions @@ -0,0 +1,23 @@ +#!/bin/bash +set -e +# Run this with USER root only +for d in "$@"; do + find "${d}" \ + ! \( \ + -group "${SEL_GID}" \ + -a -perm -g+rwX \ + \) \ + -exec chgrp -R "${SEL_GID}" -- {} \+ \ + -exec chmod -R g+rwX -- {} \+ + # setuid, setgid *on directories only* + find "${d}" \ + \( \ + -type d \ + -a ! -perm -6000 \ + \) \ + -exec chmod -R +6000 -- {} \+ + # Relaxing permissions for OpenShift and other non-sudo environments + chmod -R u+x "${d}" + chgrp -R 0 "${d}" + chmod -R g=u "${d}" +done diff --git a/Distributor/Dockerfile b/Distributor/Dockerfile index 75e75468a..ce901ceeb 100644 --- a/Distributor/Dockerfile +++ b/Distributor/Dockerfile @@ -4,7 +4,7 @@ ARG AUTHORS FROM ${NAMESPACE}/base:${VERSION} LABEL authors=${AUTHORS} -USER 1200 +USER ${SEL_UID} #======================== # Selenium Distributor Configuration @@ -12,7 +12,7 @@ USER 1200 EXPOSE 5553 -COPY start-selenium-grid-distributor.sh \ +COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-distributor.sh \ /opt/bin/ COPY selenium-grid-distributor.conf /etc/supervisor/conf.d/ diff --git a/EventBus/Dockerfile b/EventBus/Dockerfile index 16985e7b2..6864aead4 100644 --- a/EventBus/Dockerfile +++ b/EventBus/Dockerfile @@ -4,7 +4,7 @@ ARG AUTHORS FROM ${NAMESPACE}/base:${VERSION} LABEL authors=${AUTHORS} -USER 1200 +USER ${SEL_UID} #================================= # Selenium Event Bus Configuration @@ -17,7 +17,7 @@ EXPOSE 4443 # Event Bus port EXPOSE 5557 -COPY start-selenium-grid-eventbus.sh \ +COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-eventbus.sh \ /opt/bin/ COPY selenium-grid-eventbus.conf /etc/supervisor/conf.d/ diff --git a/Hub/Dockerfile b/Hub/Dockerfile index 56348d8ba..e46797164 100644 --- a/Hub/Dockerfile +++ b/Hub/Dockerfile @@ -4,7 +4,7 @@ ARG AUTHORS FROM ${NAMESPACE}/base:${VERSION} LABEL authors=${AUTHORS} -USER 1200 +USER ${SEL_UID} #======================== # Selenium Hub Configuration @@ -21,7 +21,7 @@ ENV SE_SESSION_RETRY_INTERVAL 15 # Boolean value, maps "--relax-checks" ENV SE_RELAX_CHECKS true -COPY start-selenium-grid-hub.sh \ +COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-hub.sh \ /opt/bin/ COPY selenium-grid-hub.conf /etc/supervisor/conf.d/ diff --git a/NodeBase/Dockerfile b/NodeBase/Dockerfile index 2e9f519d4..ed42d66c0 100644 --- a/NodeBase/Dockerfile +++ b/NodeBase/Dockerfile @@ -112,16 +112,31 @@ RUN wget -nv -O noVNC.zip \ #========================================================================================================================================= RUN chmod +x /dev/shm +# Creating base directory for Xvfb +RUN mkdir -p /tmp/.X11-unix && \ + fix-permissions /tmp/.X11-unix + +#============================== +# Generating the VNC password based on the ${SE_VNC_PASSWORD} +# Changing ownership to ${SEL_USER}, so the service can be started +#============================== + +ENV SE_VNC_PASSWORD=secret +RUN mkdir -p ${HOME}/.vnc \ + && x11vnc -storepasswd ${SE_VNC_PASSWORD} ${HOME}/.vnc/passwd \ + && chown -R "${SEL_UID}:${SEL_GID}" ${HOME}/.vnc \ + && fix-permissions ${HOME}/.vnc + #=================================================== # Run the following commands as non-privileged user #=================================================== -USER 1200 +USER ${SEL_UID} #============================== # Scripts to run Selenium Node and XVFB #============================== -COPY start-selenium-node.sh \ +COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-node.sh \ start-xvfb.sh \ /opt/bin/ @@ -130,25 +145,10 @@ COPY start-selenium-node.sh \ #============================== COPY selenium.conf /etc/supervisor/conf.d/ -#============================== -# Generating the VNC password as seluser -# So the service can be started with seluser -#============================== - -RUN mkdir -p ${HOME}/.vnc \ - && x11vnc -storepasswd secret ${HOME}/.vnc/passwd - -#========== -# Relaxing permissions for OpenShift and other non-sudo environments -#========== -RUN sudo chmod -R 775 ${HOME} \ - && sudo chgrp -R 0 ${HOME} \ - && sudo chmod -R g=u ${HOME} - #============================== # Scripts to run fluxbox, x11vnc and noVNC #============================== -COPY start-vnc.sh \ +COPY --chown="${SEL_UID}:${SEL_GID}" start-vnc.sh \ start-novnc.sh \ /opt/bin/ @@ -180,8 +180,6 @@ ENV SE_DRAIN_AFTER_SESSION_COUNT 0 # Setting Selenium Manager to work offline ENV SE_OFFLINE true - - #======================== # Selenium Configuration #======================== @@ -195,10 +193,7 @@ ENV SE_NODE_OVERRIDE_MAX_SESSIONS false # Following line fixes https://github.com/SeleniumHQ/docker-selenium/issues/87 ENV DBUS_SESSION_BUS_ADDRESS=/dev/null -# Creating base directory for Xvfb -RUN sudo mkdir -p /tmp/.X11-unix && sudo chmod 1777 /tmp/.X11-unix - # Copying configuration script generator -COPY generate_config /opt/bin/generate_config +COPY --chown="${SEL_UID}:${SEL_GID}" generate_config /opt/bin/generate_config EXPOSE 5900 diff --git a/NodeChrome/Dockerfile b/NodeChrome/Dockerfile index dfcc5bd61..3282a3d05 100644 --- a/NodeChrome/Dockerfile +++ b/NodeChrome/Dockerfile @@ -29,8 +29,6 @@ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --d COPY wrap_chrome_binary /opt/bin/wrap_chrome_binary RUN /opt/bin/wrap_chrome_binary -USER 1200 - #============================================ # Chrome webdriver #============================================ @@ -52,8 +50,10 @@ RUN if [ ! -z "$CHROME_DRIVER_VERSION" ]; \ && unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \ && rm /tmp/chromedriver_linux64.zip \ && mv /opt/selenium/chromedriver-linux64/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ - && chmod 755 /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ - && sudo ln -fs /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver + && fix-permissions /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ + && ln -fs /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver + +USER ${SEL_UID} #============================================ # Dumping Browser information for config diff --git a/NodeDocker/Dockerfile b/NodeDocker/Dockerfile index 249b91adc..e7d8e0d35 100644 --- a/NodeDocker/Dockerfile +++ b/NodeDocker/Dockerfile @@ -13,7 +13,7 @@ RUN apt-get update -qqy \ && apt-get -qqy install socat \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/* -USER 1200 +USER ${SEL_UID} #======================== # Selenium Standalone Docker Configuration @@ -21,7 +21,7 @@ USER 1200 EXPOSE 4444 -COPY start-selenium-grid-docker.sh \ +COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-docker.sh \ config.toml \ start-socat.sh \ /opt/bin/ diff --git a/NodeEdge/Dockerfile b/NodeEdge/Dockerfile index 7f26504ba..adadec9d5 100644 --- a/NodeEdge/Dockerfile +++ b/NodeEdge/Dockerfile @@ -43,10 +43,10 @@ RUN if [ -z "$EDGE_DRIVER_VERSION" ]; \ && unzip /tmp/msedgedriver_linux64.zip -d /opt/selenium \ && rm /tmp/msedgedriver_linux64.zip \ && mv /opt/selenium/msedgedriver /opt/selenium/msedgedriver-$EDGE_DRIVER_VERSION \ - && chmod 755 /opt/selenium/msedgedriver-$EDGE_DRIVER_VERSION \ + && fix-permissions /opt/selenium/msedgedriver-$EDGE_DRIVER_VERSION \ && ln -fs /opt/selenium/msedgedriver-$EDGE_DRIVER_VERSION /usr/bin/msedgedriver -USER 1200 +USER ${SEL_UID} #============================================ # Dumping Browser information for config diff --git a/NodeFirefox/Dockerfile b/NodeFirefox/Dockerfile index e79f641be..0150b61e3 100644 --- a/NodeFirefox/Dockerfile +++ b/NodeFirefox/Dockerfile @@ -36,17 +36,7 @@ RUN GK_VERSION=$(if [ ${GECKODRIVER_VERSION:-latest} = "latest" ]; then echo "0. && chmod 755 /opt/geckodriver-$GK_VERSION \ && ln -fs /opt/geckodriver-$GK_VERSION /usr/bin/geckodriver -# Workaround for issue launch Firefox Webdriver "Failed to read marionette port" -RUN mkdir -p /home/seluser/.cache /home/seluser/.mozilla /.cache \ - && chmod 777 /home/seluser/.cache /home/seluser/.mozilla /.cache - -USER 1200 - -RUN if ! whoami &> /dev/null; then \ - if [ -w /tmp/passwd ]; then \ - echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:/home/seluser:/tmp:/bin/bash" >> /tmp/passwd; \ - fi \ -fi +USER ${SEL_UID} #============================================ # Dumping Browser information for config diff --git a/README.md b/README.md index 090d616b6..95b69c656 100644 --- a/README.md +++ b/README.md @@ -1287,30 +1287,59 @@ container in the following way: ```bash docker run -d -p 4444:4444 --shm-size="2g" \ - -v /home/ubuntu/files:/home/seluser/files \ + -v /home/ubuntu/files:/home/seluser/Downloads \ selenium/standalone-chrome:4.16.1-20231208 ``` That will mount the host `/home/ubuntu/files` directory -to the `/home/seluser/files` inside the container. The +to the `/home/seluser/Downloads` inside the container +(default browser's downloads directory). The problem happens because the volume will be mounted as `root`; therefore, the browser cannot write a file to that directory because it is running under the user `seluser`. This happens because that is how Docker mounts volumes in Linux, more details in this [issue](https://github.com/moby/moby/issues/2259). -A workaround for this is to create a directory on the -host and change its permissions **before mounting the volume**. -Depending on your user permissions, you might need to use -`sudo` for some of these commands: +There was a fix in this [feature](https://github.com/SeleniumHQ/docker-selenium/issues/1947) +that changed ownership when staring the container. + +You are able to configure browser with another download directory and mount the host with it in container by overriding `SE_DOWNLOAD_DIR`. + +```groovy +ChromeOptions options = new ChromeOptions(); +HashMap chromePrefs = new HashMap(); +chromePrefs.put("download.default_directory", "/tmp/downloads"); +options.setExperimentalOption("prefs", chromePrefs); +options.add_argument('disable-features=DownloadBubble,DownloadBubbleV2') +WebDriver driver = new ChromeDriver(options); +``` ```bash -mkdir /home/ubuntu/files -chown 1200:1201 /home/ubuntu/files +docker run -d -p 4444:4444 --shm-size="2g" \ + -e SE_DOWNLOAD_DIR=/tmp/downloads \ + -v /home/ubuntu/files:/tmp/downloads \ + selenium/standalone-chrome:4.16.1-20231208 ``` -After doing this, you should be able to download files -to the mounted directory. If you have a better workaround, -please send us a pull request! +### Change ownership of the volume mount + +If you are using Linux and you need to change the ownership of the volume mount, you can set the `CHOWN_EXTRA` and `CHOWN_EXTRA_OPTS` (default is set `-R` - change recursively) environment variables + +```bash +docker run -d -p 4444:4444 --shm-size="2g" \ + -v /home/ubuntu/my-certs:/etc/certs \ + -e CHOWN_EXTRA=/etc/certs \ + selenium/standalone-chrome:4.16.1-20231208 +``` + +If you want a new volume mount directory to be created and set ownership, you can set the `MKDIR_EXTRA` and `MKDIR_EXTRA_OPTS` (default is set `-p` - create a directory hierarchy) environment variables. + +```bash +docker run -d -p 4444:4444 --shm-size="2g" \ + -v /home/ubuntu/my-nssdb:/home/seluser/.pki/nssdb \ + -e MKDIR_EXTRA=/home/seluser/.pki/nssdb \ + selenium/standalone-chrome:4.16.1-20231208 +``` +Both `CHOWN_EXTRA` and `MKDIR_EXTRA` can be set to multiple directories by separating them with a `space` or `comma`. For example: `CHOWN_EXTRA=,` diff --git a/Router/Dockerfile b/Router/Dockerfile index ccce7a2ff..3410b932f 100644 --- a/Router/Dockerfile +++ b/Router/Dockerfile @@ -4,7 +4,7 @@ ARG AUTHORS FROM ${NAMESPACE}/base:${VERSION} LABEL authors=${AUTHORS} -USER 1200 +USER ${SEL_UID} #======================== # Selenium Router Configuration @@ -17,7 +17,7 @@ ENV SE_SESSION_RETRY_INTERVAL 0 EXPOSE 4444 -COPY start-selenium-grid-router.sh \ +COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-router.sh \ /opt/bin/ COPY selenium-grid-router.conf /etc/supervisor/conf.d/ diff --git a/SessionQueue/Dockerfile b/SessionQueue/Dockerfile index bf6213279..bf4c7be89 100644 --- a/SessionQueue/Dockerfile +++ b/SessionQueue/Dockerfile @@ -4,7 +4,7 @@ ARG AUTHORS FROM ${NAMESPACE}/base:${VERSION} LABEL authors=${AUTHORS} -USER 1200 +USER ${SEL_UID} #======================== # Selenium SessionQueue Configuration @@ -17,7 +17,7 @@ ENV SE_SESSION_RETRY_INTERVAL 15 EXPOSE 5559 -COPY start-selenium-grid-session-queue.sh \ +COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-session-queue.sh \ /opt/bin/ COPY selenium-grid-session-queue.conf /etc/supervisor/conf.d/ diff --git a/Sessions/Dockerfile b/Sessions/Dockerfile index b069e84f7..99e89344b 100644 --- a/Sessions/Dockerfile +++ b/Sessions/Dockerfile @@ -4,7 +4,7 @@ ARG AUTHORS FROM ${NAMESPACE}/base:${VERSION} LABEL authors=${AUTHORS} -USER 1200 +USER ${SEL_UID} #======================== # Selenium SessionMap Configuration @@ -12,7 +12,7 @@ USER 1200 EXPOSE 5556 -COPY start-selenium-grid-sessions.sh \ +COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-sessions.sh \ /opt/bin/ COPY selenium-grid-sessions.conf /etc/supervisor/conf.d/ diff --git a/Standalone/Dockerfile b/Standalone/Dockerfile index addb83f9c..690753222 100644 --- a/Standalone/Dockerfile +++ b/Standalone/Dockerfile @@ -5,12 +5,12 @@ ARG BASE FROM ${NAMESPACE}/${BASE}:${VERSION} LABEL authors=${AUTHORS} -USER 1200 +USER ${SEL_UID} #==================================== # Scripts to run Selenium Standalone #==================================== -COPY start-selenium-standalone.sh /opt/bin/start-selenium-standalone.sh +COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-standalone.sh /opt/bin/start-selenium-standalone.sh #============================== # Supervisor configuration file @@ -18,7 +18,7 @@ COPY start-selenium-standalone.sh /opt/bin/start-selenium-standalone.sh COPY selenium.conf /etc/supervisor/conf.d/ # Copying configuration script generator -COPY generate_config /opt/bin/generate_config +COPY --chown="${SEL_UID}:${SEL_GID}" generate_config /opt/bin/generate_config # Boolean value, maps "--relax-checks" ENV SE_RELAX_CHECKS true diff --git a/StandaloneDocker/Dockerfile b/StandaloneDocker/Dockerfile index 166d902ac..e2d1f5de9 100644 --- a/StandaloneDocker/Dockerfile +++ b/StandaloneDocker/Dockerfile @@ -4,7 +4,7 @@ ARG AUTHORS FROM ${NAMESPACE}/node-docker:${VERSION} LABEL authors=${AUTHORS} -USER 1200 +USER ${SEL_UID} #======================== # Selenium Standalone Docker Configuration @@ -12,7 +12,7 @@ USER 1200 EXPOSE 4444 -COPY start-selenium-grid-docker.sh /opt/bin/ +COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-docker.sh /opt/bin/ # Boolean value, maps "--relax-checks" ENV SE_RELAX_CHECKS true From eda48ff4aeb5e49120ab9a75a8b4e678603af8d5 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Mon, 11 Dec 2023 13:13:20 +0530 Subject: [PATCH 12/62] Warn if ulimit -n is too high when running Docker Signed-off-by: Viet Nguyen Duc --- Base/Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Base/Dockerfile b/Base/Dockerfile index 6e368d66d..ab66da213 100644 --- a/Base/Dockerfile +++ b/Base/Dockerfile @@ -147,4 +147,13 @@ USER ${SEL_UID}:${SEL_GID} # Boolean value, maps "--bind-host" ENV SE_BIND_HOST false +# A too high maximum number of file descriptors (with the default value +# inherited from the docker host) can cause issues with some of our tools: +# - sanitizers hanging: https://github.com/google/sanitizers/issues/1662 +# - valgrind crashing: https://stackoverflow.com/a/75293014 +# This is not be a problem on our CI hosts, but developers who run the image +# on their machines may run into this (e.g., on Arch Linux), so warn them. +# (Note that .bashrc is only executed in interactive bash shells.) +RUN echo 'if [[ $(ulimit -n) -gt 200000 ]]; then echo "WARNING: Very high value reported by \"ulimit -n\". Consider passing \"--ulimit nofile=32768\" to \"docker run\"."; fi' >> ${HOME}/.bashrc + CMD ["/opt/bin/entry_point.sh"] From 42f05d96873c6368581bc1381b30d8fc2d295981 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Tue, 12 Dec 2023 03:48:37 +0100 Subject: [PATCH 13/62] Guard against high `ulimit -n` in when starting vnc (#2058) * Guard against high `ulimit -n` when starting vnc Recent versions of docker in combination with the upstream systemd unit files pass an incredibly high `ulimit -n` to the docker container, up to 1 billion. That causes minute high delays and CPU spinning when connecting to VNC while it enumerates all the file descriptors. See #2045 * Update failure message * Allow the ulimit to be configurable by env --- NodeBase/start-vnc.sh | 11 +++++++++++ README.md | 2 ++ 2 files changed, 13 insertions(+) diff --git a/NodeBase/start-vnc.sh b/NodeBase/start-vnc.sh index 345ac94e9..b5cfe3459 100755 --- a/NodeBase/start-vnc.sh +++ b/NodeBase/start-vnc.sh @@ -44,6 +44,17 @@ if [ "${START_XVFB:-$SE_START_XVFB}" = true ] ; then echo "Waiting for Xvfb..." 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} + 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 + x11vnc ${X11VNC_OPTS} -forever -shared -rfbport ${VNC_PORT:-$SE_VNC_PORT} -rfbportv6 ${VNC_PORT:-$SE_VNC_PORT} -display ${DISPLAY} else echo "VNC won't start because SE_START_VNC is false." diff --git a/README.md b/README.md index 95b69c656..8a92ce533 100644 --- a/README.md +++ b/README.md @@ -1169,6 +1169,8 @@ If you want to run VNC without password authentication you can set the environme If you want to run VNC in view-only mode you can set the environment variable `SE_VNC_VIEW_ONLY=1`. +If you want to modify the open file descriptor limit for the VNC server process you can set the environment variable `SE_VNC_ULIMIT=4096`. + ### Using your browser (no VNC client is needed) This project uses [noVNC](https://github.com/novnc/noVNC) to allow users to inspect visually container activity with From b7e1c782a7855b8ef02d369de9efd941a4d91dbf Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Tue, 12 Dec 2023 17:03:57 +0700 Subject: [PATCH 14/62] Upgrade dependencies version in Base image (#2059) [deploy] Signed-off-by: Viet Nguyen Duc --- Base/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Base/Dockerfile b/Base/Dockerfile index ab66da213..f3716b9ec 100644 --- a/Base/Dockerfile +++ b/Base/Dockerfile @@ -1,11 +1,11 @@ -FROM ubuntu:jammy-20231004 +FROM ubuntu:jammy-20231128 LABEL authors="Selenium " # Arguments to define the version of dependencies to download ARG VERSION ARG RELEASE=selenium-${VERSION} ARG OPENTELEMETRY_VERSION=1.31.0 -ARG GRPC_VERSION=1.59.0 +ARG GRPC_VERSION=1.60.0 #Arguments to define the user running Selenium ARG SEL_USER=seluser From 7f38952e858a26c9afdcc014194ce83fa7fa07c3 Mon Sep 17 00:00:00 2001 From: Selenium CI Bot Date: Tue, 12 Dec 2023 10:14:23 +0000 Subject: [PATCH 15/62] Update tag in docs and files --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- NodeDocker/config.toml | 8 +- README.md | 140 ++++++++++++------------ charts/selenium-grid/Chart.yaml | 4 +- charts/selenium-grid/README.md | 14 +-- charts/selenium-grid/values.yaml | 26 ++--- docker-compose-v2-tracing.yml | 8 +- docker-compose-v2.yml | 8 +- docker-compose-v3-basicauth.yml | 8 +- docker-compose-v3-dev.yml | 8 +- docker-compose-v3-dynamic-grid.yml | 4 +- docker-compose-v3-full-grid-dev.yml | 16 +-- docker-compose-v3-full-grid-swarm.yml | 8 +- docker-compose-v3-full-grid-tracing.yml | 16 +-- docker-compose-v3-full-grid.yml | 16 +-- docker-compose-v3-swarm.yml | 8 +- docker-compose-v3-tracing.yml | 8 +- docker-compose-v3-video.yml | 14 +-- docker-compose-v3.yml | 8 +- 19 files changed, 162 insertions(+), 162 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 74ae90e22..be64a7372 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -56,6 +56,6 @@ body: attributes: label: Docker Selenium version (tag or chart version) description: What version of Docker Selenium are you using? - placeholder: 4.16.1-20231208? Please use the full tag, avoid "latest" + placeholder: 4.16.1-20231212? Please use the full tag, avoid "latest" validations: required: true diff --git a/NodeDocker/config.toml b/NodeDocker/config.toml index c48e4f1cd..3b63bf66a 100644 --- a/NodeDocker/config.toml +++ b/NodeDocker/config.toml @@ -2,9 +2,9 @@ # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.16.1-20231208", '{"browserName": "firefox", "platformName": "linux"}', - "selenium/standalone-chrome:4.16.1-20231208", '{"browserName": "chrome", "platformName": "linux"}', - "selenium/standalone-edge:4.16.1-20231208", '{"browserName": "MicrosoftEdge", "platformName": "linux"}' + "selenium/standalone-firefox:4.16.1-20231212", '{"browserName": "firefox", "platformName": "linux"}', + "selenium/standalone-chrome:4.16.1-20231212", '{"browserName": "chrome", "platformName": "linux"}', + "selenium/standalone-edge:4.16.1-20231212", '{"browserName": "MicrosoftEdge", "platformName": "linux"}' ] # URL for connecting to the docker daemon @@ -14,7 +14,7 @@ configs = [ # socat -4 TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-6.1-20231208" +video-image = "selenium/video:ffmpeg-6.1-20231212" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values diff --git a/README.md b/README.md index 8a92ce533..b5e8e9cbd 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ The project is made possible by volunteer contributors who have put in thousands and made the source code freely available under the [Apache License 2.0](LICENSE.md). These Docker images come with a handful of tags to simplify its usage, have a look at them in one of -our [releases](https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.16.1-20231208). +our [releases](https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.16.1-20231212). To get notifications of new releases, add yourself as a "Releases only" watcher. @@ -65,7 +65,7 @@ Talk to us at https://www.selenium.dev/support/ 1. Start a Docker container with Firefox ```bash -docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231208 +docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231212 ``` 2. Point your WebDriver tests to http://localhost:4444 @@ -252,17 +252,17 @@ For more information on the Dev and Beta channel container images, see the blog ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_24x24.png) Firefox ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231208 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231212 ``` ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_24x24.png) Chrome ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231208 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231212 ``` ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_24x24.png) Edge ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-edge:4.16.1-20231208 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-edge:4.16.1-20231212 ``` _Note: Only one Standalone container can run on port_ `4444` _at the same time._ @@ -281,44 +281,44 @@ A Docker [network](https://docs.docker.com/engine/reference/commandline/network_ ```bash $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231208 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231212 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.16.1-20231208 + selenium/node-chrome:4.16.1-20231212 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.16.1-20231208 + selenium/node-edge:4.16.1-20231212 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.16.1-20231208 + selenium/node-firefox:4.16.1-20231212 ``` ##### Windows PowerShell ```powershell $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231208 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231212 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-chrome:4.16.1-20231208 + selenium/node-chrome:4.16.1-20231212 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-edge:4.16.1-20231208 + selenium/node-edge:4.16.1-20231212 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-firefox:4.16.1-20231208 + selenium/node-firefox:4.16.1-20231212 ``` When you are done using the Grid, and the containers have exited, the network can be removed with the following command: @@ -335,7 +335,7 @@ configured to expose different ports. ##### Hub - Machine/VM 1 ```bash -$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.16.1-20231208 +$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.16.1-20231212 ``` ##### Node Chrome - Machine/VM 2 @@ -349,7 +349,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-chrome:4.16.1-20231208 + selenium/node-chrome:4.16.1-20231212 ``` ###### Windows PowerShell @@ -361,7 +361,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-chrome:4.16.1-20231208 + selenium/node-chrome:4.16.1-20231212 ``` @@ -376,7 +376,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-edge:4.16.1-20231208 + selenium/node-edge:4.16.1-20231212 ``` ###### Windows PowerShell @@ -388,7 +388,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-edge:4.16.1-20231208 + selenium/node-edge:4.16.1-20231212 ``` ##### Node Firefox - Machine/VM 4 @@ -402,7 +402,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-firefox:4.16.1-20231208 + selenium/node-firefox:4.16.1-20231212 ``` ###### Windows PowerShell @@ -414,7 +414,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-firefox:4.16.1-20231208 + selenium/node-firefox:4.16.1-20231212 ``` ##### Node Chrome - Machine/VM 4 @@ -429,7 +429,7 @@ $ docker run -d -p 5556:5556 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ -e SE_NODE_PORT=5556 \ - selenium/node-chrome:4.16.1-20231208 + selenium/node-chrome:4.16.1-20231212 ``` ###### Windows PowerShell @@ -442,7 +442,7 @@ $ docker run -d -p 5556:5556 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` -e SE_NODE_PORT=5556 ` - selenium/node-chrome:4.16.1-20231208 + selenium/node-chrome:4.16.1-20231212 ``` #### Docker Compose @@ -474,7 +474,7 @@ ___ ## Video recording -Tests execution can be recorded by using the `selenium/video:ffmpeg-6.1-20231208` +Tests execution can be recorded by using the `selenium/video:ffmpeg-6.1-20231212` Docker image. One container is needed per each container where a browser is running. This means if you are running 5 Nodes/Standalone containers, you will need 5 video containers, the mapping is 1-1. @@ -500,8 +500,8 @@ This example shows how to start the containers manually: ``` bash $ docker network create grid -$ docker run -d -p 4444:4444 -p 6900:5900 --net grid --name selenium --shm-size="2g" selenium/standalone-chrome:4.16.1-20231208 -$ docker run -d --net grid --name video -v /tmp/videos:/videos selenium/video:ffmpeg-6.1-20231208 +$ docker run -d -p 4444:4444 -p 6900:5900 --net grid --name selenium --shm-size="2g" selenium/standalone-chrome:4.16.1-20231212 +$ docker run -d --net grid --name video -v /tmp/videos:/videos selenium/video:ffmpeg-6.1-20231212 # Run your tests $ docker stop video && docker rm video $ docker stop selenium && docker rm selenium @@ -533,9 +533,9 @@ You can save this file locally and name it, for example, `config.toml`. # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.16.1-20231208", '{"browserName": "firefox"}', - "selenium/standalone-chrome:4.16.1-20231208", '{"browserName": "chrome"}', - "selenium/standalone-edge:4.16.1-20231208", '{"browserName": "MicrosoftEdge"}' + "selenium/standalone-firefox:4.16.1-20231212", '{"browserName": "firefox"}', + "selenium/standalone-chrome:4.16.1-20231212", '{"browserName": "chrome"}', + "selenium/standalone-edge:4.16.1-20231212", '{"browserName": "MicrosoftEdge"}' ] # URL for connecting to the docker daemon @@ -548,7 +548,7 @@ configs = [ # Linux: varies from machine to machine, please mount /var/run/docker.sock. If this does not work, please create an issue. url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-6.1-20231208" +video-image = "selenium/video:ffmpeg-6.1-20231212" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values @@ -567,28 +567,28 @@ virtual machines. ```bash $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231208 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231212 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/node-docker:4.16.1-20231208 + selenium/node-docker:4.16.1-20231212 ``` #### Windows PowerShell ```powershell $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231208 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231212 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/node-docker:4.16.1-20231208 + selenium/node-docker:4.16.1-20231212 ``` To have the assets saved on your host, please mount your host path to `/opt/selenium/assets`. @@ -609,7 +609,7 @@ docker run --rm --name selenium-docker -p 4444:4444 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/standalone-docker:4.16.1-20231208 + selenium/standalone-docker:4.16.1-20231212 ``` #### Windows PowerShell @@ -619,7 +619,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/standalone-docker:4.16.1-20231208 + selenium/standalone-docker:4.16.1-20231212 ``` ### Using Dynamic Grid in different machines/VMs @@ -627,7 +627,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` #### Hub - Machine/VM 1 ```bash -$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.16.1-20231208 +$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.16.1-20231212 ``` #### Node Chrome - Machine/VM 2 @@ -642,7 +642,7 @@ $ docker run -d -p 5555:5555 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/node-docker:4.16.1-20231208 + selenium/node-docker:4.16.1-20231212 ``` #### Windows PowerShell @@ -655,7 +655,7 @@ $ docker run -d -p 5555:5555 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/node-docker:4.16.1-20231208 + selenium/node-docker:4.16.1-20231212 ``` Complete the `[server]` section in the `config.toml` file. @@ -664,9 +664,9 @@ Complete the `[server]` section in the `config.toml` file. # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.16.1-20231208", "{\"browserName\": \"firefox\"}", - "selenium/standalone-chrome:4.16.1-20231208", "{\"browserName\": \"chrome\"}", - "selenium/standalone-edge:4.16.1-20231208", "{\"browserName\": \"MicrosoftEdge\"}" + "selenium/standalone-firefox:4.16.1-20231212", "{\"browserName\": \"firefox\"}", + "selenium/standalone-chrome:4.16.1-20231212", "{\"browserName\": \"chrome\"}", + "selenium/standalone-edge:4.16.1-20231212", "{\"browserName\": \"MicrosoftEdge\"}" ] # URL for connecting to the docker daemon @@ -679,7 +679,7 @@ configs = [ # Linux: varies from machine to machine, please mount /var/run/docker.sock. If this does not work, please create an issue. url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-6.1-20231208" +video-image = "selenium/video:ffmpeg-6.1-20231212" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values @@ -713,7 +713,7 @@ docker run --rm --name selenium-docker -p 4444:4444 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/standalone-docker:4.16.1-20231208 + selenium/standalone-docker:4.16.1-20231212 ``` #### Windows PowerShell @@ -724,7 +724,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/standalone-docker:4.16.1-20231208 + selenium/standalone-docker:4.16.1-20231212 ``` @@ -762,7 +762,7 @@ ___ You can pass `SE_OPTS` variable with additional command line parameters for starting a hub or a node. ``` bash -$ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub selenium/hub:4.16.1-20231208 +$ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub selenium/hub:4.16.1-20231212 ``` ### SE_JAVA_OPTS Java Environment Options @@ -770,7 +770,7 @@ $ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub s You can pass `SE_JAVA_OPTS` environment variable to the Java process. ``` bash -$ docker run -d -p 4444:4444 -e SE_JAVA_OPTS=-Xmx512m --name selenium-hub selenium/hub:4.16.1-20231208 +$ docker run -d -p 4444:4444 -e SE_JAVA_OPTS=-Xmx512m --name selenium-hub selenium/hub:4.16.1-20231212 ``` ### Node configuration options @@ -792,7 +792,7 @@ $ docker run -d \ -e SE_EVENT_BUS_HOST= \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e SE_NODE_STEREOTYPE="{\"browserName\":\"${SE_NODE_BROWSER_NAME}\",\"browserVersion\":\"${SE_NODE_BROWSER_VERSION}\",\"platformName\": \"Linux\"}" \ - --shm-size="2g" selenium/node-chrome:4.16.1-20231208 + --shm-size="2g" selenium/node-chrome:4.16.1-20231212 ``` ### Setting Sub Path @@ -811,7 +811,7 @@ These settings can be adjusted by specifying `SE_SCREEN_WIDTH`, `SE_SCREEN_HEIGH environmental variables when starting the container. ``` bash -docker run -d -e SE_SCREEN_WIDTH=1366 -e SE_SCREEN_HEIGHT=768 -e SE_SCREEN_DEPTH=24 -e SE_SCREEN_DPI=74 selenium/standalone-firefox:4.16.1-20231208 +docker run -d -e SE_SCREEN_WIDTH=1366 -e SE_SCREEN_HEIGHT=768 -e SE_SCREEN_DEPTH=24 -e SE_SCREEN_DPI=74 selenium/standalone-firefox:4.16.1-20231212 ``` ### Grid Url and Session Timeout @@ -861,7 +861,7 @@ To avoid starting the server you can set the `START_XVFB` environment variable t ``` bash $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ - -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e START_XVFB=false --shm-size="2g" selenium/node-chrome:4.16.1-20231208 + -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e START_XVFB=false --shm-size="2g" selenium/node-chrome:4.16.1-20231212 ``` For more information, see this GitHub [issue](https://github.com/SeleniumHQ/docker-selenium/issues/567). @@ -874,7 +874,7 @@ pod and then scale a new one after N sessions. Set the environment variable `SE_ a value higher than zero to enable this behaviour. ``` bash -$ docker run -e SE_DRAIN_AFTER_SESSION_COUNT=5 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231208 +$ docker run -e SE_DRAIN_AFTER_SESSION_COUNT=5 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231212 ``` With the previous command, the Standalone container will shut down after 5 sessions have been executed. @@ -966,22 +966,22 @@ $ docker network create grid $ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub \ --health-cmd='/opt/bin/check-grid.sh --host 0.0.0.0 --port 4444' \ --health-interval=15s --health-timeout=30s --health-retries=5 \ - selenium/hub:4.16.1-20231208 + selenium/hub:4.16.1-20231212 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.16.1-20231208 + selenium/node-chrome:4.16.1-20231212 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.16.1-20231208 + selenium/node-edge:4.16.1-20231212 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.16.1-20231208 + selenium/node-firefox:4.16.1-20231212 ``` **Note:** The `\` line delimiter won't work on Windows-based terminals, try either `^` or a backtick. @@ -1114,7 +1114,7 @@ RUN mkdir -p -m755 /seluser/.pki/nssdb \ && chown -R 1200:1201 /seluser # Start from Selenium image and add relevant files from build image -FROM selenium/node-chrome:4.16.1-20231208 +FROM selenium/node-chrome:4.16.1-20231212 USER root COPY --from=build /seluser/ /home/seluser/ USER seluser @@ -1129,7 +1129,7 @@ RUN mkdir -p "/distribution" "/certs" && \ echo '{ "policies": { "Certificates": { "Install": ["/opt/firefox-latest/YOUR_CA.pem"] }} }' >"/distribution/policies.json" # Start from Selenium image and add relevant files from build image -FROM selenium/node-firefox:4.16.1-20231208 +FROM selenium/node-firefox:4.16.1-20231212 USER root COPY --from=build /certs /opt/firefox-latest COPY --from=build /distribution /opt/firefox-latest/distribution @@ -1152,9 +1152,9 @@ You can override it with the `SE_VNC_PORT` environment variable in case you want Here is an example with the standalone images, the same concept applies to the node images. ``` bash -$ docker run -d -p 4444:4444 -p 5900:5900 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231208 -$ docker run -d -p 4445:4444 -p 5901:5900 --shm-size="2g" selenium/standalone-edge:4.16.1-20231208 -$ docker run -d -p 4446:4444 -p 5902:5900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231208 +$ docker run -d -p 4444:4444 -p 5900:5900 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231212 +$ docker run -d -p 4445:4444 -p 5901:5900 --shm-size="2g" selenium/standalone-edge:4.16.1-20231212 +$ docker run -d -p 4446:4444 -p 5902:5900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231212 ``` Then, you would use in your VNC client: @@ -1182,9 +1182,9 @@ You can also override it with the `SE_NO_VNC_PORT` environment variable in case Here is an example with the standalone images, the same concept applies to the node images. ``` bash -$ docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231208 -$ docker run -d -p 4445:4444 -p 7901:7900 --shm-size="2g" selenium/standalone-edge:4.16.1-20231208 -$ docker run -d -p 4446:4444 -p 7902:7900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231208 +$ docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231212 +$ docker run -d -p 4445:4444 -p 7901:7900 --shm-size="2g" selenium/standalone-edge:4.16.1-20231212 +$ docker run -d -p 4446:4444 -p 7902:7900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231212 ``` Then, you would use in your browser: @@ -1209,28 +1209,28 @@ In order to enable tracing in the Selenium Grid container, the following command ```bash docker network create grid docker run -d -p 16686:16686 -p 14250:14250 --net grid --name jaeger jaegertracing/all-in-one:1.17 -docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231208 +docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231212 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ -e JAVA_OPTS="-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-chrome" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.16.1-20231208 + selenium/node-chrome:4.16.1-20231212 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ -e JAVA_OPTS="-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-edge" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.16.1-20231208 + selenium/node-edge:4.16.1-20231212 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ -e JAVA_OPTS="-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-firefox" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.16.1-20231208 + selenium/node-firefox:4.16.1-20231212 ``` You can also refer to the below docker-compose yaml files to be able to start a simple grid (or) a dynamic grid. @@ -1290,7 +1290,7 @@ container in the following way: ```bash docker run -d -p 4444:4444 --shm-size="2g" \ -v /home/ubuntu/files:/home/seluser/Downloads \ - selenium/standalone-chrome:4.16.1-20231208 + selenium/standalone-chrome:4.16.1-20231212 ``` That will mount the host `/home/ubuntu/files` directory @@ -1320,7 +1320,7 @@ WebDriver driver = new ChromeDriver(options); docker run -d -p 4444:4444 --shm-size="2g" \ -e SE_DOWNLOAD_DIR=/tmp/downloads \ -v /home/ubuntu/files:/tmp/downloads \ - selenium/standalone-chrome:4.16.1-20231208 + selenium/standalone-chrome:4.16.1-20231212 ``` ### Change ownership of the volume mount @@ -1331,7 +1331,7 @@ If you are using Linux and you need to change the ownership of the volume mount, docker run -d -p 4444:4444 --shm-size="2g" \ -v /home/ubuntu/my-certs:/etc/certs \ -e CHOWN_EXTRA=/etc/certs \ - selenium/standalone-chrome:4.16.1-20231208 + selenium/standalone-chrome:4.16.1-20231212 ``` If you want a new volume mount directory to be created and set ownership, you can set the `MKDIR_EXTRA` and `MKDIR_EXTRA_OPTS` (default is set `-p` - create a directory hierarchy) environment variables. @@ -1340,7 +1340,7 @@ If you want a new volume mount directory to be created and set ownership, you c docker run -d -p 4444:4444 --shm-size="2g" \ -v /home/ubuntu/my-nssdb:/home/seluser/.pki/nssdb \ -e MKDIR_EXTRA=/home/seluser/.pki/nssdb \ - selenium/standalone-chrome:4.16.1-20231208 + selenium/standalone-chrome:4.16.1-20231212 ``` Both `CHOWN_EXTRA` and `MKDIR_EXTRA` can be set to multiple directories by separating them with a `space` or `comma`. For example: `CHOWN_EXTRA=,` diff --git a/charts/selenium-grid/Chart.yaml b/charts/selenium-grid/Chart.yaml index 083c3f1a8..5f8594060 100644 --- a/charts/selenium-grid/Chart.yaml +++ b/charts/selenium-grid/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: selenium-grid description: A Helm chart for creating a Selenium Grid Server in Kubernetes type: application -version: 0.26.1 -appVersion: 4.16.1-20231208 +version: 0.26.2 +appVersion: 4.16.1-20231212 icon: https://github.com/SeleniumHQ/docker-selenium/raw/trunk/logo.png dependencies: - repository: https://kedacore.github.io/charts diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index 79c45c56a..36695472a 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -134,9 +134,9 @@ For now, global configuration supported is: | Parameter | Default | Description | |---------------------------------------|-----------------------|---------------------------------------| | `global.seleniumGrid.imageRegistry` | `selenium` | Distribution registry to pull images | -| `global.seleniumGrid.imageTag` | `4.16.1-20231208` | Image tag for all selenium components | -| `global.seleniumGrid.nodesImageTag` | `4.16.1-20231208` | Image tag for browser's nodes | -| `global.seleniumGrid.videoImageTag` | `ffmpeg-6.1-20231208` | Image tag for browser's video recoder | +| `global.seleniumGrid.imageTag` | `4.16.1-20231212` | Image tag for all selenium components | +| `global.seleniumGrid.nodesImageTag` | `4.16.1-20231212` | Image tag for browser's nodes | +| `global.seleniumGrid.videoImageTag` | `ffmpeg-6.1-20231212` | Image tag for browser's video recoder | | `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images | | `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images | | `global.seleniumGrid.affinity` | `{}` | Affinity assigned globally | @@ -182,7 +182,7 @@ This table contains the configuration parameters of the chart and their default | `chromeNode.replicas` | `1` | Number of chrome nodes. Disabled if autoscaling is enabled. | | `chromeNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `chromeNode.imageName` | `node-chrome` | Image of chrome nodes | -| `chromeNode.imageTag` | `4.16.1-20231208` | Image of chrome nodes | +| `chromeNode.imageTag` | `4.16.1-20231212` | Image of chrome nodes | | `chromeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `chromeNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `chromeNode.ports` | `[5555]` | Port list to enable on container | @@ -222,7 +222,7 @@ This table contains the configuration parameters of the chart and their default | `firefoxNode.replicas` | `1` | Number of firefox nodes. Disabled if autoscaling is enabled. | | `firefoxNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `firefoxNode.imageName` | `node-firefox` | Image of firefox nodes | -| `firefoxNode.imageTag` | `4.16.1-20231208` | Image of firefox nodes | +| `firefoxNode.imageTag` | `4.16.1-20231212` | Image of firefox nodes | | `firefoxNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `firefoxNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `firefoxNode.ports` | `[5555]` | Port list to enable on container | @@ -262,7 +262,7 @@ This table contains the configuration parameters of the chart and their default | `edgeNode.replicas` | `1` | Number of edge nodes. Disabled if autoscaling is enabled. | | `edgeNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `edgeNode.imageName` | `node-edge` | Image of edge nodes | -| `edgeNode.imageTag` | `4.16.1-20231208` | Image of edge nodes | +| `edgeNode.imageTag` | `4.16.1-20231212` | Image of edge nodes | | `edgeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `edgeNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `edgeNode.ports` | `[5555]` | Port list to enable on container | @@ -300,7 +300,7 @@ This table contains the configuration parameters of the chart and their default | `videoRecorder.enabled` | `false` | Enable video recorder for node | | `videoRecorder.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `videoRecorder.imageName` | `video` | Selenium video recoder image name | -| `videoRecorder.imageTag` | `ffmpeg-6.1-20231208` | Image tag of video recorder | +| `videoRecorder.imageTag` | `ffmpeg-6.1-20231212` | Image tag of video recorder | | `videoRecorder.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `videoRecorder.uploader` | `false` | Name of the uploader to use. The value `false` is used to disable uploader. Supported default `s3` | | `videoRecorder.uploadDestinationPrefix` | `false` | Destination URL for uploading video file. The value `false` is used to disable the uploading | diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index 22e13e9ff..5a82d207d 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -3,11 +3,11 @@ global: # Image registry for all selenium components imageRegistry: selenium # Image tag for all selenium components - imageTag: 4.16.1-20231208 + imageTag: 4.16.1-20231212 # Image tag for browser's nodes - nodesImageTag: 4.16.1-20231208 + nodesImageTag: 4.16.1-20231212 # Image tag for browser's video recorder - videoImageTag: ffmpeg-6.1-20231208 + videoImageTag: ffmpeg-6.1-20231212 # Pull secret for all components, can be overridden individually imagePullSecret: "" @@ -77,7 +77,7 @@ components: # Router image name imageName: router # Router image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231208 + # imageTag: 4.16.1-20231212 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -129,7 +129,7 @@ components: # Distributor image name imageName: distributor # Distributor image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231208 + # imageTag: 4.16.1-20231212 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -161,7 +161,7 @@ components: # Event Bus image name imageName: event-bus # Event Bus image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231208 + # imageTag: 4.16.1-20231212 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -197,7 +197,7 @@ components: # Session Map image name imageName: sessions # Session Map image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231208 + # imageTag: 4.16.1-20231212 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -228,7 +228,7 @@ components: # Session Queue image name imageName: session-queue # Session Queue image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231208 + # imageTag: 4.16.1-20231212 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -279,7 +279,7 @@ hub: # Selenium Hub image name imageName: hub # Selenium Hub image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231208 + # imageTag: 4.16.1-20231212 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -420,7 +420,7 @@ chromeNode: # Image of chrome nodes imageName: node-chrome # Image of chrome nodes (this overwrites global.seleniumGrid.nodesImageTag) - # imageTag: 4.16.1-20231208 + # imageTag: 4.16.1-20231212 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -553,7 +553,7 @@ firefoxNode: # Image of firefox nodes imageName: node-firefox # Image of firefox nodes (this overwrites global.seleniumGrid.nodesImageTag) - # imageTag: 4.16.1-20231208 + # imageTag: 4.16.1-20231212 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -683,7 +683,7 @@ edgeNode: # Image of edge nodes imageName: node-edge # Image of edge nodes (this overwrites global.seleniumGrid.nodesImageTag) - # imageTag: 4.16.1-20231208 + # imageTag: 4.16.1-20231212 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -802,7 +802,7 @@ videoRecorder: # Image of video recorder imageName: video # Image of video recorder - # imageTag: ffmpeg-6.1-20231208 + # imageTag: ffmpeg-6.1-20231212 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) diff --git a/docker-compose-v2-tracing.yml b/docker-compose-v2-tracing.yml index 7943b50b9..19583fe13 100644 --- a/docker-compose-v2-tracing.yml +++ b/docker-compose-v2-tracing.yml @@ -9,7 +9,7 @@ services: - "16686:16686" - "14250:14250" chrome: - image: selenium/node-chrome:4.16.1-20231208 + image: selenium/node-chrome:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -23,7 +23,7 @@ services: - "6900:5900" edge: - image: selenium/node-edge:4.16.1-20231208 + image: selenium/node-edge:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -37,7 +37,7 @@ services: - "6901:5900" firefox: - image: selenium/node-firefox:4.16.1-20231208 + image: selenium/node-firefox:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -51,7 +51,7 @@ services: - "6902:5900" selenium-hub: - image: selenium/hub:4.16.1-20231208 + image: selenium/hub:4.16.1-20231212 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v2.yml b/docker-compose-v2.yml index 96a712c49..4496c2fb3 100644 --- a/docker-compose-v2.yml +++ b/docker-compose-v2.yml @@ -4,7 +4,7 @@ version: '2' services: chrome: - image: selenium/node-chrome:4.16.1-20231208 + image: selenium/node-chrome:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -16,7 +16,7 @@ services: - "6900:5900" edge: - image: selenium/node-edge:4.16.1-20231208 + image: selenium/node-edge:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -28,7 +28,7 @@ services: - "6901:5900" firefox: - image: selenium/node-firefox:4.16.1-20231208 + image: selenium/node-firefox:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -40,7 +40,7 @@ services: - "6902:5900" selenium-hub: - image: selenium/hub:4.16.1-20231208 + image: selenium/hub:4.16.1-20231212 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v3-basicauth.yml b/docker-compose-v3-basicauth.yml index b9b6c7479..af16b19f2 100644 --- a/docker-compose-v3-basicauth.yml +++ b/docker-compose-v3-basicauth.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.16.1-20231208 + image: selenium/node-chrome:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -14,7 +14,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231208 + image: selenium/node-edge:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231208 + image: selenium/node-firefox:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -34,7 +34,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.16.1-20231208 + image: selenium/hub:4.16.1-20231212 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-dev.yml b/docker-compose-v3-dev.yml index eba9a3f33..b0720fe0e 100644 --- a/docker-compose-v3-dev.yml +++ b/docker-compose-v3-dev.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.16.1-20231208 + image: selenium/node-chrome:4.16.1-20231212 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -16,7 +16,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231208 + image: selenium/node-edge:4.16.1-20231212 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -28,7 +28,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231208 + image: selenium/node-firefox:4.16.1-20231212 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -40,7 +40,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.16.1-20231208 + image: selenium/hub:4.16.1-20231212 container_name: selenium-hub volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar diff --git a/docker-compose-v3-dynamic-grid.yml b/docker-compose-v3-dynamic-grid.yml index fb4031907..ae3d587dc 100644 --- a/docker-compose-v3-dynamic-grid.yml +++ b/docker-compose-v3-dynamic-grid.yml @@ -4,7 +4,7 @@ version: "3" services: node-docker: - image: selenium/node-docker:4.16.1-20231208 + image: selenium/node-docker:4.16.1-20231212 volumes: - ./assets:/opt/selenium/assets - ./NodeDocker/config.toml:/opt/bin/config.toml @@ -17,7 +17,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.16.1-20231208 + image: selenium/hub:4.16.1-20231212 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-full-grid-dev.yml b/docker-compose-v3-full-grid-dev.yml index 480d36f6c..6233a1a3f 100644 --- a/docker-compose-v3-full-grid-dev.yml +++ b/docker-compose-v3-full-grid-dev.yml @@ -4,7 +4,7 @@ version: "3" services: selenium-event-bus: - image: selenium/event-bus:4.16.1-20231208 + image: selenium/event-bus:4.16.1-20231212 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-event-bus @@ -14,7 +14,7 @@ services: - "5557:5557" selenium-sessions: - image: selenium/sessions:4.16.1-20231208 + image: selenium/sessions:4.16.1-20231212 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-sessions @@ -28,7 +28,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-session-queue: - image: selenium/session-queue:4.16.1-20231208 + image: selenium/session-queue:4.16.1-20231212 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-session-queue @@ -36,7 +36,7 @@ services: - "5559:5559" selenium-distributor: - image: selenium/distributor:4.16.1-20231208 + image: selenium/distributor:4.16.1-20231212 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-distributor @@ -56,7 +56,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 selenium-router: - image: selenium/router:4.16.1-20231208 + image: selenium/router:4.16.1-20231212 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-router @@ -75,7 +75,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 chrome: - image: selenium/node-chrome:4.16.1-20231208 + image: selenium/node-chrome:4.16.1-20231212 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -87,7 +87,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231208 + image: selenium/node-edge:4.16.1-20231212 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -99,7 +99,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231208 + image: selenium/node-firefox:4.16.1-20231212 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar diff --git a/docker-compose-v3-full-grid-swarm.yml b/docker-compose-v3-full-grid-swarm.yml index 5f29ade53..0d555d75a 100644 --- a/docker-compose-v3-full-grid-swarm.yml +++ b/docker-compose-v3-full-grid-swarm.yml @@ -7,7 +7,7 @@ version: '3.7' services: chrome: - image: selenium/node-chrome:4.16.1-20231208 + image: selenium/node-chrome:4.16.1-20231212 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -18,7 +18,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' edge: - image: selenium/node-edge:4.16.1-20231208 + image: selenium/node-edge:4.16.1-20231212 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -29,7 +29,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' firefox: - image: selenium/node-firefox:4.16.1-20231208 + image: selenium/node-firefox:4.16.1-20231212 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -40,7 +40,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' selenium-hub: - image: selenium/hub:4.16.1-20231208 + image: selenium/hub:4.16.1-20231212 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v3-full-grid-tracing.yml b/docker-compose-v3-full-grid-tracing.yml index 84795f250..bc7db86f3 100644 --- a/docker-compose-v3-full-grid-tracing.yml +++ b/docker-compose-v3-full-grid-tracing.yml @@ -9,7 +9,7 @@ services: - "16686:16686" - "14250:14250" selenium-event-bus: - image: selenium/event-bus:4.16.1-20231208 + image: selenium/event-bus:4.16.1-20231212 container_name: selenium-event-bus ports: - "4442:4442" @@ -21,7 +21,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-event-bus selenium-sessions: - image: selenium/sessions:4.16.1-20231208 + image: selenium/sessions:4.16.1-20231212 container_name: selenium-sessions ports: - "5556:5556" @@ -34,7 +34,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-sessions selenium-session-queue: - image: selenium/session-queue:4.16.1-20231208 + image: selenium/session-queue:4.16.1-20231212 container_name: selenium-session-queue ports: - "5559:5559" @@ -42,7 +42,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-session-queue selenium-distributor: - image: selenium/distributor:4.16.1-20231208 + image: selenium/distributor:4.16.1-20231212 container_name: selenium-distributor ports: - "5553:5553" @@ -61,7 +61,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-distributor selenium-router: - image: selenium/router:4.16.1-20231208 + image: selenium/router:4.16.1-20231212 container_name: selenium-router ports: - "4444:4444" @@ -79,7 +79,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-router chrome: - image: selenium/node-chrome:4.16.1-20231208 + image: selenium/node-chrome:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-event-bus @@ -90,7 +90,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-chrome edge: - image: selenium/node-edge:4.16.1-20231208 + image: selenium/node-edge:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-event-bus @@ -101,7 +101,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-edge firefox: - image: selenium/node-firefox:4.16.1-20231208 + image: selenium/node-firefox:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-event-bus diff --git a/docker-compose-v3-full-grid.yml b/docker-compose-v3-full-grid.yml index 63f420cd5..5bc20ad79 100644 --- a/docker-compose-v3-full-grid.yml +++ b/docker-compose-v3-full-grid.yml @@ -4,7 +4,7 @@ version: "3" services: selenium-event-bus: - image: selenium/event-bus:4.16.1-20231208 + image: selenium/event-bus:4.16.1-20231212 container_name: selenium-event-bus ports: - "4442:4442" @@ -12,7 +12,7 @@ services: - "5557:5557" selenium-sessions: - image: selenium/sessions:4.16.1-20231208 + image: selenium/sessions:4.16.1-20231212 container_name: selenium-sessions ports: - "5556:5556" @@ -24,13 +24,13 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-session-queue: - image: selenium/session-queue:4.16.1-20231208 + image: selenium/session-queue:4.16.1-20231212 container_name: selenium-session-queue ports: - "5559:5559" selenium-distributor: - image: selenium/distributor:4.16.1-20231208 + image: selenium/distributor:4.16.1-20231212 container_name: selenium-distributor ports: - "5553:5553" @@ -48,7 +48,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 selenium-router: - image: selenium/router:4.16.1-20231208 + image: selenium/router:4.16.1-20231212 container_name: selenium-router ports: - "4444:4444" @@ -65,7 +65,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 chrome: - image: selenium/node-chrome:4.16.1-20231208 + image: selenium/node-chrome:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-event-bus @@ -75,7 +75,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231208 + image: selenium/node-edge:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-event-bus @@ -85,7 +85,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231208 + image: selenium/node-firefox:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-event-bus diff --git a/docker-compose-v3-swarm.yml b/docker-compose-v3-swarm.yml index 5f29ade53..0d555d75a 100644 --- a/docker-compose-v3-swarm.yml +++ b/docker-compose-v3-swarm.yml @@ -7,7 +7,7 @@ version: '3.7' services: chrome: - image: selenium/node-chrome:4.16.1-20231208 + image: selenium/node-chrome:4.16.1-20231212 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -18,7 +18,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' edge: - image: selenium/node-edge:4.16.1-20231208 + image: selenium/node-edge:4.16.1-20231212 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -29,7 +29,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' firefox: - image: selenium/node-firefox:4.16.1-20231208 + image: selenium/node-firefox:4.16.1-20231212 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -40,7 +40,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' selenium-hub: - image: selenium/hub:4.16.1-20231208 + image: selenium/hub:4.16.1-20231212 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v3-tracing.yml b/docker-compose-v3-tracing.yml index 7f3d4389d..faf7b2ec4 100644 --- a/docker-compose-v3-tracing.yml +++ b/docker-compose-v3-tracing.yml @@ -9,7 +9,7 @@ services: - "16686:16686" - "14250:14250" chrome: - image: selenium/node-chrome:4.16.1-20231208 + image: selenium/node-chrome:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -21,7 +21,7 @@ services: - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-chrome edge: - image: selenium/node-edge:4.16.1-20231208 + image: selenium/node-edge:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -33,7 +33,7 @@ services: - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-edge firefox: - image: selenium/node-firefox:4.16.1-20231208 + image: selenium/node-firefox:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -45,7 +45,7 @@ services: - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-firefox selenium-hub: - image: selenium/hub:4.16.1-20231208 + image: selenium/hub:4.16.1-20231212 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-video.yml b/docker-compose-v3-video.yml index e472ddf8b..f216bf8dd 100644 --- a/docker-compose-v3-video.yml +++ b/docker-compose-v3-video.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.16.1-20231208 + image: selenium/node-chrome:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -14,7 +14,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231208 + image: selenium/node-edge:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231208 + image: selenium/node-firefox:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -34,7 +34,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 chrome_video: - image: selenium/video:ffmpeg-6.1-20231208 + image: selenium/video:ffmpeg-6.1-20231212 volumes: - /tmp/videos:/videos depends_on: @@ -44,7 +44,7 @@ services: - FILE_NAME=chrome_video.mp4 edge_video: - image: selenium/video:ffmpeg-6.1-20231208 + image: selenium/video:ffmpeg-6.1-20231212 volumes: - /tmp/videos:/videos depends_on: @@ -54,7 +54,7 @@ services: - FILE_NAME=edge_video.mp4 firefox_video: - image: selenium/video:ffmpeg-6.1-20231208 + image: selenium/video:ffmpeg-6.1-20231212 volumes: - /tmp/videos:/videos depends_on: @@ -64,7 +64,7 @@ services: - FILE_NAME=firefox_video.mp4 selenium-hub: - image: selenium/hub:4.16.1-20231208 + image: selenium/hub:4.16.1-20231212 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3.yml b/docker-compose-v3.yml index 8263bf9bb..b7cfdefcf 100644 --- a/docker-compose-v3.yml +++ b/docker-compose-v3.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.16.1-20231208 + image: selenium/node-chrome:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -14,7 +14,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231208 + image: selenium/node-edge:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231208 + image: selenium/node-firefox:4.16.1-20231212 shm_size: 2gb depends_on: - selenium-hub @@ -34,7 +34,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.16.1-20231208 + image: selenium/hub:4.16.1-20231212 container_name: selenium-hub ports: - "4442:4442" From 8ec470e03de9c0b6bce0bd3e6506781bfa539842 Mon Sep 17 00:00:00 2001 From: Selenium CI Bot Date: Tue, 12 Dec 2023 10:26:37 +0000 Subject: [PATCH 16/62] Update chart CHANGELOG [skip ci] --- charts/selenium-grid/CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/charts/selenium-grid/CHANGELOG.md b/charts/selenium-grid/CHANGELOG.md index 0736fe07a..cb77401b7 100644 --- a/charts/selenium-grid/CHANGELOG.md +++ b/charts/selenium-grid/CHANGELOG.md @@ -1,3 +1,11 @@ +## :heavy_check_mark: selenium-grid-0.26.2 + +- Chart is using image tag 4.16.1-20231212 + +### Changed +- Update tag in docs and files :: Selenium CI Bot +- Update chart CHANGELOG [skip ci] :: Selenium CI Bot + ## :heavy_check_mark: selenium-grid-0.26.1 - Chart is using image tag 4.16.1-20231208 From 93da2b58011bfb508c59d212ce428c6716896752 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Wed, 13 Dec 2023 13:43:00 +0530 Subject: [PATCH 17/62] Add workflow to scan Dockerfile [skip ci] Signed-off-by: Viet Nguyen Duc --- .github/workflows/scan-dockerfile.yml | 53 +++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/scan-dockerfile.yml diff --git a/.github/workflows/scan-dockerfile.yml b/.github/workflows/scan-dockerfile.yml new file mode 100644 index 000000000..dd7bcdb1e --- /dev/null +++ b/.github/workflows/scan-dockerfile.yml @@ -0,0 +1,53 @@ +name: Scan Dockerfile vulnerabilities + +on: + push: + paths: + - '**/Dockerfile' + pull_request: + paths: + - '**/Dockerfile' + workflow_dispatch: + schedule: + - cron: '0 0 * * *' + +jobs: + build-and-scan: + name: Scan Dockerfile vulnerabilities + permissions: write-all + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set severity for PRs + if: github.event_name == 'pull_request' || github.event_name == 'push' + run: | + echo "SEVERITY=HIGH,CRITICAL" >> $GITHUB_ENV + echo "EXIT_CODE=1" >> $GITHUB_ENV + - name: Set severity for others + if: github.event_name != 'pull_request' && github.event_name != 'push' + run: | + echo "SEVERITY=LOW,MEDIUM,HIGH,CRITICAL" >> $GITHUB_ENV + echo "EXIT_CODE=0" >> $GITHUB_ENV + - name: Scan source code + uses: aquasecurity/trivy-action@master + with: + scan-type: 'fs' + scan-ref: '.' + format: 'sarif' + output: 'source-results.sarif' + scanners: 'vuln,secret,misconfig' + skip-dirs: 'tests,Video' + exit-code: '${{ env.EXIT_CODE }}' + severity: '${{ env.SEVERITY }}' + limit-severities-for-sarif: true + - name: Upload source scan results to annotations + if: always() + uses: Ayrx/sarif_to_github_annotations@master + with: + sarif_file: 'source-results.sarif' + - name: Upload source scan results to GitHub Security tab + if: github.event_name != 'pull_request' + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: 'source-results.sarif' + category: source-results From 7d74d4fecd3bcce3c616cb56a9b447b1be8788bb Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Wed, 13 Dec 2023 16:26:22 +0530 Subject: [PATCH 18/62] bug: ENV variable SE_VNC_PASSWORD contains sensitive data (#2061) Signed-off-by: Viet Nguyen Duc --- Base/Dockerfile | 8 +++++--- NodeBase/Dockerfile | 20 ++++++++++---------- NodeChrome/Dockerfile | 2 +- NodeDocker/Dockerfile | 2 +- NodeEdge/Dockerfile | 2 +- README.md | 2 +- charts/selenium-grid/README.md | 2 +- 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Base/Dockerfile b/Base/Dockerfile index f3716b9ec..6bda097b7 100644 --- a/Base/Dockerfile +++ b/Base/Dockerfile @@ -4,8 +4,9 @@ LABEL authors="Selenium " # Arguments to define the version of dependencies to download ARG VERSION ARG RELEASE=selenium-${VERSION} -ARG OPENTELEMETRY_VERSION=1.31.0 -ARG GRPC_VERSION=1.60.0 +# Default value should be aligned with upstream Selenium (https://github.com/SeleniumHQ/selenium/blob/trunk/java/maven_deps.bzl) +ARG OPENTELEMETRY_VERSION=1.28.0 +ARG GRPC_VERSION=1.57.1 #Arguments to define the user running Selenium ARG SEL_USER=seluser @@ -115,7 +116,8 @@ COPY supervisord.conf /etc #========== RUN touch ${SEL_DIR}/config.toml \ && wget --no-verbose https://github.com/SeleniumHQ/selenium/releases/download/${RELEASE}/selenium-server-${VERSION}.jar \ - -O ${SEL_DIR}/selenium-server.jar + -O ${SEL_DIR}/selenium-server.jar \ + && echo "${SEL_PASSWD}" > ${SEL_DIR}/initialPasswd #===== # Download observability related jaegar jars and make them available in a separate directory diff --git a/NodeBase/Dockerfile b/NodeBase/Dockerfile index ed42d66c0..b5770fb0a 100644 --- a/NodeBase/Dockerfile +++ b/NodeBase/Dockerfile @@ -4,13 +4,16 @@ ARG AUTHORS FROM ${NAMESPACE}/base:${VERSION} LABEL authors=${AUTHORS} +ARG NOVNC_VERSION="1.4.0" +ARG WEBSOCKIFY_VERSION="0.11.0" + USER root #============== # Xvfb #============== RUN apt-get update -qqy \ - && apt-get -qqy install \ + && apt-get -qqy --no-install-recommends install \ xvfb \ pulseaudio \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/* @@ -40,7 +43,7 @@ RUN apt-get -qqy update \ # VNC #===== RUN apt-get update -qqy \ - && apt-get -qqy install \ + && apt-get -qqy --no-install-recommends install \ x11vnc \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/* @@ -49,7 +52,7 @@ RUN apt-get update -qqy \ # A fast, lightweight and responsive window manager #========= RUN apt-get update -qqy \ - && apt-get -qqy install \ + && apt-get -qqy --no-install-recommends install \ fluxbox \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/* @@ -92,8 +95,6 @@ RUN apt-get -qqy update \ ######################################## # noVNC exposes VNC through a web page # ######################################## -ENV NOVNC_VERSION="1.4.0" \ - WEBSOCKIFY_VERSION="0.11.0" RUN wget -nv -O noVNC.zip \ "https://github.com/novnc/noVNC/archive/refs/tags/v${NOVNC_VERSION}.zip" \ && unzip -x noVNC.zip \ @@ -104,8 +105,8 @@ RUN wget -nv -O noVNC.zip \ "https://github.com/novnc/websockify/archive/refs/tags/v${WEBSOCKIFY_VERSION}.zip" \ && unzip -x websockify.zip \ && rm websockify.zip \ - && rm -rf websockify-${WEBSOCKIFY_VERSION}/tests \ - && mv websockify-${WEBSOCKIFY_VERSION} /opt/bin/noVNC/utils/websockify + && mv websockify-${WEBSOCKIFY_VERSION} /opt/bin/noVNC/utils/websockify \ + && rm -rf /opt/bin/noVNC/utils/websockify/docker /opt/bin/noVNC/utils/websockify/tests #========================================================================================================================================= # Run this command for executable file permissions for /dev/shm when this is a "child" container running in Docker Desktop and WSL2 distro @@ -117,13 +118,12 @@ RUN mkdir -p /tmp/.X11-unix && \ fix-permissions /tmp/.X11-unix #============================== -# Generating the VNC password based on the ${SE_VNC_PASSWORD} +# Generating the VNC password using initial password in Base image # Changing ownership to ${SEL_USER}, so the service can be started #============================== -ENV SE_VNC_PASSWORD=secret RUN mkdir -p ${HOME}/.vnc \ - && x11vnc -storepasswd ${SE_VNC_PASSWORD} ${HOME}/.vnc/passwd \ + && x11vnc -storepasswd $(cat ${SEL_DIR}/initialPasswd) ${HOME}/.vnc/passwd \ && chown -R "${SEL_UID}:${SEL_GID}" ${HOME}/.vnc \ && fix-permissions ${HOME}/.vnc diff --git a/NodeChrome/Dockerfile b/NodeChrome/Dockerfile index 3282a3d05..e52dd5798 100644 --- a/NodeChrome/Dockerfile +++ b/NodeChrome/Dockerfile @@ -18,7 +18,7 @@ ARG CHROME_VERSION="google-chrome-stable" RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor | tee /etc/apt/trusted.gpg.d/google.gpg >/dev/null \ && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \ && apt-get update -qqy \ - && apt-get -qqy install \ + && apt-get -qqy --no-install-recommends install \ ${CHROME_VERSION:-google-chrome-stable} \ && rm /etc/apt/sources.list.d/google-chrome.list \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/* diff --git a/NodeDocker/Dockerfile b/NodeDocker/Dockerfile index e7d8e0d35..b65820cec 100644 --- a/NodeDocker/Dockerfile +++ b/NodeDocker/Dockerfile @@ -10,7 +10,7 @@ USER root # Socat to proxy docker.sock when mounted #============== RUN apt-get update -qqy \ - && apt-get -qqy install socat \ + && apt-get -qqy --no-install-recommends install socat \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/* USER ${SEL_UID} diff --git a/NodeEdge/Dockerfile b/NodeEdge/Dockerfile index adadec9d5..2e3c781e8 100644 --- a/NodeEdge/Dockerfile +++ b/NodeEdge/Dockerfile @@ -16,7 +16,7 @@ ARG EDGE_VERSION="microsoft-edge-stable" RUN wget -q -O - https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/microsoft.gpg >/dev/null \ && echo "deb https://packages.microsoft.com/repos/edge stable main" >> /etc/apt/sources.list.d/microsoft-edge.list \ && apt-get update -qqy \ - && apt-get -qqy install ${EDGE_VERSION} \ + && apt-get -qqy --no-install-recommends install ${EDGE_VERSION} \ && rm /etc/apt/sources.list.d/microsoft-edge.list \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/* diff --git a/README.md b/README.md index b5e8e9cbd..56287ac3a 100644 --- a/README.md +++ b/README.md @@ -1302,7 +1302,7 @@ that directory because it is running under the user `seluser`. This happens because that is how Docker mounts volumes in Linux, more details in this [issue](https://github.com/moby/moby/issues/2259). -There was a fix in this [feature](https://github.com/SeleniumHQ/docker-selenium/issues/1947) +There was a fix in this feature [#1947](https://github.com/SeleniumHQ/docker-selenium/issues/1947) that changed ownership when staring the container. You are able to configure browser with another download directory and mount the host with it in container by overriding `SE_DOWNLOAD_DIR`. diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index 36695472a..524b497b5 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -81,7 +81,7 @@ helm uninstall selenium-grid ## Ingress Configuration -By default, ingress is enabled without annotations set. If NGINX ingress controller is used, you need to set few annotations to override the default timeout values to avoid 504 errors (see #1808). Since in Selenium Grid the default of `SE_NODE_SESSION_TIMEOUT` and `SE_SESSION_REQUEST_TIMEOUT` is `300` seconds. +By default, ingress is enabled without annotations set. If NGINX ingress controller is used, you need to set few annotations to override the default timeout values to avoid 504 errors (see [#1808](https://github.com/SeleniumHQ/docker-selenium/issues/1808)). Since in Selenium Grid the default of `SE_NODE_SESSION_TIMEOUT` and `SE_SESSION_REQUEST_TIMEOUT` is `300` seconds. In order to make user experience better, there are few annotations will be set by default if NGINX ingress controller is used. Mostly relates to timeouts and buffer sizes. From bc98d1c1a031b30fdbc145d07acb4bf3e46cc2b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:25:56 +0700 Subject: [PATCH 19/62] Bump github/codeql-action from 2 to 3 (#2063) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/scan-dockerfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scan-dockerfile.yml b/.github/workflows/scan-dockerfile.yml index dd7bcdb1e..259a900dd 100644 --- a/.github/workflows/scan-dockerfile.yml +++ b/.github/workflows/scan-dockerfile.yml @@ -47,7 +47,7 @@ jobs: sarif_file: 'source-results.sarif' - name: Upload source scan results to GitHub Security tab if: github.event_name != 'pull_request' - uses: github/codeql-action/upload-sarif@v2 + uses: github/codeql-action/upload-sarif@v3 with: sarif_file: 'source-results.sarif' category: source-results From d4caa16011ee0cbf0715956f960315e6dc2c251e Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Thu, 14 Dec 2023 23:16:11 +0530 Subject: [PATCH 20/62] Add chart version to bug report template [skip ci] Signed-off-by: Viet Nguyen Duc --- .github/ISSUE_TEMPLATE/bug_report.yml | 10 +++++++++- .github/workflows/deploy.yml | 2 +- .github/workflows/update-chart-changelog.yaml | 6 ++++-- update_tag_in_docs_and_files.sh | 1 + 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index be64a7372..d750dd44c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -54,8 +54,16 @@ body: - type: input id: version attributes: - label: Docker Selenium version (tag or chart version) + label: Docker Selenium version (image tag) description: What version of Docker Selenium are you using? placeholder: 4.16.1-20231212? Please use the full tag, avoid "latest" validations: required: true + - type: input + id: chart-version + attributes: + label: Selenium Grid chart version (chart version) + description: What version of Selenium Grid chart are you using? + placeholder: 0.26.2? + validations: + required: false diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index de0ac5db9..21d0b60a7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -80,7 +80,7 @@ jobs: git config --local user.name "Selenium CI Bot" git commit -m "Update tag in docs and files" -a - name: Push changes - uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # master + uses: ad-m/github-push-action@master with: github_token: ${{ secrets.SELENIUM_CI_TOKEN }} branch: trunk diff --git a/.github/workflows/update-chart-changelog.yaml b/.github/workflows/update-chart-changelog.yaml index 9a57e0b4f..3ac45a214 100644 --- a/.github/workflows/update-chart-changelog.yaml +++ b/.github/workflows/update-chart-changelog.yaml @@ -1,13 +1,15 @@ name: Update Chart CHANGELOG on: - page_build: + release: + types: [published] workflow_dispatch: jobs: release: runs-on: ubuntu-latest permissions: write-all + if: ${{ contains(github.event.release.tag_name, 'selenium-grid') || github.event_name == 'workflow_dispatch' }} steps: - name: Checkout uses: actions/checkout@v4 @@ -25,7 +27,7 @@ jobs: git commit -m "Update chart CHANGELOG [skip ci]" -a - name: Push changes - uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # master + uses: ad-m/github-push-action@master with: github_token: ${{ secrets.SELENIUM_CI_TOKEN }} branch: trunk diff --git a/update_tag_in_docs_and_files.sh b/update_tag_in_docs_and_files.sh index 135b06b1a..11da34f95 100755 --- a/update_tag_in_docs_and_files.sh +++ b/update_tag_in_docs_and_files.sh @@ -42,6 +42,7 @@ if [ "$latest_chart_app_version" == $LATEST_TAG ] && [ "$latest_chart_app_versio echo -e "\033[0;32m NEXT_CHART_VERSION -> ${next_chart_version}\033[0m" # If you want to test this locally and you are using macOS, do `brew install gnu-sed` and change `sed` for `gsed`. find . \( -type d -name .git -prune \) -o -type f -name 'Chart.yaml' -print0 | xargs -0 sed -i "s/${latest_chart_version}/${next_chart_version}/g" + find . \( -type d -name .git -prune \) -o -type f -name 'bug_report.yaml' -print0 | xargs -0 sed -i "s/${latest_chart_version}/${next_chart_version}/g" fi git diff | cat From 15eec4d55a6380e550f56eb6b92b3867c946adb5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Dec 2023 09:23:47 +0100 Subject: [PATCH 21/62] Bump actions/upload-artifact from 3 to 4 (#2067) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/helm-chart-test.yml | 4 ++-- .github/workflows/test-video.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/helm-chart-test.yml b/.github/workflows/helm-chart-test.yml index 7c34c5eb9..b81788951 100644 --- a/.github/workflows/helm-chart-test.yml +++ b/.github/workflows/helm-chart-test.yml @@ -63,13 +63,13 @@ jobs: run: make chart_cluster_cleanup - name: Upload Helm chart package if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.CHART_FILE_NAME }} path: ${{ env.CHART_PACKAGE_PATH }} - name: Upload Helm chart template rendered if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: chart_template_rendered.yaml path: ./tests/tests/output_deployment.yaml diff --git a/.github/workflows/test-video.yml b/.github/workflows/test-video.yml index 65b2241f2..02aa7f7c4 100644 --- a/.github/workflows/test-video.yml +++ b/.github/workflows/test-video.yml @@ -37,17 +37,17 @@ jobs: - name: Run Docker Compose to record video run: USE_RANDOM_USER_ID=${USE_RANDOM_USER} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make test_video - name: Upload recorded Chrome video - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: chrome_video path: ./tests/videos/chrome_video.mp4 - name: Upload recorded Edge video - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: edge_video path: ./tests/videos/edge_video.mp4 - name: Upload recorded Firefox video - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: firefox_video path: ./tests/videos/firefox_video.mp4 From 56fc22aca7c7552e0f9d56a59b48fb0c55fb1e9f Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Fri, 15 Dec 2023 16:49:24 +0530 Subject: [PATCH 22/62] fix: changing owner while creating container for download support (#2064) Signed-off-by: Viet Nguyen Duc --- .github/workflows/helm-chart-test.yml | 4 +- Base/Dockerfile | 4 +- Base/entry_point.sh | 60 ++++++++++--------------- Base/fix-permissions | 65 ++++++++++++++++++--------- NodeChrome/Dockerfile | 1 - NodeEdge/Dockerfile | 1 - README.md | 56 ++++++++++++++++------- tests/test.py | 2 +- 8 files changed, 113 insertions(+), 80 deletions(-) diff --git a/.github/workflows/helm-chart-test.yml b/.github/workflows/helm-chart-test.yml index b81788951..887e6b5da 100644 --- a/.github/workflows/helm-chart-test.yml +++ b/.github/workflows/helm-chart-test.yml @@ -65,12 +65,12 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: ${{ env.CHART_FILE_NAME }} + name: ${{ matrix.test-strategy }}_${{ env.CHART_FILE_NAME }} path: ${{ env.CHART_PACKAGE_PATH }} - name: Upload Helm chart template rendered if: always() uses: actions/upload-artifact@v4 with: - name: chart_template_rendered.yaml + name: ${{ matrix.test-strategy }}_chart_template_rendered.yaml path: ./tests/tests/output_deployment.yaml if-no-files-found: ignore diff --git a/Base/Dockerfile b/Base/Dockerfile index 6bda097b7..ec37f8110 100644 --- a/Base/Dockerfile +++ b/Base/Dockerfile @@ -133,8 +133,7 @@ RUN /tmp/cs fetch --classpath --cache ${EXTERNAL_JARS} \ RUN rm -fr /root/.cache/* # Change ownership of directories -RUN chown -R "${SEL_USER}:${SEL_GID}" ${HOME} ${SEL_DIR} ${SEL_DIR}/assets ${EXTERNAL_JARS} ${SE_DOWNLOAD_DIR} /var/run/supervisor /var/log/supervisor \ - && fix-permissions ${HOME} ${SEL_DIR} ${SEL_DIR}/assets ${EXTERNAL_JARS} ${SE_DOWNLOAD_DIR} /var/run/supervisor /var/log/supervisor +RUN fix-permissions ${HOME} ${SEL_DIR} ${SEL_DIR}/assets ${EXTERNAL_JARS} ${SE_DOWNLOAD_DIR} /var/run/supervisor /var/log/supervisor #========== # Relaxing permissions for OpenShift and other non-sudo environments @@ -145,6 +144,7 @@ RUN chmod g=u /etc/passwd # Run the following commands as non-privileged user #=================================================== USER ${SEL_UID}:${SEL_GID} +VOLUME ${SE_DOWNLOAD_DIR} # Boolean value, maps "--bind-host" ENV SE_BIND_HOST false diff --git a/Base/entry_point.sh b/Base/entry_point.sh index 4ef9ee26b..0e8ef12f3 100755 --- a/Base/entry_point.sh +++ b/Base/entry_point.sh @@ -5,44 +5,30 @@ _log () { fi } -#============================================== -# OpenShift or non-sudo environments support -# https://docs.openshift.com/container-platform/3.11/creating_images/guidelines.html#openshift-specific-guidelines -#============================================== - -if ! whoami &> /dev/null; then - if [ -w /etc/passwd ]; then - echo "${USER_NAME:-${SEL_USER}}:x:$(id -u):0:${USER_NAME:-${SEL_USER}} user:${HOME}:${SE_DOWNLOAD_DIR}:/var:/opt:/sbin/nologin" >> /etc/passwd - fi -fi - -MKDIR_EXTRA=${SE_DOWNLOAD_DIR}","${MKDIR_EXTRA} -CHOWN_EXTRA=${MKDIR_EXTRA}","${CHOWN_EXTRA} - -if [ -n "${MKDIR_EXTRA}" ]; then - for extra_dir in $(echo "${MKDIR_EXTRA}" | tr ',' ' '); do - _log "Creating directory ${extra_dir} ${MKDIR_EXTRA_OPTS:+(mkdir options: ${MKDIR_EXTRA_OPTS})}" - # shellcheck disable=SC2086 - sudo mkdir ${MKDIR_EXTRA_OPTS:-"-p"} "${extra_dir}" - done -fi - -if [ -n "${CHOWN_EXTRA}" ]; then - for extra_dir in $(echo "${CHOWN_EXTRA}" | tr ',' ' '); do - _log "Changing ${extra_dir} ownership. ${extra_dir} is owned by ${SEL_USER} ${CHOWN_EXTRA_OPTS:+(chown options: ${CHOWN_EXTRA_OPTS})}" - # shellcheck disable=SC2086 - sudo chown ${CHOWN_EXTRA_OPTS:-"-R"} "${SEL_UID}:${SEL_GID}" "${extra_dir}" - sudo -E fix-permissions "${extra_dir}" - done -fi - -# Raise error if the user isn't able to write files to download dir -if [ -n "${CHOWN_EXTRA}" ]; then - for extra_dir in $(echo "${CHOWN_EXTRA}" | tr ',' ' '); do - if [[ ! -w ${extra_dir} ]]; then - _log "ERROR: no write access to download dir ${SE_DOWNLOAD_DIR}. Please correct the permissions and restart." +# If the container started as the root user +if [ "$(id -u)" == 0 ]; then + fix-permissions "${SE_DOWNLOAD_DIR}" +elif [ "$(id -u)" == "$(id -u ${SEL_USER})" ] && [ "$(id -g)" == "$(id -g ${SEL_USER})" ]; then + # Trust SEL_USER is the desired non-root user to execute with sudo + sudo -E fix-permissions "${SE_DOWNLOAD_DIR}" +else + # For non-root user to change ownership + # Relaxing permissions for OpenShift and other non-sudo environments + # (https://docs.openshift.com/container-platform/latest/openshift_images/create-images.html#use-uid_create-images) + if ! whoami &> /dev/null; then + _log "There is no entry in /etc/passwd for our UID=$(id -u). Attempting to fix..." + if [ -w /etc/passwd ]; then + _log "Renaming user to ${USER_NAME:-default} ($(id -u):$(id -g)" + # We cannot use "sed --in-place" since sed tries to create a temp file in + # /etc/ and we may not have write access. Apply sed on our own temp file: + sed --expression="s/^${SEL_USER}:/${USER_NAME:-default}:/" /etc/passwd > /tmp/passwd + echo "${USER_NAME:-default}:x:$(id -u):$(id -g):${USER_NAME:-default} user:${HOME}:/bin/bash" >> /tmp/passwd + cat /tmp/passwd > /etc/passwd + rm /tmp/passwd + _log "Added new ${USER_NAME:-default} user ($(id -u):$(id -g)). Fixed UID!" fi - done + fi + fix-permissions "${SE_DOWNLOAD_DIR}" fi /usr/bin/supervisord --configuration /etc/supervisord.conf & diff --git a/Base/fix-permissions b/Base/fix-permissions index 97d4ad8b8..e20ab2dbc 100644 --- a/Base/fix-permissions +++ b/Base/fix-permissions @@ -1,23 +1,46 @@ #!/bin/bash set -e -# Run this with USER root only -for d in "$@"; do - find "${d}" \ - ! \( \ - -group "${SEL_GID}" \ - -a -perm -g+rwX \ - \) \ - -exec chgrp -R "${SEL_GID}" -- {} \+ \ - -exec chmod -R g+rwX -- {} \+ - # setuid, setgid *on directories only* - find "${d}" \ - \( \ - -type d \ - -a ! -perm -6000 \ - \) \ - -exec chmod -R +6000 -- {} \+ - # Relaxing permissions for OpenShift and other non-sudo environments - chmod -R u+x "${d}" - chgrp -R 0 "${d}" - chmod -R g=u "${d}" -done + +if [[ "${SE_DOWNLOAD_DIR}" != "${HOME}/Downloads" ]] && [[ -d "${SE_DOWNLOAD_DIR}" ]]; then + mkdir -p "${SE_DOWNLOAD_DIR}" +fi + +if [ "$(id -u)" == 0 ]; then + # For root user to change ownership + for d in "$@"; do + find "${d}" \ + ! \( \ + -group "${SEL_GID}" \ + -a -perm -g+rwX \ + \) \ + -exec chown -R "${SEL_UID}:${SEL_GID}" -- {} \+ \ + -exec chgrp -R "${SEL_GID}" -- {} \+ \ + -exec chmod -R g+rwX -- {} \+ + find "${d}" \ + \( \ + -type d \ + -a ! -perm -775 \ + \) \ + -exec chmod -R 775 -- {} \+ + # Relaxing permissions for OpenShift and other non-sudo environments + chmod -R u+x "${d}" + chgrp -R 0 "${d}" + chmod -R g=u "${d}" + done + + # Only give write access for app data in case running of read-only filesystem + dirs=( + "${HOME}" + "${SEL_DIR}" + "${SE_DOWNLOAD_DIR}" + "/var/run/supervisor" + "/var/log/supervisor" + "/etc/passwd" + "/tmp/.X11-unix" + ) + for d in "${dirs[@]}"; do + if [[ -d $d ]]; then + chmod 777 -R "${d}" + fi + done +fi diff --git a/NodeChrome/Dockerfile b/NodeChrome/Dockerfile index e52dd5798..aee098943 100644 --- a/NodeChrome/Dockerfile +++ b/NodeChrome/Dockerfile @@ -50,7 +50,6 @@ RUN if [ ! -z "$CHROME_DRIVER_VERSION" ]; \ && unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \ && rm /tmp/chromedriver_linux64.zip \ && mv /opt/selenium/chromedriver-linux64/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ - && fix-permissions /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ && ln -fs /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver USER ${SEL_UID} diff --git a/NodeEdge/Dockerfile b/NodeEdge/Dockerfile index 2e3c781e8..500862f0f 100644 --- a/NodeEdge/Dockerfile +++ b/NodeEdge/Dockerfile @@ -43,7 +43,6 @@ RUN if [ -z "$EDGE_DRIVER_VERSION" ]; \ && unzip /tmp/msedgedriver_linux64.zip -d /opt/selenium \ && rm /tmp/msedgedriver_linux64.zip \ && mv /opt/selenium/msedgedriver /opt/selenium/msedgedriver-$EDGE_DRIVER_VERSION \ - && fix-permissions /opt/selenium/msedgedriver-$EDGE_DRIVER_VERSION \ && ln -fs /opt/selenium/msedgedriver-$EDGE_DRIVER_VERSION /usr/bin/msedgedriver USER ${SEL_UID} diff --git a/README.md b/README.md index 56287ac3a..ec9e6b535 100644 --- a/README.md +++ b/README.md @@ -1302,46 +1302,72 @@ that directory because it is running under the user `seluser`. This happens because that is how Docker mounts volumes in Linux, more details in this [issue](https://github.com/moby/moby/issues/2259). -There was a fix in this feature [#1947](https://github.com/SeleniumHQ/docker-selenium/issues/1947) -that changed ownership when staring the container. +A workaround (to be done manually) for this is to create a directory on the +host and change its permissions **before mounting the volume**. +Depending on your user permissions, you might need to use +`sudo` for some of these commands: -You are able to configure browser with another download directory and mount the host with it in container by overriding `SE_DOWNLOAD_DIR`. +```bash +mkdir /home/ubuntu/files +chown 1200:1201 /home/ubuntu/files +``` + +After doing this, you should be able to download files +to the mounted directory. + +--- +Another introduced feature [#1947](https://github.com/SeleniumHQ/docker-selenium/issues/1947) +that take action to change ownership when staring the container. +You are able to configure another default browser download directory and mount the host with it in container by overriding `SE_DOWNLOAD_DIR`. + +For example, in test you might be scripting something ```groovy ChromeOptions options = new ChromeOptions(); HashMap chromePrefs = new HashMap(); -chromePrefs.put("download.default_directory", "/tmp/downloads"); +chromePrefs.put("download.default_directory", "/path/to/your/downloads"); options.setExperimentalOption("prefs", chromePrefs); options.add_argument('disable-features=DownloadBubble,DownloadBubbleV2') WebDriver driver = new ChromeDriver(options); ``` +When running the container, you set the `SE_DOWNLOAD_DIR` and mount the host with that directory in container. ```bash docker run -d -p 4444:4444 --shm-size="2g" \ - -e SE_DOWNLOAD_DIR=/tmp/downloads \ - -v /home/ubuntu/files:/tmp/downloads \ + -e SE_DOWNLOAD_DIR=/path/to/your/downloads \ + -v /home/ubuntu/files:/path/to/your/downloads \ selenium/standalone-chrome:4.16.1-20231212 ``` -### Change ownership of the volume mount +**Note:** The changing ownership when starting container is not supported well when both overriding `SE_DOWNLOAD_DIR` and running non-root (e.g. Podman) or specifying user ids different from `1200` (OpenShift arbitrary user ids). + +In this case, you can use above workaround to create and set permissions for the directory on the host before mounting the volume. -If you are using Linux and you need to change the ownership of the volume mount, you can set the `CHOWN_EXTRA` and `CHOWN_EXTRA_OPTS` (default is set `-R` - change recursively) environment variables +You also can run the container with `--user root` once to initialize and change ownership of the directory on the host, then run the container with non-root user again. +For example, the first run with root user: ```bash docker run -d -p 4444:4444 --shm-size="2g" \ - -v /home/ubuntu/my-certs:/etc/certs \ - -e CHOWN_EXTRA=/etc/certs \ + --user root \ + -e SE_DOWNLOAD_DIR=/path/to/your/downloads \ + -v /home/ubuntu/files:/path/to/your/downloads \ selenium/standalone-chrome:4.16.1-20231212 ``` -If you want a new volume mount directory to be created and set ownership, you can set the `MKDIR_EXTRA` and `MKDIR_EXTRA_OPTS` (default is set `-p` - create a directory hierarchy) environment variables. - +Then stop it, rerun with switching to non-root user: ```bash docker run -d -p 4444:4444 --shm-size="2g" \ - -v /home/ubuntu/my-nssdb:/home/seluser/.pki/nssdb \ - -e MKDIR_EXTRA=/home/seluser/.pki/nssdb \ + --user 4496 \ + -e SE_DOWNLOAD_DIR=/path/to/your/downloads \ + -v /home/ubuntu/files:/path/to/your/downloads \ selenium/standalone-chrome:4.16.1-20231212 ``` +Summarize the supported use case for changing ownership when starting container: -Both `CHOWN_EXTRA` and `MKDIR_EXTRA` can be set to multiple directories by separating them with a `space` or `comma`. For example: `CHOWN_EXTRA=,` +| User (uid) | Mount `SE_DOWNLOAD_DIR` in container | Auto changing | +|----------------------|--------------------------------------|---------------| +| seluser (uid `1200`) | default `/home/seluser/Downloads` | Yes | +| seluser (uid `1200`) | any `/path/to/downloads` | Yes | +| any (uid != `1200`) | default `/home/seluser/Downloads` | Yes | +| any (uid != `1200`) | any `/path/to/downloads` | No | diff --git a/tests/test.py b/tests/test.py index b8b462c2b..0d260e330 100644 --- a/tests/test.py +++ b/tests/test.py @@ -174,7 +174,7 @@ def standalone_browser_container_matches(container): use_random_user_id = USE_RANDOM_USER_ID == 'true' run_in_docker_compose = RUN_IN_DOCKER_COMPOSE == 'true' - random_user_id = random.randint(2000, 65000) + random_user_id = "%s:%s" % (random.randint(2000, 65000), random.randint(2001, 65001)) if use_random_user_id: logger.info("Running tests with a random user ID -> %s" % random_user_id) From 3e22a51441d62efd99215ce4ed82ef6e07256c55 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Mon, 18 Dec 2023 15:01:37 +0530 Subject: [PATCH 23/62] revert: changing owner while creating container for download support (#2069) Signed-off-by: Viet Nguyen Duc --- Base/Dockerfile | 86 ++++++++++++++++++------------------------- Base/entry_point.sh | 38 +++++-------------- Base/fix-permissions | 46 ----------------------- NodeBase/Dockerfile | 15 +++++--- NodeChrome/Dockerfile | 1 + NodeEdge/Dockerfile | 1 + README.md | 71 +++++++---------------------------- tests/test.py | 2 +- 8 files changed, 71 insertions(+), 189 deletions(-) delete mode 100644 Base/fix-permissions diff --git a/Base/Dockerfile b/Base/Dockerfile index ec37f8110..59856c38b 100644 --- a/Base/Dockerfile +++ b/Base/Dockerfile @@ -10,9 +10,10 @@ ARG GRPC_VERSION=1.57.1 #Arguments to define the user running Selenium ARG SEL_USER=seluser +ARG SEL_GROUP=${SEL_USER} ARG SEL_PASSWD=secret -ARG SEL_UID=1200 -ARG SEL_GID=1201 +ARG UID=1200 +ARG GID=1201 USER root #================================================ @@ -62,44 +63,24 @@ RUN ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime && \ # Configure environement #====================================== ENV SEL_USER=${SEL_USER} -ENV SEL_UID=${SEL_UID} -ENV SEL_GID=${SEL_GID} +ENV SEL_UID=${UID} +ENV SEL_GID=${GID} ENV HOME=/home/${SEL_USER} -ENV SEL_DIR=/opt/selenium -ENV EXTERNAL_JARS=/external_jars -ENV SE_DOWNLOAD_DIR=${HOME}/Downloads - -# Copy a script that we will use to correct permissions after running certain commands -COPY fix-permissions /usr/local/bin/fix-permissions -RUN chmod a+rx /usr/local/bin/fix-permissions +ENV SEL_DOWNLOAD_DIR=${HOME}/Downloads #======================================== # Add normal user and group with passwordless sudo #======================================== -RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su \ - && sed -i.bak -e 's/^%admin/#%admin/' /etc/sudoers \ - && sed -i.bak -e 's/^%sudo/#%sudo/' /etc/sudoers \ - && echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers - -RUN groupadd ${SEL_USER} \ - --gid ${SEL_GID} \ - && useradd ${SEL_USER} \ - --no-log-init \ - --create-home \ - --gid ${SEL_GID} \ - --shell /bin/bash \ - --uid ${SEL_UID} \ - && chmod g+w /etc/passwd \ - && echo "${SEL_USER}:${SEL_PASSWD}" | chpasswd - -#====================================== -# Create directories needed -#====================================== -RUN mkdir -p ${HOME}/.mozilla ${HOME}/.cache \ - ${SEL_DIR} ${SEL_DIR}/assets \ - /var/run/supervisor /var/log/supervisor \ - ${EXTERNAL_JARS} \ - ${SE_DOWNLOAD_DIR} +RUN groupadd ${SEL_GROUP} \ + --gid ${SEL_GID} \ + && useradd ${SEL_USER} \ + --create-home \ + --gid ${SEL_GID} \ + --shell /bin/bash \ + --uid ${SEL_UID} \ + && usermod -a -G sudo ${SEL_USER} \ + && echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers \ + && echo "${SEL_USER}:${SEL_PASSWD}" | chpasswd #====================================== # Add Grid check script @@ -112,39 +93,42 @@ COPY --chown="${SEL_UID}:${SEL_GID}" check-grid.sh entry_point.sh /opt/bin/ COPY supervisord.conf /etc #========== -# Selenium +# Selenium & relaxing permissions for OpenShift and other non-sudo environments #========== -RUN touch ${SEL_DIR}/config.toml \ +RUN mkdir -p /opt/selenium /opt/selenium/assets /var/run/supervisor /var/log/supervisor ${SEL_DOWNLOAD_DIR} ${HOME}/.mozilla ${HOME}/.vnc \ + && touch /opt/selenium/config.toml \ + && chown -R ${SEL_USER}:${SEL_GROUP} /opt/selenium /var/run/supervisor /var/log/supervisor /etc/passwd ${HOME} \ + && chmod -R 775 /opt/selenium /var/run/supervisor /var/log/supervisor /etc/passwd ${HOME} \ && wget --no-verbose https://github.com/SeleniumHQ/selenium/releases/download/${RELEASE}/selenium-server-${VERSION}.jar \ - -O ${SEL_DIR}/selenium-server.jar \ - && echo "${SEL_PASSWD}" > ${SEL_DIR}/initialPasswd + -O /opt/selenium/selenium-server.jar \ + && echo "${SEL_PASSWD}" > /opt/selenium/initialPasswd \ + && chgrp -R 0 /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor \ + && chmod -R g=u /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor \ + && setfacl -Rm u:${SEL_USER}:rwx /opt /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor \ + && setfacl -Rm g:${SEL_GROUP}:rwx /opt /opt/selenium ${HOME} /opt/selenium/assets /var/run/supervisor /var/log/supervisor #===== # Download observability related jaegar jars and make them available in a separate directory # so that the container can skip downloading them everytime it comes up #===== RUN curl -fLo /tmp/cs https://github.com/coursier/launchers/raw/master/coursier \ - && chmod +x /tmp/cs + && chmod +x /tmp/cs \ + && mkdir -p /external_jars \ + && chmod -R 775 /external_jars -RUN /tmp/cs fetch --classpath --cache ${EXTERNAL_JARS} \ +RUN /tmp/cs fetch --classpath --cache /external_jars \ io.opentelemetry:opentelemetry-exporter-otlp:${OPENTELEMETRY_VERSION} \ io.opentelemetry:opentelemetry-exporter-jaeger:${OPENTELEMETRY_VERSION} \ - io.grpc:grpc-netty:${GRPC_VERSION} > ${EXTERNAL_JARS}/.classpath.txt -RUN rm -fr /root/.cache/* + io.grpc:grpc-netty:${GRPC_VERSION} > /external_jars/.classpath.txt -# Change ownership of directories -RUN fix-permissions ${HOME} ${SEL_DIR} ${SEL_DIR}/assets ${EXTERNAL_JARS} ${SE_DOWNLOAD_DIR} /var/run/supervisor /var/log/supervisor - -#========== -# Relaxing permissions for OpenShift and other non-sudo environments -#========== -RUN chmod g=u /etc/passwd +RUN chmod 664 /external_jars/.classpath.txt +RUN rm -fr /root/.cache/* #=================================================== # Run the following commands as non-privileged user #=================================================== USER ${SEL_UID}:${SEL_GID} -VOLUME ${SE_DOWNLOAD_DIR} +VOLUME ${SEL_DOWNLOAD_DIR} # Boolean value, maps "--bind-host" ENV SE_BIND_HOST false diff --git a/Base/entry_point.sh b/Base/entry_point.sh index 0e8ef12f3..0fd0b314e 100755 --- a/Base/entry_point.sh +++ b/Base/entry_point.sh @@ -1,34 +1,14 @@ #!/usr/bin/env bash -_log () { - if [[ "$*" == "ERROR:"* ]] || [[ "$*" == "WARNING:"* ]] || [[ "${CONTAINER_LOGS_QUIET}" == "" ]]; then - echo "$@" - fi -} -# If the container started as the root user -if [ "$(id -u)" == 0 ]; then - fix-permissions "${SE_DOWNLOAD_DIR}" -elif [ "$(id -u)" == "$(id -u ${SEL_USER})" ] && [ "$(id -g)" == "$(id -g ${SEL_USER})" ]; then - # Trust SEL_USER is the desired non-root user to execute with sudo - sudo -E fix-permissions "${SE_DOWNLOAD_DIR}" -else - # For non-root user to change ownership - # Relaxing permissions for OpenShift and other non-sudo environments - # (https://docs.openshift.com/container-platform/latest/openshift_images/create-images.html#use-uid_create-images) - if ! whoami &> /dev/null; then - _log "There is no entry in /etc/passwd for our UID=$(id -u). Attempting to fix..." - if [ -w /etc/passwd ]; then - _log "Renaming user to ${USER_NAME:-default} ($(id -u):$(id -g)" - # We cannot use "sed --in-place" since sed tries to create a temp file in - # /etc/ and we may not have write access. Apply sed on our own temp file: - sed --expression="s/^${SEL_USER}:/${USER_NAME:-default}:/" /etc/passwd > /tmp/passwd - echo "${USER_NAME:-default}:x:$(id -u):$(id -g):${USER_NAME:-default} user:${HOME}:/bin/bash" >> /tmp/passwd - cat /tmp/passwd > /etc/passwd - rm /tmp/passwd - _log "Added new ${USER_NAME:-default} user ($(id -u):$(id -g)). Fixed UID!" - fi - fi - fix-permissions "${SE_DOWNLOAD_DIR}" +#============================================== +# OpenShift or non-sudo environments support +# https://docs.openshift.com/container-platform/3.11/creating_images/guidelines.html#openshift-specific-guidelines +#============================================== + +if ! whoami &> /dev/null; then + if [ -w /etc/passwd ]; then + echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd + fi fi /usr/bin/supervisord --configuration /etc/supervisord.conf & diff --git a/Base/fix-permissions b/Base/fix-permissions deleted file mode 100644 index e20ab2dbc..000000000 --- a/Base/fix-permissions +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -set -e - -if [[ "${SE_DOWNLOAD_DIR}" != "${HOME}/Downloads" ]] && [[ -d "${SE_DOWNLOAD_DIR}" ]]; then - mkdir -p "${SE_DOWNLOAD_DIR}" -fi - -if [ "$(id -u)" == 0 ]; then - # For root user to change ownership - for d in "$@"; do - find "${d}" \ - ! \( \ - -group "${SEL_GID}" \ - -a -perm -g+rwX \ - \) \ - -exec chown -R "${SEL_UID}:${SEL_GID}" -- {} \+ \ - -exec chgrp -R "${SEL_GID}" -- {} \+ \ - -exec chmod -R g+rwX -- {} \+ - find "${d}" \ - \( \ - -type d \ - -a ! -perm -775 \ - \) \ - -exec chmod -R 775 -- {} \+ - # Relaxing permissions for OpenShift and other non-sudo environments - chmod -R u+x "${d}" - chgrp -R 0 "${d}" - chmod -R g=u "${d}" - done - - # Only give write access for app data in case running of read-only filesystem - dirs=( - "${HOME}" - "${SEL_DIR}" - "${SE_DOWNLOAD_DIR}" - "/var/run/supervisor" - "/var/log/supervisor" - "/etc/passwd" - "/tmp/.X11-unix" - ) - for d in "${dirs[@]}"; do - if [[ -d $d ]]; then - chmod 777 -R "${d}" - fi - done -fi diff --git a/NodeBase/Dockerfile b/NodeBase/Dockerfile index b5770fb0a..fa70d1cb0 100644 --- a/NodeBase/Dockerfile +++ b/NodeBase/Dockerfile @@ -114,8 +114,7 @@ RUN wget -nv -O noVNC.zip \ RUN chmod +x /dev/shm # Creating base directory for Xvfb -RUN mkdir -p /tmp/.X11-unix && \ - fix-permissions /tmp/.X11-unix +RUN mkdir -p /tmp/.X11-unix #============================== # Generating the VNC password using initial password in Base image @@ -123,9 +122,15 @@ RUN mkdir -p /tmp/.X11-unix && \ #============================== RUN mkdir -p ${HOME}/.vnc \ - && x11vnc -storepasswd $(cat ${SEL_DIR}/initialPasswd) ${HOME}/.vnc/passwd \ - && chown -R "${SEL_UID}:${SEL_GID}" ${HOME}/.vnc \ - && fix-permissions ${HOME}/.vnc + && x11vnc -storepasswd $(cat /opt/selenium/initialPasswd) ${HOME}/.vnc/passwd \ + && chown -R "${SEL_USER}:${SEL_GROUP}" ${HOME}/.vnc + +#========== +# Relaxing permissions for OpenShift and other non-sudo environments +#========== +RUN chmod -R 775 ${HOME} /tmp/.X11-unix \ + && chgrp -R 0 ${HOME} /tmp/.X11-unix \ + && chmod -R g=u ${HOME} /tmp/.X11-unix #=================================================== # Run the following commands as non-privileged user diff --git a/NodeChrome/Dockerfile b/NodeChrome/Dockerfile index aee098943..c4d1fdd26 100644 --- a/NodeChrome/Dockerfile +++ b/NodeChrome/Dockerfile @@ -50,6 +50,7 @@ RUN if [ ! -z "$CHROME_DRIVER_VERSION" ]; \ && unzip /tmp/chromedriver_linux64.zip -d /opt/selenium \ && rm /tmp/chromedriver_linux64.zip \ && mv /opt/selenium/chromedriver-linux64/chromedriver /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ + && chmod 755 /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION \ && ln -fs /opt/selenium/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver USER ${SEL_UID} diff --git a/NodeEdge/Dockerfile b/NodeEdge/Dockerfile index 500862f0f..4c8ab8414 100644 --- a/NodeEdge/Dockerfile +++ b/NodeEdge/Dockerfile @@ -43,6 +43,7 @@ RUN if [ -z "$EDGE_DRIVER_VERSION" ]; \ && unzip /tmp/msedgedriver_linux64.zip -d /opt/selenium \ && rm /tmp/msedgedriver_linux64.zip \ && mv /opt/selenium/msedgedriver /opt/selenium/msedgedriver-$EDGE_DRIVER_VERSION \ + && chmod 755 /opt/selenium/msedgedriver-$EDGE_DRIVER_VERSION \ && ln -fs /opt/selenium/msedgedriver-$EDGE_DRIVER_VERSION /usr/bin/msedgedriver USER ${SEL_UID} diff --git a/README.md b/README.md index ec9e6b535..5341c59ac 100644 --- a/README.md +++ b/README.md @@ -900,6 +900,17 @@ $ BUILD_ARGS="--build-arg http_proxy=http://acme:3128 --build-arg https_proxy=ht _Note: Omitting_ `VERSION=local` _will build the images with the released version but replacing the date for the current one._ +If you want to build the image with the host UID/GID, simply set an environment variable `BUILD_ARGS` + +``` bash +$ BUILD_ARGS="--build-arg UID=$(id -u) --build-arg GID=$(id -g)" make build +``` + +If you want to build the image with different default user/password, simply set an environment variable `BUILD_ARGS` + +``` bash +$ BUILD_ARGS="--build-arg SEL_USER=yourseluser --build-arg SEL_PASSWD=welcome" make build +``` ___ ## Waiting for the Grid to be ready @@ -1302,7 +1313,7 @@ that directory because it is running under the user `seluser`. This happens because that is how Docker mounts volumes in Linux, more details in this [issue](https://github.com/moby/moby/issues/2259). -A workaround (to be done manually) for this is to create a directory on the +A workaround for this is to create a directory on the host and change its permissions **before mounting the volume**. Depending on your user permissions, you might need to use `sudo` for some of these commands: @@ -1313,61 +1324,7 @@ chown 1200:1201 /home/ubuntu/files ``` After doing this, you should be able to download files -to the mounted directory. - ---- -Another introduced feature [#1947](https://github.com/SeleniumHQ/docker-selenium/issues/1947) -that take action to change ownership when staring the container. - -You are able to configure another default browser download directory and mount the host with it in container by overriding `SE_DOWNLOAD_DIR`. - -For example, in test you might be scripting something -```groovy -ChromeOptions options = new ChromeOptions(); -HashMap chromePrefs = new HashMap(); -chromePrefs.put("download.default_directory", "/path/to/your/downloads"); -options.setExperimentalOption("prefs", chromePrefs); -options.add_argument('disable-features=DownloadBubble,DownloadBubbleV2') -WebDriver driver = new ChromeDriver(options); -``` - -When running the container, you set the `SE_DOWNLOAD_DIR` and mount the host with that directory in container. -```bash -docker run -d -p 4444:4444 --shm-size="2g" \ - -e SE_DOWNLOAD_DIR=/path/to/your/downloads \ - -v /home/ubuntu/files:/path/to/your/downloads \ - selenium/standalone-chrome:4.16.1-20231212 -``` - -**Note:** The changing ownership when starting container is not supported well when both overriding `SE_DOWNLOAD_DIR` and running non-root (e.g. Podman) or specifying user ids different from `1200` (OpenShift arbitrary user ids). - -In this case, you can use above workaround to create and set permissions for the directory on the host before mounting the volume. - -You also can run the container with `--user root` once to initialize and change ownership of the directory on the host, then run the container with non-root user again. - -For example, the first run with root user: -```bash -docker run -d -p 4444:4444 --shm-size="2g" \ - --user root \ - -e SE_DOWNLOAD_DIR=/path/to/your/downloads \ - -v /home/ubuntu/files:/path/to/your/downloads \ - selenium/standalone-chrome:4.16.1-20231212 -``` - -Then stop it, rerun with switching to non-root user: -```bash -docker run -d -p 4444:4444 --shm-size="2g" \ - --user 4496 \ - -e SE_DOWNLOAD_DIR=/path/to/your/downloads \ - -v /home/ubuntu/files:/path/to/your/downloads \ - selenium/standalone-chrome:4.16.1-20231212 -``` -Summarize the supported use case for changing ownership when starting container: +to the mounted directory. If you have a better workaround, +please send us a pull request! -| User (uid) | Mount `SE_DOWNLOAD_DIR` in container | Auto changing | -|----------------------|--------------------------------------|---------------| -| seluser (uid `1200`) | default `/home/seluser/Downloads` | Yes | -| seluser (uid `1200`) | any `/path/to/downloads` | Yes | -| any (uid != `1200`) | default `/home/seluser/Downloads` | Yes | -| any (uid != `1200`) | any `/path/to/downloads` | No | diff --git a/tests/test.py b/tests/test.py index 0d260e330..b8b462c2b 100644 --- a/tests/test.py +++ b/tests/test.py @@ -174,7 +174,7 @@ def standalone_browser_container_matches(container): use_random_user_id = USE_RANDOM_USER_ID == 'true' run_in_docker_compose = RUN_IN_DOCKER_COMPOSE == 'true' - random_user_id = "%s:%s" % (random.randint(2000, 65000), random.randint(2001, 65001)) + random_user_id = random.randint(2000, 65000) if use_random_user_id: logger.info("Running tests with a random user ID -> %s" % random_user_id) From 02e6af24b276905d5123f7701755b285156a25f7 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Mon, 18 Dec 2023 16:00:44 +0530 Subject: [PATCH 24/62] feat(chart): Simplify to change log level in Kubernetes (#2072) feat(chart): Simplify to change log level in Kubernetes Signed-off-by: Viet Nguyen Duc --- .../start-selenium-grid-distributor.sh | 5 ++++ EventBus/start-selenium-grid-eventbus.sh | 5 ++++ Hub/start-selenium-grid-hub.sh | 5 ++++ NodeBase/start-selenium-node.sh | 5 ++++ NodeDocker/start-selenium-grid-docker.sh | 5 ++++ Router/start-selenium-grid-router.sh | 5 ++++ .../start-selenium-grid-session-queue.sh | 5 ++++ Sessions/start-selenium-grid-sessions.sh | 5 ++++ Standalone/start-selenium-standalone.sh | 5 ++++ .../start-selenium-grid-docker.sh | 5 ++++ charts/selenium-grid/Chart.yaml | 2 +- charts/selenium-grid/README.md | 1 + charts/selenium-grid/templates/_helpers.tpl | 2 ++ .../templates/distributor-deployment.yaml | 2 ++ .../templates/event-bus-deployment.yaml | 6 +++-- .../templates/hub-deployment.yaml | 6 +++-- .../templates/logging-configmap.yaml | 15 ++++++++++++ .../templates/router-deployment.yaml | 6 +++-- .../templates/session-map-deployment.yaml | 2 ++ .../templates/session-queuer-deployment.yaml | 6 +++-- charts/selenium-grid/values.yaml | 8 +++++++ tests/charts/templates/render/dummy.yaml | 1 + tests/charts/templates/test.py | 23 +++++++++++++++++++ 23 files changed, 121 insertions(+), 9 deletions(-) create mode 100644 charts/selenium-grid/templates/logging-configmap.yaml diff --git a/Distributor/start-selenium-grid-distributor.sh b/Distributor/start-selenium-grid-distributor.sh index b51340c91..b0782c3c3 100755 --- a/Distributor/start-selenium-grid-distributor.sh +++ b/Distributor/start-selenium-grid-distributor.sh @@ -54,6 +54,11 @@ if [ ! -z "$SE_DISTRIBUTOR_PORT" ]; then PORT_CONFIG="--port ${SE_DISTRIBUTOR_PORT}" fi +if [ ! -z "$SE_LOG_LEVEL" ]; then + echo "Appending Selenium options: --log-level ${SE_LOG_LEVEL}" + SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/EventBus/start-selenium-grid-eventbus.sh b/EventBus/start-selenium-grid-eventbus.sh index d3413a968..a8af2c040 100755 --- a/EventBus/start-selenium-grid-eventbus.sh +++ b/EventBus/start-selenium-grid-eventbus.sh @@ -19,6 +19,11 @@ if [ ! -z "$SE_OPTS" ]; then echo "Appending Selenium options: ${SE_OPTS}" fi +if [ ! -z "$SE_LOG_LEVEL" ]; then + echo "Appending Selenium options: --log-level ${SE_LOG_LEVEL}" + SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/Hub/start-selenium-grid-hub.sh b/Hub/start-selenium-grid-hub.sh index 98b9758f7..e25fe16d4 100755 --- a/Hub/start-selenium-grid-hub.sh +++ b/Hub/start-selenium-grid-hub.sh @@ -22,6 +22,11 @@ if [ ! -z "$SE_SUB_PATH" ]; then SUB_PATH_CONFIG="--sub-path ${SE_SUB_PATH}" fi +if [ ! -z "$SE_LOG_LEVEL" ]; then + echo "Appending Selenium options: --log-level ${SE_LOG_LEVEL}" + SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/NodeBase/start-selenium-node.sh b/NodeBase/start-selenium-node.sh index 4b069c7dd..21cd7b946 100755 --- a/NodeBase/start-selenium-node.sh +++ b/NodeBase/start-selenium-node.sh @@ -36,6 +36,11 @@ if [ ! -z "$SE_NODE_SESSION_TIMEOUT" ]; then echo "Appending Selenium node session timeout via SE_OPTS: ${SE_OPTS}" fi +if [ ! -z "$SE_LOG_LEVEL" ]; then + echo "Appending Selenium options: --log-level ${SE_LOG_LEVEL}" + SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" +fi + if [ "$GENERATE_CONFIG" = true ]; then echo "Generating Selenium Config" /opt/bin/generate_config diff --git a/NodeDocker/start-selenium-grid-docker.sh b/NodeDocker/start-selenium-grid-docker.sh index 0220a1ec9..a811780e7 100755 --- a/NodeDocker/start-selenium-grid-docker.sh +++ b/NodeDocker/start-selenium-grid-docker.sh @@ -29,6 +29,11 @@ if [ ! -z "$SE_NODE_GRID_URL" ]; then SE_GRID_URL="--grid-url ${SE_NODE_GRID_URL}" fi +if [ ! -z "$SE_LOG_LEVEL" ]; then + echo "Appending Selenium options: --log-level ${SE_LOG_LEVEL}" + SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/Router/start-selenium-grid-router.sh b/Router/start-selenium-grid-router.sh index 1c3103dfc..bb848a1c7 100755 --- a/Router/start-selenium-grid-router.sh +++ b/Router/start-selenium-grid-router.sh @@ -54,6 +54,11 @@ if [ ! -z "$SE_ROUTER_PORT" ]; then PORT_CONFIG="--port ${SE_ROUTER_PORT}" fi +if [ ! -z "$SE_LOG_LEVEL" ]; then + echo "Appending Selenium options: --log-level ${SE_LOG_LEVEL}" + SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/SessionQueue/start-selenium-grid-session-queue.sh b/SessionQueue/start-selenium-grid-session-queue.sh index b92c116bd..11074afb9 100755 --- a/SessionQueue/start-selenium-grid-session-queue.sh +++ b/SessionQueue/start-selenium-grid-session-queue.sh @@ -19,6 +19,11 @@ if [ ! -z "$SE_SESSION_QUEUE_PORT" ]; then PORT_CONFIG="--port ${SE_SESSION_QUEUE_PORT}" fi +if [ ! -z "$SE_LOG_LEVEL" ]; then + echo "Appending Selenium options: --log-level ${SE_LOG_LEVEL}" + SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/Sessions/start-selenium-grid-sessions.sh b/Sessions/start-selenium-grid-sessions.sh index 8dd9db195..4d34a1a5b 100755 --- a/Sessions/start-selenium-grid-sessions.sh +++ b/Sessions/start-selenium-grid-sessions.sh @@ -34,6 +34,11 @@ if [ ! -z "$SE_SESSIONS_PORT" ]; then PORT_CONFIG="--port ${SE_SESSIONS_PORT}" fi +if [ ! -z "$SE_LOG_LEVEL" ]; then + echo "Appending Selenium options: --log-level ${SE_LOG_LEVEL}" + SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/Standalone/start-selenium-standalone.sh b/Standalone/start-selenium-standalone.sh index cfde62d8e..955cb15f4 100755 --- a/Standalone/start-selenium-standalone.sh +++ b/Standalone/start-selenium-standalone.sh @@ -11,6 +11,11 @@ if [ ! -z "$SE_OPTS" ]; then echo "Appending Selenium options: ${SE_OPTS}" fi +if [ ! -z "$SE_LOG_LEVEL" ]; then + echo "Appending Selenium options: --log-level ${SE_LOG_LEVEL}" + SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" +fi + /opt/bin/generate_config echo "Selenium Grid Standalone configuration: " diff --git a/StandaloneDocker/start-selenium-grid-docker.sh b/StandaloneDocker/start-selenium-grid-docker.sh index 2f4ad1e13..8571abc7a 100755 --- a/StandaloneDocker/start-selenium-grid-docker.sh +++ b/StandaloneDocker/start-selenium-grid-docker.sh @@ -14,6 +14,11 @@ if [ ! -z "$SE_NODE_GRID_URL" ]; then SE_GRID_URL="--grid-url ${SE_NODE_GRID_URL}" fi +if [ ! -z "$SE_LOG_LEVEL" ]; then + echo "Appending Selenium options: --log-level ${SE_LOG_LEVEL}" + SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/charts/selenium-grid/Chart.yaml b/charts/selenium-grid/Chart.yaml index 5f8594060..6a0dbfdb6 100644 --- a/charts/selenium-grid/Chart.yaml +++ b/charts/selenium-grid/Chart.yaml @@ -7,7 +7,7 @@ appVersion: 4.16.1-20231212 icon: https://github.com/SeleniumHQ/docker-selenium/raw/trunk/logo.png dependencies: - repository: https://kedacore.github.io/charts - version: 2.12.0 + version: 2.12.1 name: keda condition: autoscaling.enabled maintainers: diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index 524b497b5..8681ed5e0 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -140,6 +140,7 @@ For now, global configuration supported is: | `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images | | `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images | | `global.seleniumGrid.affinity` | `{}` | Affinity assigned globally | +| `global.seleniumGrid.logLevel` | `INFO` | Set log level for all components | This table contains the configuration parameters of the chart and their default values: diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index 48c18bb95..12342ad9b 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -207,6 +207,8 @@ template: name: {{ .Values.busConfigMap.name }} - configMapRef: name: {{ .Values.nodeConfigMap.name }} + - configMapRef: + name: {{ .Values.loggingConfigMap.name }} {{- with .node.extraEnvFrom }} {{- tpl (toYaml .) $ | nindent 10 }} {{- end }} diff --git a/charts/selenium-grid/templates/distributor-deployment.yaml b/charts/selenium-grid/templates/distributor-deployment.yaml index 07462f15e..990e519fb 100644 --- a/charts/selenium-grid/templates/distributor-deployment.yaml +++ b/charts/selenium-grid/templates/distributor-deployment.yaml @@ -47,6 +47,8 @@ spec: envFrom: - configMapRef: name: {{ .Values.busConfigMap.name }} + - configMapRef: + name: {{ .Values.loggingConfigMap.name }} {{- with .Values.components.extraEnvFrom }} {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/selenium-grid/templates/event-bus-deployment.yaml b/charts/selenium-grid/templates/event-bus-deployment.yaml index 8d894790b..498570c9b 100644 --- a/charts/selenium-grid/templates/event-bus-deployment.yaml +++ b/charts/selenium-grid/templates/event-bus-deployment.yaml @@ -42,10 +42,12 @@ spec: {{- with .Values.components.extraEnvironmentVariables }} env: {{- tpl (toYaml .) $ | nindent 12 }} {{- end }} - {{- with .Values.components.extraEnvFrom }} envFrom: + - configMapRef: + name: {{ .Values.loggingConfigMap.name }} + {{- with .Values.components.extraEnvFrom }} {{- toYaml . | nindent 12 }} - {{- end }} + {{- end }} {{- with .Values.components.eventBus.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/selenium-grid/templates/hub-deployment.yaml b/charts/selenium-grid/templates/hub-deployment.yaml index 8b322ecd5..14345e6c8 100644 --- a/charts/selenium-grid/templates/hub-deployment.yaml +++ b/charts/selenium-grid/templates/hub-deployment.yaml @@ -76,10 +76,12 @@ spec: {{- with .Values.hub.extraEnvironmentVariables }} {{- tpl (toYaml .) $ | nindent 12 }} {{- end }} - {{- with .Values.hub.extraEnvFrom }} envFrom: + - configMapRef: + name: {{ .Values.loggingConfigMap.name }} + {{- with .Values.hub.extraEnvFrom }} {{- toYaml . | nindent 12 }} - {{- end }} + {{- end }} {{- with .Values.hub.extraVolumeMounts }} volumeMounts: {{- tpl (toYaml .) $ | nindent 12 }} diff --git a/charts/selenium-grid/templates/logging-configmap.yaml b/charts/selenium-grid/templates/logging-configmap.yaml new file mode 100644 index 000000000..36acc3bde --- /dev/null +++ b/charts/selenium-grid/templates/logging-configmap.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Values.loggingConfigMap.name }} + namespace: {{ .Release.Namespace }} +{{- with .Values.loggingConfigMap.annotations }} + annotations: {{- toYaml . | nindent 4 }} +{{- end }} + labels: + {{- include "seleniumGrid.commonLabels" . | nindent 4 }} + {{- with .Values.customLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +data: + SE_LOG_LEVEL: "{{ default "INFO" .Values.global.seleniumGrid.logLevel }}" diff --git a/charts/selenium-grid/templates/router-deployment.yaml b/charts/selenium-grid/templates/router-deployment.yaml index 33d98c65a..70ebe9bc3 100644 --- a/charts/selenium-grid/templates/router-deployment.yaml +++ b/charts/selenium-grid/templates/router-deployment.yaml @@ -56,10 +56,12 @@ spec: {{- with .Values.components.extraEnvironmentVariables }} {{- tpl (toYaml .) $ | nindent 12 }} {{- end }} - {{- with .Values.components.extraEnvFrom }} envFrom: + - configMapRef: + name: {{ .Values.loggingConfigMap.name }} + {{- with .Values.components.extraEnvFrom }} {{- toYaml . | nindent 12 }} - {{- end }} + {{- end }} ports: - containerPort: {{ .Values.components.router.port }} protocol: TCP diff --git a/charts/selenium-grid/templates/session-map-deployment.yaml b/charts/selenium-grid/templates/session-map-deployment.yaml index 8aebdefb2..2edd701e2 100644 --- a/charts/selenium-grid/templates/session-map-deployment.yaml +++ b/charts/selenium-grid/templates/session-map-deployment.yaml @@ -36,6 +36,8 @@ spec: env: {{- tpl (toYaml .) $ | nindent 12 }} {{- end }} envFrom: + - configMapRef: + name: {{ .Values.loggingConfigMap.name }} - configMapRef: name: {{ .Values.busConfigMap.name }} {{- with .Values.components.extraEnvFrom }} diff --git a/charts/selenium-grid/templates/session-queuer-deployment.yaml b/charts/selenium-grid/templates/session-queuer-deployment.yaml index 557d6774e..379285038 100644 --- a/charts/selenium-grid/templates/session-queuer-deployment.yaml +++ b/charts/selenium-grid/templates/session-queuer-deployment.yaml @@ -35,10 +35,12 @@ spec: {{- with .Values.components.extraEnvironmentVariables }} env: {{- tpl (toYaml .) $ | nindent 12 }} {{- end }} - {{- with .Values.components.extraEnvFrom }} envFrom: + - configMapRef: + name: {{ .Values.loggingConfigMap.name }} + {{- with .Values.components.extraEnvFrom }} {{- toYaml . | nindent 12 }} - {{- end }} + {{- end }} ports: - containerPort: {{ .Values.components.sessionQueue.port }} protocol: TCP diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index 5a82d207d..f6be10a83 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -10,6 +10,8 @@ global: videoImageTag: ffmpeg-6.1-20231212 # Pull secret for all components, can be overridden individually imagePullSecret: "" + # Log level for all components. Possible values describe here: https://www.selenium.dev/documentation/grid/configuration/cli_options/#logging + logLevel: INFO # Basic auth settings for Selenium Grid basicAuth: @@ -68,6 +70,12 @@ nodeConfigMap: # Custom annotations for configmap annotations: {} +# ConfigMap that contains common environment variables for Logging (https://www.selenium.dev/documentation/grid/configuration/cli_options/#logging) +loggingConfigMap: + name: selenium-logging-config + # Custom annotations for configmap + annotations: {} + # Configuration for isolated components (applied only if `isolateComponents: true`) components: diff --git a/tests/charts/templates/render/dummy.yaml b/tests/charts/templates/render/dummy.yaml index 52d672a8a..fbb746166 100644 --- a/tests/charts/templates/render/dummy.yaml +++ b/tests/charts/templates/render/dummy.yaml @@ -1,6 +1,7 @@ # This is dummy values file for chart template testing global: seleniumGrid: + logLevel: FINE affinity: &affinity podAffinity: requiredDuringSchedulingIgnoredDuringExecution: diff --git a/tests/charts/templates/test.py b/tests/charts/templates/test.py index f05c7629d..2f0c2f412 100644 --- a/tests/charts/templates/test.py +++ b/tests/charts/templates/test.py @@ -67,6 +67,29 @@ def test_sub_path_set_to_grid_env_var(self): is_present = True self.assertTrue(is_present, "ENV variable SE_SUB_PATH is not populated") + def test_log_level_set_to_logging_config_map(self): + resources_name = ['selenium-chrome-node', 'selenium-distributor', 'selenium-edge-node', 'selenium-firefox-node', + 'selenium-event-bus', 'selenium-router', 'selenium-session-map', 'selenium-session-queue'] + logger.info(f"Assert log level value is set to logging ConfigMap") + count_config = 0 + for doc in LIST_OF_DOCUMENTS: + if doc['metadata']['name'] == 'selenium-logging-config' and doc['kind'] == 'ConfigMap': + self.assertTrue(doc['data']['SE_LOG_LEVEL'] == 'FINE') + count_config += 1 + self.assertEqual(count_config, 1, "No logging ConfigMap found") + count = 0 + for doc in LIST_OF_DOCUMENTS: + if doc['metadata']['name'] in resources_name and doc['kind'] == 'Deployment': + is_present = False + logger.info(f"Assert logging ConfigMap is set to envFrom in resource {doc['metadata']['name']}") + list_env_from = doc['spec']['template']['spec']['containers'][0]['envFrom'] + for env in list_env_from: + if env['configMapRef']['name'] == 'selenium-logging-config': + is_present = True + self.assertTrue(is_present, "envFrom doesn't contain logging ConfigMap") + count += 1 + self.assertEqual(count, len(resources_name), "Logging ConfigMap is not present in expected resources") + if __name__ == '__main__': failed = False try: From af16a26f192ced4e993834dcd72b12f1ece8f730 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Tue, 19 Dec 2023 15:50:07 +0530 Subject: [PATCH 25/62] feat(chart): Simplify to access Selenium Grid from outside of Kubernetes (#2073) [deploy] Signed-off-by: Viet Nguyen Duc --- charts/selenium-grid/Chart.yaml | 4 + charts/selenium-grid/README.md | 74 ++++++++++++++- charts/selenium-grid/templates/NOTES.txt | 19 ++-- charts/selenium-grid/templates/_helpers.tpl | 73 ++++++++++++-- .../templates/distributor-service.yaml | 3 + .../templates/event-bus-service.yaml | 9 ++ .../selenium-grid/templates/hub-service.yaml | 9 ++ .../templates/node-configmap.yaml | 2 +- .../templates/router-service.yaml | 3 + .../templates/session-queuer-service.yaml | 3 + charts/selenium-grid/values.yaml | 39 +++++++- .../charts/ci/ParallelAutoscaling-values.yaml | 7 -- tests/charts/ci/auth-ingress-values.yaml | 21 ++-- tests/charts/config/ct.yaml | 1 + tests/charts/make/chart_cluster_setup.sh | 7 -- tests/charts/refValues/simplex-minikube.yaml | 95 +++++++++++++++++++ tests/charts/templates/render/dummy.yaml | 19 ++++ tests/charts/templates/test.py | 13 ++- 18 files changed, 362 insertions(+), 39 deletions(-) create mode 100644 tests/charts/refValues/simplex-minikube.yaml diff --git a/charts/selenium-grid/Chart.yaml b/charts/selenium-grid/Chart.yaml index 6a0dbfdb6..1fedd8f1d 100644 --- a/charts/selenium-grid/Chart.yaml +++ b/charts/selenium-grid/Chart.yaml @@ -10,6 +10,10 @@ dependencies: version: 2.12.1 name: keda condition: autoscaling.enabled +- repository: https://kubernetes.github.io/ingress-nginx + version: 4.8.3 + name: ingress-nginx + condition: ingress-nginx.enabled maintainers: - name: SeleniumHQ email: selenium-developers@googlegroups.com diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index 8681ed5e0..8b1f46225 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -2,6 +2,27 @@ This chart enables the creation of a Selenium Grid Server in Kubernetes. +## Contents + +* [Selenium-Grid Helm Chart](#selenium-grid-helm-chart) + * [Contents](#contents) + * [Installing the chart](#installing-the-chart) + * [Enable Selenium Grid Autoscaling](#enable-selenium-grid-autoscaling) + * [Settings when scaling with deployments](#settings-when-scaling-with-deployments-) + * [Updating Selenium-Grid release](#updating-selenium-grid-release) + * [Uninstalling Selenium Grid release](#uninstalling-selenium-grid-release) + * [Ingress Configuration](#ingress-configuration) + * [References values](#references-values) + * [Configuration](#configuration) + * [Configuration global](#configuration-global) + * [Configuration `global.K8S_PUBLIC_IP`](#configuration-globalk8spublicip) + * [Configuration of Selenium Grid chart](#configuration-of-selenium-grid-chart) + * [Configuration of KEDA](#configuration-of-keda) + * [Configuration of Ingress NGINX Controller](#configuration-of-ingress-nginx-controller) + * [Configuration for Selenium-Hub](#configuration-for-selenium-hub) + * [Configuration for isolated components](#configuration-for-isolated-components) + + ## Installing the chart If you want to install the latest master version of Selenium Grid onto your cluster you can do that by using the helm charts repository located at https://www.selenium.dev/docker-selenium. @@ -127,12 +148,20 @@ nginx.ingress.kubernetes.io/client-body-buffer-size nginx.ingress.kubernetes.io/proxy-buffers-number ``` +## Reference values + +There are some values file that used to test and deploy Selenium Grid chart. You can find them in +- [tests/charts/refValues](../../tests/charts/refValues). +- [tests/charts/ci](../../tests/charts/ci). + ## Configuration +### Configuration global For now, global configuration supported is: | Parameter | Default | Description | |---------------------------------------|-----------------------|---------------------------------------| +| `global.K8S_PUBLIC_IP` | `""` | Public IP of the host running K8s | | `global.seleniumGrid.imageRegistry` | `selenium` | Distribution registry to pull images | | `global.seleniumGrid.imageTag` | `4.16.1-20231212` | Image tag for all selenium components | | `global.seleniumGrid.nodesImageTag` | `4.16.1-20231212` | Image tag for browser's nodes | @@ -142,6 +171,32 @@ For now, global configuration supported is: | `global.seleniumGrid.affinity` | `{}` | Affinity assigned globally | | `global.seleniumGrid.logLevel` | `INFO` | Set log level for all components | +#### Configuration `global.K8S_PUBLIC_IP` + +This is the public IP of the host running Kubernetes cluster. Mainly, it is used to construct the URL for the Selenium Grid (Hub or Router) can be accessed from the outside of the cluster for Node register, Grid UI, RemoteWebDriver, etc. +- Ingress is enabled without setting `ingress.hostname`. All the services will be exposed via the public IP is set in `K8S_PUBLIC_IP`. +- Using NodePort to expose the services. All the services will be exposed via the public IP is set in `K8S_PUBLIC_IP`. +- Using LoadBalancer to expose the services. All the services will be exposed via the LB External IP is set in `K8S_PUBLIC_IP`. + +For example: +```yaml +global: + K8S_PUBLIC_IP: "10.10.10.10" +ingress: + enabled: true + hostname: "" +hub: + subPath: "/selenium" + serviceType: NodePort +``` +``` +# Source: selenium-grid/templates/node-configmap.yaml + +SE_NODE_GRID_URL: 'http://admin:admin@10.10.10.10/selenium' +``` +Besides that, from the outside of the cluster, you can access via NodePort http://10.10.10.10:30444/selenium + +### Configuration of Selenium Grid chart This table contains the configuration parameters of the chart and their default values: | Parameter | Default | Description | @@ -163,6 +218,8 @@ This table contains the configuration parameters of the chart and their default | `ingress.nginx.proxyTimeout` | `3600` | Value is used to set for NGINX ingress annotations related to proxy timeout | | `ingress.nginx.proxyBuffer.size` | `512M` | Value is used to set for NGINX ingress annotations on size of the buffer proxy_buffer_size used for reading | | `ingress.nginx.proxyBuffer.number` | `4` | Value is used to set for NGINX ingress annotations on number of the buffers in proxy_buffers used for reading | +| `ingress.ports.http` | `80` | Port to expose for HTTP | +| `ingress.ports.https` | `443` | Port to expose for HTTPS | | `ingress.hostname` | `` | Default host for the ingress resource | | `ingress.path` | `/` | Default host path for the ingress resource | | `ingress.pathType` | `Prefix` | Default path type for the ingress resource | @@ -322,15 +379,21 @@ This table contains the configuration parameters of the chart and their default | `videoRecorder.s3.extraEnvFrom` | `` | Custom environment taken from `configMap` or `secret` variables for video uploader | | `videoRecorder.s3.extraVolumeMounts` | `[]` | Extra mounts of declared ExtraVolumes into pod of video uploader | | `customLabels` | `{}` | Custom labels for k8s resources | +| `ingress-nginx.enabled` | `false` | Enable the dependency chart Ingress controller for Kubernetes (https://github.com/kubernetes/ingress-nginx) | ### Configuration of KEDA -If you are setting `autoscaling.enabled` to `true` KEDA is installed and can be configured with +If you are setting `autoscaling.enabled` to `true`, chart KEDA is installed and can be configured with values with the prefix `keda`. So you can for example set `keda.prometheus.metricServer.enabled` to `true` to enable the metrics server for KEDA. See https://github.com/kedacore/charts/blob/main/keda/README.md for more details. +### Configuration of Ingress NGINX Controller + +If you are setting `ingress-nginx.enabled` to `true`, chart Ingress NGINX Controller is installed and can be configured with +values with the prefix `ingress-nginx`. See https://github.com/kubernetes/ingress-nginx for more details. + ### Configuration for Selenium-Hub You can configure the Selenium Hub with these values: @@ -345,8 +408,11 @@ You can configure the Selenium Hub with these values: | `hub.annotations` | `{}` | Custom annotations for Selenium Hub pod | | `hub.labels` | `{}` | Custom labels for Selenium Hub pod | | `hub.publishPort` | `4442` | Port where events are published | +| `hub.publishNodePort` | `31442` | NodePort where events are published | | `hub.subscribePort` | `4443` | Port where to subscribe for events | +| `hub.subscribeNodePort` | `31443` | NodePort where to subscribe for events | | `hub.port` | `4444` | Selenium Hub port | +| `hub.nodePort` | `31444` | Selenium Hub NodePort | | `hub.livenessProbe` | `See values.yaml` | Liveness probe settings | | `hub.readinessProbe` | `See values.yaml` | Readiness probe settings | | `hub.tolerations` | `[]` | Tolerations for selenium-hub pods | @@ -378,6 +444,7 @@ If you implement selenium-grid with separate components (`isolateComponents: tru | `components.router.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `components.router.annotations` | `{}` | Custom annotations for router pod | | `components.router.port` | `4444` | Router port | +| `components.router.nodePort` | `30444` | Router NodePort | | `components.router.livenessProbe` | `See values.yaml` | Liveness probe settings | | `components.router.readinessProbe` | `See values.yaml` | Readiness probe settings | | `components.router.resources` | `{}` | Resources for router pod | @@ -396,6 +463,7 @@ If you implement selenium-grid with separate components (`isolateComponents: tru | `components.distributor.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `components.distributor.annotations` | `{}` | Custom annotations for Distributor pod | | `components.distributor.port` | `5553` | Distributor port | +| `components.distributor.nodePort` | `30553` | Distributor NodePort | | `components.distributor.resources` | `{}` | Resources for Distributor pod | | `components.distributor.securityContext` | `See values.yaml` | Security context for Distributor pod | | `components.distributor.serviceType` | `ClusterIP` | Kubernetes service type (see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) | @@ -411,8 +479,11 @@ If you implement selenium-grid with separate components (`isolateComponents: tru | `components.eventBus.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `components.eventBus.annotations` | `{}` | Custom annotations for Event Bus pod | | `components.eventBus.port` | `5557` | Event Bus port | +| `components.eventBus.nodePort` | `30557` | Event Bus NodePort | | `components.eventBus.publishPort` | `4442` | Port where events are published | +| `components.eventBus.publishNodePort` | `30442` | NodePort where events are published | | `components.eventBus.subscribePort` | `4443` | Port where to subscribe for events | +| `components.eventBus.subscribeNodePort` | `30443` | NodePort where to subscribe for events | | `components.eventBus.resources` | `{}` | Resources for event-bus pod | | `components.eventBus.securityContext` | `See values.yaml` | Security context for event-bus pod | | `components.eventBus.serviceType` | `ClusterIP` | Kubernetes service type (see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) | @@ -442,6 +513,7 @@ If you implement selenium-grid with separate components (`isolateComponents: tru | `components.sessionQueue.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `components.sessionQueue.annotations` | `{}` | Custom annotations for Session Queue pod | | `components.sessionQueue.port` | `5559` | Session Queue Port | +| `components.sessionQueue.nodePort` | `30559` | Session Queue NodePort | | `components.sessionQueue.resources` | `{}` | Resources for Session Queue pod | | `components.sessionQueue.securityContext` | `See values.yaml` | Security context for Session Queue pod | | `components.sessionQueue.serviceType` | `ClusterIP` | Kubernetes service type (see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) | diff --git a/charts/selenium-grid/templates/NOTES.txt b/charts/selenium-grid/templates/NOTES.txt index ce79f74b5..949f854ec 100644 --- a/charts/selenium-grid/templates/NOTES.txt +++ b/charts/selenium-grid/templates/NOTES.txt @@ -9,20 +9,27 @@ Selenium Grid Server deployed successfully. {{- if .Values.ingress.enabled }} {{- if .Values.ingress.hostname }} 1. Ingress is enabled, and it exposes the Grid Hub or Grid Router with the hostname you supplied. - To access Selenium from outside of Kubernetes, simply open http://{{ .Values.ingress.hostname }}. - {{- else}} + To access Selenium from outside of Kubernetes, simply open {{ include "seleniumGrid.url" .}}. + {{- else if and (empty .Values.ingress.hostname) .Values.global.K8S_PUBLIC_IP }} +1. Ingress is enabled, but hostname doesn't set, and it exposes the Grid Hub or Grid Router with the K8S_PUBLIC_IP you supplied. + To access Selenium from outside of Kubernetes, simply open {{ include "seleniumGrid.url" .}}. + {{- else }} 1. Ingress is enabled, but hostname doesn't set. All inbound HTTP traffic will be routed to the Grid by matching any host. Please keep in mind that it is rarely necessary, and in most cases, you shall provide `ingress.hostname` in values.yaml. To access Selenium from outside of Kubernetes: - - open IP of the any node with Ingress, or + - open the IP of any node with Ingress, or - any hostname pointing to the node with Ingress {{- end}} {{- else}} -1. Ingress is disabled. To access Selenium from outside of Kubernetes, simply run these commands: {{- if contains "NodePort" $serviceType }} - export NODE_PORT=$(kubectl get -n {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" svc {{ $svcName }}) + {{- if .Values.global.K8S_PUBLIC_IP }} +1. Ingress is disabled, and it exposes the Grid Hub or Grid Router with NodePort and the K8S_PUBLIC_IP you supplied + To access Selenium from outside of Kubernetes with NodePort and K8S_PUBLIC_IP you supplied, simply open {{ include "seleniumGrid.url" .}}. + {{- else }} +1. Ingress is disabled. To access Selenium from outside of Kubernetes, simply run these commands: export NODE_IP=$(kubectl get nodes -n {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT + echo http://$NODE_IP:{{ include "seleniumGrid.url.port" .}}{{ include "seleniumGrid.url.subPath" .}} + {{- end }} {{- else if contains "LoadBalancer" $serviceType }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch the status of by running 'kubectl get -n {{ .Release.Namespace }} svc -w {{ $svcName }}' diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index 12342ad9b..db7a8cedc 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -341,28 +341,87 @@ template: Get the url of the grid. If the external url can be figured out from the ingress use that, otherwise the cluster internal url */}} {{- define "seleniumGrid.url" -}} -{{- if and .Values.ingress.enabled .Values.ingress.hostname (ne .Values.ingress.hostname "selenium-grid.local") -}} -http{{if .Values.ingress.tls}}s{{end}}://{{- if eq .Values.basicAuth.enabled true}}{{ .Values.basicAuth.username}}:{{ .Values.basicAuth.password}}@{{- end}}{{.Values.ingress.hostname}} +{{- $url := printf "%s://%s%s%s%s" (include "seleniumGrid.url.schema" .) (include "seleniumGrid.url.basicAuth" .) (include "seleniumGrid.url.host" .) (include "seleniumGrid.url.port" .) (include "seleniumGrid.url.subPath" .) -}} +{{- $url }} +{{- end -}} + +{{- define "seleniumGrid.url.schema" -}} +{{- $schema := "http" -}} +{{- if .Values.ingress.enabled -}} + {{- if .Values.ingress.tls -}} + {{- $schema = "https" -}} + {{- end -}} +{{- end -}} +{{- $schema }} +{{- end -}} + +{{- define "seleniumGrid.url.basicAuth" -}} +{{- $basicAuth := "" -}} +{{- if eq .Values.basicAuth.enabled true -}} + {{- $basicAuth = printf "%s:%s@" .Values.basicAuth.username (.Values.basicAuth.password | toString) -}} +{{- end -}} +{{- $basicAuth }} +{{- end -}} + +{{- define "seleniumGrid.url.host" -}} +{{- $host := printf "%s.%s" (include ($.Values.isolateComponents | ternary "seleniumGrid.router.fullname" "seleniumGrid.hub.fullname") $ ) (.Release.Namespace) -}} +{{- if .Values.ingress.enabled -}} + {{- if and ( empty .Values.ingress.hostname) (not (empty .Values.global.K8S_PUBLIC_IP)) -}} + {{- $host = .Values.global.K8S_PUBLIC_IP -}} + {{- else if and .Values.ingress.hostname (ne .Values.ingress.hostname "selenium-grid.local") -}} + {{- $host = .Values.ingress.hostname -}} + {{- end -}} +{{- else if not (empty .Values.global.K8S_PUBLIC_IP) -}} + {{- $host = .Values.global.K8S_PUBLIC_IP -}} +{{- end -}} +{{- $host }} +{{- end -}} + +{{- define "seleniumGrid.url.port" -}} +{{- $port := ":4444" -}} +{{- if .Values.ingress.enabled -}} + {{- if or (ne (.Values.ingress.ports.http | toString) "80") (ne (.Values.ingress.ports.https | toString) "443") -}} + {{- $port = printf ":%s" (ternary (.Values.ingress.ports.http | toString) (.Values.ingress.ports.https | toString) (eq (include "seleniumGrid.url.schema" .) "http")) -}} + {{- else -}} + {{- $port = "" -}} + {{- end -}} {{- else -}} -http://{{- if eq .Values.basicAuth.enabled true}}{{ .Values.basicAuth.username}}:{{ .Values.basicAuth.password}}@{{- end}}{{ include ($.Values.isolateComponents | ternary "seleniumGrid.router.fullname" "seleniumGrid.hub.fullname") $ }}.{{ .Release.Namespace }}:{{ $.Values.components.router.port }} -{{- end }} + {{- if .Values.isolateComponents -}} + {{- if and (eq .Values.components.router.serviceType "NodePort") .Values.components.router.nodePort -}} + {{- $port = printf ":%s" (.Values.components.router.nodePort | toString) -}} + {{- end -}} + {{- else -}} + {{- if and (eq .Values.hub.serviceType "NodePort") .Values.hub.nodePort -}} + {{- $port = printf ":%s" (.Values.hub.nodePort | toString) -}} + {{- end -}} + {{- end -}} +{{- end -}} +{{- $port }} {{- end -}} {{- define "seleniumGrid.url.subPath" -}} {{- $subPath := "/" -}} -{{ if $.Values.isolateComponents }} +{{- if $.Values.isolateComponents -}} {{- $subPath = default $subPath $.Values.components.subPath -}} {{- else -}} {{- $subPath = default $subPath $.Values.hub.subPath -}} {{- end -}} -{{ $subPath }} +{{- $subPath }} {{- end -}} {{/* Graphql Url of the hub or the router */}} {{- define "seleniumGrid.graphqlURL" -}} -http://{{- if eq .Values.basicAuth.enabled true}}{{ .Values.basicAuth.username}}:{{ .Values.basicAuth.password}}@{{- end}}{{ include ($.Values.isolateComponents | ternary "seleniumGrid.router.fullname" "seleniumGrid.hub.fullname") $ }}.{{ .Release.Namespace }}:{{ $.Values.components.router.port }}/graphql +{{- printf "http://%s%s%s/graphql" (include "seleniumGrid.url.basicAuth" .) (printf "%s.%s" (include ($.Values.isolateComponents | ternary "seleniumGrid.router.fullname" "seleniumGrid.hub.fullname") $) (.Release.Namespace)) (printf ":%s" ($.Values.isolateComponents | ternary ($.Values.components.router.port | toString) ($.Values.hub.port | toString))) -}} +{{- end -}} + +{{/* +Graphql unsafeSsl of the hub or the router +*/}} +{{- define "seleniumGrid.graphqlURL.unsafeSsl" -}} +{{- $unsafeSsl := printf "%s" (ternary "false" "true" (contains (include "seleniumGrid.graphqlURL" .) "https")) -}} +{{- $unsafeSsl }} {{- end -}} {{/* diff --git a/charts/selenium-grid/templates/distributor-service.yaml b/charts/selenium-grid/templates/distributor-service.yaml index 295407fac..86b99e5b4 100644 --- a/charts/selenium-grid/templates/distributor-service.yaml +++ b/charts/selenium-grid/templates/distributor-service.yaml @@ -23,4 +23,7 @@ spec: protocol: TCP port: {{ .Values.components.distributor.port }} targetPort: {{ .Values.components.distributor.port }} + {{- if and (eq .Values.components.distributor.serviceType "NodePort") .Values.components.distributor.nodePort }} + nodePort: {{ .Values.components.distributor.nodePort }} + {{- end }} {{- end }} diff --git a/charts/selenium-grid/templates/event-bus-service.yaml b/charts/selenium-grid/templates/event-bus-service.yaml index c3a30bcc0..c5c5b9052 100644 --- a/charts/selenium-grid/templates/event-bus-service.yaml +++ b/charts/selenium-grid/templates/event-bus-service.yaml @@ -23,12 +23,21 @@ spec: protocol: TCP port: {{ .Values.components.eventBus.port }} targetPort: {{ .Values.components.eventBus.port }} + {{- if and (eq .Values.components.eventBus.serviceType "NodePort") .Values.components.eventBus.nodePort }} + nodePort: {{ .Values.components.eventBus.nodePort }} + {{- end }} - name: tcp-evtbus-pub protocol: TCP port: {{ .Values.components.eventBus.publishPort }} targetPort: {{ .Values.components.eventBus.publishPort }} + {{- if and (eq .Values.components.eventBus.serviceType "NodePort") .Values.components.eventBus.publishNodePort }} + nodePort: {{ .Values.components.eventBus.publishNodePort }} + {{- end }} - name: tcp-evtbus-sub protocol: TCP port: {{ .Values.components.eventBus.subscribePort }} targetPort: {{ .Values.components.eventBus.subscribePort }} + {{- if and (eq .Values.components.eventBus.serviceType "NodePort") .Values.components.eventBus.subscribeNodePort }} + nodePort: {{ .Values.components.eventBus.subscribeNodePort }} + {{- end }} {{- end }} diff --git a/charts/selenium-grid/templates/hub-service.yaml b/charts/selenium-grid/templates/hub-service.yaml index aa4daa34c..0f394a6eb 100644 --- a/charts/selenium-grid/templates/hub-service.yaml +++ b/charts/selenium-grid/templates/hub-service.yaml @@ -26,12 +26,21 @@ spec: protocol: TCP port: {{ .Values.hub.port }} targetPort: {{ .Values.hub.port }} + {{- if and (eq .Values.hub.serviceType "NodePort") .Values.hub.nodePort }} + nodePort: {{ .Values.hub.nodePort }} + {{- end }} - name: tcp-hub-pub protocol: TCP port: {{ .Values.hub.publishPort }} targetPort: {{ .Values.hub.publishPort }} + {{- if and (eq .Values.hub.serviceType "NodePort") .Values.hub.publishNodePort }} + nodePort: {{ .Values.hub.publishNodePort }} + {{- end }} - name: tcp-hub-sub protocol: TCP port: {{ .Values.hub.subscribePort }} targetPort: {{ .Values.hub.subscribePort }} + {{- if and (eq .Values.hub.serviceType "NodePort") .Values.hub.subscribeNodePort }} + nodePort: {{ .Values.hub.subscribeNodePort }} + {{- end }} {{- end }} diff --git a/charts/selenium-grid/templates/node-configmap.yaml b/charts/selenium-grid/templates/node-configmap.yaml index 52e447d63..da4edab40 100644 --- a/charts/selenium-grid/templates/node-configmap.yaml +++ b/charts/selenium-grid/templates/node-configmap.yaml @@ -13,4 +13,4 @@ metadata: {{- end }} data: SE_DRAIN_AFTER_SESSION_COUNT: '{{- and (eq (include "seleniumGrid.useKEDA" .) "true") (eq .Values.autoscaling.scalingType "job") | ternary "1" "0" -}}' - SE_NODE_GRID_URL: '{{ include "seleniumGrid.url" .}}{{ include "seleniumGrid.url.subPath" .}}' + SE_NODE_GRID_URL: '{{ include "seleniumGrid.url" .}}' diff --git a/charts/selenium-grid/templates/router-service.yaml b/charts/selenium-grid/templates/router-service.yaml index 9eaff7955..c93d04c11 100644 --- a/charts/selenium-grid/templates/router-service.yaml +++ b/charts/selenium-grid/templates/router-service.yaml @@ -26,4 +26,7 @@ spec: protocol: TCP port: {{ .Values.components.router.port }} targetPort: {{ .Values.components.router.port }} + {{- if and (eq $.Values.components.router.serviceType "NodePort") $.Values.components.router.nodePort }} + nodePort: {{ $.Values.components.router.nodePort }} + {{- end }} {{- end }} diff --git a/charts/selenium-grid/templates/session-queuer-service.yaml b/charts/selenium-grid/templates/session-queuer-service.yaml index 54e535f7b..b0e0fe96d 100644 --- a/charts/selenium-grid/templates/session-queuer-service.yaml +++ b/charts/selenium-grid/templates/session-queuer-service.yaml @@ -23,4 +23,7 @@ spec: protocol: TCP port: {{ .Values.components.sessionQueue.port }} targetPort: {{ .Values.components.sessionQueue.port }} + {{- if and (eq .Values.components.sessionQueue.serviceType "NodePort") .Values.components.sessionQueue.nodePort }} + nodePort: {{ .Values.components.sessionQueue.nodePort }} + {{- end }} {{- end }} diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index f6be10a83..c7b46c536 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -1,4 +1,8 @@ global: + # Public IP of the host running Kubernetes cluster. + # This is used to access the Selenium Grid from outside the cluster when ingress is disabled or enabled without a hostname is set. + # This is part of constructing SE_NODE_GRID_URL and rewrite URL of `se:vnc`, `se:cdp` in the capabilities when `ingress.hostname` is unset + K8S_PUBLIC_IP: "" seleniumGrid: # Image registry for all selenium components imageRegistry: selenium @@ -44,6 +48,9 @@ ingress: proxyBuffer: size: 512M number: 4 + ports: + http: 80 + https: 443 # Custom annotations for ingress resource annotations: {} # Default host for the ingress resource @@ -96,6 +103,7 @@ components: annotations: {} # Router port port: 4444 + nodePort: 30444 # Liveness probe settings livenessProbe: enabled: true @@ -148,6 +156,7 @@ components: annotations: {} # Distributor port port: 5553 + nodePort: 30553 # Resources for Distributor container resources: {} # SecurityContext for Distributor container @@ -180,10 +189,13 @@ components: annotations: {} # Event Bus port port: 5557 + nodePort: 30557 # Port where events are published publishPort: 4442 + publishNodePort: 30442 # Port where to subscribe for events subscribePort: 4443 + subscribeNodePort: 30443 # Resources for event-bus container resources: {} # SecurityContext for event-bus container @@ -246,6 +258,7 @@ components: # Custom annotations for Session Queue pods annotations: {} port: 5559 + nodePort: 30559 # Resources for Session Queue container resources: {} # SecurityContext for Session Queue container @@ -299,10 +312,13 @@ hub: labels: {} # Port where events are published publishPort: 4442 + publishNodePort: 31442 # Port where to subscribe for events subscribePort: 4443 + subscribeNodePort: 31443 # Selenium Hub port port: 4444 + nodePort: 31444 # Liveness probe settings livenessProbe: enabled: true @@ -387,7 +403,8 @@ autoscaling: # see https://keda.sh/docs/latest/concepts/scaling-jobs/#scaledjob-spec scaledJobOptions: scalingStrategy: - strategy: accurate + # Change this to "accurate" when the calculation problem is fixed + strategy: default # Number of Completed jobs should be kept successfulJobsHistoryLimit: 0 # Number of Failed jobs should be kept (for troubleshooting purposes) @@ -535,8 +552,9 @@ chromeNode: hpa: url: '{{ include "seleniumGrid.graphqlURL" . }}' browserName: chrome + sessionBrowserName: 'chrome' # browserVersion: '91.0' # Optional. Only required when supporting multiple versions of browser in your Selenium Grid. - unsafeSsl: 'true' # Optional + unsafeSsl: '{{ include "seleniumGrid.graphqlURL.unsafeSsl" . }}' # Optional # It is used to add a sidecars proxy in the same pod of the browser node. # It means it will add a new container to the deployment itself. @@ -668,6 +686,8 @@ firefoxNode: hpa: url: '{{ include "seleniumGrid.graphqlURL" . }}' browserName: firefox + sessionBrowserName: 'firefox' + unsafeSsl: '{{ include "seleniumGrid.graphqlURL.unsafeSsl" . }}' # Optional # It is used to add a sidecars proxy in the same pod of the browser node. # It means it will add a new container to the deployment itself. @@ -798,6 +818,7 @@ edgeNode: url: '{{ include "seleniumGrid.graphqlURL" . }}' browserName: MicrosoftEdge sessionBrowserName: 'msedge' + unsafeSsl: '{{ include "seleniumGrid.graphqlURL.unsafeSsl" . }}' # Optional # It is used to add a sidecars proxy in the same pod of the browser node. # It means it will add a new container to the deployment itself. @@ -918,3 +939,17 @@ videoRecorder: # Custom labels for k8s resources customLabels: {} + +# Configuration for dependency chart keda +keda: + http: + timeout: 60000 + webhooks: + enabled: false + +# Configuration for dependency chart ingress-nginx +ingress-nginx: + enabled: false + controller: + admissionWebhooks: + enabled: false diff --git a/tests/charts/ci/ParallelAutoscaling-values.yaml b/tests/charts/ci/ParallelAutoscaling-values.yaml index 39ea9434c..78302b94f 100644 --- a/tests/charts/ci/ParallelAutoscaling-values.yaml +++ b/tests/charts/ci/ParallelAutoscaling-values.yaml @@ -31,10 +31,3 @@ ingress: name: '{{ template "seleniumGrid.hub.fullname" $ }}' port: number: 4444 - - path: /(/?)(session/.*/se/vnc) - pathType: ImplementationSpecific - backend: - service: - name: '{{ template "seleniumGrid.hub.fullname" $ }}' - port: - number: 4444 diff --git a/tests/charts/ci/auth-ingress-values.yaml b/tests/charts/ci/auth-ingress-values.yaml index e5d055ba6..38bc87e1b 100644 --- a/tests/charts/ci/auth-ingress-values.yaml +++ b/tests/charts/ci/auth-ingress-values.yaml @@ -1,11 +1,16 @@ +global: + K8S_PUBLIC_IP: localhost + ingress: annotations: + kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/rewrite-target: /$2 nginx.ingress.kubernetes.io/app-root: &gridAppRoot "/selenium" nginx.ingress.kubernetes.io/proxy-connect-timeout: "360" nginx.ingress.kubernetes.io/proxy-read-timeout: "360" nginx.ingress.kubernetes.io/proxy-send-timeout: "360" + ingressClassName: nginx hostname: "" paths: - path: /selenium(/|$)(.*) @@ -15,16 +20,10 @@ ingress: name: '{{ template "seleniumGrid.router.fullname" $ }}' port: number: 4444 - - path: /(/?)(session/.*/se/vnc) - pathType: ImplementationSpecific - backend: - service: - name: '{{ template "seleniumGrid.router.fullname" $ }}' - port: - number: 4444 basicAuth: enabled: false + isolateComponents: true hub: @@ -32,3 +31,11 @@ hub: components: subPath: *gridAppRoot + +ingress-nginx: + enabled: true + controller: + hostNetwork: true + kind: DaemonSet + service: + type: ClusterIP diff --git a/tests/charts/config/ct.yaml b/tests/charts/config/ct.yaml index 7c085d076..2b2446823 100755 --- a/tests/charts/config/ct.yaml +++ b/tests/charts/config/ct.yaml @@ -5,6 +5,7 @@ chart-dirs: - charts chart-repos: - kedacore=https://kedacore.github.io/charts + - ingressNginx=https://kubernetes.github.io/ingress-nginx upgrade: false helm-extra-args: --timeout 600s check-version-increment: false diff --git a/tests/charts/make/chart_cluster_setup.sh b/tests/charts/make/chart_cluster_setup.sh index 76b27872d..c87cbc5b1 100755 --- a/tests/charts/make/chart_cluster_setup.sh +++ b/tests/charts/make/chart_cluster_setup.sh @@ -38,13 +38,6 @@ kind create cluster --wait ${WAIT_TIMEOUT} --name ${CLUSTER_NAME} --config tests echo "Install KEDA core on kind kubernetes cluster" kubectl apply --server-side -f https://github.com/kedacore/keda/releases/download/v2.12.1/keda-2.12.1-core.yaml -echo "Install ingress-nginx on kind kubernetes cluster" -kubectl apply -n ${INGRESS_NAMESPACE} -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml -kubectl wait --namespace ${INGRESS_NAMESPACE} \ - --for=condition=ready pod \ - --selector=app.kubernetes.io/component=controller \ - --timeout=${WAIT_TIMEOUT} - echo "Load built local Docker Images into Kind Cluster" image_list=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep ${NAMESPACE} | grep ${VERSION}) for image in $image_list; do diff --git a/tests/charts/refValues/simplex-minikube.yaml b/tests/charts/refValues/simplex-minikube.yaml new file mode 100644 index 000000000..eb6100336 --- /dev/null +++ b/tests/charts/refValues/simplex-minikube.yaml @@ -0,0 +1,95 @@ +# README: This is a sample values for chart deployment in Minikube +# Chart dependency ingress-nginx is installed together by enabling `ingress-nginx.enabled` +# Chart dependency keda is installed together by enabling `autoscaling.enable` +# Enabled ingress without hostname, set the subPath `/selenium`. Set K8S_PUBLIC_IP point to the public host IP, where Minikube is running +# `ingress-nginx.controller.hostNetwork` is set to true to allow access from outside the cluster via http:///selenium +# Components serviceType is set to NodePort to allow access from outside the cluster via K8S_PUBLIC_IP and NodePort http://:30444/selenium +global: + K8S_PUBLIC_IP: "10.10.10.10" # Replace with your public IP + seleniumGrid: + logLevel: INFO +# imageRegistry: selenium +# imageTag: latest +# nodesImageTag: latest +# videoImageTag: latest + +ingress: + enabled: true + annotations: + kubernetes.io/ingress.class: nginx + nginx.ingress.kubernetes.io/use-regex: "true" + nginx.ingress.kubernetes.io/rewrite-target: /$2 + nginx.ingress.kubernetes.io/app-root: &gridAppRoot "/selenium" + ingressClassName: nginx + hostname: "" + paths: + - path: /selenium(/|$)(.*) + pathType: ImplementationSpecific + backend: + service: + name: '{{ template "seleniumGrid.router.fullname" $ }}' + port: + number: 4444 + +basicAuth: + enabled: true + +isolateComponents: true + +autoscaling: + enabled: true + scalingType: job + annotations: + helm.sh/hook: post-install,post-upgrade,post-rollback + scaledOptions: + minReplicaCount: 0 + maxReplicaCount: 8 + pollingInterval: 15 + scaledJobOptions: + successfulJobsHistoryLimit: 0 + failedJobsHistoryLimit: 5 + scalingStrategy: + strategy: default + +hub: + subPath: *gridAppRoot + serviceType: NodePort + +components: + subPath: *gridAppRoot + router: + serviceType: NodePort + +chromeNode: + extraEnvironmentVariables: &extraEnvironmentVariablesNodes + - name: SE_NODE_SESSION_TIMEOUT + value: "300" + - name: SE_VNC_NO_PASSWORD + value: "true" + - name: SE_OPTS + value: "--enable-managed-downloads true" + startupProbe: &nodeStartupProbe + httpGet: + path: /status + port: 5555 + failureThreshold: 120 + periodSeconds: 1 + +firefoxNode: + extraEnvironmentVariables: *extraEnvironmentVariablesNodes + startupProbe: *nodeStartupProbe + +edgeNode: + extraEnvironmentVariables: *extraEnvironmentVariablesNodes + startupProbe: *nodeStartupProbe + +videoRecorder: + enabled: false + +ingress-nginx: + enabled: true + controller: + hostNetwork: true + kind: DaemonSet + service: + type: ClusterIP diff --git a/tests/charts/templates/render/dummy.yaml b/tests/charts/templates/render/dummy.yaml index fbb746166..42864d78f 100644 --- a/tests/charts/templates/render/dummy.yaml +++ b/tests/charts/templates/render/dummy.yaml @@ -1,5 +1,6 @@ # This is dummy values file for chart template testing global: + K8S_PUBLIC_IP: "10.10.10.10" seleniumGrid: logLevel: FINE affinity: &affinity @@ -12,6 +13,11 @@ global: values: - selenium topologyKey: "kubernetes.io/hostname" + +basicAuth: + username: sysadmin + password: strongPassword + ingress: nginx: proxyTimeout: 360 # Set different proxy timout @@ -25,6 +31,9 @@ ingress: nginx.ingress.kubernetes.io/proxy-connect-timeout: "3600" # Override default key nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" # Override default key hostname: "" + ports: + http: 8081 + https: 8443 paths: - path: /selenium(/|$)(.*) pathType: ImplementationSpecific @@ -45,6 +54,16 @@ isolateComponents: true components: subPath: *gridAppRoot + router: + serviceType: NodePort + distributor: + serviceType: NodePort + eventBus: + serviceType: NodePort + sessionQueue: + serviceType: NodePort + sessionMap: + serviceType: NodePort chromeNode: affinity: *affinity diff --git a/tests/charts/templates/test.py b/tests/charts/templates/test.py index 2f0c2f412..8587b42d7 100644 --- a/tests/charts/templates/test.py +++ b/tests/charts/templates/test.py @@ -51,7 +51,7 @@ def test_sub_path_append_to_node_grid_url(self): for doc in LIST_OF_DOCUMENTS: if doc['metadata']['name'] in resources_name and doc['kind'] == 'ConfigMap': logger.info(f"Assert subPath is appended to node grid url") - self.assertTrue(doc['data']['SE_NODE_GRID_URL'] == 'http://admin:admin@selenium-router.default:4444/selenium') + self.assertTrue(doc['data']['SE_NODE_GRID_URL'] == 'http://sysadmin:strongPassword@10.10.10.10:8081/selenium') count += 1 self.assertEqual(count, len(resources_name), "No node config resources found") @@ -90,6 +90,17 @@ def test_log_level_set_to_logging_config_map(self): count += 1 self.assertEqual(count, len(resources_name), "Logging ConfigMap is not present in expected resources") + def test_node_port_set_when_service_type_is_node_port(self): + single_node_port = {'selenium-distributor': 30553, 'selenium-router': 30444, 'selenium-session-queue': 30559} + count = 0 + logger.info(f"Assert NodePort is set to components service") + for doc in LIST_OF_DOCUMENTS: + if doc['metadata']['name'] in single_node_port.keys() and doc['kind'] == 'Service': + logger.info(f"Assert NodePort is set to service {doc['metadata']['name']}") + self.assertTrue(doc['spec']['ports'][0]['nodePort'] == single_node_port[doc['metadata']['name']], f"Service {doc['metadata']['name']} with expect NodePort {single_node_port[doc['metadata']['name']]} is not found") + count += 1 + self.assertEqual(count, len(single_node_port.keys()), "Number of services with NodePort is not correct") + if __name__ == '__main__': failed = False try: From c70012fec7dc8f7dbf46c9f185dbfffa80eb57b0 Mon Sep 17 00:00:00 2001 From: Selenium CI Bot Date: Tue, 19 Dec 2023 10:37:20 +0000 Subject: [PATCH 26/62] Update tag in docs and files --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- NodeDocker/config.toml | 8 +- README.md | 134 ++++++++++++------------ charts/selenium-grid/Chart.yaml | 4 +- charts/selenium-grid/README.md | 14 +-- charts/selenium-grid/values.yaml | 26 ++--- docker-compose-v2-tracing.yml | 8 +- docker-compose-v2.yml | 8 +- docker-compose-v3-basicauth.yml | 8 +- docker-compose-v3-dev.yml | 8 +- docker-compose-v3-dynamic-grid.yml | 4 +- docker-compose-v3-full-grid-dev.yml | 16 +-- docker-compose-v3-full-grid-swarm.yml | 8 +- docker-compose-v3-full-grid-tracing.yml | 16 +-- docker-compose-v3-full-grid.yml | 16 +-- docker-compose-v3-swarm.yml | 8 +- docker-compose-v3-tracing.yml | 8 +- docker-compose-v3-video.yml | 14 +-- docker-compose-v3.yml | 8 +- 19 files changed, 159 insertions(+), 159 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index d750dd44c..20f98a2ff 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -56,7 +56,7 @@ body: attributes: label: Docker Selenium version (image tag) description: What version of Docker Selenium are you using? - placeholder: 4.16.1-20231212? Please use the full tag, avoid "latest" + placeholder: 4.16.1-20231219? Please use the full tag, avoid "latest" validations: required: true - type: input diff --git a/NodeDocker/config.toml b/NodeDocker/config.toml index 3b63bf66a..f1916a401 100644 --- a/NodeDocker/config.toml +++ b/NodeDocker/config.toml @@ -2,9 +2,9 @@ # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.16.1-20231212", '{"browserName": "firefox", "platformName": "linux"}', - "selenium/standalone-chrome:4.16.1-20231212", '{"browserName": "chrome", "platformName": "linux"}', - "selenium/standalone-edge:4.16.1-20231212", '{"browserName": "MicrosoftEdge", "platformName": "linux"}' + "selenium/standalone-firefox:4.16.1-20231219", '{"browserName": "firefox", "platformName": "linux"}', + "selenium/standalone-chrome:4.16.1-20231219", '{"browserName": "chrome", "platformName": "linux"}', + "selenium/standalone-edge:4.16.1-20231219", '{"browserName": "MicrosoftEdge", "platformName": "linux"}' ] # URL for connecting to the docker daemon @@ -14,7 +14,7 @@ configs = [ # socat -4 TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-6.1-20231212" +video-image = "selenium/video:ffmpeg-6.1-20231219" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values diff --git a/README.md b/README.md index 5341c59ac..44fe851b6 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ The project is made possible by volunteer contributors who have put in thousands and made the source code freely available under the [Apache License 2.0](LICENSE.md). These Docker images come with a handful of tags to simplify its usage, have a look at them in one of -our [releases](https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.16.1-20231212). +our [releases](https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.16.1-20231219). To get notifications of new releases, add yourself as a "Releases only" watcher. @@ -65,7 +65,7 @@ Talk to us at https://www.selenium.dev/support/ 1. Start a Docker container with Firefox ```bash -docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231212 +docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231219 ``` 2. Point your WebDriver tests to http://localhost:4444 @@ -252,17 +252,17 @@ For more information on the Dev and Beta channel container images, see the blog ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_24x24.png) Firefox ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231212 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231219 ``` ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_24x24.png) Chrome ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231212 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231219 ``` ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_24x24.png) Edge ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-edge:4.16.1-20231212 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-edge:4.16.1-20231219 ``` _Note: Only one Standalone container can run on port_ `4444` _at the same time._ @@ -281,44 +281,44 @@ A Docker [network](https://docs.docker.com/engine/reference/commandline/network_ ```bash $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231212 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231219 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.16.1-20231212 + selenium/node-chrome:4.16.1-20231219 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.16.1-20231212 + selenium/node-edge:4.16.1-20231219 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.16.1-20231212 + selenium/node-firefox:4.16.1-20231219 ``` ##### Windows PowerShell ```powershell $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231212 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231219 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-chrome:4.16.1-20231212 + selenium/node-chrome:4.16.1-20231219 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-edge:4.16.1-20231212 + selenium/node-edge:4.16.1-20231219 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-firefox:4.16.1-20231212 + selenium/node-firefox:4.16.1-20231219 ``` When you are done using the Grid, and the containers have exited, the network can be removed with the following command: @@ -335,7 +335,7 @@ configured to expose different ports. ##### Hub - Machine/VM 1 ```bash -$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.16.1-20231212 +$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.16.1-20231219 ``` ##### Node Chrome - Machine/VM 2 @@ -349,7 +349,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-chrome:4.16.1-20231212 + selenium/node-chrome:4.16.1-20231219 ``` ###### Windows PowerShell @@ -361,7 +361,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-chrome:4.16.1-20231212 + selenium/node-chrome:4.16.1-20231219 ``` @@ -376,7 +376,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-edge:4.16.1-20231212 + selenium/node-edge:4.16.1-20231219 ``` ###### Windows PowerShell @@ -388,7 +388,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-edge:4.16.1-20231212 + selenium/node-edge:4.16.1-20231219 ``` ##### Node Firefox - Machine/VM 4 @@ -402,7 +402,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-firefox:4.16.1-20231212 + selenium/node-firefox:4.16.1-20231219 ``` ###### Windows PowerShell @@ -414,7 +414,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-firefox:4.16.1-20231212 + selenium/node-firefox:4.16.1-20231219 ``` ##### Node Chrome - Machine/VM 4 @@ -429,7 +429,7 @@ $ docker run -d -p 5556:5556 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ -e SE_NODE_PORT=5556 \ - selenium/node-chrome:4.16.1-20231212 + selenium/node-chrome:4.16.1-20231219 ``` ###### Windows PowerShell @@ -442,7 +442,7 @@ $ docker run -d -p 5556:5556 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` -e SE_NODE_PORT=5556 ` - selenium/node-chrome:4.16.1-20231212 + selenium/node-chrome:4.16.1-20231219 ``` #### Docker Compose @@ -474,7 +474,7 @@ ___ ## Video recording -Tests execution can be recorded by using the `selenium/video:ffmpeg-6.1-20231212` +Tests execution can be recorded by using the `selenium/video:ffmpeg-6.1-20231219` Docker image. One container is needed per each container where a browser is running. This means if you are running 5 Nodes/Standalone containers, you will need 5 video containers, the mapping is 1-1. @@ -500,8 +500,8 @@ This example shows how to start the containers manually: ``` bash $ docker network create grid -$ docker run -d -p 4444:4444 -p 6900:5900 --net grid --name selenium --shm-size="2g" selenium/standalone-chrome:4.16.1-20231212 -$ docker run -d --net grid --name video -v /tmp/videos:/videos selenium/video:ffmpeg-6.1-20231212 +$ docker run -d -p 4444:4444 -p 6900:5900 --net grid --name selenium --shm-size="2g" selenium/standalone-chrome:4.16.1-20231219 +$ docker run -d --net grid --name video -v /tmp/videos:/videos selenium/video:ffmpeg-6.1-20231219 # Run your tests $ docker stop video && docker rm video $ docker stop selenium && docker rm selenium @@ -533,9 +533,9 @@ You can save this file locally and name it, for example, `config.toml`. # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.16.1-20231212", '{"browserName": "firefox"}', - "selenium/standalone-chrome:4.16.1-20231212", '{"browserName": "chrome"}', - "selenium/standalone-edge:4.16.1-20231212", '{"browserName": "MicrosoftEdge"}' + "selenium/standalone-firefox:4.16.1-20231219", '{"browserName": "firefox"}', + "selenium/standalone-chrome:4.16.1-20231219", '{"browserName": "chrome"}', + "selenium/standalone-edge:4.16.1-20231219", '{"browserName": "MicrosoftEdge"}' ] # URL for connecting to the docker daemon @@ -548,7 +548,7 @@ configs = [ # Linux: varies from machine to machine, please mount /var/run/docker.sock. If this does not work, please create an issue. url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-6.1-20231212" +video-image = "selenium/video:ffmpeg-6.1-20231219" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values @@ -567,28 +567,28 @@ virtual machines. ```bash $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231212 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231219 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/node-docker:4.16.1-20231212 + selenium/node-docker:4.16.1-20231219 ``` #### Windows PowerShell ```powershell $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231212 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231219 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/node-docker:4.16.1-20231212 + selenium/node-docker:4.16.1-20231219 ``` To have the assets saved on your host, please mount your host path to `/opt/selenium/assets`. @@ -609,7 +609,7 @@ docker run --rm --name selenium-docker -p 4444:4444 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/standalone-docker:4.16.1-20231212 + selenium/standalone-docker:4.16.1-20231219 ``` #### Windows PowerShell @@ -619,7 +619,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/standalone-docker:4.16.1-20231212 + selenium/standalone-docker:4.16.1-20231219 ``` ### Using Dynamic Grid in different machines/VMs @@ -627,7 +627,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` #### Hub - Machine/VM 1 ```bash -$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.16.1-20231212 +$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.16.1-20231219 ``` #### Node Chrome - Machine/VM 2 @@ -642,7 +642,7 @@ $ docker run -d -p 5555:5555 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/node-docker:4.16.1-20231212 + selenium/node-docker:4.16.1-20231219 ``` #### Windows PowerShell @@ -655,7 +655,7 @@ $ docker run -d -p 5555:5555 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/node-docker:4.16.1-20231212 + selenium/node-docker:4.16.1-20231219 ``` Complete the `[server]` section in the `config.toml` file. @@ -664,9 +664,9 @@ Complete the `[server]` section in the `config.toml` file. # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.16.1-20231212", "{\"browserName\": \"firefox\"}", - "selenium/standalone-chrome:4.16.1-20231212", "{\"browserName\": \"chrome\"}", - "selenium/standalone-edge:4.16.1-20231212", "{\"browserName\": \"MicrosoftEdge\"}" + "selenium/standalone-firefox:4.16.1-20231219", "{\"browserName\": \"firefox\"}", + "selenium/standalone-chrome:4.16.1-20231219", "{\"browserName\": \"chrome\"}", + "selenium/standalone-edge:4.16.1-20231219", "{\"browserName\": \"MicrosoftEdge\"}" ] # URL for connecting to the docker daemon @@ -679,7 +679,7 @@ configs = [ # Linux: varies from machine to machine, please mount /var/run/docker.sock. If this does not work, please create an issue. url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-6.1-20231212" +video-image = "selenium/video:ffmpeg-6.1-20231219" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values @@ -713,7 +713,7 @@ docker run --rm --name selenium-docker -p 4444:4444 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/standalone-docker:4.16.1-20231212 + selenium/standalone-docker:4.16.1-20231219 ``` #### Windows PowerShell @@ -724,7 +724,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/standalone-docker:4.16.1-20231212 + selenium/standalone-docker:4.16.1-20231219 ``` @@ -762,7 +762,7 @@ ___ You can pass `SE_OPTS` variable with additional command line parameters for starting a hub or a node. ``` bash -$ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub selenium/hub:4.16.1-20231212 +$ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub selenium/hub:4.16.1-20231219 ``` ### SE_JAVA_OPTS Java Environment Options @@ -770,7 +770,7 @@ $ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub s You can pass `SE_JAVA_OPTS` environment variable to the Java process. ``` bash -$ docker run -d -p 4444:4444 -e SE_JAVA_OPTS=-Xmx512m --name selenium-hub selenium/hub:4.16.1-20231212 +$ docker run -d -p 4444:4444 -e SE_JAVA_OPTS=-Xmx512m --name selenium-hub selenium/hub:4.16.1-20231219 ``` ### Node configuration options @@ -792,7 +792,7 @@ $ docker run -d \ -e SE_EVENT_BUS_HOST= \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e SE_NODE_STEREOTYPE="{\"browserName\":\"${SE_NODE_BROWSER_NAME}\",\"browserVersion\":\"${SE_NODE_BROWSER_VERSION}\",\"platformName\": \"Linux\"}" \ - --shm-size="2g" selenium/node-chrome:4.16.1-20231212 + --shm-size="2g" selenium/node-chrome:4.16.1-20231219 ``` ### Setting Sub Path @@ -811,7 +811,7 @@ These settings can be adjusted by specifying `SE_SCREEN_WIDTH`, `SE_SCREEN_HEIGH environmental variables when starting the container. ``` bash -docker run -d -e SE_SCREEN_WIDTH=1366 -e SE_SCREEN_HEIGHT=768 -e SE_SCREEN_DEPTH=24 -e SE_SCREEN_DPI=74 selenium/standalone-firefox:4.16.1-20231212 +docker run -d -e SE_SCREEN_WIDTH=1366 -e SE_SCREEN_HEIGHT=768 -e SE_SCREEN_DEPTH=24 -e SE_SCREEN_DPI=74 selenium/standalone-firefox:4.16.1-20231219 ``` ### Grid Url and Session Timeout @@ -861,7 +861,7 @@ To avoid starting the server you can set the `START_XVFB` environment variable t ``` bash $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ - -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e START_XVFB=false --shm-size="2g" selenium/node-chrome:4.16.1-20231212 + -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e START_XVFB=false --shm-size="2g" selenium/node-chrome:4.16.1-20231219 ``` For more information, see this GitHub [issue](https://github.com/SeleniumHQ/docker-selenium/issues/567). @@ -874,7 +874,7 @@ pod and then scale a new one after N sessions. Set the environment variable `SE_ a value higher than zero to enable this behaviour. ``` bash -$ docker run -e SE_DRAIN_AFTER_SESSION_COUNT=5 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231212 +$ docker run -e SE_DRAIN_AFTER_SESSION_COUNT=5 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231219 ``` With the previous command, the Standalone container will shut down after 5 sessions have been executed. @@ -977,22 +977,22 @@ $ docker network create grid $ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub \ --health-cmd='/opt/bin/check-grid.sh --host 0.0.0.0 --port 4444' \ --health-interval=15s --health-timeout=30s --health-retries=5 \ - selenium/hub:4.16.1-20231212 + selenium/hub:4.16.1-20231219 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.16.1-20231212 + selenium/node-chrome:4.16.1-20231219 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.16.1-20231212 + selenium/node-edge:4.16.1-20231219 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.16.1-20231212 + selenium/node-firefox:4.16.1-20231219 ``` **Note:** The `\` line delimiter won't work on Windows-based terminals, try either `^` or a backtick. @@ -1125,7 +1125,7 @@ RUN mkdir -p -m755 /seluser/.pki/nssdb \ && chown -R 1200:1201 /seluser # Start from Selenium image and add relevant files from build image -FROM selenium/node-chrome:4.16.1-20231212 +FROM selenium/node-chrome:4.16.1-20231219 USER root COPY --from=build /seluser/ /home/seluser/ USER seluser @@ -1140,7 +1140,7 @@ RUN mkdir -p "/distribution" "/certs" && \ echo '{ "policies": { "Certificates": { "Install": ["/opt/firefox-latest/YOUR_CA.pem"] }} }' >"/distribution/policies.json" # Start from Selenium image and add relevant files from build image -FROM selenium/node-firefox:4.16.1-20231212 +FROM selenium/node-firefox:4.16.1-20231219 USER root COPY --from=build /certs /opt/firefox-latest COPY --from=build /distribution /opt/firefox-latest/distribution @@ -1163,9 +1163,9 @@ You can override it with the `SE_VNC_PORT` environment variable in case you want Here is an example with the standalone images, the same concept applies to the node images. ``` bash -$ docker run -d -p 4444:4444 -p 5900:5900 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231212 -$ docker run -d -p 4445:4444 -p 5901:5900 --shm-size="2g" selenium/standalone-edge:4.16.1-20231212 -$ docker run -d -p 4446:4444 -p 5902:5900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231212 +$ docker run -d -p 4444:4444 -p 5900:5900 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231219 +$ docker run -d -p 4445:4444 -p 5901:5900 --shm-size="2g" selenium/standalone-edge:4.16.1-20231219 +$ docker run -d -p 4446:4444 -p 5902:5900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231219 ``` Then, you would use in your VNC client: @@ -1193,9 +1193,9 @@ You can also override it with the `SE_NO_VNC_PORT` environment variable in case Here is an example with the standalone images, the same concept applies to the node images. ``` bash -$ docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231212 -$ docker run -d -p 4445:4444 -p 7901:7900 --shm-size="2g" selenium/standalone-edge:4.16.1-20231212 -$ docker run -d -p 4446:4444 -p 7902:7900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231212 +$ docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231219 +$ docker run -d -p 4445:4444 -p 7901:7900 --shm-size="2g" selenium/standalone-edge:4.16.1-20231219 +$ docker run -d -p 4446:4444 -p 7902:7900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231219 ``` Then, you would use in your browser: @@ -1220,28 +1220,28 @@ In order to enable tracing in the Selenium Grid container, the following command ```bash docker network create grid docker run -d -p 16686:16686 -p 14250:14250 --net grid --name jaeger jaegertracing/all-in-one:1.17 -docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231212 +docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231219 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ -e JAVA_OPTS="-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-chrome" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.16.1-20231212 + selenium/node-chrome:4.16.1-20231219 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ -e JAVA_OPTS="-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-edge" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.16.1-20231212 + selenium/node-edge:4.16.1-20231219 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ -e JAVA_OPTS="-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-firefox" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.16.1-20231212 + selenium/node-firefox:4.16.1-20231219 ``` You can also refer to the below docker-compose yaml files to be able to start a simple grid (or) a dynamic grid. @@ -1301,7 +1301,7 @@ container in the following way: ```bash docker run -d -p 4444:4444 --shm-size="2g" \ -v /home/ubuntu/files:/home/seluser/Downloads \ - selenium/standalone-chrome:4.16.1-20231212 + selenium/standalone-chrome:4.16.1-20231219 ``` That will mount the host `/home/ubuntu/files` directory diff --git a/charts/selenium-grid/Chart.yaml b/charts/selenium-grid/Chart.yaml index 1fedd8f1d..9792a20b1 100644 --- a/charts/selenium-grid/Chart.yaml +++ b/charts/selenium-grid/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: selenium-grid description: A Helm chart for creating a Selenium Grid Server in Kubernetes type: application -version: 0.26.2 -appVersion: 4.16.1-20231212 +version: 0.26.3 +appVersion: 4.16.1-20231219 icon: https://github.com/SeleniumHQ/docker-selenium/raw/trunk/logo.png dependencies: - repository: https://kedacore.github.io/charts diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index 8b1f46225..d14b83c3f 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -163,9 +163,9 @@ For now, global configuration supported is: |---------------------------------------|-----------------------|---------------------------------------| | `global.K8S_PUBLIC_IP` | `""` | Public IP of the host running K8s | | `global.seleniumGrid.imageRegistry` | `selenium` | Distribution registry to pull images | -| `global.seleniumGrid.imageTag` | `4.16.1-20231212` | Image tag for all selenium components | -| `global.seleniumGrid.nodesImageTag` | `4.16.1-20231212` | Image tag for browser's nodes | -| `global.seleniumGrid.videoImageTag` | `ffmpeg-6.1-20231212` | Image tag for browser's video recoder | +| `global.seleniumGrid.imageTag` | `4.16.1-20231219` | Image tag for all selenium components | +| `global.seleniumGrid.nodesImageTag` | `4.16.1-20231219` | Image tag for browser's nodes | +| `global.seleniumGrid.videoImageTag` | `ffmpeg-6.1-20231219` | Image tag for browser's video recoder | | `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images | | `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images | | `global.seleniumGrid.affinity` | `{}` | Affinity assigned globally | @@ -240,7 +240,7 @@ This table contains the configuration parameters of the chart and their default | `chromeNode.replicas` | `1` | Number of chrome nodes. Disabled if autoscaling is enabled. | | `chromeNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `chromeNode.imageName` | `node-chrome` | Image of chrome nodes | -| `chromeNode.imageTag` | `4.16.1-20231212` | Image of chrome nodes | +| `chromeNode.imageTag` | `4.16.1-20231219` | Image of chrome nodes | | `chromeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `chromeNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `chromeNode.ports` | `[5555]` | Port list to enable on container | @@ -280,7 +280,7 @@ This table contains the configuration parameters of the chart and their default | `firefoxNode.replicas` | `1` | Number of firefox nodes. Disabled if autoscaling is enabled. | | `firefoxNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `firefoxNode.imageName` | `node-firefox` | Image of firefox nodes | -| `firefoxNode.imageTag` | `4.16.1-20231212` | Image of firefox nodes | +| `firefoxNode.imageTag` | `4.16.1-20231219` | Image of firefox nodes | | `firefoxNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `firefoxNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `firefoxNode.ports` | `[5555]` | Port list to enable on container | @@ -320,7 +320,7 @@ This table contains the configuration parameters of the chart and their default | `edgeNode.replicas` | `1` | Number of edge nodes. Disabled if autoscaling is enabled. | | `edgeNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `edgeNode.imageName` | `node-edge` | Image of edge nodes | -| `edgeNode.imageTag` | `4.16.1-20231212` | Image of edge nodes | +| `edgeNode.imageTag` | `4.16.1-20231219` | Image of edge nodes | | `edgeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `edgeNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `edgeNode.ports` | `[5555]` | Port list to enable on container | @@ -358,7 +358,7 @@ This table contains the configuration parameters of the chart and their default | `videoRecorder.enabled` | `false` | Enable video recorder for node | | `videoRecorder.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `videoRecorder.imageName` | `video` | Selenium video recoder image name | -| `videoRecorder.imageTag` | `ffmpeg-6.1-20231212` | Image tag of video recorder | +| `videoRecorder.imageTag` | `ffmpeg-6.1-20231219` | Image tag of video recorder | | `videoRecorder.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `videoRecorder.uploader` | `false` | Name of the uploader to use. The value `false` is used to disable uploader. Supported default `s3` | | `videoRecorder.uploadDestinationPrefix` | `false` | Destination URL for uploading video file. The value `false` is used to disable the uploading | diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index c7b46c536..bfe5eb011 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -7,11 +7,11 @@ global: # Image registry for all selenium components imageRegistry: selenium # Image tag for all selenium components - imageTag: 4.16.1-20231212 + imageTag: 4.16.1-20231219 # Image tag for browser's nodes - nodesImageTag: 4.16.1-20231212 + nodesImageTag: 4.16.1-20231219 # Image tag for browser's video recorder - videoImageTag: ffmpeg-6.1-20231212 + videoImageTag: ffmpeg-6.1-20231219 # Pull secret for all components, can be overridden individually imagePullSecret: "" # Log level for all components. Possible values describe here: https://www.selenium.dev/documentation/grid/configuration/cli_options/#logging @@ -92,7 +92,7 @@ components: # Router image name imageName: router # Router image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231212 + # imageTag: 4.16.1-20231219 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -145,7 +145,7 @@ components: # Distributor image name imageName: distributor # Distributor image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231212 + # imageTag: 4.16.1-20231219 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -178,7 +178,7 @@ components: # Event Bus image name imageName: event-bus # Event Bus image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231212 + # imageTag: 4.16.1-20231219 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -217,7 +217,7 @@ components: # Session Map image name imageName: sessions # Session Map image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231212 + # imageTag: 4.16.1-20231219 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -248,7 +248,7 @@ components: # Session Queue image name imageName: session-queue # Session Queue image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231212 + # imageTag: 4.16.1-20231219 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -300,7 +300,7 @@ hub: # Selenium Hub image name imageName: hub # Selenium Hub image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231212 + # imageTag: 4.16.1-20231219 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -445,7 +445,7 @@ chromeNode: # Image of chrome nodes imageName: node-chrome # Image of chrome nodes (this overwrites global.seleniumGrid.nodesImageTag) - # imageTag: 4.16.1-20231212 + # imageTag: 4.16.1-20231219 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -579,7 +579,7 @@ firefoxNode: # Image of firefox nodes imageName: node-firefox # Image of firefox nodes (this overwrites global.seleniumGrid.nodesImageTag) - # imageTag: 4.16.1-20231212 + # imageTag: 4.16.1-20231219 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -711,7 +711,7 @@ edgeNode: # Image of edge nodes imageName: node-edge # Image of edge nodes (this overwrites global.seleniumGrid.nodesImageTag) - # imageTag: 4.16.1-20231212 + # imageTag: 4.16.1-20231219 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -831,7 +831,7 @@ videoRecorder: # Image of video recorder imageName: video # Image of video recorder - # imageTag: ffmpeg-6.1-20231212 + # imageTag: ffmpeg-6.1-20231219 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) diff --git a/docker-compose-v2-tracing.yml b/docker-compose-v2-tracing.yml index 19583fe13..fc5469aa4 100644 --- a/docker-compose-v2-tracing.yml +++ b/docker-compose-v2-tracing.yml @@ -9,7 +9,7 @@ services: - "16686:16686" - "14250:14250" chrome: - image: selenium/node-chrome:4.16.1-20231212 + image: selenium/node-chrome:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -23,7 +23,7 @@ services: - "6900:5900" edge: - image: selenium/node-edge:4.16.1-20231212 + image: selenium/node-edge:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -37,7 +37,7 @@ services: - "6901:5900" firefox: - image: selenium/node-firefox:4.16.1-20231212 + image: selenium/node-firefox:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -51,7 +51,7 @@ services: - "6902:5900" selenium-hub: - image: selenium/hub:4.16.1-20231212 + image: selenium/hub:4.16.1-20231219 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v2.yml b/docker-compose-v2.yml index 4496c2fb3..c0b92ae28 100644 --- a/docker-compose-v2.yml +++ b/docker-compose-v2.yml @@ -4,7 +4,7 @@ version: '2' services: chrome: - image: selenium/node-chrome:4.16.1-20231212 + image: selenium/node-chrome:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -16,7 +16,7 @@ services: - "6900:5900" edge: - image: selenium/node-edge:4.16.1-20231212 + image: selenium/node-edge:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -28,7 +28,7 @@ services: - "6901:5900" firefox: - image: selenium/node-firefox:4.16.1-20231212 + image: selenium/node-firefox:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -40,7 +40,7 @@ services: - "6902:5900" selenium-hub: - image: selenium/hub:4.16.1-20231212 + image: selenium/hub:4.16.1-20231219 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v3-basicauth.yml b/docker-compose-v3-basicauth.yml index af16b19f2..05b1e2f55 100644 --- a/docker-compose-v3-basicauth.yml +++ b/docker-compose-v3-basicauth.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.16.1-20231212 + image: selenium/node-chrome:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -14,7 +14,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231212 + image: selenium/node-edge:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231212 + image: selenium/node-firefox:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -34,7 +34,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.16.1-20231212 + image: selenium/hub:4.16.1-20231219 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-dev.yml b/docker-compose-v3-dev.yml index b0720fe0e..2a638496a 100644 --- a/docker-compose-v3-dev.yml +++ b/docker-compose-v3-dev.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.16.1-20231212 + image: selenium/node-chrome:4.16.1-20231219 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -16,7 +16,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231212 + image: selenium/node-edge:4.16.1-20231219 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -28,7 +28,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231212 + image: selenium/node-firefox:4.16.1-20231219 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -40,7 +40,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.16.1-20231212 + image: selenium/hub:4.16.1-20231219 container_name: selenium-hub volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar diff --git a/docker-compose-v3-dynamic-grid.yml b/docker-compose-v3-dynamic-grid.yml index ae3d587dc..83f6185c1 100644 --- a/docker-compose-v3-dynamic-grid.yml +++ b/docker-compose-v3-dynamic-grid.yml @@ -4,7 +4,7 @@ version: "3" services: node-docker: - image: selenium/node-docker:4.16.1-20231212 + image: selenium/node-docker:4.16.1-20231219 volumes: - ./assets:/opt/selenium/assets - ./NodeDocker/config.toml:/opt/bin/config.toml @@ -17,7 +17,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.16.1-20231212 + image: selenium/hub:4.16.1-20231219 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-full-grid-dev.yml b/docker-compose-v3-full-grid-dev.yml index 6233a1a3f..4f4d131b6 100644 --- a/docker-compose-v3-full-grid-dev.yml +++ b/docker-compose-v3-full-grid-dev.yml @@ -4,7 +4,7 @@ version: "3" services: selenium-event-bus: - image: selenium/event-bus:4.16.1-20231212 + image: selenium/event-bus:4.16.1-20231219 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-event-bus @@ -14,7 +14,7 @@ services: - "5557:5557" selenium-sessions: - image: selenium/sessions:4.16.1-20231212 + image: selenium/sessions:4.16.1-20231219 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-sessions @@ -28,7 +28,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-session-queue: - image: selenium/session-queue:4.16.1-20231212 + image: selenium/session-queue:4.16.1-20231219 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-session-queue @@ -36,7 +36,7 @@ services: - "5559:5559" selenium-distributor: - image: selenium/distributor:4.16.1-20231212 + image: selenium/distributor:4.16.1-20231219 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-distributor @@ -56,7 +56,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 selenium-router: - image: selenium/router:4.16.1-20231212 + image: selenium/router:4.16.1-20231219 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-router @@ -75,7 +75,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 chrome: - image: selenium/node-chrome:4.16.1-20231212 + image: selenium/node-chrome:4.16.1-20231219 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -87,7 +87,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231212 + image: selenium/node-edge:4.16.1-20231219 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -99,7 +99,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231212 + image: selenium/node-firefox:4.16.1-20231219 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar diff --git a/docker-compose-v3-full-grid-swarm.yml b/docker-compose-v3-full-grid-swarm.yml index 0d555d75a..636efd51b 100644 --- a/docker-compose-v3-full-grid-swarm.yml +++ b/docker-compose-v3-full-grid-swarm.yml @@ -7,7 +7,7 @@ version: '3.7' services: chrome: - image: selenium/node-chrome:4.16.1-20231212 + image: selenium/node-chrome:4.16.1-20231219 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -18,7 +18,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' edge: - image: selenium/node-edge:4.16.1-20231212 + image: selenium/node-edge:4.16.1-20231219 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -29,7 +29,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' firefox: - image: selenium/node-firefox:4.16.1-20231212 + image: selenium/node-firefox:4.16.1-20231219 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -40,7 +40,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' selenium-hub: - image: selenium/hub:4.16.1-20231212 + image: selenium/hub:4.16.1-20231219 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v3-full-grid-tracing.yml b/docker-compose-v3-full-grid-tracing.yml index bc7db86f3..781357aa4 100644 --- a/docker-compose-v3-full-grid-tracing.yml +++ b/docker-compose-v3-full-grid-tracing.yml @@ -9,7 +9,7 @@ services: - "16686:16686" - "14250:14250" selenium-event-bus: - image: selenium/event-bus:4.16.1-20231212 + image: selenium/event-bus:4.16.1-20231219 container_name: selenium-event-bus ports: - "4442:4442" @@ -21,7 +21,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-event-bus selenium-sessions: - image: selenium/sessions:4.16.1-20231212 + image: selenium/sessions:4.16.1-20231219 container_name: selenium-sessions ports: - "5556:5556" @@ -34,7 +34,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-sessions selenium-session-queue: - image: selenium/session-queue:4.16.1-20231212 + image: selenium/session-queue:4.16.1-20231219 container_name: selenium-session-queue ports: - "5559:5559" @@ -42,7 +42,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-session-queue selenium-distributor: - image: selenium/distributor:4.16.1-20231212 + image: selenium/distributor:4.16.1-20231219 container_name: selenium-distributor ports: - "5553:5553" @@ -61,7 +61,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-distributor selenium-router: - image: selenium/router:4.16.1-20231212 + image: selenium/router:4.16.1-20231219 container_name: selenium-router ports: - "4444:4444" @@ -79,7 +79,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-router chrome: - image: selenium/node-chrome:4.16.1-20231212 + image: selenium/node-chrome:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-event-bus @@ -90,7 +90,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-chrome edge: - image: selenium/node-edge:4.16.1-20231212 + image: selenium/node-edge:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-event-bus @@ -101,7 +101,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-edge firefox: - image: selenium/node-firefox:4.16.1-20231212 + image: selenium/node-firefox:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-event-bus diff --git a/docker-compose-v3-full-grid.yml b/docker-compose-v3-full-grid.yml index 5bc20ad79..af9266fef 100644 --- a/docker-compose-v3-full-grid.yml +++ b/docker-compose-v3-full-grid.yml @@ -4,7 +4,7 @@ version: "3" services: selenium-event-bus: - image: selenium/event-bus:4.16.1-20231212 + image: selenium/event-bus:4.16.1-20231219 container_name: selenium-event-bus ports: - "4442:4442" @@ -12,7 +12,7 @@ services: - "5557:5557" selenium-sessions: - image: selenium/sessions:4.16.1-20231212 + image: selenium/sessions:4.16.1-20231219 container_name: selenium-sessions ports: - "5556:5556" @@ -24,13 +24,13 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-session-queue: - image: selenium/session-queue:4.16.1-20231212 + image: selenium/session-queue:4.16.1-20231219 container_name: selenium-session-queue ports: - "5559:5559" selenium-distributor: - image: selenium/distributor:4.16.1-20231212 + image: selenium/distributor:4.16.1-20231219 container_name: selenium-distributor ports: - "5553:5553" @@ -48,7 +48,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 selenium-router: - image: selenium/router:4.16.1-20231212 + image: selenium/router:4.16.1-20231219 container_name: selenium-router ports: - "4444:4444" @@ -65,7 +65,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 chrome: - image: selenium/node-chrome:4.16.1-20231212 + image: selenium/node-chrome:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-event-bus @@ -75,7 +75,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231212 + image: selenium/node-edge:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-event-bus @@ -85,7 +85,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231212 + image: selenium/node-firefox:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-event-bus diff --git a/docker-compose-v3-swarm.yml b/docker-compose-v3-swarm.yml index 0d555d75a..636efd51b 100644 --- a/docker-compose-v3-swarm.yml +++ b/docker-compose-v3-swarm.yml @@ -7,7 +7,7 @@ version: '3.7' services: chrome: - image: selenium/node-chrome:4.16.1-20231212 + image: selenium/node-chrome:4.16.1-20231219 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -18,7 +18,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' edge: - image: selenium/node-edge:4.16.1-20231212 + image: selenium/node-edge:4.16.1-20231219 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -29,7 +29,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' firefox: - image: selenium/node-firefox:4.16.1-20231212 + image: selenium/node-firefox:4.16.1-20231219 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -40,7 +40,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' selenium-hub: - image: selenium/hub:4.16.1-20231212 + image: selenium/hub:4.16.1-20231219 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v3-tracing.yml b/docker-compose-v3-tracing.yml index faf7b2ec4..a8c012ec3 100644 --- a/docker-compose-v3-tracing.yml +++ b/docker-compose-v3-tracing.yml @@ -9,7 +9,7 @@ services: - "16686:16686" - "14250:14250" chrome: - image: selenium/node-chrome:4.16.1-20231212 + image: selenium/node-chrome:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -21,7 +21,7 @@ services: - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-chrome edge: - image: selenium/node-edge:4.16.1-20231212 + image: selenium/node-edge:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -33,7 +33,7 @@ services: - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-edge firefox: - image: selenium/node-firefox:4.16.1-20231212 + image: selenium/node-firefox:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -45,7 +45,7 @@ services: - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-firefox selenium-hub: - image: selenium/hub:4.16.1-20231212 + image: selenium/hub:4.16.1-20231219 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-video.yml b/docker-compose-v3-video.yml index f216bf8dd..484e55806 100644 --- a/docker-compose-v3-video.yml +++ b/docker-compose-v3-video.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.16.1-20231212 + image: selenium/node-chrome:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -14,7 +14,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231212 + image: selenium/node-edge:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231212 + image: selenium/node-firefox:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -34,7 +34,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 chrome_video: - image: selenium/video:ffmpeg-6.1-20231212 + image: selenium/video:ffmpeg-6.1-20231219 volumes: - /tmp/videos:/videos depends_on: @@ -44,7 +44,7 @@ services: - FILE_NAME=chrome_video.mp4 edge_video: - image: selenium/video:ffmpeg-6.1-20231212 + image: selenium/video:ffmpeg-6.1-20231219 volumes: - /tmp/videos:/videos depends_on: @@ -54,7 +54,7 @@ services: - FILE_NAME=edge_video.mp4 firefox_video: - image: selenium/video:ffmpeg-6.1-20231212 + image: selenium/video:ffmpeg-6.1-20231219 volumes: - /tmp/videos:/videos depends_on: @@ -64,7 +64,7 @@ services: - FILE_NAME=firefox_video.mp4 selenium-hub: - image: selenium/hub:4.16.1-20231212 + image: selenium/hub:4.16.1-20231219 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3.yml b/docker-compose-v3.yml index b7cfdefcf..e863abebf 100644 --- a/docker-compose-v3.yml +++ b/docker-compose-v3.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.16.1-20231212 + image: selenium/node-chrome:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -14,7 +14,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231212 + image: selenium/node-edge:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231212 + image: selenium/node-firefox:4.16.1-20231219 shm_size: 2gb depends_on: - selenium-hub @@ -34,7 +34,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.16.1-20231212 + image: selenium/hub:4.16.1-20231219 container_name: selenium-hub ports: - "4442:4442" From 1e72a8087358e2f9f8d64629b636851faf96699c Mon Sep 17 00:00:00 2001 From: Selenium CI Bot Date: Tue, 19 Dec 2023 10:50:11 +0000 Subject: [PATCH 27/62] Update chart CHANGELOG [skip ci] --- charts/selenium-grid/CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/charts/selenium-grid/CHANGELOG.md b/charts/selenium-grid/CHANGELOG.md index cb77401b7..acdc9a2b0 100644 --- a/charts/selenium-grid/CHANGELOG.md +++ b/charts/selenium-grid/CHANGELOG.md @@ -1,3 +1,18 @@ +## :heavy_check_mark: selenium-grid-0.26.3 + +- Chart is using image tag 4.16.1-20231219 + +### Added +- feat(chart): Simplify to access Selenium Grid from outside of Kubernetes (#2073) :: Viet Nguyen Duc +- feat(chart): Simplify to change log level in Kubernetes (#2072) :: Viet Nguyen Duc + +### Fixed +- bug: ENV variable SE_VNC_PASSWORD contains sensitive data (#2061) :: Viet Nguyen Duc + +### Changed +- Update tag in docs and files :: Selenium CI Bot +- Update chart CHANGELOG [skip ci] :: Selenium CI Bot + ## :heavy_check_mark: selenium-grid-0.26.2 - Chart is using image tag 4.16.1-20231212 From c914033f21a7137342dcc9078bc601f8cc10f08a Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Tue, 19 Dec 2023 19:01:42 +0700 Subject: [PATCH 28/62] Update sample chart refValues for deployment [skip ci] Signed-off-by: Viet Nguyen Duc --- tests/charts/refValues/sample-aws.yaml | 82 ++++++++++++++++++++ tests/charts/refValues/simplex-minikube.yaml | 1 + 2 files changed, 83 insertions(+) create mode 100644 tests/charts/refValues/sample-aws.yaml diff --git a/tests/charts/refValues/sample-aws.yaml b/tests/charts/refValues/sample-aws.yaml new file mode 100644 index 000000000..d32d101cf --- /dev/null +++ b/tests/charts/refValues/sample-aws.yaml @@ -0,0 +1,82 @@ +# README: This is a sample values for chart deployment in EKS AWS +# Chart dependency ingress-nginx is installed together by enabling `ingress-nginx.enabled`. On AWS, ingress-nginx is installed as a Classic LoadBalancer +# Chart dependency keda is installed together by enabling `autoscaling.enable` +# Enabled ingress with hostname, set the subPath `/selenium`. Grid is accessible via http://my.hostname/selenium +# Use this reference values to deploy e.g. `helm upgrade --install test --values tests/charts/refValues/sample-aws.yaml docker-selenium/selenium-grid --version <0.26.3_onwards>` +global: + K8S_PUBLIC_IP: "" + seleniumGrid: + logLevel: INFO # Change to FINE when you want to debug the issue + +ingress: + enabled: true + annotations: + kubernetes.io/ingress.class: nginx + nginx.ingress.kubernetes.io/use-regex: "true" + nginx.ingress.kubernetes.io/rewrite-target: /$2 + nginx.ingress.kubernetes.io/app-root: &gridAppRoot "/selenium" + ingressClassName: nginx + hostname: "aws.ndviet.org" # Replace with your hostname + paths: + - path: /selenium(/|$)(.*) + pathType: ImplementationSpecific + backend: + service: + name: '{{ template "seleniumGrid.router.fullname" $ }}' + port: + number: 4444 + +basicAuth: + enabled: false + +isolateComponents: true + +autoscaling: + enabled: true + scalingType: job + annotations: + helm.sh/hook: post-install,post-upgrade,post-rollback + scaledOptions: + minReplicaCount: 0 + maxReplicaCount: 8 + pollingInterval: 15 + scaledJobOptions: + successfulJobsHistoryLimit: 0 + failedJobsHistoryLimit: 5 + scalingStrategy: + strategy: default + +hub: + subPath: *gridAppRoot + +components: + subPath: *gridAppRoot + +chromeNode: + extraEnvironmentVariables: &extraEnvironmentVariablesNodes + - name: SE_NODE_SESSION_TIMEOUT + value: "300" + - name: SE_VNC_NO_PASSWORD + value: "true" + - name: SE_OPTS + value: "--enable-managed-downloads true" + startupProbe: &nodeStartupProbe + httpGet: + path: /status + port: 5555 + failureThreshold: 120 + periodSeconds: 1 + +firefoxNode: + extraEnvironmentVariables: *extraEnvironmentVariablesNodes + startupProbe: *nodeStartupProbe + +edgeNode: + extraEnvironmentVariables: *extraEnvironmentVariablesNodes + startupProbe: *nodeStartupProbe + +videoRecorder: + enabled: false + +ingress-nginx: + enabled: true diff --git a/tests/charts/refValues/simplex-minikube.yaml b/tests/charts/refValues/simplex-minikube.yaml index eb6100336..e491deda3 100644 --- a/tests/charts/refValues/simplex-minikube.yaml +++ b/tests/charts/refValues/simplex-minikube.yaml @@ -4,6 +4,7 @@ # Enabled ingress without hostname, set the subPath `/selenium`. Set K8S_PUBLIC_IP point to the public host IP, where Minikube is running # `ingress-nginx.controller.hostNetwork` is set to true to allow access from outside the cluster via http:///selenium # Components serviceType is set to NodePort to allow access from outside the cluster via K8S_PUBLIC_IP and NodePort http://:30444/selenium +# Use this reference values to deploy e.g. `helm upgrade --install test --values tests/charts/refValues/simplex-minikube.yaml docker-selenium/selenium-grid --version <0.26.3_onwards>` global: K8S_PUBLIC_IP: "10.10.10.10" # Replace with your public IP seleniumGrid: From a1082c2aa127c3fc381fb9d92cef19ef8ead61c7 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Fri, 22 Dec 2023 22:54:57 +0700 Subject: [PATCH 29/62] fix(chart): Remove trailing slash from default subPath value (#2076) --- charts/selenium-grid/Chart.yaml | 2 +- charts/selenium-grid/templates/_helpers.tpl | 2 +- charts/selenium-grid/templates/hub-deployment.yaml | 4 +++- charts/selenium-grid/templates/router-deployment.yaml | 4 +++- charts/selenium-grid/values.yaml | 4 ++-- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/charts/selenium-grid/Chart.yaml b/charts/selenium-grid/Chart.yaml index 9792a20b1..63dad9e7b 100644 --- a/charts/selenium-grid/Chart.yaml +++ b/charts/selenium-grid/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: selenium-grid description: A Helm chart for creating a Selenium Grid Server in Kubernetes type: application -version: 0.26.3 +version: 0.26.4 appVersion: 4.16.1-20231219 icon: https://github.com/SeleniumHQ/docker-selenium/raw/trunk/logo.png dependencies: diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index db7a8cedc..7902d1938 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -400,7 +400,7 @@ Get the url of the grid. If the external url can be figured out from the ingress {{- end -}} {{- define "seleniumGrid.url.subPath" -}} -{{- $subPath := "/" -}} +{{- $subPath := "" -}} {{- if $.Values.isolateComponents -}} {{- $subPath = default $subPath $.Values.components.subPath -}} {{- else -}} diff --git a/charts/selenium-grid/templates/hub-deployment.yaml b/charts/selenium-grid/templates/hub-deployment.yaml index 14345e6c8..b9b28a446 100644 --- a/charts/selenium-grid/templates/hub-deployment.yaml +++ b/charts/selenium-grid/templates/hub-deployment.yaml @@ -65,8 +65,10 @@ spec: failureThreshold: {{ .Values.hub.readinessProbe.failureThreshold }} {{- end }} env: + {{- with .Values.hub.subPath }} - name: SE_SUB_PATH - value: {{ .Values.hub.subPath }} + value: {{ . | quote }} + {{- end }} {{- if eq .Values.basicAuth.enabled true}} - name: ROUTER_USERNAME value: {{ .Values.basicAuth.username }} diff --git a/charts/selenium-grid/templates/router-deployment.yaml b/charts/selenium-grid/templates/router-deployment.yaml index 70ebe9bc3..cc0cbbf29 100644 --- a/charts/selenium-grid/templates/router-deployment.yaml +++ b/charts/selenium-grid/templates/router-deployment.yaml @@ -45,8 +45,10 @@ spec: value: {{ template "seleniumGrid.sessionQueue.fullname" . }} - name: SE_SESSION_QUEUE_PORT value: {{ .Values.components.sessionQueue.port | quote }} + {{- with .Values.components.subPath }} - name: SE_SUB_PATH - value: {{ .Values.components.subPath }} + value: {{ . | quote }} + {{- end }} {{- if eq .Values.basicAuth.enabled true}} - name: ROUTER_USERNAME value: {{ .Values.basicAuth.username }} diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index bfe5eb011..b6e7ef07c 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -275,7 +275,7 @@ components: priorityClassName: "" # Custom sub path for all components - subPath: / + subPath: "" # Custom environment variables for all components extraEnvironmentVariables: @@ -338,7 +338,7 @@ hub: periodSeconds: 10 successThreshold: 1 # Custom sub path for the hub deployment - subPath: / + subPath: "" # Custom environment variables for selenium-hub extraEnvironmentVariables: # - name: SE_JAVA_OPTS From 58ed283d03edbe3fdc167aff5c01dbc7571e8ed5 Mon Sep 17 00:00:00 2001 From: Selenium CI Bot Date: Fri, 22 Dec 2023 16:02:17 +0000 Subject: [PATCH 30/62] Update chart CHANGELOG [skip ci] --- charts/selenium-grid/CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/charts/selenium-grid/CHANGELOG.md b/charts/selenium-grid/CHANGELOG.md index acdc9a2b0..747eb3b22 100644 --- a/charts/selenium-grid/CHANGELOG.md +++ b/charts/selenium-grid/CHANGELOG.md @@ -1,3 +1,13 @@ +## :heavy_check_mark: selenium-grid-0.26.4 + +- Chart is using image tag 4.16.1-20231219 + +### Fixed +- fix(chart): Remove trailing slash from default subPath value (#2076) :: Viet Nguyen Duc + +### Changed +- Update chart CHANGELOG [skip ci] :: Selenium CI Bot + ## :heavy_check_mark: selenium-grid-0.26.3 - Chart is using image tag 4.16.1-20231219 From 7c477843d25bcc4d055a98a997810e10291b8b81 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Wed, 27 Dec 2023 17:19:27 +0700 Subject: [PATCH 31/62] feat(chart): Simplify config ports, probes, lifecycle hooks for Nodes (#2077) feat(chart): Simplify config probes, lifecycle hooks for Nodes Signed-off-by: Viet Nguyen Duc --- .github/workflows/helm-chart-test.yml | 6 +- Makefile | 2 +- charts/selenium-grid/README.md | 233 ++++++++++++++---- charts/selenium-grid/TESTING.md | 6 +- charts/selenium-grid/templates/_helpers.tpl | 175 +++++++++++-- .../templates/chrome-node-service.yaml | 7 +- .../templates/edge-node-service.yaml | 7 +- .../templates/event-bus-configmap.yaml | 2 +- .../templates/firefox-node-service.yaml | 7 +- .../templates/hub-deployment.yaml | 58 +++-- .../templates/node-configmap.yaml | 8 + .../templates/router-deployment.yaml | 59 +++-- charts/selenium-grid/values.yaml | 217 +++++++++++----- tests/SeleniumTests/__init__.py | 6 +- tests/charts/bootstrap.sh | 4 +- .../ci/DeploymentAutoScaling-values.yaml | 72 ++++++ ...values.yaml => JobAutoscaling-values.yaml} | 17 ++ tests/charts/ci/NodeChrome-values.yaml | 1 + tests/charts/ci/NodeEdge-values.yaml | 1 + tests/charts/ci/NodeFirefox-values.yaml | 1 + tests/charts/ci/autoscaling-values.yaml | 5 - tests/charts/make/chart_test.sh | 19 +- tests/charts/refValues/sample-aws.yaml | 8 - tests/charts/refValues/simplex-minikube.yaml | 10 +- tests/test.py | 2 +- 25 files changed, 734 insertions(+), 199 deletions(-) create mode 100644 tests/charts/ci/DeploymentAutoScaling-values.yaml rename tests/charts/ci/{ParallelAutoscaling-values.yaml => JobAutoscaling-values.yaml} (67%) delete mode 100644 tests/charts/ci/autoscaling-values.yaml diff --git a/.github/workflows/helm-chart-test.yml b/.github/workflows/helm-chart-test.yml index 887e6b5da..674031795 100644 --- a/.github/workflows/helm-chart-test.yml +++ b/.github/workflows/helm-chart-test.yml @@ -67,10 +67,10 @@ jobs: with: name: ${{ matrix.test-strategy }}_${{ env.CHART_FILE_NAME }} path: ${{ env.CHART_PACKAGE_PATH }} - - name: Upload Helm chart template rendered + - name: Upload chart test artifacts if: always() uses: actions/upload-artifact@v4 with: - name: ${{ matrix.test-strategy }}_chart_template_rendered.yaml - path: ./tests/tests/output_deployment.yaml + name: ${{ matrix.test-strategy }}-artifacts + path: ./tests/tests/ if-no-files-found: ignore diff --git a/Makefile b/Makefile index 5df2eb27e..f9e55dd2c 100644 --- a/Makefile +++ b/Makefile @@ -395,7 +395,7 @@ chart_test_edge: VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/charts/make/chart_test.sh NodeEdge chart_test_parallel_autoscaling: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/charts/make/chart_test.sh ParallelAutoscaling + VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/charts/make/chart_test.sh JobAutoscaling .PHONY: \ all \ diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index d14b83c3f..3568d4cd5 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -6,16 +6,21 @@ This chart enables the creation of a Selenium Grid Server in Kubernetes. * [Selenium-Grid Helm Chart](#selenium-grid-helm-chart) * [Contents](#contents) + * [Introduction](#introduction) * [Installing the chart](#installing-the-chart) * [Enable Selenium Grid Autoscaling](#enable-selenium-grid-autoscaling) - * [Settings when scaling with deployments](#settings-when-scaling-with-deployments-) + * [Settings common for both `job` and `deployment` scalingType](#settings-common-for-both-job-and-deployment-scalingtype) + * [Settings when scalingType with `deployment`](#settings-when-scalingtype-with-deployment-) + * [Settings when scalingType with `job`](#settings-when-scalingtype-with-job) * [Updating Selenium-Grid release](#updating-selenium-grid-release) * [Uninstalling Selenium Grid release](#uninstalling-selenium-grid-release) * [Ingress Configuration](#ingress-configuration) - * [References values](#references-values) * [Configuration](#configuration) * [Configuration global](#configuration-global) * [Configuration `global.K8S_PUBLIC_IP`](#configuration-globalk8spublicip) + * [Configuration of Nodes](#configuration-of-nodes) + * [Container ports and Service ports](#container-ports-and-service-ports) + * [Probes](#probes) * [Configuration of Selenium Grid chart](#configuration-of-selenium-grid-chart) * [Configuration of KEDA](#configuration-of-keda) * [Configuration of Ingress NGINX Controller](#configuration-of-ingress-nginx-controller) @@ -23,6 +28,13 @@ This chart enables the creation of a Selenium Grid Server in Kubernetes. * [Configuration for isolated components](#configuration-for-isolated-components) +## Introduction + +We offer a Helm chart to simplify the deployment of Selenium Grid Docker images to Kubernetes. +- Chart changes are tracked in [CHANGELOG](CHANGELOG.md). +- Sanity/Regression tests for the chart features are tracked in [TESTING](TESTING.md). +- There are some reference values file that used to test and deploy Selenium Grid chart. You can find them in [tests/charts/refValues](../../tests/charts/refValues) and [tests/charts/ci](../../tests/charts/ci). + ## Installing the chart If you want to install the latest master version of Selenium Grid onto your cluster you can do that by using the helm charts repository located at https://www.selenium.dev/docker-selenium. @@ -67,14 +79,82 @@ or [jobs](https://keda.sh/docs/latest/concepts/scaling-jobs/) and the charts sup chart support both modes. It is controlled with `autoscaling.scalingType` that can be set to either job (default) or deployment. -### Settings when scaling with deployments +### Settings common for both `job` and `deployment` scalingType + +There are few settings that are common for both scaling types. These are grouped under `autoscaling.scaledOptions`. + +In case individual node should be scaled differently, you can override the upstream settings with `.scaledOptions` for each node type. For example: + +```yaml +autoscaling: + scaledOptions: + minReplicaCount: 0 + maxReplicaCount: 8 + pollingInterval: 20 + +chromeNode: + scaledOptions: + minReplicaCount: 1 + maxReplicaCount: 16 + pollingInterval: 10 +``` + +### Settings when scalingType with `deployment` + +By default, `autoscaling.terminationGracePeriodSeconds` is set to 3600 seconds. This is used when scalingType is set to `deployment`. You can adjust this value, it will affect to all nodes. + +In case individual node which needs to set different period, you can override the upstream settings with `.terminationGracePeriodSeconds` for each node type. Note that override value must be greater than upstream setting to take effect. For example: + +```yaml +autoscaling: + terminationGracePeriodSeconds: 3600 #default +chromeNode: + terminationGracePeriodSeconds: 7200 #override +firefoxNode: + terminationGracePeriodSeconds: 1800 #not override +``` + +When scaling using deployments the HPA choose pods to terminate randomly. If the chosen pod is currently executing a test rather +than being idle, then there is `terminationGracePeriodSeconds` seconds before the test is expected to complete. If your test is +still executing after `terminationGracePeriodSeconds` seconds, it would result in failure as the pod will be killed. + +During `terminationGracePeriodSeconds` period, there is `preStop` hook to execute command to wait for the pod can be shut down gracefully which can be defined in `.deregisterLifecycle` +- There is a `_helpers` template with name `seleniumGrid.node.deregisterLifecycle` render value for pod `lifecycle.preStop`. By default, hook to execute the script to drain node and wait for current session to complete if any. The script is stored in node ConfigMap, more details can be seen in config `nodeConfigMap.` +- You can define your custom `preStop` hook which is applied for all nodes via `autoscaling.deregisterLifecycle` +- In case individual node which needs different hook, you can override the upstream settings with `.deregisterLifecycle` for each node type. If you want to disable upstream hook in a node, pass the value as `false` +- If an individual node has settings `.lifecycle` itself, it would take the highest precedence to override the above use cases. + +```yaml +autoscaling: + deregisterLifecycle: + preStop: + exec: + command: ["bash", "-c", "echo 'Your custom preStop hook applied for all nodes'"] +chromeNode: + deregisterLifecycle: false #disable upstream hook in chrome node +firefoxNode: + deregisterLifecycle: + preStop: + exec: + command: ["bash", "-c", "echo 'Your custom preStop hook specific for firefox node'"] +edgeNode: + lifecycle: + preStop: + exec: + command: ["bash", "-c", "echo 'preStop hook is defined in edge node lifecycle itself'"] +``` + +For other settings that KEDA [ScaledObject spec](https://keda.sh/docs/latest/concepts/scaling-deployments/#scaledobject-spec) supports, you can set them via `autoscaling.scaledObjectOptions`. For example: + +```yaml +autoscaling: + scaledObjectOptions: + cooldownPeriod: 60 +``` + +### Settings when scalingType with `job` -The `terminationGracePeriodSeconds` is set to 30 seconds by default. When scaling using deployments -the HPA choose pods to terminate randomly. If the chosen pod is currently executing a test rather -than being idle, then there is 30 seconds before the test is expected to complete. If your test is -still executing after 30 seconds, it would result in failure as the pod will be killed. If you want -to give more time for your tests to complete, you may set `terminationGracePeriodSeconds` to value -upto 3600 seconds. +Settings that KEDA [ScaledJob spec](https://keda.sh/docs/latest/concepts/scaling-jobs/#scaledjob-spec) supports can be set via `autoscaling.scaledJobOptions`. ## Updating Selenium-Grid release @@ -148,28 +228,22 @@ nginx.ingress.kubernetes.io/client-body-buffer-size nginx.ingress.kubernetes.io/proxy-buffers-number ``` -## Reference values - -There are some values file that used to test and deploy Selenium Grid chart. You can find them in -- [tests/charts/refValues](../../tests/charts/refValues). -- [tests/charts/ci](../../tests/charts/ci). - ## Configuration ### Configuration global For now, global configuration supported is: -| Parameter | Default | Description | -|---------------------------------------|-----------------------|---------------------------------------| -| `global.K8S_PUBLIC_IP` | `""` | Public IP of the host running K8s | -| `global.seleniumGrid.imageRegistry` | `selenium` | Distribution registry to pull images | -| `global.seleniumGrid.imageTag` | `4.16.1-20231219` | Image tag for all selenium components | -| `global.seleniumGrid.nodesImageTag` | `4.16.1-20231219` | Image tag for browser's nodes | -| `global.seleniumGrid.videoImageTag` | `ffmpeg-6.1-20231219` | Image tag for browser's video recoder | -| `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images | -| `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images | -| `global.seleniumGrid.affinity` | `{}` | Affinity assigned globally | -| `global.seleniumGrid.logLevel` | `INFO` | Set log level for all components | +| Parameter | Default | Description | +|---------------------------------------|-----------------------|----------------------------------------| +| `global.K8S_PUBLIC_IP` | `""` | Public IP of the host running K8s | +| `global.seleniumGrid.imageRegistry` | `selenium` | Distribution registry to pull images | +| `global.seleniumGrid.imageTag` | `4.16.1-20231219` | Image tag for all selenium components | +| `global.seleniumGrid.nodesImageTag` | `4.16.1-20231219` | Image tag for browser's nodes | +| `global.seleniumGrid.videoImageTag` | `ffmpeg-6.1-20231219` | Image tag for browser's video recorder | +| `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images | +| `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images | +| `global.seleniumGrid.affinity` | `{}` | Affinity assigned globally | +| `global.seleniumGrid.logLevel` | `INFO` | Set log level for all components | #### Configuration `global.K8S_PUBLIC_IP` @@ -196,6 +270,78 @@ SE_NODE_GRID_URL: 'http://admin:admin@10.10.10.10/selenium' ``` Besides that, from the outside of the cluster, you can access via NodePort http://10.10.10.10:30444/selenium +### Configuration of Nodes + +#### Container ports and Service ports + +By default, Node will use port `5555` to listen on container (following [this](https://www.selenium.dev/documentation/grid/configuration/cli_options/#server)) and expose via Service. You can update this value via `.port` in respective node type. This will be used to set `SE_NODE_PORT` environment variable to pass to option `--port` when starting the node and update in Service accordingly. + +By default, if httpGet probes are enabled, it will use `.port` value in respective node type unless you override it via e.g. `.startupProbe.port` `.readinessProbe.port` or `.livenessProbe.port` in respective node type. + +In a node container, there are other running services can be exposed. For example: VNC, NoVNC, SSH, etc. You can easily expose them on container via `.ports` and on Service `service.ports` in respective node type. + +```yaml +chromeNode: + port: 6666 # Update `SE_NODE_PORT` to 6666 + nodePort: 30666 # Specify a NodePort to expose `SE_NODE_PORT` to outside traffic + ports: + - 5900 # You can give port number alone, default protocol is TCP + - 7900 + service: + type: NodePort # Expose entire ports on Service via NodePort + ports: + - name: vnc-port + protocol: TCP + port: 5900 + targetPort: 5900 + nodePort: 30590 # Specify a NodePort to expose VNC port + - name: novnc-port + protocol: TCP + port: 7900 + targetPort: 7900 + # NodePort will be assigned randomly if not set +edgeNode: + ports: # You also can give object following manifest of container ports + - containerPort: 5900 + name: vnc + protocol: TCP + - containerPort: 7900 + name: novnc + protocol: TCP +``` + +#### Probes + +By default, `startupProbe` is enabled and `readinessProbe` and `livenessProbe` are disabled. You can enable/disable them via `.startupProbe.enabled` `.readinessProbe.enabled` `.livenessProbe.enabled` in respective node type. + +By default, probes are using `httpGet` method to check the node state. It will use `.port` value in respective node type unless you override it via e.g. `.startupProbe.port` `.readinessProbe.port` or `.livenessProbe.port` in respective node type. + +Other settings of probe support to override under `.startupProbe` `.readinessProbe` `.livenessProbe` in respective node type. + +```markdown + schema + path + port + initialDelaySeconds + failureThreshold + timeoutSeconds + periodSeconds + successThreshold +``` + +You can easily configure the probes (as Kubernetes [supports](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)) to override the default settings. For example: + +```yaml +edgeNode: + port: 5555 + startupProbe: + enabled: true + tcpSocket: + port: 5555 + failureThreshold: 10 + periodSeconds: 5 +``` + ### Configuration of Selenium Grid chart This table contains the configuration parameters of the chart and their default values: @@ -243,9 +389,9 @@ This table contains the configuration parameters of the chart and their default | `chromeNode.imageTag` | `4.16.1-20231219` | Image of chrome nodes | | `chromeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `chromeNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | -| `chromeNode.ports` | `[5555]` | Port list to enable on container | -| `chromeNode.seleniumPort` | `5900` | Selenium port (spec.ports[0].targetPort in kubernetes service) | -| `chromeNode.seleniumServicePort` | `6900` | Selenium port exposed in service (spec.ports[0].port in kubernetes service) | +| `chromeNode.ports` | `[]` | Extra ports list to enable on container (e.g VNC, NoVNC, SSH if any) | +| `chromeNode.port` | `5555` | Port is used to set `SE_NODE_PORT` | +| `chromeNode.nodePort` | `nil` | NodePort where chrome-node exposed | | `chromeNode.annotations` | `{}` | Annotations for chrome-node pods | | `chromeNode.labels` | `{}` | Labels for chrome-node pods | | `chromeNode.resources` | `See values.yaml` | Resources for chrome-node pods | @@ -263,8 +409,9 @@ This table contains the configuration parameters of the chart and their default | `chromeNode.service.ports` | `[]` | Extra ports exposed in node service | | `chromeNode.service.annotations` | `{}` | Custom annotations for service | | `chromeNode.dshmVolumeSizeLimit` | `1Gi` | Size limit for DSH volume mounted in container (if not set, default is "1Gi") | -| `chromeNode.startupProbe` | `{}` | Probe to check pod is started successfully | -| `chromeNode.livenessProbe` | `{}` | Liveness probe settings | +| `chromeNode.startupProbe.enabled` | `true` | Enable Probe to check pod is started successfully (the following configs see `values.yaml`) | +| `chromeNode.readinessProbe.enabled` | `false` | Enable Readiness probe settings (the following configs see `values.yaml`) | +| `chromeNode.livenessProbe.enabled` | `false` | Enable Liveness probe settings (the following configs see `values.yaml`) | | `chromeNode.terminationGracePeriodSeconds` | `30` | Time to graceful terminate container (default: 30s) | | `chromeNode.lifecycle` | `{}` | hooks to make pod correctly shutdown or started | | `chromeNode.extraVolumeMounts` | `[]` | Extra mounts of declared ExtraVolumes into pod | @@ -283,9 +430,9 @@ This table contains the configuration parameters of the chart and their default | `firefoxNode.imageTag` | `4.16.1-20231219` | Image of firefox nodes | | `firefoxNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `firefoxNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | -| `firefoxNode.ports` | `[5555]` | Port list to enable on container | -| `firefoxNode.seleniumPort` | `5900` | Selenium port (spec.ports[0].targetPort in kubernetes service) | -| `firefoxNode.seleniumServicePort` | `6900` | Selenium port exposed in service (spec.ports[0].port in kubernetes service) | +| `firefoxNode.ports` | `[]` | Extra ports list to enable on container (e.g VNC, NoVNC, SSH if any) | +| `firefoxNode.port` | `5555` | Port is used to set `SE_NODE_PORT` | +| `firefoxNode.nodePort` | `nil` | NodePort where firefox-node exposed | | `firefoxNode.annotations` | `{}` | Annotations for firefox-node pods | | `firefoxNode.labels` | `{}` | Labels for firefox-node pods | | `firefoxNode.resources` | `See values.yaml` | Resources for firefox-node pods | @@ -303,8 +450,9 @@ This table contains the configuration parameters of the chart and their default | `firefoxNode.service.ports` | `[]` | Extra ports exposed in node service | | `firefoxNode.service.annotations` | `{}` | Custom annotations for service | | `firefoxNode.dshmVolumeSizeLimit` | `1Gi` | Size limit for DSH volume mounted in container (if not set, default is "1Gi") | -| `firefoxNode.startupProbe` | `{}` | Probe to check pod is started successfully | -| `firefoxNode.livenessProbe` | `{}` | Liveness probe settings | +| `firefoxNode.startupProbe.enabled` | `true` | Enable Probe to check pod is started successfully (the following configs see `values.yaml`) | +| `firefoxNode.readinessProbe.enabled` | `false` | Enable Readiness probe settings (the following configs see `values.yaml`) | +| `firefoxNode.livenessProbe.enabled` | `false` | Enable Liveness probe settings (the following configs see `values.yaml`) | | `firefoxNode.terminationGracePeriodSeconds` | `30` | Time to graceful terminate container (default: 30s) | | `firefoxNode.lifecycle` | `{}` | hooks to make pod correctly shutdown or started | | `firefoxNode.extraVolumeMounts` | `[]` | Extra mounts of declared ExtraVolumes into pod | @@ -323,9 +471,9 @@ This table contains the configuration parameters of the chart and their default | `edgeNode.imageTag` | `4.16.1-20231219` | Image of edge nodes | | `edgeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `edgeNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | -| `edgeNode.ports` | `[5555]` | Port list to enable on container | -| `edgeNode.seleniumPort` | `5900` | Selenium port (spec.ports[0].targetPort in kubernetes service) | -| `edgeNode.seleniumServicePort` | `6900` | Selenium port exposed in service (spec.ports[0].port in kubernetes service) | +| `edgeNode.ports` | `[]` | Extra ports list to enable on container (e.g VNC, NoVNC, SSH if any) | +| `edgeNode.port` | `5555` | Port is used to set `SE_NODE_PORT` | +| `edgeNode.nodePort` | `nil` | NodePort where edge-node exposed | | `edgeNode.annotations` | `{}` | Annotations for edge-node pods | | `edgeNode.labels` | `{}` | Labels for edge-node pods | | `edgeNode.resources` | `See values.yaml` | Resources for edge-node pods | @@ -343,8 +491,9 @@ This table contains the configuration parameters of the chart and their default | `edgeNode.service.ports` | `[]` | Extra ports exposed in node service | | `edgeNode.service.annotations` | `{}` | Custom annotations for service | | `edgeNode.dshmVolumeSizeLimit` | `1Gi` | Size limit for DSH volume mounted in container (if not set, default is "1Gi") | -| `edgeNode.startupProbe` | `{}` | Probe to check pod is started successfully | -| `edgeNode.livenessProbe` | `{}` | Liveness probe settings | +| `edgeNode.startupProbe.enabled` | `true` | Enable Probe to check pod is started successfully (the following configs see `values.yaml`) | +| `edgeNode.readinessProbe.enabled` | `false` | Enable Readiness probe settings (the following configs see `values.yaml`) | +| `edgeNode.livenessProbe.enabled` | `false` | Enable Liveness probe settings (the following configs see `values.yaml`) | | `edgeNode.terminationGracePeriodSeconds` | `30` | Time to graceful terminate container (default: 30s) | | `edgeNode.lifecycle` | `{}` | hooks to make pod correctly shutdown or started | | `edgeNode.extraVolumeMounts` | `[]` | Extra mounts of declared ExtraVolumes into pod | @@ -357,7 +506,7 @@ This table contains the configuration parameters of the chart and their default | `edgeNode.scaledObjectOptions` | See `values.yaml` | Override the global `autoscaling.scaledObjectOptions` with specific scaled options for edge nodes | | `videoRecorder.enabled` | `false` | Enable video recorder for node | | `videoRecorder.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | -| `videoRecorder.imageName` | `video` | Selenium video recoder image name | +| `videoRecorder.imageName` | `video` | Selenium video recorder image name | | `videoRecorder.imageTag` | `ffmpeg-6.1-20231219` | Image tag of video recorder | | `videoRecorder.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `videoRecorder.uploader` | `false` | Name of the uploader to use. The value `false` is used to disable uploader. Supported default `s3` | diff --git a/charts/selenium-grid/TESTING.md b/charts/selenium-grid/TESTING.md index 7e94f85e4..fd29f09c1 100644 --- a/charts/selenium-grid/TESTING.md +++ b/charts/selenium-grid/TESTING.md @@ -10,7 +10,7 @@ All related testing to this helm chart will be documented in this file. | | Basic Auth is enabled | ✗ | | | Auto scaling | Auto scaling with `enableWithExistingKEDA` is `true` | ✓ | Cluster | | | Auto scaling with `scalingType` is `job` | ✓ | Cluster | -| | Auto scaling with `scalingType` is `deployment` | ✗ | | +| | Auto scaling with `scalingType` is `deployment` | ✓ | Cluster | | | Auto scaling with `autoscaling.scaledOptions.minReplicaCount` is `0` | ✓ | Cluster | | | Parallel tests execution against node autoscaling | ✓ | Cluster | | Ingress | Ingress is enabled without `hostname` | ✓ | Cluster | @@ -27,6 +27,10 @@ All related testing to this helm chart will be documented in this file. | | Components are able to set `.affinity` | ✓ | Template | | Tracing | Enable tracing via `SE_ENABLE_TRACING` | ✓ | Cluster | | | Disable tracing via `SE_ENABLE_TRACING` | ✓ | Cluster | +| `Node` component | `SE_NODE_PORT` can set a port different via `.port` | ✓ | Cluster | +| | Extra ports can be exposed on container via `.ports` | ✓ | Cluster | +| | Extra ports can be exposed on Service via `.service.ports` | ✓ | Cluster | +| | Service type change to `NodePort`, specific NodePort can be set | ✓ | Cluster | ## Test Chart Template - By using `helm template` command, the chart template is tested without installing it to Kubernetes cluster. diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index 7902d1938..baa2bc3be 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -80,6 +80,56 @@ Ingress fullname {{- default "selenium-ingress" .Values.ingress.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{/* +Probe httpGet schema +*/}} +{{- define "seleniumGrid.probe.httpGet.schema" -}} +{{- "HTTP" -}} +{{- end -}} + +{{/* +Check user define custom probe method +*/}} +{{- define "seleniumGrid.probe.fromUserDefine" -}} +{{- $overrideProbe := dict -}} +{{- with .exec -}} +{{- $overrideProbe = dict "exec" . -}} +{{- end }} +{{- with .httpGet -}} +{{- $overrideProbe = dict "httpGet" . -}} +{{- end }} +{{- with .tcpSocket -}} +{{- $overrideProbe = dict "tcpSocket" . -}} +{{- end }} +{{- with .grpc -}} +{{- $overrideProbe = dict "grpc" . -}} +{{- end -}} +{{- $overrideProbe | toYaml -}} +{{- end -}} + +{{/* +Get probe settings +*/}} +{{- define "seleniumGrid.probe.settings" -}} +{{- $settings := dict -}} +{{- with .initialDelaySeconds -}} + {{- $settings = set $settings "initialDelaySeconds" . -}} +{{- end }} +{{- with .periodSeconds -}} + {{- $settings = set $settings "periodSeconds" . -}} +{{- end }} +{{- with .timeoutSeconds -}} + {{- $settings = set $settings "timeoutSeconds" . -}} +{{- end }} +{{- with .successThreshold -}} + {{- $settings = set $settings "successThreshold" . -}} +{{- end }} +{{- with .failureThreshold -}} + {{- $settings = set $settings "failureThreshold" . -}} +{{- end -}} +{{- $settings | toYaml -}} +{{- end -}} + {{- define "seleniumGrid.ingress.nginx.annotations.default" -}} {{- with .Values.ingress.nginx }} {{- with .proxyTimeout }} @@ -199,9 +249,12 @@ template: {{- $imageRegistry := default .Values.global.seleniumGrid.imageRegistry .node.imageRegistry }} image: {{ printf "%s/%s:%s" $imageRegistry .node.imageName $imageTag }} imagePullPolicy: {{ .node.imagePullPolicy }} - {{- with .node.extraEnvironmentVariables }} - env: {{- tpl (toYaml .) $ | nindent 10 }} - {{- end }} + env: + - name: SE_NODE_PORT + value: {{ .node.port | quote }} + {{- with .node.extraEnvironmentVariables }} + {{- tpl (toYaml .) $ | nindent 10 }} + {{- end }} envFrom: - configMapRef: name: {{ .Values.busConfigMap.name }} @@ -212,16 +265,26 @@ template: {{- with .node.extraEnvFrom }} {{- tpl (toYaml .) $ | nindent 10 }} {{- end }} - {{- if gt (len .node.ports) 0 }} ports: - {{- range .node.ports }} - - containerPort: {{ . }} + - containerPort: {{ .node.port }} + protocol: TCP + {{- if gt (len .node.ports) 0 }} + {{- $ports := .node.ports -}} + {{- if (regexMatch "[0-9]+$" (index $ports 0 | toString)) -}} + {{- range .node.ports }} + - containerPort: {{ . | int }} protocol: TCP + {{- end }} + {{- else -}} + {{- tpl (toYaml .node.ports) $ | nindent 10 }} {{- end }} {{- end }} volumeMounts: - name: dshm mountPath: /dev/shm + - name: {{ .Values.nodeConfigMap.scriptVolumeMountName }} + mountPath: /opt/selenium/{{ .Values.nodeConfigMap.preStopScript }} + subPath: {{ .Values.nodeConfigMap.preStopScript }} {{- if .node.extraVolumeMounts }} {{- tpl (toYaml .node.extraVolumeMounts) $ | nindent 10 }} {{- end }} @@ -231,12 +294,54 @@ template: {{- with .node.securityContext }} securityContext: {{- toYaml . | nindent 10 }} {{- end }} - {{- include "seleniumGrid.lifecycle" . | nindent 8 -}} + {{- include "seleniumGrid.node.lifecycle" . | nindent 8 -}} + {{- if .node.startupProbe.enabled }} {{- with .node.startupProbe }} - startupProbe: {{- toYaml . | nindent 10 }} + startupProbe: + {{- if (ne (include "seleniumGrid.probe.fromUserDefine" .) "{}") }} + {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} + {{- else }} + httpGet: + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + path: {{ .path }} + port: {{ default ($.node.port) .port }} + {{- end }} + {{- if (ne (include "seleniumGrid.probe.settings" .) "{}") }} + {{- include "seleniumGrid.probe.settings" . | nindent 10 }} + {{- end }} + {{- end }} + {{- end }} + {{- if .node.readinessProbe.enabled }} + {{- with .node.readinessProbe }} + readinessProbe: + {{- if (ne (include "seleniumGrid.probe.fromUserDefine" .) "{}") }} + {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 12 }} + {{- else }} + httpGet: + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + path: {{ .path }} + port: {{ default ($.node.port) .port }} + {{- end }} + {{- if (ne (include "seleniumGrid.probe.settings" .) "{}") }} + {{- include "seleniumGrid.probe.settings" . | nindent 10 }} + {{- end }} + {{- end }} {{- end }} + {{- if .node.livenessProbe.enabled }} {{- with .node.livenessProbe }} - livenessProbe: {{- toYaml . | nindent 10 }} + livenessProbe: + {{- if (ne (include "seleniumGrid.probe.fromUserDefine" .) "{}") }} + {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} + {{- else }} + httpGet: + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + path: {{ .path }} + port: {{ default ($.node.port) .port }} + {{- end }} + {{- if (ne (include "seleniumGrid.probe.settings" .) "{}") }} + {{- include "seleniumGrid.probe.settings" . | nindent 10 }} + {{- end }} + {{- end }} {{- end }} {{- if .node.sidecars }} {{- toYaml .node.sidecars | nindent 6 }} @@ -325,6 +430,10 @@ template: {{- end }} terminationGracePeriodSeconds: {{ .node.terminationGracePeriodSeconds }} volumes: + - name: {{ .Values.nodeConfigMap.scriptVolumeMountName }} + configMap: + name: {{ .Values.nodeConfigMap.name }} + defaultMode: {{ .Values.nodeConfigMap.defaultMode }} - name: dshm emptyDir: medium: Memory @@ -425,19 +534,55 @@ Graphql unsafeSsl of the hub or the router {{- end -}} {{/* -Get the lifecycle of the pod. When KEDA is activated and the lifecycle is used for a pod of a -deployment preStop hook to deregister from the selenium hub. +Define preStop hook for the node pod. Node preStop script is stored in a ConfigMap and mounted as a volume. */}} -{{- define "seleniumGrid.lifecycle" }} -{{ $lifecycle := tpl (toYaml (default (dict) .node.lifecycle)) $ }} -{{- if and (eq .Values.autoscaling.scalingType "deployment") (eq (include "seleniumGrid.useKEDA" .) "true") -}} -{{ $lifecycle = merge ($lifecycle | fromYaml ) .Values.autoscaling.deregisterLifecycle | toYaml }} +{{- define "seleniumGrid.node.deregisterLifecycle" -}} +preStop: + exec: + command: ["bash", "-c", "/opt/selenium/{{ .Values.nodeConfigMap.preStopScript }}"] +{{- end -}} + +{{/* +Get the lifecycle of the pod is used for a Node to deregister from the Hub/Router. +1. IF KEDA is activated, scalingType is "deployment", and individual node deregisterLifecycle is not set, use autoscaling.deregisterLifecycle +2. ELSE (KEDA is not activated and node deregisterLifecycle is set), use .deregisterLifecycle in individual node +3. IF individual node with .lifecycle is set, it takes highest precedence to override the preStop in above use cases +*/}} +{{- define "seleniumGrid.node.lifecycle" }} +{{- $defaultDeregisterLifecycle := tpl (include "seleniumGrid.node.deregisterLifecycle" .) $ -}} +{{- $lifecycle := toYaml (dict) -}} +{{- if and (and (eq .Values.autoscaling.scalingType "deployment") (eq (include "seleniumGrid.useKEDA" .) "true")) (empty .node.deregisterLifecycle) -}} + {{- $lifecycle = merge ($lifecycle | fromYaml) (tpl (toYaml (default ($defaultDeregisterLifecycle | fromYaml) .Values.autoscaling.deregisterLifecycle)) $ | fromYaml) | toYaml -}} +{{- else -}} + {{- if eq (.node.deregisterLifecycle | toString | lower) "false" -}} + {{- $lifecycle = toYaml (dict) -}} + {{- else -}} + {{- $lifecycle = (tpl (toYaml (default ($defaultDeregisterLifecycle | fromYaml) .node.deregisterLifecycle) ) $ | fromYaml) | toYaml -}} + {{- end -}} +{{- end -}} +{{- if not (empty .node.lifecycle) -}} + {{- $lifecycle = mergeOverwrite ($lifecycle | fromYaml) (tpl (toYaml .node.lifecycle) $ | fromYaml) | toYaml -}} {{- end -}} {{ if and $lifecycle (ne $lifecycle "{}") -}} lifecycle: {{ $lifecycle | nindent 2 }} {{- end -}} {{- end -}} +{{/* +Define terminationGracePeriodSeconds of the node pod. +1. IF KEDA is activated, scalingType is "deployment", use autoscaling.terminationGracePeriodSeconds +2. IF node.terminationGracePeriodSeconds is greater than autoscaling.terminationGracePeriodSeconds, use node.terminationGracePeriodSeconds +*/}} +{{- define "seleniumGrid.node.terminationGracePeriodSeconds" -}} +{{- $autoscalingPeriod := default 0 .Values.autoscaling.terminationGracePeriodSeconds -}} +{{- $nodePeriod := default 0 .node.terminationGracePeriodSeconds -}} +{{- $period := $nodePeriod -}} +{{- if and (eq .Values.autoscaling.scalingType "deployment") (eq (include "seleniumGrid.useKEDA" .) "true") -}} + {{- $period = ternary $nodePeriod $autoscalingPeriod (gt $nodePeriod $autoscalingPeriod) -}} +{{- end -}} +{{- $period -}} +{{- end -}} + {{/* Default specs of VolumeMounts and Volumes for video recorder */}} diff --git a/charts/selenium-grid/templates/chrome-node-service.yaml b/charts/selenium-grid/templates/chrome-node-service.yaml index efe8f1873..a6965c3d0 100644 --- a/charts/selenium-grid/templates/chrome-node-service.yaml +++ b/charts/selenium-grid/templates/chrome-node-service.yaml @@ -22,8 +22,11 @@ spec: ports: - name: tcp-chrome protocol: TCP - port: {{ .Values.chromeNode.seleniumServicePort }} - targetPort: {{ .Values.chromeNode.seleniumPort }} + port: {{ .Values.chromeNode.port }} + targetPort: {{ .Values.chromeNode.port }} + {{- if and (eq $.Values.chromeNode.service.type "NodePort") .Values.chromeNode.nodePort }} + nodePort: {{ .Values.chromeNode.nodePort }} + {{- end }} {{- with .Values.chromeNode.service.ports }} {{- range . }} - name: {{ .name }} diff --git a/charts/selenium-grid/templates/edge-node-service.yaml b/charts/selenium-grid/templates/edge-node-service.yaml index d54dd70a3..896be0ac9 100644 --- a/charts/selenium-grid/templates/edge-node-service.yaml +++ b/charts/selenium-grid/templates/edge-node-service.yaml @@ -22,8 +22,11 @@ spec: ports: - name: tcp-edge protocol: TCP - port: {{ .Values.edgeNode.seleniumServicePort }} - targetPort: {{ .Values.edgeNode.seleniumPort }} + port: {{ .Values.edgeNode.port }} + targetPort: {{ .Values.edgeNode.port }} + {{- if and (eq $.Values.edgeNode.service.type "NodePort") .Values.edgeNode.nodePort }} + nodePort: {{ .Values.edgeNode.nodePort }} + {{- end }} {{- with .Values.edgeNode.service.ports }} {{- range . }} - name: {{ .name }} diff --git a/charts/selenium-grid/templates/event-bus-configmap.yaml b/charts/selenium-grid/templates/event-bus-configmap.yaml index 05f279bba..ad2b33756 100644 --- a/charts/selenium-grid/templates/event-bus-configmap.yaml +++ b/charts/selenium-grid/templates/event-bus-configmap.yaml @@ -1,4 +1,4 @@ -{{- $eventBusHost := ternary (include "seleniumGrid.eventBus.fullname" .) (include "seleniumGrid.hub.fullname" .) .Values.isolateComponents -}} +{{- $eventBusHost := printf "%s.%s" (ternary (include "seleniumGrid.eventBus.fullname" .) (include "seleniumGrid.hub.fullname" .) .Values.isolateComponents) (.Release.Namespace) -}} {{- $eventBusPublishPort := ternary .Values.components.eventBus.publishPort .Values.hub.publishPort .Values.isolateComponents -}} {{- $eventBusSubscribePort := ternary .Values.components.eventBus.subscribePort .Values.hub.subscribePort .Values.isolateComponents -}} apiVersion: v1 diff --git a/charts/selenium-grid/templates/firefox-node-service.yaml b/charts/selenium-grid/templates/firefox-node-service.yaml index 43ba40380..a0de36ca5 100644 --- a/charts/selenium-grid/templates/firefox-node-service.yaml +++ b/charts/selenium-grid/templates/firefox-node-service.yaml @@ -22,8 +22,11 @@ spec: ports: - name: tcp-firefox protocol: TCP - port: {{ .Values.firefoxNode.seleniumServicePort }} - targetPort: {{ .Values.firefoxNode.seleniumPort }} + port: {{ .Values.firefoxNode.port }} + targetPort: {{ .Values.firefoxNode.port }} + {{- if and (eq $.Values.firefoxNode.service.type "NodePort") .Values.firefoxNode.nodePort }} + nodePort: {{ .Values.firefoxNode.nodePort }} + {{- end }} {{- with .Values.firefoxNode.service.ports }} {{- range . }} - name: {{ .name }} diff --git a/charts/selenium-grid/templates/hub-deployment.yaml b/charts/selenium-grid/templates/hub-deployment.yaml index b9b28a446..71473b209 100644 --- a/charts/selenium-grid/templates/hub-deployment.yaml +++ b/charts/selenium-grid/templates/hub-deployment.yaml @@ -42,27 +42,53 @@ spec: protocol: TCP - containerPort: {{ .Values.hub.subscribePort }} protocol: TCP - {{- if .Values.hub.livenessProbe.enabled }} - livenessProbe: + {{- if .Values.hub.startupProbe.enabled }} + {{- with .Values.hub.startupProbe }} + startupProbe: + {{- if (ne (include "seleniumGrid.probe.fromUserDefine" .) "{}") }} + {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} + {{- else }} httpGet: - path: {{ .Values.hub.livenessProbe.path }} - port: {{ .Values.hub.port }} - initialDelaySeconds: {{ .Values.hub.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.hub.livenessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.hub.livenessProbe.timeoutSeconds }} - successThreshold: {{ .Values.hub.livenessProbe.successThreshold }} - failureThreshold: {{ .Values.hub.livenessProbe.failureThreshold }} + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + path: {{ .path }} + port: {{ default ($.Values.hub.port) .port }} + {{- end }} + {{- if (ne (include "seleniumGrid.probe.settings" .) "{}") }} + {{- include "seleniumGrid.probe.settings" . | nindent 12 }} + {{- end }} + {{- end }} {{- end }} {{- if .Values.hub.readinessProbe.enabled }} + {{- with .Values.hub.readinessProbe }} readinessProbe: + {{- if (ne (include "seleniumGrid.probe.fromUserDefine" .) "{}") }} + {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} + {{- else }} httpGet: - path: {{ .Values.hub.readinessProbe.path }} - port: {{ .Values.hub.port }} - initialDelaySeconds: {{ .Values.hub.readinessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.hub.readinessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.hub.readinessProbe.timeoutSeconds }} - successThreshold: {{ .Values.hub.readinessProbe.successThreshold }} - failureThreshold: {{ .Values.hub.readinessProbe.failureThreshold }} + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + path: {{ .path }} + port: {{ default ($.Values.hub.port) .port }} + {{- end }} + {{- if (ne (include "seleniumGrid.probe.settings" .) "{}") }} + {{- include "seleniumGrid.probe.settings" . | nindent 12 }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.hub.livenessProbe.enabled }} + {{- with .Values.hub.livenessProbe }} + livenessProbe: + {{- if (ne (include "seleniumGrid.probe.fromUserDefine" .) "{}") }} + {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} + {{- else }} + httpGet: + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + path: {{ .path }} + port: {{ default ($.Values.hub.port) .port }} + {{- end }} + {{- if (ne (include "seleniumGrid.probe.settings" .) "{}") }} + {{- include "seleniumGrid.probe.settings" . | nindent 12 }} + {{- end }} + {{- end }} {{- end }} env: {{- with .Values.hub.subPath }} diff --git a/charts/selenium-grid/templates/node-configmap.yaml b/charts/selenium-grid/templates/node-configmap.yaml index da4edab40..807e2036c 100644 --- a/charts/selenium-grid/templates/node-configmap.yaml +++ b/charts/selenium-grid/templates/node-configmap.yaml @@ -14,3 +14,11 @@ metadata: data: SE_DRAIN_AFTER_SESSION_COUNT: '{{- and (eq (include "seleniumGrid.useKEDA" .) "true") (eq .Values.autoscaling.scalingType "job") | ternary "1" "0" -}}' SE_NODE_GRID_URL: '{{ include "seleniumGrid.url" .}}' + {{ .Values.nodeConfigMap.preStopScript }}: | + #!/bin/bash + if curl -sf 127.0.0.1:${SE_NODE_PORT}/status; then + curl -X POST 127.0.0.1:${SE_NODE_PORT}/se/grid/node/drain --header 'X-REGISTRATION-SECRET;' + while curl -sf 127.0.0.1:${SE_NODE_PORT}/status; do sleep 1; done + else + echo "Node is already drained. Shutting down gracefully!" + fi diff --git a/charts/selenium-grid/templates/router-deployment.yaml b/charts/selenium-grid/templates/router-deployment.yaml index cc0cbbf29..e02829d46 100644 --- a/charts/selenium-grid/templates/router-deployment.yaml +++ b/charts/selenium-grid/templates/router-deployment.yaml @@ -67,27 +67,54 @@ spec: ports: - containerPort: {{ .Values.components.router.port }} protocol: TCP - {{- if .Values.components.router.livenessProbe.enabled }} - livenessProbe: + {{- if .Values.components.router.startupProbe.enabled }} + {{- with .Values.components.router.startupProbe }} + startupProbe: + {{- if (ne (include "seleniumGrid.probe.fromUserDefine" .) "{}") }} + {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} + {{- else }} httpGet: - path: {{ .Values.components.router.livenessProbe.path }} - port: {{ .Values.components.router.port }} - initialDelaySeconds: {{ .Values.components.router.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.components.router.livenessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.components.router.livenessProbe.timeoutSeconds }} - successThreshold: {{ .Values.components.router.livenessProbe.successThreshold }} - failureThreshold: {{ .Values.components.router.livenessProbe.failureThreshold }} + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + path: {{ .path }} + port: {{ default ($.Values.components.router.port) .port }} + {{- end }} + {{- if (ne (include "seleniumGrid.probe.settings" .) "{}") }} + {{- include "seleniumGrid.probe.settings" . | nindent 12 }} + {{- end }} + {{- end }} {{- end }} {{- if .Values.components.router.readinessProbe.enabled }} + {{- with .Values.components.router.readinessProbe }} readinessProbe: + {{- if (ne (include "seleniumGrid.probe.fromUserDefine" .) "{}") }} + {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} + {{- else }} + httpGet: + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + path: {{ .path }} + port: {{ default ($.Values.components.router.port) .port }} + {{- end }} + {{- if (ne (include "seleniumGrid.probe.settings" .) "{}") }} + {{- include "seleniumGrid.probe.settings" . | nindent 12 }} + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.components.router.livenessProbe.enabled }} + livenessProbe: + {{- with .Values.components.router.livenessProbe }} + livenessProbe: + {{- if (ne (include "seleniumGrid.probe.fromUserDefine" .) "{}") }} + {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} + {{- else }} httpGet: - path: {{ .Values.components.router.readinessProbe.path }} - port: {{ .Values.components.router.port }} - initialDelaySeconds: {{ .Values.components.router.readinessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.components.router.readinessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.components.router.readinessProbe.timeoutSeconds }} - successThreshold: {{ .Values.components.router.readinessProbe.successThreshold }} - failureThreshold: {{ .Values.components.router.readinessProbe.failureThreshold }} + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + path: {{ .path }} + port: {{ default ($.Values.components.router.port) .port }} + {{- end }} + {{- if (ne (include "seleniumGrid.probe.settings" .) "{}") }} + {{- include "seleniumGrid.probe.settings" . | nindent 12 }} + {{- end }} + {{- end }} {{- end }} {{- with .Values.components.router.resources }} resources: {{- toYaml . | nindent 12 }} diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index b6e7ef07c..f4a094c16 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -74,6 +74,12 @@ busConfigMap: # ConfigMap that contains common environment variables for browser nodes nodeConfigMap: name: selenium-node-config + # Default mode for ConfigMap is mounted as file + defaultMode: 0755 + # File name of preStop script in ConfigMap + preStopScript: nodePreStop.sh + # Name of volume mount is used to mount scripts in the ConfigMap + scriptVolumeMountName: node-helper-scripts # Custom annotations for configmap annotations: {} @@ -104,11 +110,11 @@ components: # Router port port: 4444 nodePort: 30444 - # Liveness probe settings - livenessProbe: + # Wait for pod startup + startupProbe: enabled: true path: /readyz - initialDelaySeconds: 10 + initialDelaySeconds: 5 failureThreshold: 10 timeoutSeconds: 10 periodSeconds: 10 @@ -122,6 +128,15 @@ components: timeoutSeconds: 10 periodSeconds: 10 successThreshold: 1 + # Liveness probe settings + livenessProbe: + enabled: true + path: /readyz + initialDelaySeconds: 10 + failureThreshold: 10 + timeoutSeconds: 10 + periodSeconds: 10 + successThreshold: 1 # Resources for router container resources: {} # SecurityContext for router container @@ -319,11 +334,11 @@ hub: # Selenium Hub port port: 4444 nodePort: 31444 - # Liveness probe settings - livenessProbe: + # Wait for pod startup + startupProbe: enabled: true path: /readyz - initialDelaySeconds: 10 + initialDelaySeconds: 5 failureThreshold: 10 timeoutSeconds: 10 periodSeconds: 10 @@ -337,6 +352,15 @@ hub: timeoutSeconds: 10 periodSeconds: 10 successThreshold: 1 + # Liveness probe settings + livenessProbe: + enabled: true + path: /readyz + initialDelaySeconds: 10 + failureThreshold: 10 + timeoutSeconds: 10 + periodSeconds: 10 + successThreshold: 1 # Custom sub path for the hub deployment subPath: "" # Custom environment variables for selenium-hub @@ -418,15 +442,13 @@ autoscaling: scaledObjectOptions: scaleTargetRef: kind: Deployment + # Define terminationGracePeriodSeconds for scalingType "deployment". Period for `deregisterLifecycle` to gracefully shut down the node before force killing it + terminationGracePeriodSeconds: 3600 + # Define preStop command to shuts down the node gracefully when scalingType is set to "deployment" deregisterLifecycle: - preStop: - exec: - command: - - bash - - -c - - | - curl -X POST 127.0.0.1:5555/se/grid/node/drain --header 'X-REGISTRATION-SECRET;' && \ - while curl 127.0.0.1:5555/status; do sleep 1; done; + # preStop: + # exec: + # command: [ "bash", "-c", "/opt/selenium/nodePreStop.sh" ] # Configuration for chrome nodes chromeNode: @@ -451,13 +473,13 @@ chromeNode: # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) imagePullSecret: "" - # Port list to enable on container - ports: - - 5555 - # Selenium port (spec.ports[0].targetPort in kubernetes service) - seleniumPort: 5900 - # Selenium port exposed in service (spec.ports[0].port in kubernetes service) - seleniumServicePort: 6900 + # Extra ports list to enable on the node container (e.g. SSH, VNC, NoVNC, etc.) + ports: [] + # - 5900 + # - 7900 + # Node component port + port: 5555 + nodePort: # Annotations for chrome-node pods annotations: {} # Labels for chrome-node pods @@ -510,9 +532,9 @@ chromeNode: loadBalancerIP: "" # Extra ports exposed in node service ports: - # - name: node-port - # port: 5555 - # targetPort: 5555 + # - name: vnc-port + # port: 5900 + # targetPort: 5900 # Custom annotations for service annotations: {} # Size limit for DSH volume mounted in container (if not set, default is "1Gi") @@ -521,18 +543,40 @@ chromeNode: priorityClassName: "" # Wait for pod startup - startupProbe: {} - # httpGet: - # path: /status - # port: 5555 - # failureThreshold: 120 - # periodSeconds: 5 + startupProbe: + enabled: true + path: /status + initialDelaySeconds: 0 + failureThreshold: 10 + timeoutSeconds: 5 + periodSeconds: 5 + successThreshold: 1 + + # Readiness probe settings + readinessProbe: + enabled: false + path: /status + initialDelaySeconds: 10 + failureThreshold: 10 + timeoutSeconds: 10 + periodSeconds: 10 + successThreshold: 1 # Liveness probe settings - livenessProbe: {} + livenessProbe: + enabled: false + path: /status + initialDelaySeconds: 15 + failureThreshold: 10 + timeoutSeconds: 10 + periodSeconds: 10 + successThreshold: 1 # Time to wait for pod termination terminationGracePeriodSeconds: 30 + # Define preStop command to shuts down the chrome node gracefully. This overwrites autoscaling.deregisterLifecycle + deregisterLifecycle: + # Define postStart and preStop events. This overwrites the defined preStop in deregisterLifecycle if any lifecycle: {} extraVolumeMounts: [] # - name: my-extra-volume @@ -585,13 +629,13 @@ firefoxNode: # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) imagePullSecret: "" - # Port list to enable on container - ports: - - 5555 - # Selenium port (spec.ports[0].targetPort in kubernetes service) - seleniumPort: 5900 - # Selenium port exposed in service (spec.ports[0].port in kubernetes service) - seleniumServicePort: 6900 + # Extra ports list to enable on the node container (e.g. SSH, VNC, NoVNC, etc.) + ports: [] + # - 5900 + # - 7900 + # Node component port + port: 5555 + nodePort: # Annotations for firefox-node pods annotations: {} # Labels for firefox-node pods @@ -644,9 +688,9 @@ firefoxNode: loadBalancerIP: "" # Extra ports exposed in node service ports: - # - name: node-port - # port: 5555 - # targetPort: 5555 + # - name: vnc-port + # port: 5900 + # targetPort: 5900 # Custom annotations for service annotations: {} # Size limit for DSH volume mounted in container (if not set, default is "1Gi") @@ -655,18 +699,40 @@ firefoxNode: priorityClassName: "" # Wait for pod startup - startupProbe: {} - # httpGet: - # path: /status - # port: 5555 - # failureThreshold: 120 - # periodSeconds: 5 + startupProbe: + enabled: true + path: /status + initialDelaySeconds: 0 + failureThreshold: 10 + timeoutSeconds: 5 + periodSeconds: 5 + successThreshold: 1 + + # Readiness probe settings + readinessProbe: + enabled: false + path: /status + initialDelaySeconds: 10 + failureThreshold: 10 + timeoutSeconds: 10 + periodSeconds: 10 + successThreshold: 1 # Liveness probe settings - livenessProbe: {} + livenessProbe: + enabled: false + path: /status + initialDelaySeconds: 15 + failureThreshold: 10 + timeoutSeconds: 10 + periodSeconds: 10 + successThreshold: 1 # Time to wait for pod termination terminationGracePeriodSeconds: 30 + # Define preStop command to shuts down the chrome node gracefully. This overwrites autoscaling.deregisterLifecycle + deregisterLifecycle: + # Define postStart and preStop events. This overwrites the defined preStop in deregisterLifecycle if any lifecycle: {} extraVolumeMounts: [] # - name: my-extra-volume @@ -717,12 +783,13 @@ edgeNode: # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) imagePullSecret: "" - ports: - - 5555 - # Selenium port (spec.ports[0].targetPort in kubernetes service) - seleniumPort: 5900 - # Selenium port exposed in service (spec.ports[0].port in kubernetes service) - seleniumServicePort: 6900 + # Extra ports list to enable on the node container (e.g. SSH, VNC, NoVNC, etc.) + ports: [] + # - 5900 + # - 7900 + # Node component port + port: 5555 + nodePort: # Annotations for edge-node pods annotations: {} # Labels for edge-node pods @@ -775,9 +842,9 @@ edgeNode: loadBalancerIP: "" # Extra ports exposed in node service ports: - # - name: node-port - # port: 5555 - # targetPort: 5555 + # - name: vnc-port + # port: 5900 + # targetPort: 5900 # Custom annotations for service annotations: {} # Size limit for DSH volume mounted in container (if not set, default is "1Gi") @@ -786,18 +853,40 @@ edgeNode: priorityClassName: "" # Wait for pod startup - startupProbe: {} - # httpGet: - # path: /status - # port: 5555 - # failureThreshold: 120 - # periodSeconds: 5 + startupProbe: + enabled: true + path: /status + initialDelaySeconds: 0 + failureThreshold: 10 + timeoutSeconds: 5 + periodSeconds: 5 + successThreshold: 1 + + # Readiness probe settings + readinessProbe: + enabled: false + path: /status + initialDelaySeconds: 10 + failureThreshold: 10 + timeoutSeconds: 10 + periodSeconds: 10 + successThreshold: 1 # Liveness probe settings - livenessProbe: {} + livenessProbe: + enabled: false + path: /status + initialDelaySeconds: 15 + failureThreshold: 10 + timeoutSeconds: 10 + periodSeconds: 10 + successThreshold: 1 # Time to wait for pod termination terminationGracePeriodSeconds: 30 + # Define preStop command to shuts down the chrome node gracefully. This overwrites autoscaling.deregisterLifecycle + deregisterLifecycle: + # Define postStart and preStop events. This overwrites the defined preStop in deregisterLifecycle if any lifecycle: {} extraVolumeMounts: [] # - name: my-extra-volume diff --git a/tests/SeleniumTests/__init__.py b/tests/SeleniumTests/__init__.py index fa95acefa..4ca352683 100644 --- a/tests/SeleniumTests/__init__.py +++ b/tests/SeleniumTests/__init__.py @@ -127,7 +127,7 @@ def test_title_and_maximize_window(self): self.driver.maximize_window() self.assertTrue(self.driver.title == 'The Internet') -class ParallelAutoscaling(): +class JobAutoscaling(): def run(self, test_classes): with concurrent.futures.ThreadPoolExecutor() as executor: futures = [] @@ -138,7 +138,7 @@ def run(self, test_classes): for future in concurrent.futures.as_completed(futures): future.result() -class ParallelAutoscalingTests(unittest.TestCase): +class JobAutoscalingTests(unittest.TestCase): def test_parallel_autoscaling(self): - runner = ParallelAutoscaling() + runner = JobAutoscaling() runner.run([ChromeTests, EdgeTests, FirefoxTests]) diff --git a/tests/charts/bootstrap.sh b/tests/charts/bootstrap.sh index d961b63ae..f1ade17d1 100755 --- a/tests/charts/bootstrap.sh +++ b/tests/charts/bootstrap.sh @@ -13,9 +13,9 @@ python -m pip install pyyaml==6.0.1 \ cd .. helm template dummy --values tests/charts/templates/render/dummy.yaml \ - charts/selenium-grid > ./tests/tests/output_deployment.yaml + charts/selenium-grid > ./tests/tests/dummy_template_manifests.yaml -python tests/charts/templates/test.py "./tests/tests/output_deployment.yaml" +python tests/charts/templates/test.py "./tests/tests/dummy_template_manifests.yaml" ret_code=$? if [ "${CI:-false}" = "false" ]; then diff --git a/tests/charts/ci/DeploymentAutoScaling-values.yaml b/tests/charts/ci/DeploymentAutoScaling-values.yaml new file mode 100644 index 000000000..b9e5b120e --- /dev/null +++ b/tests/charts/ci/DeploymentAutoScaling-values.yaml @@ -0,0 +1,72 @@ +autoscaling: + enableWithExistingKEDA: true + scalingType: deployment + scaledOptions: + minReplicaCount: 0 + maxReplicaCount: 3 + scaledObjectOptions: + cooldownPeriod: 30 + terminationGracePeriodSeconds: 360 +# Configuration for chrome nodes +chromeNode: + # (test): user is able to change `SE_NODE_PORT` + port: 6666 + # (test): user is able to set NodePort to expose `SE_NODE_PORT` + nodePort: 30666 + # (test): user is able to define list extra container ports + ports: + - 5900 + - 7900 + service: + type: NodePort + # (test): user is able to define extra ports for Node service + ports: + - name: vnc-port + protocol: TCP + port: 5900 + targetPort: 5900 + nodePort: 30590 + - name: novnc-port + protocol: TCP + port: 7900 + targetPort: 7900 + # NodePort will be assigned randomly if not set + nameOverride: my-chrome-name + extraEnvironmentVariables: &extraEnvironmentVariables + - name: SE_OPTS + value: "--enable-managed-downloads true" + - name: SE_DRAIN_AFTER_SESSION_COUNT + value: "0" + readinessProbe: + enabled: &readinessProbe true + livenessProbe: + enabled: &livenessProbe true +# Configuration for edge nodes +edgeNode: + # (test): user is able to define extra container ports + ports: + - containerPort: 5900 + name: vnc + protocol: TCP + - containerPort: 7900 + name: novnc + protocol: TCP + nameOverride: my-edge-name + extraEnvironmentVariables: *extraEnvironmentVariables + # (test): user is able to override probe method + startupProbe: + enabled: true + tcpSocket: + port: 8888 + readinessProbe: + enabled: *readinessProbe + livenessProbe: + enabled: *livenessProbe +# Configuration for firefox nodes +firefoxNode: + nameOverride: my-firefox-name + extraEnvironmentVariables: *extraEnvironmentVariables + readinessProbe: + enabled: *readinessProbe + livenessProbe: + enabled: *livenessProbe diff --git a/tests/charts/ci/ParallelAutoscaling-values.yaml b/tests/charts/ci/JobAutoscaling-values.yaml similarity index 67% rename from tests/charts/ci/ParallelAutoscaling-values.yaml rename to tests/charts/ci/JobAutoscaling-values.yaml index 78302b94f..d8fc0bc79 100644 --- a/tests/charts/ci/ParallelAutoscaling-values.yaml +++ b/tests/charts/ci/JobAutoscaling-values.yaml @@ -1,26 +1,43 @@ isolateComponents: false + autoscaling: + enableWithExistingKEDA: true + scalingType: job strategy: default scaledOptions: minReplicaCount: 0 maxReplicaCount: 5 + pollingInterval: 20 +# Configuration for chrome nodes chromeNode: nameOverride: my-chrome-name extraEnvironmentVariables: - name: SE_OPTS value: "--enable-managed-downloads true" + readinessProbe: + enabled: &readinessProbe false + livenessProbe: + enabled: &livenessProbe false # Configuration for edge nodes edgeNode: nameOverride: my-edge-name extraEnvironmentVariables: - name: SE_OPTS value: "--enable-managed-downloads true" + readinessProbe: + enabled: *readinessProbe + livenessProbe: + enabled: *livenessProbe # Configuration for firefox nodes firefoxNode: nameOverride: my-firefox-name extraEnvironmentVariables: - name: SE_OPTS value: "--enable-managed-downloads true" + readinessProbe: + enabled: *readinessProbe + livenessProbe: + enabled: *livenessProbe ingress: paths: diff --git a/tests/charts/ci/NodeChrome-values.yaml b/tests/charts/ci/NodeChrome-values.yaml index 09396f42d..d7c9df098 100644 --- a/tests/charts/ci/NodeChrome-values.yaml +++ b/tests/charts/ci/NodeChrome-values.yaml @@ -1,6 +1,7 @@ # This is used in Helm chart testing # Configuration for chrome nodes chromeNode: + port: 6666 nameOverride: my-chrome-name extraEnvironmentVariables: - name: SE_OPTS diff --git a/tests/charts/ci/NodeEdge-values.yaml b/tests/charts/ci/NodeEdge-values.yaml index 27220e275..7c78ccbe7 100644 --- a/tests/charts/ci/NodeEdge-values.yaml +++ b/tests/charts/ci/NodeEdge-values.yaml @@ -4,6 +4,7 @@ chromeNode: enabled: false # Configuration for edge nodes edgeNode: + port: 8888 nameOverride: my-edge-name extraEnvironmentVariables: - name: SE_OPTS diff --git a/tests/charts/ci/NodeFirefox-values.yaml b/tests/charts/ci/NodeFirefox-values.yaml index 21bb6a285..72cce27c5 100644 --- a/tests/charts/ci/NodeFirefox-values.yaml +++ b/tests/charts/ci/NodeFirefox-values.yaml @@ -7,6 +7,7 @@ edgeNode: enabled: false # Configuration for firefox nodes firefoxNode: + port: 7777 nameOverride: my-firefox-name extraEnvironmentVariables: - name: SE_OPTS diff --git a/tests/charts/ci/autoscaling-values.yaml b/tests/charts/ci/autoscaling-values.yaml deleted file mode 100644 index 7fa80b2bb..000000000 --- a/tests/charts/ci/autoscaling-values.yaml +++ /dev/null @@ -1,5 +0,0 @@ -autoscaling: - enableWithExistingKEDA: true - scalingType: job - scaledOptions: - minReplicaCount: 0 diff --git a/tests/charts/make/chart_test.sh b/tests/charts/make/chart_test.sh index 2d87c799e..194bb6056 100755 --- a/tests/charts/make/chart_test.sh +++ b/tests/charts/make/chart_test.sh @@ -1,4 +1,6 @@ #!/bin/bash +mkdir -p tests/tests +set -o xtrace echo "Set ENV variables" CLUSTER_NAME=${CLUSTER_NAME:-"chart-testing"} @@ -31,7 +33,7 @@ cleanup() { on_failure() { local exit_status=$? echo "Describe all resources in the ${SELENIUM_NAMESPACE} namespace for debugging purposes" - kubectl describe all -n ${SELENIUM_NAMESPACE} + kubectl describe all -n ${SELENIUM_NAMESPACE} > tests/tests/describe_all_resources_${MATRIX_BROWSER}.txt echo "There is step failed with exit status $exit_status" cleanup exit $exit_status @@ -42,20 +44,25 @@ trap 'on_failure' ERR HELM_COMMAND_SET_AUTOSCALING="" if [ "${SELENIUM_GRID_AUTOSCALING}" = "true" ]; then - HELM_COMMAND_SET_AUTOSCALING="--values ${TEST_VALUES_PATH}/autoscaling-values.yaml \ + HELM_COMMAND_SET_AUTOSCALING="--values ${TEST_VALUES_PATH}/DeploymentAutoScaling-values.yaml \ --set autoscaling.enableWithExistingKEDA=${SELENIUM_GRID_AUTOSCALING} \ --set autoscaling.scaledOptions.minReplicaCount=${SELENIUM_GRID_AUTOSCALING_MIN_REPLICA}" fi -echo "Deploy Selenium Grid Chart" -helm upgrade --install ${RELEASE_NAME} \ +HELM_COMMAND_ARGS="${RELEASE_NAME} \ --values ${TEST_VALUES_PATH}/auth-ingress-values.yaml \ --values ${TEST_VALUES_PATH}/tracing-values.yaml \ --values ${TEST_VALUES_PATH}/${MATRIX_BROWSER}-values.yaml \ ${HELM_COMMAND_SET_AUTOSCALING} \ --set global.seleniumGrid.imageTag=${VERSION} --set global.seleniumGrid.imageRegistry=${NAMESPACE} \ --set global.seleniumGrid.nodesImageTag=${VERSION} \ -${CHART_PATH} --namespace ${SELENIUM_NAMESPACE} --create-namespace +${CHART_PATH} --namespace ${SELENIUM_NAMESPACE} --create-namespace" + +echo "Render manifests YAML for this deployment" +helm template ${HELM_COMMAND_ARGS} > tests/tests/cluster_deployment_manifests_${MATRIX_BROWSER}.yaml + +echo "Deploy Selenium Grid Chart" +helm upgrade --install ${HELM_COMMAND_ARGS} echo "Run Tests" export SELENIUM_GRID_HOST=${SELENIUM_GRID_HOST} @@ -71,6 +78,6 @@ echo "Get pods status" kubectl get pods -n ${SELENIUM_NAMESPACE} echo "Get all resources in the ${SELENIUM_NAMESPACE} namespace" -kubectl get all -n ${SELENIUM_NAMESPACE} +kubectl get all -n ${SELENIUM_NAMESPACE} > tests/tests/describe_all_resources_${MATRIX_BROWSER}.txt cleanup diff --git a/tests/charts/refValues/sample-aws.yaml b/tests/charts/refValues/sample-aws.yaml index d32d101cf..06172f0e3 100644 --- a/tests/charts/refValues/sample-aws.yaml +++ b/tests/charts/refValues/sample-aws.yaml @@ -60,20 +60,12 @@ chromeNode: value: "true" - name: SE_OPTS value: "--enable-managed-downloads true" - startupProbe: &nodeStartupProbe - httpGet: - path: /status - port: 5555 - failureThreshold: 120 - periodSeconds: 1 firefoxNode: extraEnvironmentVariables: *extraEnvironmentVariablesNodes - startupProbe: *nodeStartupProbe edgeNode: extraEnvironmentVariables: *extraEnvironmentVariablesNodes - startupProbe: *nodeStartupProbe videoRecorder: enabled: false diff --git a/tests/charts/refValues/simplex-minikube.yaml b/tests/charts/refValues/simplex-minikube.yaml index e491deda3..5239714c7 100644 --- a/tests/charts/refValues/simplex-minikube.yaml +++ b/tests/charts/refValues/simplex-minikube.yaml @@ -33,7 +33,7 @@ ingress: number: 4444 basicAuth: - enabled: true + enabled: false isolateComponents: true @@ -69,20 +69,12 @@ chromeNode: value: "true" - name: SE_OPTS value: "--enable-managed-downloads true" - startupProbe: &nodeStartupProbe - httpGet: - path: /status - port: 5555 - failureThreshold: 120 - periodSeconds: 1 firefoxNode: extraEnvironmentVariables: *extraEnvironmentVariablesNodes - startupProbe: *nodeStartupProbe edgeNode: extraEnvironmentVariables: *extraEnvironmentVariablesNodes - startupProbe: *nodeStartupProbe videoRecorder: enabled: false diff --git a/tests/test.py b/tests/test.py index b8b462c2b..5be6fbe8c 100644 --- a/tests/test.py +++ b/tests/test.py @@ -57,7 +57,7 @@ 'StandaloneFirefox': 'FirefoxTests', # Chart Parallel Test - 'ParallelAutoscaling': 'ParallelAutoscalingTests' + 'JobAutoscaling': 'JobAutoscalingTests' } FROM_IMAGE_ARGS = { From ac2897ed091119f4cc9a88ebc85c33d643b37a81 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Fri, 5 Jan 2024 15:20:32 +0700 Subject: [PATCH 32/62] feat(chart): Simplify to enable HTTPS/TLS in Selenium Grid on Kubernetes (#2080) * feat(chart): Simplify to enable HTTPS/TLS in Selenium Grid on Kubernetes * feat(chart): Simplify to enable node registration secret --------- Signed-off-by: Viet Nguyen Duc --- .github/workflows/helm-chart-test.yml | 8 +- .../start-selenium-grid-distributor.sh | 29 +++++ EventBus/start-selenium-grid-eventbus.sh | 24 ++++ Hub/start-selenium-grid-hub.sh | 29 +++++ Makefile | 4 + NodeBase/start-selenium-node.sh | 33 +++++- NodeDocker/start-selenium-grid-docker.sh | 24 ++++ Router/start-selenium-grid-router.sh | 29 +++++ .../start-selenium-grid-session-queue.sh | 24 ++++ Sessions/start-selenium-grid-sessions.sh | 24 ++++ Standalone/start-selenium-standalone.sh | 24 ++++ .../start-selenium-grid-docker.sh | 24 ++++ charts/selenium-grid/README.md | 92 +++++++++++++++ charts/selenium-grid/certs/cert.sh | 61 ++++++++++ charts/selenium-grid/certs/selenium.jks | Bin 0 -> 2864 bytes charts/selenium-grid/certs/selenium.pem | 23 ++++ .../selenium-grid/certs/selenium.pkcs8.base64 | 1 + charts/selenium-grid/templates/_helpers.tpl | 108 ++++++++++++++++-- .../templates/distributor-deployment.yaml | 16 +++ .../templates/event-bus-deployment.yaml | 16 +++ .../templates/hub-deployment.yaml | 30 +++-- charts/selenium-grid/templates/ingress.yaml | 9 +- .../templates/router-deployment.yaml | 28 +++-- charts/selenium-grid/templates/secrets.yaml | 33 ++++++ .../templates/server-configmap.yaml | 20 ++++ .../templates/session-map-deployment.yaml | 16 +++ .../templates/session-queuer-deployment.yaml | 16 +++ .../templates/tls-cert-secret.yaml | 29 +++++ charts/selenium-grid/values.yaml | 45 ++++++++ tests/SeleniumTests/__init__.py | 7 +- tests/SmokeTests/__init__.py | 5 +- tests/bootstrap.sh | 4 + .../ci/DeploymentAutoScaling-values.yaml | 3 +- tests/charts/ci/JobAutoscaling-values.yaml | 20 +--- tests/charts/ci/auth-ingress-values.yaml | 4 +- tests/charts/ci/tls-values.yaml | 11 ++ tests/charts/make/chart_test.sh | 13 ++- tests/charts/refValues/sample-aws.yaml | 2 +- tests/charts/refValues/simplex-minikube.yaml | 13 ++- tests/charts/templates/render/dummy.yaml | 8 +- tests/charts/templates/test.py | 7 +- 41 files changed, 848 insertions(+), 68 deletions(-) create mode 100755 charts/selenium-grid/certs/cert.sh create mode 100644 charts/selenium-grid/certs/selenium.jks create mode 100644 charts/selenium-grid/certs/selenium.pem create mode 100644 charts/selenium-grid/certs/selenium.pkcs8.base64 create mode 100644 charts/selenium-grid/templates/secrets.yaml create mode 100644 charts/selenium-grid/templates/server-configmap.yaml create mode 100644 charts/selenium-grid/templates/tls-cert-secret.yaml create mode 100644 tests/charts/ci/tls-values.yaml diff --git a/.github/workflows/helm-chart-test.yml b/.github/workflows/helm-chart-test.yml index 674031795..42408e0e3 100644 --- a/.github/workflows/helm-chart-test.yml +++ b/.github/workflows/helm-chart-test.yml @@ -13,8 +13,9 @@ jobs: name: Test Helm charts runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - test-strategy: [chart_test, chart_test_parallel_autoscaling] + test-strategy: [chart_test, chart_test_parallel_autoscaling, chart_test_https_tls] steps: - uses: actions/checkout@v4 - name: Output Docker info @@ -24,6 +25,11 @@ jobs: with: python-version: '3.11' check-latest: true + - name: Install CA certificates + run: | + sudo apt install openssl -y + sudo apt install ca-certificates -y + sudo update-ca-certificates --fresh - name: Get branch name (only for push to branch) if: github.event_name == 'push' run: echo "BRANCH=$(echo ${PUSH_BRANCH##*/})" >> $GITHUB_ENV diff --git a/Distributor/start-selenium-grid-distributor.sh b/Distributor/start-selenium-grid-distributor.sh index b0782c3c3..c9af77f71 100755 --- a/Distributor/start-selenium-grid-distributor.sh +++ b/Distributor/start-selenium-grid-distributor.sh @@ -59,6 +59,35 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" fi +if [ ! -z "$SE_EXTERNAL_URL" ]; then + echo "Appending Selenium options: --external-url ${SE_EXTERNAL_URL}" + SE_OPTS="$SE_OPTS --external-url ${SE_EXTERNAL_URL}" +fi + +if [ ! -z "$SE_HTTPS_CERTIFICATE" ]; then + echo "Appending Selenium options: --https-certificate ${SE_HTTPS_CERTIFICATE}" + SE_OPTS="$SE_OPTS --https-certificate ${SE_HTTPS_CERTIFICATE}" +fi + +if [ ! -z "$SE_HTTPS_PRIVATE_KEY" ]; then + echo "Appending Selenium options: --https-private-key ${SE_HTTPS_PRIVATE_KEY}" + SE_OPTS="$SE_OPTS --https-private-key ${SE_HTTPS_PRIVATE_KEY}" +fi + +if [ ! -z "$SE_JAVA_SSL_TRUST_STORE" ]; then + echo "Appending Java options: -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + echo "Appending Java options: -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + echo "Appending Java options: -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" +fi + +if [ ! -z "$SE_REGISTRATION_SECRET" ]; then + echo "Appending Selenium options: --registration-secret ${SE_REGISTRATION_SECRET}" + SE_OPTS="$SE_OPTS --registration-secret ${SE_REGISTRATION_SECRET}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/EventBus/start-selenium-grid-eventbus.sh b/EventBus/start-selenium-grid-eventbus.sh index a8af2c040..25c43f10c 100755 --- a/EventBus/start-selenium-grid-eventbus.sh +++ b/EventBus/start-selenium-grid-eventbus.sh @@ -24,6 +24,30 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" fi +if [ ! -z "$SE_EXTERNAL_URL" ]; then + echo "Appending Selenium options: --external-url ${SE_EXTERNAL_URL}" + SE_OPTS="$SE_OPTS --external-url ${SE_EXTERNAL_URL}" +fi + +if [ ! -z "$SE_HTTPS_CERTIFICATE" ]; then + echo "Appending Selenium options: --https-certificate ${SE_HTTPS_CERTIFICATE}" + SE_OPTS="$SE_OPTS --https-certificate ${SE_HTTPS_CERTIFICATE}" +fi + +if [ ! -z "$SE_HTTPS_PRIVATE_KEY" ]; then + echo "Appending Selenium options: --https-private-key ${SE_HTTPS_PRIVATE_KEY}" + SE_OPTS="$SE_OPTS --https-private-key ${SE_HTTPS_PRIVATE_KEY}" +fi + +if [ ! -z "$SE_JAVA_SSL_TRUST_STORE" ]; then + echo "Appending Java options: -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + echo "Appending Java options: -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + echo "Appending Java options: -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/Hub/start-selenium-grid-hub.sh b/Hub/start-selenium-grid-hub.sh index e25fe16d4..682b28e50 100755 --- a/Hub/start-selenium-grid-hub.sh +++ b/Hub/start-selenium-grid-hub.sh @@ -27,6 +27,35 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" fi +if [ ! -z "$SE_EXTERNAL_URL" ]; then + echo "Appending Selenium options: --external-url ${SE_EXTERNAL_URL}" + SE_OPTS="$SE_OPTS --external-url ${SE_EXTERNAL_URL}" +fi + +if [ ! -z "$SE_HTTPS_CERTIFICATE" ]; then + echo "Appending Selenium options: --https-certificate ${SE_HTTPS_CERTIFICATE}" + SE_OPTS="$SE_OPTS --https-certificate ${SE_HTTPS_CERTIFICATE}" +fi + +if [ ! -z "$SE_HTTPS_PRIVATE_KEY" ]; then + echo "Appending Selenium options: --https-private-key ${SE_HTTPS_PRIVATE_KEY}" + SE_OPTS="$SE_OPTS --https-private-key ${SE_HTTPS_PRIVATE_KEY}" +fi + +if [ ! -z "$SE_JAVA_SSL_TRUST_STORE" ]; then + echo "Appending Java options: -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + echo "Appending Java options: -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + echo "Appending Java options: -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" +fi + +if [ ! -z "$SE_REGISTRATION_SECRET" ]; then + echo "Appending Selenium options: --registration-secret ${SE_REGISTRATION_SECRET}" + SE_OPTS="$SE_OPTS --registration-secret ${SE_REGISTRATION_SECRET}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/Makefile b/Makefile index f9e55dd2c..39a4723ec 100644 --- a/Makefile +++ b/Makefile @@ -397,6 +397,10 @@ chart_test_edge: chart_test_parallel_autoscaling: VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/charts/make/chart_test.sh JobAutoscaling +chart_test_https_tls: + VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_PORT=443 \ + ./tests/charts/make/chart_test.sh JobAutoscaling + .PHONY: \ all \ base \ diff --git a/NodeBase/start-selenium-node.sh b/NodeBase/start-selenium-node.sh index 21cd7b946..65402cbec 100755 --- a/NodeBase/start-selenium-node.sh +++ b/NodeBase/start-selenium-node.sh @@ -32,8 +32,8 @@ if [ ! -z "$SE_OPTS" ]; then fi if [ ! -z "$SE_NODE_SESSION_TIMEOUT" ]; then - SE_OPTS="$SE_OPTS --session-timeout $SE_NODE_SESSION_TIMEOUT" - echo "Appending Selenium node session timeout via SE_OPTS: ${SE_OPTS}" + echo "Appending Selenium options: --session-timeout ${SE_NODE_SESSION_TIMEOUT}" + SE_OPTS="$SE_OPTS --session-timeout ${SE_NODE_SESSION_TIMEOUT}" fi if [ ! -z "$SE_LOG_LEVEL" ]; then @@ -41,6 +41,35 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" fi +if [ ! -z "$SE_EXTERNAL_URL" ]; then + echo "Appending Selenium options: --external-url ${SE_EXTERNAL_URL}" + SE_OPTS="$SE_OPTS --external-url ${SE_EXTERNAL_URL}" +fi + +if [ ! -z "$SE_HTTPS_CERTIFICATE" ]; then + echo "Appending Selenium options: --https-certificate ${SE_HTTPS_CERTIFICATE}" + SE_OPTS="$SE_OPTS --https-certificate ${SE_HTTPS_CERTIFICATE}" +fi + +if [ ! -z "$SE_HTTPS_PRIVATE_KEY" ]; then + echo "Appending Selenium options: --https-private-key ${SE_HTTPS_PRIVATE_KEY}" + SE_OPTS="$SE_OPTS --https-private-key ${SE_HTTPS_PRIVATE_KEY}" +fi + +if [ ! -z "$SE_JAVA_SSL_TRUST_STORE" ]; then + echo "Appending Java options: -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + echo "Appending Java options: -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + echo "Appending Java options: -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" +fi + +if [ ! -z "$SE_REGISTRATION_SECRET" ]; then + echo "Appending Selenium options: --registration-secret ${SE_REGISTRATION_SECRET}" + SE_OPTS="$SE_OPTS --registration-secret ${SE_REGISTRATION_SECRET}" +fi + if [ "$GENERATE_CONFIG" = true ]; then echo "Generating Selenium Config" /opt/bin/generate_config diff --git a/NodeDocker/start-selenium-grid-docker.sh b/NodeDocker/start-selenium-grid-docker.sh index a811780e7..935fbee46 100755 --- a/NodeDocker/start-selenium-grid-docker.sh +++ b/NodeDocker/start-selenium-grid-docker.sh @@ -34,6 +34,30 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" fi +if [ ! -z "$SE_EXTERNAL_URL" ]; then + echo "Appending Selenium options: --external-url ${SE_EXTERNAL_URL}" + SE_OPTS="$SE_OPTS --external-url ${SE_EXTERNAL_URL}" +fi + +if [ ! -z "$SE_HTTPS_CERTIFICATE" ]; then + echo "Appending Selenium options: --https-certificate ${SE_HTTPS_CERTIFICATE}" + SE_OPTS="$SE_OPTS --https-certificate ${SE_HTTPS_CERTIFICATE}" +fi + +if [ ! -z "$SE_HTTPS_PRIVATE_KEY" ]; then + echo "Appending Selenium options: --https-private-key ${SE_HTTPS_PRIVATE_KEY}" + SE_OPTS="$SE_OPTS --https-private-key ${SE_HTTPS_PRIVATE_KEY}" +fi + +if [ ! -z "$SE_JAVA_SSL_TRUST_STORE" ]; then + echo "Appending Java options: -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + echo "Appending Java options: -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + echo "Appending Java options: -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/Router/start-selenium-grid-router.sh b/Router/start-selenium-grid-router.sh index bb848a1c7..6a7c0bc78 100755 --- a/Router/start-selenium-grid-router.sh +++ b/Router/start-selenium-grid-router.sh @@ -59,6 +59,35 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" fi +if [ ! -z "$SE_EXTERNAL_URL" ]; then + echo "Appending Selenium options: --external-url ${SE_EXTERNAL_URL}" + SE_OPTS="$SE_OPTS --external-url ${SE_EXTERNAL_URL}" +fi + +if [ ! -z "$SE_HTTPS_CERTIFICATE" ]; then + echo "Appending Selenium options: --https-certificate ${SE_HTTPS_CERTIFICATE}" + SE_OPTS="$SE_OPTS --https-certificate ${SE_HTTPS_CERTIFICATE}" +fi + +if [ ! -z "$SE_HTTPS_PRIVATE_KEY" ]; then + echo "Appending Selenium options: --https-private-key ${SE_HTTPS_PRIVATE_KEY}" + SE_OPTS="$SE_OPTS --https-private-key ${SE_HTTPS_PRIVATE_KEY}" +fi + +if [ ! -z "$SE_JAVA_SSL_TRUST_STORE" ]; then + echo "Appending Java options: -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + echo "Appending Java options: -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + echo "Appending Java options: -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" +fi + +if [ ! -z "$SE_REGISTRATION_SECRET" ]; then + echo "Appending Selenium options: --registration-secret ${SE_REGISTRATION_SECRET}" + SE_OPTS="$SE_OPTS --registration-secret ${SE_REGISTRATION_SECRET}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/SessionQueue/start-selenium-grid-session-queue.sh b/SessionQueue/start-selenium-grid-session-queue.sh index 11074afb9..ac6f5a763 100755 --- a/SessionQueue/start-selenium-grid-session-queue.sh +++ b/SessionQueue/start-selenium-grid-session-queue.sh @@ -24,6 +24,30 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" fi +if [ ! -z "$SE_EXTERNAL_URL" ]; then + echo "Appending Selenium options: --external-url ${SE_EXTERNAL_URL}" + SE_OPTS="$SE_OPTS --external-url ${SE_EXTERNAL_URL}" +fi + +if [ ! -z "$SE_HTTPS_CERTIFICATE" ]; then + echo "Appending Selenium options: --https-certificate ${SE_HTTPS_CERTIFICATE}" + SE_OPTS="$SE_OPTS --https-certificate ${SE_HTTPS_CERTIFICATE}" +fi + +if [ ! -z "$SE_HTTPS_PRIVATE_KEY" ]; then + echo "Appending Selenium options: --https-private-key ${SE_HTTPS_PRIVATE_KEY}" + SE_OPTS="$SE_OPTS --https-private-key ${SE_HTTPS_PRIVATE_KEY}" +fi + +if [ ! -z "$SE_JAVA_SSL_TRUST_STORE" ]; then + echo "Appending Java options: -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + echo "Appending Java options: -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + echo "Appending Java options: -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/Sessions/start-selenium-grid-sessions.sh b/Sessions/start-selenium-grid-sessions.sh index 4d34a1a5b..3a6112388 100755 --- a/Sessions/start-selenium-grid-sessions.sh +++ b/Sessions/start-selenium-grid-sessions.sh @@ -39,6 +39,30 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" fi +if [ ! -z "$SE_EXTERNAL_URL" ]; then + echo "Appending Selenium options: --external-url ${SE_EXTERNAL_URL}" + SE_OPTS="$SE_OPTS --external-url ${SE_EXTERNAL_URL}" +fi + +if [ ! -z "$SE_HTTPS_CERTIFICATE" ]; then + echo "Appending Selenium options: --https-certificate ${SE_HTTPS_CERTIFICATE}" + SE_OPTS="$SE_OPTS --https-certificate ${SE_HTTPS_CERTIFICATE}" +fi + +if [ ! -z "$SE_HTTPS_PRIVATE_KEY" ]; then + echo "Appending Selenium options: --https-private-key ${SE_HTTPS_PRIVATE_KEY}" + SE_OPTS="$SE_OPTS --https-private-key ${SE_HTTPS_PRIVATE_KEY}" +fi + +if [ ! -z "$SE_JAVA_SSL_TRUST_STORE" ]; then + echo "Appending Java options: -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + echo "Appending Java options: -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + echo "Appending Java options: -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/Standalone/start-selenium-standalone.sh b/Standalone/start-selenium-standalone.sh index 955cb15f4..9f8c50baa 100755 --- a/Standalone/start-selenium-standalone.sh +++ b/Standalone/start-selenium-standalone.sh @@ -16,6 +16,30 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" fi +if [ ! -z "$SE_EXTERNAL_URL" ]; then + echo "Appending Selenium options: --external-url ${SE_EXTERNAL_URL}" + SE_OPTS="$SE_OPTS --external-url ${SE_EXTERNAL_URL}" +fi + +if [ ! -z "$SE_HTTPS_CERTIFICATE" ]; then + echo "Appending Selenium options: --https-certificate ${SE_HTTPS_CERTIFICATE}" + SE_OPTS="$SE_OPTS --https-certificate ${SE_HTTPS_CERTIFICATE}" +fi + +if [ ! -z "$SE_HTTPS_PRIVATE_KEY" ]; then + echo "Appending Selenium options: --https-private-key ${SE_HTTPS_PRIVATE_KEY}" + SE_OPTS="$SE_OPTS --https-private-key ${SE_HTTPS_PRIVATE_KEY}" +fi + +if [ ! -z "$SE_JAVA_SSL_TRUST_STORE" ]; then + echo "Appending Java options: -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + echo "Appending Java options: -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + echo "Appending Java options: -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" +fi + /opt/bin/generate_config echo "Selenium Grid Standalone configuration: " diff --git a/StandaloneDocker/start-selenium-grid-docker.sh b/StandaloneDocker/start-selenium-grid-docker.sh index 8571abc7a..cf75e5279 100755 --- a/StandaloneDocker/start-selenium-grid-docker.sh +++ b/StandaloneDocker/start-selenium-grid-docker.sh @@ -19,6 +19,30 @@ if [ ! -z "$SE_LOG_LEVEL" ]; then SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}" fi +if [ ! -z "$SE_EXTERNAL_URL" ]; then + echo "Appending Selenium options: --external-url ${SE_EXTERNAL_URL}" + SE_OPTS="$SE_OPTS --external-url ${SE_EXTERNAL_URL}" +fi + +if [ ! -z "$SE_HTTPS_CERTIFICATE" ]; then + echo "Appending Selenium options: --https-certificate ${SE_HTTPS_CERTIFICATE}" + SE_OPTS="$SE_OPTS --https-certificate ${SE_HTTPS_CERTIFICATE}" +fi + +if [ ! -z "$SE_HTTPS_PRIVATE_KEY" ]; then + echo "Appending Selenium options: --https-private-key ${SE_HTTPS_PRIVATE_KEY}" + SE_OPTS="$SE_OPTS --https-private-key ${SE_HTTPS_PRIVATE_KEY}" +fi + +if [ ! -z "$SE_JAVA_SSL_TRUST_STORE" ]; then + echo "Appending Java options: -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStore=${SE_JAVA_SSL_TRUST_STORE}" + echo "Appending Java options: -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djavax.net.ssl.trustStorePassword=${SE_JAVA_SSL_TRUST_STORE_PASSWORD}" + echo "Appending Java options: -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" + SE_JAVA_OPTS="$SE_JAVA_OPTS -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index 3568d4cd5..5368ca2ea 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -21,6 +21,9 @@ This chart enables the creation of a Selenium Grid Server in Kubernetes. * [Configuration of Nodes](#configuration-of-nodes) * [Container ports and Service ports](#container-ports-and-service-ports) * [Probes](#probes) + * [Configuration of Secure Communication (HTTPS)](#configuration-of-secure-communication-https) + * [Secure Communication](#secure-communication) + * [Node Registration](#node-registration) * [Configuration of Selenium Grid chart](#configuration-of-selenium-grid-chart) * [Configuration of KEDA](#configuration-of-keda) * [Configuration of Ingress NGINX Controller](#configuration-of-ingress-nginx-controller) @@ -228,6 +231,23 @@ nginx.ingress.kubernetes.io/client-body-buffer-size nginx.ingress.kubernetes.io/proxy-buffers-number ``` +You can generate a dummy self-signed certificate specify for your `hostname`, assign it to spec `ingress.tls` and NGINX ingress controller default certificate (if it is enabled inline). For example: + +```yaml +tls: + ingress: + generateTLS: true + +ingress: + hostname: "your.domain.com" + +ingress-nginx: + enabled: true + controller: + extraArgs: + default-ssl-certificate: '$(POD_NAMESPACE)/selenium-tls-secret' +``` + ## Configuration ### Configuration global @@ -342,6 +362,78 @@ edgeNode: periodSeconds: 5 ``` +### Configuration of Secure Communication (HTTPS) + +Selenium Grid supports secure communication between components. Refer to the [instructions](https://github.com/SeleniumHQ/selenium/blob/trunk/java/src/org/openqa/selenium/grid/commands/security.txt) and [options](https://www.selenium.dev/documentation/grid/configuration/cli_options/#server) are able to configure the secure communication. Below is the details on how to enable secure communication in Selenium Grid chart. + +#### Secure Communication + +In the chart, there is directory [certs](./certs) contains the default certificate, private key (as PKCS8 format), and Java Keystore (JKS) to teach Java about secure connection (since we are using a non-standard CA) for your trial, local testing purpose. You can generate your own self-signed certificate put them in that default directory by using script [cert.sh](./certs/cert.sh) with adjust needed information. The certificate, private key, truststore are mounted to the components via `Secret`. + +There are multiple ways to configure your certificate, private key, truststore to the components. You can choose one of them or combine them together. + +- Use the default directory [certs](./certs). Rename your own files to be same as the default files and replace them. Give `--set tls.enabled=true` to enable secure communication. + +- Use the default directory [certs](./certs). Copy your own files to there and adjust the file name under config `tls.defaultFile`, those will be picked up when installing chart. For example: + + ```yaml + tls: + enabled: true + trustStorePassword: "your_truststore_password" + defaultFile: + certificate: "certs/your_cert.pem" + privateKey: "certs/your_private_key.pkcs8" + trustStore: "certs/your_truststore.jks" + ``` + For some security reasons, you may not able to put private key in your source code or your customization chart package. You can provide files with contents are encoded in Base64 format, just append `.base64` to the file name for chart able to know and decode them. For example: + + ```yaml + tls: + enabled: true + trustStorePassword: "your_truststore_password" + defaultFile: + certificate: "certs/your_cert.pem.base64" + privateKey: "certs/your_private_key.pkcs8.base64" + trustStore: "certs/your_truststore.jks.base64" + ``` + +- Using Helm CLI `--set-file` to pass your own file to particular config key. For example: + + ```bash + helm upgrade -i test selenium-grid \ + --set tls.enabled=true \ + --set-file tls.certificate=/path/to/your_cert.pem \ + --set-file tls.privateKey=/path/to/your_private_key.pkcs8 \ + --set-file tls.trustStore=/path/to/your_truststore.jks \ + --set-string tls.trustStorePassword=your_truststore_password + ``` + +If you start NGINX ingress controller inline with Selenium Grid chart, you can configure the default certificate of NGINX ingress controller to use the same certificate as Selenium Grid. For example: + +```yaml +tls: + enabled: true + +ingress-nginx: + enabled: true + controller: + extraArgs: + default-ssl-certificate: '$(POD_NAMESPACE)/selenium-tls-secret' +``` + +#### Node Registration + +In order to enable secure in the node registration to make sure that the node is one you control and not a rouge node, you can enable and provide a registration secret string to Distributor, Router and +Node servers in config `tls.registrationSecret`. For example: + +```yaml +tls: + enabled: true + registrationSecret: + enabled: true + value: "matchThisSecret" +``` + ### Configuration of Selenium Grid chart This table contains the configuration parameters of the chart and their default values: diff --git a/charts/selenium-grid/certs/cert.sh b/charts/selenium-grid/certs/cert.sh new file mode 100755 index 000000000..d170d262a --- /dev/null +++ b/charts/selenium-grid/certs/cert.sh @@ -0,0 +1,61 @@ +# README: This script is used to generate a self-signed certificate for enabling HTTPS/TLS in Selenium Grid + +CERTNAME=${1:-selenium} +STOREPASS=${2:-changeit} +KEYPASS=${3:-changeit} +ALIAS=${4:-SeleniumHQ} +BASE64_ONLY=1 + +# Remove existing files +rm -f ${CERTNAME}.* + +# Create JKS (Java Keystore) - this is used to set for JAVA_OPTS -Djavax.net.ssl.trustStore= +# The key pass set to JAVA_OPTS -Djavax.net.ssl.trustStorePassword= +# Dummy cert without correct SAN, DNS, to skip hostname verification by JAVA_OPTS -Djdk.internal.httpclient.disableHostnameVerification=true +keytool -genkeypair \ + -alias ${ALIAS} \ + -keyalg RSA \ + -v \ + -dname "CN=SeleniumHQ,OU=Software Freedom Conservancy,O=SeleniumHQ,L=Unknown,ST=Unknown,C=Unknown" \ + -ext "SAN:c=DNS:localhost,DNS:selenium-grid.local" \ + -validity 3650 \ + -storepass ${STOREPASS} \ + -keypass ${KEYPASS} \ + -keystore ${CERTNAME}.jks + +# Base64 encode JKS file (for Kubernetes Secret) +#base64 -i ${CERTNAME}.jks -w 0 > ${CERTNAME}.jks.base64 + +# Create PKCS12 from JKS +keytool -importkeystore -srckeystore ${CERTNAME}.jks \ + -destkeystore ${CERTNAME}.p12 \ + -srcstoretype jks \ + -storepass ${STOREPASS} -keypass ${KEYPASS} -srcstorepass ${STOREPASS} \ + -deststoretype pkcs12 + +# Create private key PEM from PKCS12 +openssl pkcs12 -nodes -in ${CERTNAME}.p12 -out ${CERTNAME}.key \ + -passin pass:${KEYPASS} + +# Create private key PKCS8 format (this is used to set for option --https-private-key) +openssl pkcs8 -in ${CERTNAME}.key -topk8 -nocrypt -out ${CERTNAME}.pkcs8 + +# Base64 encode PKCS8 file (for Kubernetes Secret) +base64 -i ${CERTNAME}.pkcs8 -w 0 > ${CERTNAME}.pkcs8.base64 + +# Create certificate PEM from JKS (this is used to set for option --https-certificate) +keytool -exportcert -alias ${ALIAS} \ + -storepass ${STOREPASS} -keypass ${KEYPASS} \ + -keystore ${CERTNAME}.jks -rfc -file ${CERTNAME}.pem + +# Base64 encode Certificate PEM file (for Kubernetes Secret) +#base64 -i ${CERTNAME}.pem -w 0 > ${CERTNAME}.pem.base64 + +if [ ${BASE64_ONLY} -eq 1 ]; then + # Remove source files (prevent sensitive data leak) + rm -f ${CERTNAME}.key + rm -f ${CERTNAME}.p12 + rm -f ${CERTNAME}.pkcs8 + # Retain ${CERTNAME}.jks for Java client establishing HTTPS connection + # Retain ${CERTNAME}.pem for client establishing HTTPS connection +fi diff --git a/charts/selenium-grid/certs/selenium.jks b/charts/selenium-grid/certs/selenium.jks new file mode 100644 index 0000000000000000000000000000000000000000..f3ea9229b476e696767939b702d42d943f2457d6 GIT binary patch literal 2864 zcma);X*d*&7RP7Cj4{Sq)|Rnl8Czq^kfpM3A+jV(mSKdH%*YZZrWYX*$~M*^6tWYO zHEZ^*>@;>VwuIj9bMMpp+)wv@_&?`4|8xH5eN zP#ny*73|ABzKRzqk?dwKrdXEPe zA-rSo_E!7mliJh8a1oYHqoN?S^Z6aZw}Y5O8@V&*jRMF;kMx6iE~Sxf4^KJ-oJR0; zO?vNFg)y>?+;{!Vi^_ev)!s2-Iggb1tY45#?RZ_Eq&~hDTd;zN`JwPepj+tl*m5MY zN4giz%Sz16DqRcGCL<2a@SAo#=K?R24vB&q^i%M*`eH9Yk&-X7)9pL#94CW6X{MD` z0TfjVXZk$pP+u%f;sy8UUW?Nv*# zDe637+Ww=*f(9CV_?B&8l4M`qcG!g#_?mm5ho@zuE`wBc#M*)wx)hq5dzBOPep(NN zPocl*jRGOjf%)U^Z(>Z$eI{pDqL}&S;bOR1p^mud>o%{oca(_0jmsIsKuxpRQBrF}Uz+(TJOE)u(7Dy*R_Yn@lFvj}0In0k7BXmb@k|BrSbb@H5SfAz+F* z*44=Gv=-2H*TNK*$j4PF<*w`=Gb6LS{@oO7$CsVVm%xb|Z2<|VZDasn@j1n_eqEA?lZBP&mE_2Sesu; zm6qQ(=O|foAEef=M~T++*YAjgs+@5`vPTCt@BEx{l(NKpy1TuNvuxS0E@lzj5V@i% zc<-;Vb!AM0y4+eFDRq{UW2@;?v2x?5oQ0XsQo2r|efwk3Tc!2Fl7naZsz|Z5UUEKT zQR;KA4d-R9wRuO)y@L2J>?Sr|5vdTt%(&^)jlHM%#@v=D0f{_X;K{x@7}%_--bztt zoooG0$ikk~NIb<-$gTU@qx@s~TnYWfXwkCIxb5AnexnO+5tpJCDV7Cp@`r>j60323 zNV-G!3k%y6=3rKv(LF_lWOcQ@pp2wKais_siMdf-Q1V7VRt<#8p}QB{LiWMGaI&!Km><$OzzoG;S9E%C&-cjT7Q z5!DBO*>NT zqll81lUGtwl2uf^^qa)MKTA-05&^u8B7iqQK)~-p{bvIFU%39frjDy+yT=XfxKqy9 zciMb?$4>D7!8LxcacIiD)Gk^+Q;hkmOHBv??7i|OP096xo-?OtRgBY3 zJtThj*Jj2-$D~d`1NQC_k&M|vgELWbI%Uq#17oT*uF>i4{V%w(8ZZU(1{V9YB|}}n zGwJ@;)>d@lu{)RFeWiSG#iY6RVJ`AwsWZC?$LbtC3&IH$kMoVN%$H)z2(V~DN&0Zq zm+d^hzKsb(v+?CQ%ZSJl3F7^h&(H%%mbqtoMrWhYQnpn$LmF zV&8?^)3s?~M_Da69UoTysKWT`PaW$TZ4ffQFprF%UNOLEN7ErKmVvC^sxnrzZkroG zZ>zx}tJdY^!_|f|9|=A8N_xM}p5US889UHcEdm@Foc%5ML;3Lw7Tn^8NU()eleKNv#%Un+VQXeJ{y(Q7R%v% z-KEeufpe3)Xn6*;J5MH4#z$Gx{AUrgR*~hQr+t~hhJCaUEMFvau;BYM90lZEa;{U_ zR;ss(ucrED8DY(ftMD8OYqrJDCbGUQ%XGyww{}0E zVR{mhMrC2`35zibWXsRP*vLd~?9Nj~u4}XuS8!GxgEY>6x|tz0SD%Stu2900{j9Q` zkd@Bmb#z^sFIX%LGsB}rc0n1TWKhh1zDN)d0s!;xZ){YX3lQ4-9?6npPpQy8r}%l9wj{SCOeGj{+0 literal 0 HcmV?d00001 diff --git a/charts/selenium-grid/certs/selenium.pem b/charts/selenium-grid/certs/selenium.pem new file mode 100644 index 000000000..b870d2900 --- /dev/null +++ b/charts/selenium-grid/certs/selenium.pem @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIID4jCCAsqgAwIBAgIJAJcK6V/XPo7CMA0GCSqGSIb3DQEBCwUAMIGHMRAwDgYD +VQQGEwdVbmtub3duMRAwDgYDVQQIEwdVbmtub3duMRAwDgYDVQQHEwdVbmtub3du +MRMwEQYDVQQKEwpTZWxlbml1bUhRMSUwIwYDVQQLExxTb2Z0d2FyZSBGcmVlZG9t +IENvbnNlcnZhbmN5MRMwEQYDVQQDEwpTZWxlbml1bUhRMB4XDTI0MDEwNDA2MzMx +MloXDTM0MDEwMTA2MzMxMlowgYcxEDAOBgNVBAYTB1Vua25vd24xEDAOBgNVBAgT +B1Vua25vd24xEDAOBgNVBAcTB1Vua25vd24xEzARBgNVBAoTClNlbGVuaXVtSFEx +JTAjBgNVBAsTHFNvZnR3YXJlIEZyZWVkb20gQ29uc2VydmFuY3kxEzARBgNVBAMT +ClNlbGVuaXVtSFEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCekj09 +xvrD4+nkKmZf10h3TntIFqKI75x35Z2GxwHE2Kqt3eNwbqUrni2zRbYIalddnawW +bOqc2pgEnLtM7VRoCgxlYzARaevfI2uY+EBI4QjgzSTZstuWksPqSmHrLOo4q75w +OSYFUtfaa+6l7ijnVQLKWo4wCnGssk9UBJWvNU9ZMdTzEqLvIMr2Hi0LmKXs9k/F +bIM+XIAAynf8aG4awq0s/eZTirmEqbhmi2udwMNMV60IaC8ZNo53k4VJ+lQWOOwB +/Q1CHRWotjvD4WFt2XI9cCAjbDMpkZONaaCIA70XjTG+5DiGDOUAlap6LFlBrUh4 +3YHQHvXEIKZe2tVDAgMBAAGjTzBNMB0GA1UdDgQWBBRpoVLPxMaU/3QI5x3KUl0x +wL4bVjAsBgNVHREBAf8EIjAggglsb2NhbGhvc3SCE3NlbGVuaXVtLWdyaWQubG9j +YWwwDQYJKoZIhvcNAQELBQADggEBAByNMqeuoiSG1BxnoUGKYiPEurKl8wdsJH8+ +doL5loA7PUnUFY8Vpd4IRHf/RMgTCkSGyLDI/y9lLNLkwkyzt+Wlnfh6sPVXT6DL +cHMrPYavBXZFNStvawS4BztSpcOPOGq6Y2W0gkcVUun8dpS2Dx/w5CW56HzmbPVu +iL9ZW3D6rSm/Qz4cay3rN9MA7WPzTLA3g1YizQLhkvk9JIwNphO16X28qEMIoD2Q +vCGFDdS3xtxmRBj3x/4nGU19WTqECG7eOS4+1Xp5faYietKZVkfhl5rue53wv6lu +v+QNozSyg5nW3YcydA3SeRuf2/kwkvyP61zey4HMHThR+vPKz9U= +-----END CERTIFICATE----- diff --git a/charts/selenium-grid/certs/selenium.pkcs8.base64 b/charts/selenium-grid/certs/selenium.pkcs8.base64 new file mode 100644 index 000000000..f661b989d --- /dev/null +++ b/charts/selenium-grid/certs/selenium.pkcs8.base64 @@ -0,0 +1 @@ +LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2UUlCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktjd2dnU2pBZ0VBQW9JQkFRQ2VrajA5eHZyRDQrbmsKS21aZjEwaDNUbnRJRnFLSTc1eDM1WjJHeHdIRTJLcXQzZU53YnFVcm5pMnpSYllJYWxkZG5hd1diT3FjMnBnRQpuTHRNN1ZSb0NneGxZekFSYWV2ZkkydVkrRUJJNFFqZ3pTVFpzdHVXa3NQcVNtSHJMT280cTc1d09TWUZVdGZhCmErNmw3aWpuVlFMS1dvNHdDbkdzc2s5VUJKV3ZOVTlaTWRUekVxTHZJTXIySGkwTG1LWHM5ay9GYklNK1hJQUEKeW5mOGFHNGF3cTBzL2VaVGlybUVxYmhtaTJ1ZHdNTk1WNjBJYUM4Wk5vNTNrNFZKK2xRV09Pd0IvUTFDSFJXbwp0anZENFdGdDJYSTljQ0FqYkRNcGtaT05hYUNJQTcwWGpURys1RGlHRE9VQWxhcDZMRmxCclVoNDNZSFFIdlhFCklLWmUydFZEQWdNQkFBRUNnZ0VBSmpSNXlONmVJSUJUSkFRTE1tQStOM0NUUjJVY3QvMXpKM2dOSWlIa2pUYmUKdUpGVGNRMVhnbERVRmZOZnpsdEF2Vzkxdk5sMUZXR2RhczhRV1pKODJheENIRk52aTJLSHovVkt3VXBld3JCbApZVFJNQXArVFJJNEw0ZkVWOG9HWjFSbWNBcEhpVlRvR2c3dXBmaFVKaWVMemp5bU9SSWpmcG9vM2pyaWtEOWhZCnMzTTJXaHNHdDBwZ1FwZVEreHNTeXRxNjFhT21xdnpLZUE5OUVxZE9keUJ2QkxSMDZyN0FDdlpmeTJvUVpHYXAKUEJ3ZHZIWmNQdXZlUGxVNUpDQWhEcWhlbFIyTHd2dzVhN3FLbjBvTkRFTG5zVnFWblJ3Q0ErUUhjYVBTbG40Nwp0SzI2YUxVdUZLSFg0QW5idDZaNWNMTWdNUzR2bGV3R0h0OG9JUXVCa1FLQmdRQzE1N2NWRkhPc3poUkh6LzBBCkhIVGNqcXB4ditzSUFNVnNCWUlJTVozKzI3MjlVeGFoMllPN1crZjEzVTJlakVsMk1qaW5jTnF1QWVpSmEveWYKTklqcFJtbFJVaWRScUpUUHNQdVJJcEZOWmNCNjh0MnpudFNMa0NkUDJDVTBZaFRpdklVY1RYOEJDRWZ6VDdwSwpjTyt3cTArc0FpRFhoS3pRSUJGaW9sNVZsd0tCZ1FEZktWM0w4V2ZLemFvODFhYndJQkd4M0dnK3BNNElnaTNWCldwMW40TVRuY05mRUJwZ251bVhDa00zSEMvT0VaUnRoYTU0QXdFOWwxUy9vN2RUWEZNNXRWQVQwNXpjNDZuL04KdkFCNUhuYnplS1hDTk5lakI4S1JZNjlvR0U2Ulptb0kxczhvd3ZQUHpCeGE4anN5V3p6M0VoZXY2Z2xHUXBGTwpyVmhWN0h0ck5RS0JnRmpjZEJ5UkhCMExvdTZkMVJzTHk2Nis1dGFnaVdFa2Qwell0L2ZtdlNiMkU0OThHbTlBClFkRHlDYk9hdzBNemh1TjlqeDJFek43NlFhMTRHalZ2eFg0bmptVlNlN0N4YU5pNHZYdmQ1aHRvSElvelFFaHgKeTZUTjY5WmVZWFpnZjVGdnhKclo1TFFOWnBDZW53T2tmZ0xRL1IrcS9uNHA2djNVM0lsUmhrSExBb0dCQU11SgpzVEVYNXpERDBHZFgvc0M0bnlyMyttUlljRXEyWVJOZGFIK2NORHRiWXBBNTY0RWdzenQ0VXhjZXdXYVp5UlZiCjBHcWkvRWZHMzhHMVdoRXB1dlZnVW4wRWZndDlaai9CSHpWWklla0N1enljY2FrU3BOVnlkRU9mRjlucDdRQk8KMi9jemlLaVlZNnhYanNKcEVQdlFGcWF0OFBPU04zSHBETTZodUJlWkFvR0FSZE9IRzlVWXA3M25DQ3d4VHJjKwpnNk91eXI5aXFacVBsalFDK1V4MmtySC9HMTkrSE96RHJLWWFSRElqQk4wTHRyeXJpcVZFQWJWZjZQNHNnNVpCCitjVS9pbDZLb1k2ditQa2tydnZJRVUyVUZHRnpmcnNVZklFQURrdHR5OEdIcTFja0tobjAxWGlNNDJnaGZaSEsKK0lYRExZYzRCMDZ5dFY1bmFZYU9US1k9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K \ No newline at end of file diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index baa2bc3be..e033bdac4 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -1,3 +1,33 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "seleniumGrid.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +*/}} +{{- define "seleniumGrid.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "seleniumGrid.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + {{/* Common labels */}} @@ -6,7 +36,7 @@ app.kubernetes.io/managed-by: {{ .Release.Service | lower }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: {{ printf "selenium-grid-%s" .Chart.AppVersion }} -helm.sh/chart: {{ printf "%s-%s" .Chart.Name (.Chart.Version | replace "+" "_") }} +helm.sh/chart: {{ include "seleniumGrid.chart" . }} {{- end -}} {{/* @@ -72,7 +102,6 @@ Edge node fullname {{- default "selenium-edge-node" .Values.edgeNode.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} - {{/* Ingress fullname */}} @@ -80,11 +109,18 @@ Ingress fullname {{- default "selenium-ingress" .Values.ingress.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{/* +Protocol of server components +*/}} +{{- define "seleniumGrid.server.protocol" -}} +{{- .Values.tls.enabled | ternary "https" "http" -}} +{{- end -}} + {{/* Probe httpGet schema */}} {{- define "seleniumGrid.probe.httpGet.schema" -}} -{{- "HTTP" -}} +{{- .Values.tls.enabled | ternary "HTTPS" "HTTP" -}} {{- end -}} {{/* @@ -130,6 +166,40 @@ Get probe settings {{- $settings | toYaml -}} {{- end -}} +{{/* +Secret TLS fullname +*/}} +{{- define "seleniumGrid.tls.fullname" -}} +{{- default "selenium-tls-secret" .Values.tls.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Is registration secret enabled +*/}} +{{- define "seleniumGrid.tls.registrationSecret.enabled" -}} +{{- and .Values.tls.enabled .Values.tls.registrationSecret.enabled | ternary "true" "" -}} +{{- end -}} + +{{/* +Get default certificate file name in chart +*/}} +{{- define "seleniumGrid.tls.getDefaultFile" -}} +{{- $value := index . 0 -}} +{{- $global := index . 1 -}} +{{- $content := $global.Files.Get $value -}} +{{- if (contains "base64" (lower $value)) -}} + {{- $content = $content | b64dec -}} +{{- end -}} +{{- $content -}} +{{- end -}} + +{{/* +Common secrets cross components +*/}} +{{- define "seleniumGrid.common.secrets" -}} +{{- default "selenium-secrets" .Values.secrets.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + {{- define "seleniumGrid.ingress.nginx.annotations.default" -}} {{- with .Values.ingress.nginx }} {{- with .proxyTimeout }} @@ -151,6 +221,10 @@ nginx.ingress.kubernetes.io/proxy-buffers-number: {{ . | quote }} {{- end }} {{- end }} {{- end }} +{{- if .Values.tls.enabled }} +nginx.ingress.kubernetes.io/ssl-passthrough: "true" +nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" +{{- end }} {{- end -}} {{/* @@ -262,6 +336,10 @@ template: name: {{ .Values.nodeConfigMap.name }} - configMapRef: name: {{ .Values.loggingConfigMap.name }} + - configMapRef: + name: {{ .Values.serverConfigMap.name }} + - secretRef: + name: {{ include "seleniumGrid.common.secrets" $ | quote }} {{- with .node.extraEnvFrom }} {{- tpl (toYaml .) $ | nindent 10 }} {{- end }} @@ -285,6 +363,11 @@ template: - name: {{ .Values.nodeConfigMap.scriptVolumeMountName }} mountPath: /opt/selenium/{{ .Values.nodeConfigMap.preStopScript }} subPath: {{ .Values.nodeConfigMap.preStopScript }} + {{- if .Values.tls.enabled }} + - name: {{ include "seleniumGrid.tls.fullname" $ | quote }} + mountPath: {{ .Values.serverConfigMap.certVolumeMountPath }} + readOnly: true + {{- end }} {{- if .node.extraVolumeMounts }} {{- tpl (toYaml .node.extraVolumeMounts) $ | nindent 10 }} {{- end }} @@ -302,7 +385,7 @@ template: {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} {{- else }} httpGet: - scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" $) .schema }} path: {{ .path }} port: {{ default ($.node.port) .port }} {{- end }} @@ -318,7 +401,7 @@ template: {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 12 }} {{- else }} httpGet: - scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" $) .schema }} path: {{ .path }} port: {{ default ($.node.port) .port }} {{- end }} @@ -334,7 +417,7 @@ template: {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} {{- else }} httpGet: - scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" $) .schema }} path: {{ .path }} port: {{ default ($.node.port) .port }} {{- end }} @@ -438,6 +521,11 @@ template: emptyDir: medium: Memory sizeLimit: {{ default "1Gi" .node.dshmVolumeSizeLimit }} + {{- if .Values.tls.enabled }} + - name: {{ include "seleniumGrid.tls.fullname" $ | quote }} + secret: + secretName: {{ include "seleniumGrid.tls.fullname" $ | quote }} + {{- end }} {{- if .node.extraVolumes }} {{ tpl (toYaml .node.extraVolumes) $ | nindent 6 }} {{- end }} @@ -456,7 +544,9 @@ Get the url of the grid. If the external url can be figured out from the ingress {{- define "seleniumGrid.url.schema" -}} {{- $schema := "http" -}} -{{- if .Values.ingress.enabled -}} +{{- if .Values.tls.enabled -}} + {{- $schema = "https" -}} +{{- else if .Values.ingress.enabled -}} {{- if .Values.ingress.tls -}} {{- $schema = "https" -}} {{- end -}} @@ -522,14 +612,14 @@ Get the url of the grid. If the external url can be figured out from the ingress Graphql Url of the hub or the router */}} {{- define "seleniumGrid.graphqlURL" -}} -{{- printf "http://%s%s%s/graphql" (include "seleniumGrid.url.basicAuth" .) (printf "%s.%s" (include ($.Values.isolateComponents | ternary "seleniumGrid.router.fullname" "seleniumGrid.hub.fullname") $) (.Release.Namespace)) (printf ":%s" ($.Values.isolateComponents | ternary ($.Values.components.router.port | toString) ($.Values.hub.port | toString))) -}} +{{- printf "%s://%s%s%s/graphql" (include "seleniumGrid.server.protocol" .) (include "seleniumGrid.url.basicAuth" .) (printf "%s.%s" (include ($.Values.isolateComponents | ternary "seleniumGrid.router.fullname" "seleniumGrid.hub.fullname") $) (.Release.Namespace)) (printf ":%s" ($.Values.isolateComponents | ternary ($.Values.components.router.port | toString) ($.Values.hub.port | toString))) -}} {{- end -}} {{/* Graphql unsafeSsl of the hub or the router */}} {{- define "seleniumGrid.graphqlURL.unsafeSsl" -}} -{{- $unsafeSsl := printf "%s" (ternary "false" "true" (contains (include "seleniumGrid.graphqlURL" .) "https")) -}} +{{- $unsafeSsl := printf "%s" (ternary "true" "false" .Values.serverConfigMap.disableHostnameVerification) -}} {{- $unsafeSsl }} {{- end -}} diff --git a/charts/selenium-grid/templates/distributor-deployment.yaml b/charts/selenium-grid/templates/distributor-deployment.yaml index 990e519fb..52578d6c7 100644 --- a/charts/selenium-grid/templates/distributor-deployment.yaml +++ b/charts/selenium-grid/templates/distributor-deployment.yaml @@ -49,9 +49,19 @@ spec: name: {{ .Values.busConfigMap.name }} - configMapRef: name: {{ .Values.loggingConfigMap.name }} + - configMapRef: + name: {{ .Values.serverConfigMap.name }} + - secretRef: + name: {{ include "seleniumGrid.common.secrets" $ | quote }} {{- with .Values.components.extraEnvFrom }} {{- toYaml . | nindent 12 }} {{- end }} + volumeMounts: + {{- if .Values.tls.enabled }} + - name: {{ include "seleniumGrid.tls.fullname" . | quote }} + mountPath: {{ .Values.serverConfigMap.certVolumeMountPath | quote }} + readOnly: true + {{- end }} ports: - containerPort: {{ .Values.components.distributor.port }} protocol: TCP @@ -78,4 +88,10 @@ spec: {{- with .Values.components.distributor.priorityClassName }} priorityClassName: {{ . }} {{- end }} + volumes: + {{- if .Values.tls.enabled }} + - name: {{ include "seleniumGrid.tls.fullname" . | quote }} + secret: + secretName: {{ include "seleniumGrid.tls.fullname" . | quote }} + {{- end }} {{- end }} diff --git a/charts/selenium-grid/templates/event-bus-deployment.yaml b/charts/selenium-grid/templates/event-bus-deployment.yaml index 498570c9b..ef29a6908 100644 --- a/charts/selenium-grid/templates/event-bus-deployment.yaml +++ b/charts/selenium-grid/templates/event-bus-deployment.yaml @@ -45,9 +45,19 @@ spec: envFrom: - configMapRef: name: {{ .Values.loggingConfigMap.name }} + - configMapRef: + name: {{ .Values.serverConfigMap.name }} + - secretRef: + name: {{ include "seleniumGrid.common.secrets" $ | quote }} {{- with .Values.components.extraEnvFrom }} {{- toYaml . | nindent 12 }} {{- end }} + volumeMounts: + {{- if .Values.tls.enabled }} + - name: {{ include "seleniumGrid.tls.fullname" . | quote }} + mountPath: {{ .Values.serverConfigMap.certVolumeMountPath | quote }} + readOnly: true + {{- end }} {{- with .Values.components.eventBus.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} @@ -71,4 +81,10 @@ spec: {{- with .Values.components.eventBus.priorityClassName }} priorityClassName: {{ . }} {{- end }} + volumes: + {{- if .Values.tls.enabled }} + - name: {{ include "seleniumGrid.tls.fullname" . | quote }} + secret: + secretName: {{ include "seleniumGrid.tls.fullname" . | quote }} + {{- end }} {{- end }} diff --git a/charts/selenium-grid/templates/hub-deployment.yaml b/charts/selenium-grid/templates/hub-deployment.yaml index 71473b209..e952215a4 100644 --- a/charts/selenium-grid/templates/hub-deployment.yaml +++ b/charts/selenium-grid/templates/hub-deployment.yaml @@ -49,7 +49,7 @@ spec: {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} {{- else }} httpGet: - scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" $) .schema }} path: {{ .path }} port: {{ default ($.Values.hub.port) .port }} {{- end }} @@ -65,7 +65,7 @@ spec: {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} {{- else }} httpGet: - scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" $) .schema }} path: {{ .path }} port: {{ default ($.Values.hub.port) .port }} {{- end }} @@ -81,7 +81,7 @@ spec: {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} {{- else }} httpGet: - scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" $) .schema }} path: {{ .path }} port: {{ default ($.Values.hub.port) .port }} {{- end }} @@ -95,23 +95,26 @@ spec: - name: SE_SUB_PATH value: {{ . | quote }} {{- end }} - {{- if eq .Values.basicAuth.enabled true}} - - name: ROUTER_USERNAME - value: {{ .Values.basicAuth.username }} - - name: ROUTER_PASSWORD - value: {{ .Values.basicAuth.password }} - {{- end }} {{- with .Values.hub.extraEnvironmentVariables }} {{- tpl (toYaml .) $ | nindent 12 }} {{- end }} envFrom: - configMapRef: name: {{ .Values.loggingConfigMap.name }} + - configMapRef: + name: {{ .Values.serverConfigMap.name }} + - secretRef: + name: {{ include "seleniumGrid.common.secrets" $ | quote }} {{- with .Values.hub.extraEnvFrom }} {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.hub.extraVolumeMounts }} volumeMounts: + {{- if .Values.tls.enabled }} + - name: {{ include "seleniumGrid.tls.fullname" . | quote }} + mountPath: {{ .Values.serverConfigMap.certVolumeMountPath | quote }} + readOnly: true + {{- end }} + {{- with .Values.hub.extraVolumeMounts }} {{- tpl (toYaml .) $ | nindent 12 }} {{- end }} {{- with .Values.hub.resources }} @@ -137,8 +140,13 @@ spec: {{- with .Values.hub.priorityClassName }} priorityClassName: {{ . }} {{- end }} - {{- with .Values.hub.extraVolumes }} volumes: + {{- if .Values.tls.enabled }} + - name: {{ include "seleniumGrid.tls.fullname" . | quote }} + secret: + secretName: {{ include "seleniumGrid.tls.fullname" . | quote }} + {{- end }} + {{- with .Values.hub.extraVolumes }} {{- tpl (toYaml .) $ | nindent 8 }} {{- end }} {{- end }} diff --git a/charts/selenium-grid/templates/ingress.yaml b/charts/selenium-grid/templates/ingress.yaml index 215cfbace..2f8195b6e 100644 --- a/charts/selenium-grid/templates/ingress.yaml +++ b/charts/selenium-grid/templates/ingress.yaml @@ -32,14 +32,19 @@ spec: {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} ingressClassName: {{ .Values.ingress.className }} {{- end }} - {{- if .Values.ingress.tls }} + {{- if and (or .Values.tls.enabled .Values.tls.ingress.generateTLS) .Values.ingress.hostname (not .Values.ingress.tls) }} + tls: + - hosts: + - {{ .Values.ingress.hostname | quote }} + secretName: {{ include "seleniumGrid.tls.fullname" . | quote }} + {{- else if .Values.ingress.tls }} tls: {{- range .Values.ingress.tls }} - hosts: {{- range .hosts }} - {{ . | quote }} {{- end }} - secretName: {{ .secretName }} + secretName: {{ tpl (.secretName) $ | quote }} {{- end }} {{- end }} rules: diff --git a/charts/selenium-grid/templates/router-deployment.yaml b/charts/selenium-grid/templates/router-deployment.yaml index e02829d46..a57e2682c 100644 --- a/charts/selenium-grid/templates/router-deployment.yaml +++ b/charts/selenium-grid/templates/router-deployment.yaml @@ -49,21 +49,25 @@ spec: - name: SE_SUB_PATH value: {{ . | quote }} {{- end }} - {{- if eq .Values.basicAuth.enabled true}} - - name: ROUTER_USERNAME - value: {{ .Values.basicAuth.username }} - - name: ROUTER_PASSWORD - value: {{ .Values.basicAuth.password }} - {{- end }} {{- with .Values.components.extraEnvironmentVariables }} {{- tpl (toYaml .) $ | nindent 12 }} {{- end }} envFrom: - configMapRef: name: {{ .Values.loggingConfigMap.name }} + - configMapRef: + name: {{ .Values.serverConfigMap.name }} + - secretRef: + name: {{ include "seleniumGrid.common.secrets" $ | quote }} {{- with .Values.components.extraEnvFrom }} {{- toYaml . | nindent 12 }} {{- end }} + volumeMounts: + {{- if .Values.tls.enabled }} + - name: {{ include "seleniumGrid.tls.fullname" . | quote }} + mountPath: {{ .Values.serverConfigMap.certVolumeMountPath | quote }} + readOnly: true + {{- end }} ports: - containerPort: {{ .Values.components.router.port }} protocol: TCP @@ -74,7 +78,7 @@ spec: {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} {{- else }} httpGet: - scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" $) .schema }} path: {{ .path }} port: {{ default ($.Values.components.router.port) .port }} {{- end }} @@ -90,7 +94,7 @@ spec: {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} {{- else }} httpGet: - scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" $) .schema }} path: {{ .path }} port: {{ default ($.Values.components.router.port) .port }} {{- end }} @@ -107,7 +111,7 @@ spec: {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} {{- else }} httpGet: - scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" .) .schema }} + scheme: {{ default (include "seleniumGrid.probe.httpGet.schema" $) .schema }} path: {{ .path }} port: {{ default ($.Values.components.router.port) .port }} {{- end }} @@ -139,4 +143,10 @@ spec: {{- with .Values.components.router.priorityClassName }} priorityClassName: {{ . }} {{- end }} + volumes: + {{- if .Values.tls.enabled }} + - name: {{ include "seleniumGrid.tls.fullname" . | quote }} + secret: + secretName: {{ include "seleniumGrid.tls.fullname" . | quote }} + {{- end }} {{- end }} diff --git a/charts/selenium-grid/templates/secrets.yaml b/charts/selenium-grid/templates/secrets.yaml new file mode 100644 index 000000000..06881d15a --- /dev/null +++ b/charts/selenium-grid/templates/secrets.yaml @@ -0,0 +1,33 @@ +{{- if .Values.secrets.create }} +apiVersion: v1 +kind: Secret +metadata: +{{- with .Values.secrets.annotations }} + annotations: {{- toYaml . | nindent 4 }} +{{- end }} + name: {{ include "seleniumGrid.common.secrets" . }} + labels: + {{- include "seleniumGrid.commonLabels" . | nindent 4 }} + {{- with .Values.customLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +type: Opaque +data: +{{- range $name, $value := .Values.secrets.env }} +{{- if not (empty $value) }} + {{- $_ := set $ "name" $name }} + {{- $_ := set $ "value" $value }} + {{ $name }}: {{ tpl ($value) $ | b64enc }} +{{- end }} +{{- end }} +{{- if eq .Values.basicAuth.enabled true }} + ROUTER_USERNAME: {{ .Values.basicAuth.username | b64enc }} + ROUTER_PASSWORD: {{ .Values.basicAuth.password | b64enc }} +{{- end }} +{{- if .Values.tls.enabled }} + SE_JAVA_SSL_TRUST_STORE_PASSWORD: {{ .Values.tls.trustStorePassword | b64enc }} +{{- end }} +{{- if (include "seleniumGrid.tls.registrationSecret.enabled" $) }} + SE_REGISTRATION_SECRET: {{ .Values.tls.registrationSecret.value | b64enc }} +{{- end }} +{{- end }} diff --git a/charts/selenium-grid/templates/server-configmap.yaml b/charts/selenium-grid/templates/server-configmap.yaml new file mode 100644 index 000000000..3e4e4b766 --- /dev/null +++ b/charts/selenium-grid/templates/server-configmap.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Values.serverConfigMap.name }} + namespace: {{ .Release.Namespace }} +{{- with .Values.busConfigMap.annotations }} + annotations: {{- toYaml . | nindent 4 }} +{{- end }} + labels: + {{- include "seleniumGrid.commonLabels" . | nindent 4 }} + {{- with .Values.customLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +data: +{{- if .Values.tls.enabled }} + SE_HTTPS_CERTIFICATE: {{ printf "%s/%s" .Values.serverConfigMap.certVolumeMountPath .Values.serverConfigMap.certificateFile | quote }} + SE_HTTPS_PRIVATE_KEY: {{ printf "%s/%s" .Values.serverConfigMap.certVolumeMountPath .Values.serverConfigMap.privateKeyFile | quote }} + SE_JAVA_SSL_TRUST_STORE: {{ printf "%s/%s" .Values.serverConfigMap.certVolumeMountPath .Values.serverConfigMap.trustStoreFile | quote }} + SE_JAVA_DISABLE_HOSTNAME_VERIFICATION: {{ .Values.serverConfigMap.disableHostnameVerification | quote }} +{{- end }} diff --git a/charts/selenium-grid/templates/session-map-deployment.yaml b/charts/selenium-grid/templates/session-map-deployment.yaml index 2edd701e2..27d120540 100644 --- a/charts/selenium-grid/templates/session-map-deployment.yaml +++ b/charts/selenium-grid/templates/session-map-deployment.yaml @@ -38,11 +38,21 @@ spec: envFrom: - configMapRef: name: {{ .Values.loggingConfigMap.name }} + - configMapRef: + name: {{ .Values.serverConfigMap.name }} + - secretRef: + name: {{ include "seleniumGrid.common.secrets" $ | quote }} - configMapRef: name: {{ .Values.busConfigMap.name }} {{- with .Values.components.extraEnvFrom }} {{- toYaml . | nindent 12 }} {{- end }} + volumeMounts: + {{- if .Values.tls.enabled }} + - name: {{ include "seleniumGrid.tls.fullname" . | quote }} + mountPath: {{ .Values.serverConfigMap.certVolumeMountPath | quote }} + readOnly: true + {{- end }} ports: - containerPort: {{ .Values.components.sessionMap.port }} protocol: TCP @@ -69,4 +79,10 @@ spec: {{- with .Values.components.sessionMap.priorityClassName }} priorityClassName: {{ . }} {{- end }} + volumes: + {{- if .Values.tls.enabled }} + - name: {{ include "seleniumGrid.tls.fullname" . | quote }} + secret: + secretName: {{ include "seleniumGrid.tls.fullname" . | quote }} + {{- end }} {{- end }} diff --git a/charts/selenium-grid/templates/session-queuer-deployment.yaml b/charts/selenium-grid/templates/session-queuer-deployment.yaml index 379285038..546090e43 100644 --- a/charts/selenium-grid/templates/session-queuer-deployment.yaml +++ b/charts/selenium-grid/templates/session-queuer-deployment.yaml @@ -38,9 +38,19 @@ spec: envFrom: - configMapRef: name: {{ .Values.loggingConfigMap.name }} + - configMapRef: + name: {{ .Values.serverConfigMap.name }} + - secretRef: + name: {{ include "seleniumGrid.common.secrets" $ | quote }} {{- with .Values.components.extraEnvFrom }} {{- toYaml . | nindent 12 }} {{- end }} + volumeMounts: + {{- if .Values.tls.enabled }} + - name: {{ include "seleniumGrid.tls.fullname" . | quote }} + mountPath: {{ .Values.serverConfigMap.certVolumeMountPath | quote }} + readOnly: true + {{- end }} ports: - containerPort: {{ .Values.components.sessionQueue.port }} protocol: TCP @@ -67,4 +77,10 @@ spec: {{- with .Values.components.sessionQueue.priorityClassName }} priorityClassName: {{ . }} {{- end }} + volumes: + {{- if .Values.tls.enabled }} + - name: {{ include "seleniumGrid.tls.fullname" . | quote }} + secret: + secretName: {{ include "seleniumGrid.tls.fullname" . | quote }} + {{- end }} {{- end }} diff --git a/charts/selenium-grid/templates/tls-cert-secret.yaml b/charts/selenium-grid/templates/tls-cert-secret.yaml new file mode 100644 index 000000000..000a1e5a7 --- /dev/null +++ b/charts/selenium-grid/templates/tls-cert-secret.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: Secret +metadata: + annotations: + "restartOnUpdate": "true" + name: {{ include "seleniumGrid.tls.fullname" . }} + labels: + {{- include "seleniumGrid.commonLabels" . | nindent 4 }} + {{- with .Values.customLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +type: Opaque +data: +{{- if and .Values.ingress.enabled .Values.tls.ingress.generateTLS (not .Values.tls.enabled) }} + {{- $name := default "SeleniumHQ" .Values.tls.ingress.defaultName -}} + {{- $days := default 365 (.Values.tls.ingress.defaultDays | int) -}} + {{- $cn := ternary .Values.tls.ingress.defaultCN .Values.ingress.hostname (empty .Values.ingress.hostname) -}} + {{- $server := genSelfSignedCert $cn ( default nil .Values.tls.ingress.defaultIPList ) ( default nil .Values.tls.ingress.defaultSANList ) $days }} + tls.crt: {{ $server.Cert | b64enc }} + tls.key: {{ $server.Key | b64enc }} +{{- else if and .Values.ingress.enabled .Values.tls.enabled }} + tls.crt: {{ default (include "seleniumGrid.tls.getDefaultFile" (list .Values.tls.defaultFile.certificate $)) .Values.tls.certificate | b64enc }} + tls.key: {{ default (include "seleniumGrid.tls.getDefaultFile" (list .Values.tls.defaultFile.privateKey $)) .Values.tls.privateKey | b64enc }} +{{- end }} +{{- if .Values.tls.enabled }} + {{ .Values.serverConfigMap.privateKeyFile }}: {{ default (include "seleniumGrid.tls.getDefaultFile" (list .Values.tls.defaultFile.privateKey $)) .Values.tls.privateKey | b64enc }} + {{ .Values.serverConfigMap.certificateFile }}: {{ default (include "seleniumGrid.tls.getDefaultFile" (list .Values.tls.defaultFile.certificate $)) .Values.tls.certificate | b64enc }} + {{ .Values.serverConfigMap.trustStoreFile }}: {{ default (include "seleniumGrid.tls.getDefaultFile" (list .Values.tls.defaultFile.trustStore $)) .Values.tls.trustStore | b64enc }} +{{- end }} diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index f4a094c16..fa29d28b9 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -17,6 +17,31 @@ global: # Log level for all components. Possible values describe here: https://www.selenium.dev/documentation/grid/configuration/cli_options/#logging logLevel: INFO +tls: + enabled: false + ingress: + generateTLS: false + defaultName: "SeleniumHQ" + defaultDays: 3650 + defaultCN: "www.selenium.dev" + # or *.domain.com + defaultSANList: [] + # - domain.com + # - production.domain.com + defaultIPList: [] + # - 10.10.10.10 + defaultFile: + certificate: "certs/selenium.pem" + privateKey: "certs/selenium.pkcs8.base64" + trustStore: "certs/selenium.jks" + certificate: + privateKey: + trustStore: + trustStorePassword: "changeit" + registrationSecret: + enabled: false + value: "HappyTesting" + # Basic auth settings for Selenium Grid basicAuth: # Enable or disable basic auth @@ -89,6 +114,26 @@ loggingConfigMap: # Custom annotations for configmap annotations: {} +# ConfigMap that contains common environment variables for Server (https://www.selenium.dev/documentation/grid/configuration/cli_options/#server) +serverConfigMap: + name: selenium-server-config + certVolumeMountPath: /etc/ssl/certs/selenium + certificateFile: selenium.pem + privateKeyFile: selenium.pkcs8 + trustStoreFile: selenium.jks + # Disable verification the hostname included in the server's TLS/SSL certificates matches the hostnames provided + disableHostnameVerification: true + # Custom annotations for configmap + annotations: {} + +# Secrets for all components. Components environment variables contain sensitive data should be stored in secrets. +secrets: + create: true + name: selenium-secrets + env: + SE_VNC_PASSWORD: "secret" + annotations: {} + # Configuration for isolated components (applied only if `isolateComponents: true`) components: diff --git a/tests/SeleniumTests/__init__.py b/tests/SeleniumTests/__init__.py index 4ca352683..0938d6939 100644 --- a/tests/SeleniumTests/__init__.py +++ b/tests/SeleniumTests/__init__.py @@ -10,6 +10,7 @@ from selenium.webdriver.edge.options import Options as EdgeOptions from selenium.webdriver.chrome.options import Options as ChromeOptions +SELENIUM_GRID_PROTOCOL = os.environ.get('SELENIUM_GRID_PROTOCOL', 'http') SELENIUM_GRID_HOST = os.environ.get('SELENIUM_GRID_HOST', 'localhost') SELENIUM_GRID_PORT = os.environ.get('SELENIUM_GRID_PORT', '4444') WEB_DRIVER_WAIT_TIMEOUT = int(os.environ.get('WEB_DRIVER_WAIT_TIMEOUT', 60)) @@ -95,7 +96,7 @@ def setUp(self): options.add_argument('disable-features=DownloadBubble,DownloadBubbleV2') self.driver = webdriver.Remote( options=options, - command_executor="http://%s:%s" % (SELENIUM_GRID_HOST,SELENIUM_GRID_PORT) + command_executor="%s://%s:%s" % (SELENIUM_GRID_PROTOCOL,SELENIUM_GRID_HOST,SELENIUM_GRID_PORT) ) class EdgeTests(SeleniumGenericTests): @@ -105,7 +106,7 @@ def setUp(self): options.add_argument('disable-features=DownloadBubble,DownloadBubbleV2') self.driver = webdriver.Remote( options=options, - command_executor="http://%s:%s" % (SELENIUM_GRID_HOST,SELENIUM_GRID_PORT) + command_executor="%s://%s:%s" % (SELENIUM_GRID_PROTOCOL,SELENIUM_GRID_HOST,SELENIUM_GRID_PORT) ) @@ -119,7 +120,7 @@ def setUp(self): options.enable_downloads = True self.driver = webdriver.Remote( options=options, - command_executor="http://%s:%s" % (SELENIUM_GRID_HOST,SELENIUM_GRID_PORT) + command_executor="%s://%s:%s" % (SELENIUM_GRID_PROTOCOL,SELENIUM_GRID_HOST,SELENIUM_GRID_PORT) ) def test_title_and_maximize_window(self): diff --git a/tests/SmokeTests/__init__.py b/tests/SmokeTests/__init__.py index a2f74c7fa..2cd737017 100644 --- a/tests/SmokeTests/__init__.py +++ b/tests/SmokeTests/__init__.py @@ -2,12 +2,13 @@ import unittest import time import json - +from ssl import _create_unverified_context try: from urllib2 import urlopen except ImportError: from urllib.request import urlopen +SELENIUM_GRID_PROTOCOL = os.environ.get('SELENIUM_GRID_PROTOCOL', 'http') SELENIUM_GRID_HOST = os.environ.get('SELENIUM_GRID_HOST', 'localhost') SELENIUM_GRID_PORT = os.environ.get('SELENIUM_GRID_PORT', '4444') SELENIUM_GRID_AUTOSCALING = os.environ.get('SELENIUM_GRID_AUTOSCALING', 'false') @@ -28,7 +29,7 @@ def smoke_test_container(self, port): while current_attempts < max_attempts: current_attempts = current_attempts + 1 try: - response = urlopen('http://%s:%s/status' % (SELENIUM_GRID_HOST, port)) + response = urlopen('%s://%s:%s/status' % (SELENIUM_GRID_PROTOCOL, SELENIUM_GRID_HOST, port), context=_create_unverified_context()) status_json = json.loads(response.read()) if not auto_scaling or (auto_scaling and auto_scaling_min_replica > 0): self.assertTrue(status_json['value']['ready'], "Container is not ready on port %s" % port) diff --git a/tests/bootstrap.sh b/tests/bootstrap.sh index 7ce7b8cf4..3d02bf550 100755 --- a/tests/bootstrap.sh +++ b/tests/bootstrap.sh @@ -11,6 +11,10 @@ python -m pip install selenium==4.16.0 \ docker===6.1.3 \ | grep -v 'Requirement already satisfied' +if [ "${SELENIUM_GRID_PROTOCOL}" = "https" ]; then + export REQUESTS_CA_BUNDLE="${CHART_CERT_PATH}" +fi + python test.py $1 ret_code=$? diff --git a/tests/charts/ci/DeploymentAutoScaling-values.yaml b/tests/charts/ci/DeploymentAutoScaling-values.yaml index b9e5b120e..08dcf1cb0 100644 --- a/tests/charts/ci/DeploymentAutoScaling-values.yaml +++ b/tests/charts/ci/DeploymentAutoScaling-values.yaml @@ -35,14 +35,13 @@ chromeNode: extraEnvironmentVariables: &extraEnvironmentVariables - name: SE_OPTS value: "--enable-managed-downloads true" - - name: SE_DRAIN_AFTER_SESSION_COUNT - value: "0" readinessProbe: enabled: &readinessProbe true livenessProbe: enabled: &livenessProbe true # Configuration for edge nodes edgeNode: + port: 8888 # (test): user is able to define extra container ports ports: - containerPort: 5900 diff --git a/tests/charts/ci/JobAutoscaling-values.yaml b/tests/charts/ci/JobAutoscaling-values.yaml index d8fc0bc79..35742e41a 100644 --- a/tests/charts/ci/JobAutoscaling-values.yaml +++ b/tests/charts/ci/JobAutoscaling-values.yaml @@ -11,7 +11,7 @@ autoscaling: # Configuration for chrome nodes chromeNode: nameOverride: my-chrome-name - extraEnvironmentVariables: + extraEnvironmentVariables: &extraEnvironmentVariables - name: SE_OPTS value: "--enable-managed-downloads true" readinessProbe: @@ -21,9 +21,7 @@ chromeNode: # Configuration for edge nodes edgeNode: nameOverride: my-edge-name - extraEnvironmentVariables: - - name: SE_OPTS - value: "--enable-managed-downloads true" + extraEnvironmentVariables: *extraEnvironmentVariables readinessProbe: enabled: *readinessProbe livenessProbe: @@ -31,20 +29,8 @@ edgeNode: # Configuration for firefox nodes firefoxNode: nameOverride: my-firefox-name - extraEnvironmentVariables: - - name: SE_OPTS - value: "--enable-managed-downloads true" + extraEnvironmentVariables: *extraEnvironmentVariables readinessProbe: enabled: *readinessProbe livenessProbe: enabled: *livenessProbe - -ingress: - paths: - - path: /selenium(/|$)(.*) - pathType: ImplementationSpecific - backend: - service: - name: '{{ template "seleniumGrid.hub.fullname" $ }}' - port: - number: 4444 diff --git a/tests/charts/ci/auth-ingress-values.yaml b/tests/charts/ci/auth-ingress-values.yaml index 38bc87e1b..4ccd0a6f2 100644 --- a/tests/charts/ci/auth-ingress-values.yaml +++ b/tests/charts/ci/auth-ingress-values.yaml @@ -1,5 +1,7 @@ global: K8S_PUBLIC_IP: localhost + seleniumGrid: + logLevel: INFO ingress: annotations: @@ -17,7 +19,7 @@ ingress: pathType: ImplementationSpecific backend: service: - name: '{{ template "seleniumGrid.router.fullname" $ }}' + name: '{{ ternary (include "seleniumGrid.router.fullname" $ ) (include "seleniumGrid.hub.fullname" $ ) $.Values.isolateComponents }}' port: number: 4444 diff --git a/tests/charts/ci/tls-values.yaml b/tests/charts/ci/tls-values.yaml new file mode 100644 index 000000000..0f7439251 --- /dev/null +++ b/tests/charts/ci/tls-values.yaml @@ -0,0 +1,11 @@ +tls: + enabled: true + generateTLS: false + registrationSecret: + enabled: true + value: "HappyTestOps" + +ingress-nginx: + controller: + extraArgs: + default-ssl-certificate: '$(POD_NAMESPACE)/selenium-tls-secret' diff --git a/tests/charts/make/chart_test.sh b/tests/charts/make/chart_test.sh index 194bb6056..617d3ef6e 100755 --- a/tests/charts/make/chart_test.sh +++ b/tests/charts/make/chart_test.sh @@ -11,6 +11,7 @@ INGRESS_NAMESPACE=${INGRESS_NAMESPACE:-"ingress-nginx"} SUB_PATH=${SUB_PATH:-"/selenium"} CHART_PATH=${CHART_PATH:-"charts/selenium-grid"} TEST_VALUES_PATH=${TEST_VALUES_PATH:-"tests/charts/ci"} +SELENIUM_GRID_PROTOCOL=${SELENIUM_GRID_PROTOCOL:-"http"} SELENIUM_GRID_HOST=${SELENIUM_GRID_HOST:-"localhost"} SELENIUM_GRID_PORT=${SELENIUM_GRID_PORT:-"80"} MATRIX_BROWSER=${1:-"NodeChrome"} @@ -20,6 +21,8 @@ WAIT_TIMEOUT=${WAIT_TIMEOUT:-"90s"} HUB_CHECKS_INTERVAL=${HUB_CHECKS_INTERVAL:-45} WEB_DRIVER_WAIT_TIMEOUT=${WEB_DRIVER_WAIT_TIMEOUT:-120} SKIP_CLEANUP=${SKIP_CLEANUP:-"false"} # For debugging purposes, retain the cluster after the test run +CHART_CERT_PATH=${CHART_CERT_PATH:-"${CHART_PATH}/certs/selenium.pem"} +SSL_CERT_DIR=${SSL_CERT_DIR:-"/etc/ssl/certs"} cleanup() { if [ "${SKIP_CLEANUP}" = "false" ]; then @@ -49,11 +52,17 @@ if [ "${SELENIUM_GRID_AUTOSCALING}" = "true" ]; then --set autoscaling.scaledOptions.minReplicaCount=${SELENIUM_GRID_AUTOSCALING_MIN_REPLICA}" fi +HELM_COMMAND_SET_TLS="" +if [ "${SELENIUM_GRID_PROTOCOL}" = "https" ]; then + HELM_COMMAND_SET_TLS="--values ${TEST_VALUES_PATH}/tls-values.yaml" +fi + HELM_COMMAND_ARGS="${RELEASE_NAME} \ --values ${TEST_VALUES_PATH}/auth-ingress-values.yaml \ --values ${TEST_VALUES_PATH}/tracing-values.yaml \ ---values ${TEST_VALUES_PATH}/${MATRIX_BROWSER}-values.yaml \ ${HELM_COMMAND_SET_AUTOSCALING} \ +${HELM_COMMAND_SET_TLS} \ +--values ${TEST_VALUES_PATH}/${MATRIX_BROWSER}-values.yaml \ --set global.seleniumGrid.imageTag=${VERSION} --set global.seleniumGrid.imageRegistry=${NAMESPACE} \ --set global.seleniumGrid.nodesImageTag=${VERSION} \ ${CHART_PATH} --namespace ${SELENIUM_NAMESPACE} --create-namespace" @@ -65,6 +74,8 @@ echo "Deploy Selenium Grid Chart" helm upgrade --install ${HELM_COMMAND_ARGS} echo "Run Tests" +export CHART_CERT_PATH=$(readlink -f ${CHART_CERT_PATH}) +export SELENIUM_GRID_PROTOCOL=${SELENIUM_GRID_PROTOCOL} export SELENIUM_GRID_HOST=${SELENIUM_GRID_HOST} export SELENIUM_GRID_PORT=${SELENIUM_GRID_PORT}""${SUB_PATH} export SELENIUM_GRID_AUTOSCALING=${SELENIUM_GRID_AUTOSCALING} diff --git a/tests/charts/refValues/sample-aws.yaml b/tests/charts/refValues/sample-aws.yaml index 06172f0e3..097eb4277 100644 --- a/tests/charts/refValues/sample-aws.yaml +++ b/tests/charts/refValues/sample-aws.yaml @@ -22,7 +22,7 @@ ingress: pathType: ImplementationSpecific backend: service: - name: '{{ template "seleniumGrid.router.fullname" $ }}' + name: '{{ ternary (include "seleniumGrid.router.fullname" $ ) (include "seleniumGrid.hub.fullname" $ ) $.Values.isolateComponents }}' port: number: 4444 diff --git a/tests/charts/refValues/simplex-minikube.yaml b/tests/charts/refValues/simplex-minikube.yaml index 5239714c7..a67b0bbf2 100644 --- a/tests/charts/refValues/simplex-minikube.yaml +++ b/tests/charts/refValues/simplex-minikube.yaml @@ -14,6 +14,11 @@ global: # nodesImageTag: latest # videoImageTag: latest +tls: +# enabled: true + ingress: + generateTLS: true + ingress: enabled: true annotations: @@ -28,7 +33,7 @@ ingress: pathType: ImplementationSpecific backend: service: - name: '{{ template "seleniumGrid.router.fullname" $ }}' + name: '{{ ternary (include "seleniumGrid.router.fullname" $ ) (include "seleniumGrid.hub.fullname" $ ) $.Values.isolateComponents }}' port: number: 4444 @@ -38,7 +43,8 @@ basicAuth: isolateComponents: true autoscaling: - enabled: true +# enabled: true + enableWithExistingKEDA: true scalingType: job annotations: helm.sh/hook: post-install,post-upgrade,post-rollback @@ -82,6 +88,9 @@ videoRecorder: ingress-nginx: enabled: true controller: + # Set controller default certificate use the same with Selenium Grid + extraArgs: + default-ssl-certificate: '$(POD_NAMESPACE)/selenium-tls-secret' hostNetwork: true kind: DaemonSet service: diff --git a/tests/charts/templates/render/dummy.yaml b/tests/charts/templates/render/dummy.yaml index 42864d78f..b5b2ef971 100644 --- a/tests/charts/templates/render/dummy.yaml +++ b/tests/charts/templates/render/dummy.yaml @@ -18,6 +18,10 @@ basicAuth: username: sysadmin password: strongPassword +tls: + enabled: true + generateTLS: false + ingress: nginx: proxyTimeout: 360 # Set different proxy timout @@ -39,14 +43,14 @@ ingress: pathType: ImplementationSpecific backend: service: - name: '{{ template "seleniumGrid.router.fullname" $ }}' + name: '{{ ternary (include "seleniumGrid.router.fullname" $ ) (include "seleniumGrid.hub.fullname" $ ) $.Values.isolateComponents }}' port: number: 4444 - path: /(/?)(session/.*/se/vnc) pathType: ImplementationSpecific backend: service: - name: '{{ template "seleniumGrid.router.fullname" $ }}' + name: '{{ ternary (include "seleniumGrid.router.fullname" $ ) (include "seleniumGrid.hub.fullname" $ ) $.Values.isolateComponents }}' port: number: 4444 diff --git a/tests/charts/templates/test.py b/tests/charts/templates/test.py index 8587b42d7..a40cbd22d 100644 --- a/tests/charts/templates/test.py +++ b/tests/charts/templates/test.py @@ -51,7 +51,7 @@ def test_sub_path_append_to_node_grid_url(self): for doc in LIST_OF_DOCUMENTS: if doc['metadata']['name'] in resources_name and doc['kind'] == 'ConfigMap': logger.info(f"Assert subPath is appended to node grid url") - self.assertTrue(doc['data']['SE_NODE_GRID_URL'] == 'http://sysadmin:strongPassword@10.10.10.10:8081/selenium') + self.assertTrue(doc['data']['SE_NODE_GRID_URL'] == 'https://sysadmin:strongPassword@10.10.10.10:8443/selenium') count += 1 self.assertEqual(count, len(resources_name), "No node config resources found") @@ -84,8 +84,9 @@ def test_log_level_set_to_logging_config_map(self): logger.info(f"Assert logging ConfigMap is set to envFrom in resource {doc['metadata']['name']}") list_env_from = doc['spec']['template']['spec']['containers'][0]['envFrom'] for env in list_env_from: - if env['configMapRef']['name'] == 'selenium-logging-config': - is_present = True + if env.get('configMapRef') is not None: + if env['configMapRef']['name'] == 'selenium-logging-config': + is_present = True self.assertTrue(is_present, "envFrom doesn't contain logging ConfigMap") count += 1 self.assertEqual(count, len(resources_name), "Logging ConfigMap is not present in expected resources") From 7accd3fc7f0021dd3b0e73c25af50758da8e4f69 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Wed, 10 Jan 2024 06:07:06 +0700 Subject: [PATCH 33/62] feat(chart): Add config to control disabling Grid UI (#2083) Signed-off-by: Viet Nguyen Duc --- Hub/start-selenium-grid-hub.sh | 5 +++++ Router/start-selenium-grid-router.sh | 5 +++++ charts/selenium-grid/README.md | 2 ++ .../selenium-grid/templates/hub-deployment.yaml | 4 ++++ .../templates/router-deployment.yaml | 4 ++++ charts/selenium-grid/values.yaml | 4 ++++ tests/charts/templates/render/dummy.yaml | 1 + tests/charts/templates/test.py | 16 ++++++++++++++-- 8 files changed, 39 insertions(+), 2 deletions(-) diff --git a/Hub/start-selenium-grid-hub.sh b/Hub/start-selenium-grid-hub.sh index 682b28e50..d93a0e92a 100755 --- a/Hub/start-selenium-grid-hub.sh +++ b/Hub/start-selenium-grid-hub.sh @@ -56,6 +56,11 @@ if [ ! -z "$SE_REGISTRATION_SECRET" ]; then SE_OPTS="$SE_OPTS --registration-secret ${SE_REGISTRATION_SECRET}" fi +if [ ! -z "$SE_DISABLE_UI" ]; then + echo "Appending Selenium options: --disable-ui ${SE_DISABLE_UI}" + SE_OPTS="$SE_OPTS --disable-ui ${SE_DISABLE_UI}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/Router/start-selenium-grid-router.sh b/Router/start-selenium-grid-router.sh index 6a7c0bc78..3288abb15 100755 --- a/Router/start-selenium-grid-router.sh +++ b/Router/start-selenium-grid-router.sh @@ -88,6 +88,11 @@ if [ ! -z "$SE_REGISTRATION_SECRET" ]; then SE_OPTS="$SE_OPTS --registration-secret ${SE_REGISTRATION_SECRET}" fi +if [ ! -z "$SE_DISABLE_UI" ]; then + echo "Appending Selenium options: --disable-ui ${SE_DISABLE_UI}" + SE_OPTS="$SE_OPTS --disable-ui ${SE_DISABLE_UI}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index 5368ca2ea..ae3a4c00d 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -648,6 +648,7 @@ You can configure the Selenium Hub with these values: | `hub.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `hub.annotations` | `{}` | Custom annotations for Selenium Hub pod | | `hub.labels` | `{}` | Custom labels for Selenium Hub pod | +| `hub.disableUI` | `false` | Disable the Grid UI | | `hub.publishPort` | `4442` | Port where events are published | | `hub.publishNodePort` | `31442` | NodePort where events are published | | `hub.subscribePort` | `4443` | Port where to subscribe for events | @@ -764,6 +765,7 @@ If you implement selenium-grid with separate components (`isolateComponents: tru | `components.sessionQueue.affinity` | `{}` | Affinity for Session Queue pods | | `components.sessionQueue.priorityClassName` | `""` | Priority class name for Session Queue pods | | `components.subPath` | `/` | Custom sub path for all components | +| `components.disableUI` | `false` | Disable the Grid UI | | `components.extraEnvironmentVariables` | `nil` | Custom environment variables for all components | | `components.extraEnvFrom` | `nil` | Custom environment variables taken from `configMap` or `secret` for all components | diff --git a/charts/selenium-grid/templates/hub-deployment.yaml b/charts/selenium-grid/templates/hub-deployment.yaml index e952215a4..00fea3f12 100644 --- a/charts/selenium-grid/templates/hub-deployment.yaml +++ b/charts/selenium-grid/templates/hub-deployment.yaml @@ -95,6 +95,10 @@ spec: - name: SE_SUB_PATH value: {{ . | quote }} {{- end }} + {{- if .Values.hub.disableUI }} + - name: SE_DISABLE_UI + value: {{ .Values.hub.disableUI | quote }} + {{- end }} {{- with .Values.hub.extraEnvironmentVariables }} {{- tpl (toYaml .) $ | nindent 12 }} {{- end }} diff --git a/charts/selenium-grid/templates/router-deployment.yaml b/charts/selenium-grid/templates/router-deployment.yaml index a57e2682c..647b5f1ab 100644 --- a/charts/selenium-grid/templates/router-deployment.yaml +++ b/charts/selenium-grid/templates/router-deployment.yaml @@ -49,6 +49,10 @@ spec: - name: SE_SUB_PATH value: {{ . | quote }} {{- end }} + {{- if .Values.components.disableUI }} + - name: SE_DISABLE_UI + value: {{ .Values.components.disableUI | quote }} + {{- end }} {{- with .Values.components.extraEnvironmentVariables }} {{- tpl (toYaml .) $ | nindent 12 }} {{- end }} diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index fa29d28b9..6f4e9b7c7 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -336,6 +336,8 @@ components: # Custom sub path for all components subPath: "" + # Disable the Grid UI + disableUI: false # Custom environment variables for all components extraEnvironmentVariables: @@ -370,6 +372,8 @@ hub: annotations: {} # Custom labels for Selenium Hub pods labels: {} + # Disable the Grid UI + disableUI: false # Port where events are published publishPort: 4442 publishNodePort: 31442 diff --git a/tests/charts/templates/render/dummy.yaml b/tests/charts/templates/render/dummy.yaml index b5b2ef971..a5587451a 100644 --- a/tests/charts/templates/render/dummy.yaml +++ b/tests/charts/templates/render/dummy.yaml @@ -58,6 +58,7 @@ isolateComponents: true components: subPath: *gridAppRoot + disableUI: true router: serviceType: NodePort distributor: diff --git a/tests/charts/templates/test.py b/tests/charts/templates/test.py index a40cbd22d..1d0196584 100644 --- a/tests/charts/templates/test.py +++ b/tests/charts/templates/test.py @@ -50,7 +50,7 @@ def test_sub_path_append_to_node_grid_url(self): count = 0 for doc in LIST_OF_DOCUMENTS: if doc['metadata']['name'] in resources_name and doc['kind'] == 'ConfigMap': - logger.info(f"Assert subPath is appended to node grid url") + logger.info(f"Assert subPath is appended to Node env SE_NODE_GRID_URL") self.assertTrue(doc['data']['SE_NODE_GRID_URL'] == 'https://sysadmin:strongPassword@10.10.10.10:8443/selenium') count += 1 self.assertEqual(count, len(resources_name), "No node config resources found") @@ -60,13 +60,25 @@ def test_sub_path_set_to_grid_env_var(self): is_present = False for doc in LIST_OF_DOCUMENTS: if doc['metadata']['name'] in resources_name and doc['kind'] == 'Deployment': - logger.info(f"Assert subPath is set to grid ENV variable") + logger.info(f"Assert subPath is set to Router env SE_SUB_PATH") list_env = doc['spec']['template']['spec']['containers'][0]['env'] for env in list_env: if env['name'] == 'SE_SUB_PATH' and env['value'] == '/selenium': is_present = True self.assertTrue(is_present, "ENV variable SE_SUB_PATH is not populated") + def test_disable_ui_set_to_grid_env_var(self): + resources_name = ['selenium-router'] + is_present = False + for doc in LIST_OF_DOCUMENTS: + if doc['metadata']['name'] in resources_name and doc['kind'] == 'Deployment': + logger.info(f"Assert option disable UI is set to Router env SE_DISABLE_UI") + list_env = doc['spec']['template']['spec']['containers'][0]['env'] + for env in list_env: + if env['name'] == 'SE_DISABLE_UI' and env['value'] == 'true': + is_present = True + self.assertTrue(is_present, "ENV variable SE_DISABLE_UI is not populated") + def test_log_level_set_to_logging_config_map(self): resources_name = ['selenium-chrome-node', 'selenium-distributor', 'selenium-edge-node', 'selenium-firefox-node', 'selenium-event-bus', 'selenium-router', 'selenium-session-map', 'selenium-session-queue'] From 6eca337ab6db23e8bdf579bd969f57662bd851b8 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Wed, 10 Jan 2024 09:42:43 +0700 Subject: [PATCH 34/62] build(nightly): Add build image based on upstream Selenium Nightly (#2088) Signed-off-by: Viet Nguyen Duc --- .github/workflows/nightly.yaml | 83 ++++++++++++++++++++++++++++++++++ Makefile | 47 ++++++++++++++++++- generate_release_notes.sh | 17 +++---- 3 files changed, 137 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/nightly.yaml diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml new file mode 100644 index 000000000..d71eb25f1 --- /dev/null +++ b/.github/workflows/nightly.yaml @@ -0,0 +1,83 @@ +name: Nightly +on: + workflow_dispatch: + inputs: + NAMESPACE: + description: 'Set image registry' + required: true + default: 'selenium' + schedule: + - cron: '0 1 * * *' + +jobs: + deploy: + name: Nightly build + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + persist-credentials: false + fetch-depth: 0 + - name: Output Docker info + run: docker info + - name: Sets build date + run: echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV + - name: Sets prerelease to nightly + run: | + echo "PRERELEASE=true" >> $GITHUB_ENV + echo "NAME=${NAMESPACE}" >> $GITHUB_ENV + env: + NAMESPACE: ${{ github.event.inputs.NAMESPACE }} + - name: Build base image to get Grid version + run: VERSION="local" BUILD_DATE=${BUILD_DATE} make base_nightly + - name: Get Grid version + # sed used to remove last comma of Selenium version output + run: | + echo "GRID_VERSION=$(docker run --rm ${{ env.NAME }}/base:local-${BUILD_DATE} java -jar /opt/selenium/selenium-server.jar hub --version | awk '{print $3}' | sed 's/\(.*\),/\1 /')" | awk '{$1=$1;print}' >> $GITHUB_ENV + - name: Display Grid version and set Base version + run: | + echo ${GRID_VERSION} + echo "BASE_VERSION=$(echo ${GRID_VERSION})" >> $GITHUB_ENV + echo "BASE_RELEASE=nightly" >> $GITHUB_ENV + - name: Remove local Docker tag + run: docker rmi ${{ env.NAME }}/base:local-${BUILD_DATE} + - name: Build images + run: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build + - name: Login Docker Hub + run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" + env: + DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} + DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} + - name: Tag images as nightly + uses: nick-invision/retry@master + with: + timeout_minutes: 20 + max_attempts: 3 + command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make tag_nightly + - name: Deploy nightly tag + uses: nick-invision/retry@master + with: + timeout_minutes: 20 + max_attempts: 3 + command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release_nightly + - name: Sets env var for the next tag + run: echo "NEXT_TAG=nightly" >> $GITHUB_ENV + - name: Get current latest tag + run: echo "LATEST_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV + - name: Display latest tag + run: echo ${LATEST_TAG} + - name: Create release notes (release_notes.md) + run: ./generate_release_notes.sh ${LATEST_TAG} origin/trunk ${GRID_VERSION} ${BUILD_DATE} + - name: Create Nightly Release + id: create_release + uses: ncipollo/release-action@main + with: + #artifacts: + replacesArtifacts: true + bodyFile: "release_notes.md" + generateReleaseNotes: true + name: Nightly + tag: nightly + allowUpdates: true + prerelease: ${{ env.PRERELEASE }} diff --git a/Makefile b/Makefile index 39a4723ec..b0dd7c237 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,11 @@ NAME := $(or $(NAME),$(NAME),selenium) CURRENT_DATE := $(shell date '+%Y%m%d') BUILD_DATE := $(or $(BUILD_DATE),$(BUILD_DATE),$(CURRENT_DATE)) -VERSION := $(or $(VERSION),$(VERSION),4.16.1) -BASE_VERSION := $(or $(BASE_VERSION),$(BASE_VERSION),4.16.1) 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)) TAG_VERSION := $(VERSION)-$(BUILD_DATE) NAMESPACE := $(or $(NAMESPACE),$(NAMESPACE),$(NAME)) AUTHORS := $(or $(AUTHORS),$(AUTHORS),SeleniumHQ) @@ -41,6 +43,9 @@ ci: build test base: cd ./Base && docker build $(BUILD_ARGS) --build-arg VERSION=$(BASE_VERSION) --build-arg RELEASE=$(BASE_RELEASE) -t $(NAME)/base:$(TAG_VERSION) . +base_nightly: + cd ./Base && docker build $(BUILD_ARGS) --build-arg VERSION=$(BASE_VERSION_NIGHTLY) --build-arg RELEASE=$(BASE_RELEASE_NIGHTLY) -t $(NAME)/base:$(TAG_VERSION) . + hub: base cd ./Hub && docker build $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/hub:$(TAG_VERSION) . @@ -177,6 +182,44 @@ release_latest: docker push $(NAME)/standalone-docker:latest docker push $(NAME)/video:latest +tag_nightly: + docker tag $(NAME)/base:$(TAG_VERSION) $(NAME)/base:nightly + docker tag $(NAME)/hub:$(TAG_VERSION) $(NAME)/hub:nightly + docker tag $(NAME)/distributor:$(TAG_VERSION) $(NAME)/distributor:nightly + docker tag $(NAME)/router:$(TAG_VERSION) $(NAME)/router:nightly + docker tag $(NAME)/sessions:$(TAG_VERSION) $(NAME)/sessions:nightly + docker tag $(NAME)/session-queue:$(TAG_VERSION) $(NAME)/session-queue:nightly + docker tag $(NAME)/event-bus:$(TAG_VERSION) $(NAME)/event-bus:nightly + docker tag $(NAME)/node-base:$(TAG_VERSION) $(NAME)/node-base:nightly + docker tag $(NAME)/node-chrome:$(TAG_VERSION) $(NAME)/node-chrome:nightly + docker tag $(NAME)/node-edge:$(TAG_VERSION) $(NAME)/node-edge:nightly + docker tag $(NAME)/node-firefox:$(TAG_VERSION) $(NAME)/node-firefox:nightly + docker tag $(NAME)/node-docker:$(TAG_VERSION) $(NAME)/node-docker:nightly + docker tag $(NAME)/standalone-chrome:$(TAG_VERSION) $(NAME)/standalone-chrome:nightly + docker tag $(NAME)/standalone-edge:$(TAG_VERSION) $(NAME)/standalone-edge:nightly + docker tag $(NAME)/standalone-firefox:$(TAG_VERSION) $(NAME)/standalone-firefox:nightly + docker tag $(NAME)/standalone-docker:$(TAG_VERSION) $(NAME)/standalone-docker:nightly + docker tag $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) $(NAME)/video:nightly + +release_nightly: + docker push $(NAME)/base:nightly + docker push $(NAME)/hub:nightly + docker push $(NAME)/distributor:nightly + docker push $(NAME)/router:nightly + docker push $(NAME)/sessions:nightly + docker push $(NAME)/session-queue:nightly + docker push $(NAME)/event-bus:nightly + docker push $(NAME)/node-base:nightly + docker push $(NAME)/node-chrome:nightly + docker push $(NAME)/node-edge:nightly + docker push $(NAME)/node-firefox:nightly + docker push $(NAME)/node-docker:nightly + docker push $(NAME)/standalone-chrome:nightly + docker push $(NAME)/standalone-edge:nightly + docker push $(NAME)/standalone-firefox:nightly + docker push $(NAME)/standalone-docker:nightly + docker push $(NAME)/video:nightly + tag_major_minor: docker tag $(NAME)/base:$(TAG_VERSION) $(NAME)/base:$(MAJOR) docker tag $(NAME)/hub:$(TAG_VERSION) $(NAME)/hub:$(MAJOR) diff --git a/generate_release_notes.sh b/generate_release_notes.sh index c2f4e40ae..d76c2912c 100755 --- a/generate_release_notes.sh +++ b/generate_release_notes.sh @@ -4,6 +4,7 @@ LATEST_TAG=$1 HEAD_BRANCH=$2 GRID_VERSION=$3 BUILD_DATE=$4 +NAMESPACE=${NAME:-selenium} TAG_VERSION=${GRID_VERSION}-${BUILD_DATE} @@ -11,13 +12,13 @@ echo "" >> release_notes.md echo "### Changelog" > release_notes.md git --no-pager log "${LATEST_TAG}...${HEAD_BRANCH}" --pretty=format:"* [\`%h\`](http://github.com/seleniumhq/docker-selenium/commit/%H) - %s :: %an" --reverse >> release_notes.md -CHROME_VERSION=$(docker run --rm selenium/node-chrome:${TAG_VERSION} google-chrome --version | awk '{print $3}') -EDGE_VERSION=$(docker run --rm selenium/node-edge:${TAG_VERSION} microsoft-edge --version | awk '{print $3}') -CHROMEDRIVER_VERSION=$(docker run --rm selenium/node-chrome:${TAG_VERSION} chromedriver --version | awk '{print $2}') -EDGEDRIVER_VERSION=$(docker run --rm selenium/node-edge:${TAG_VERSION} msedgedriver --version | awk '{print $4}') -FIREFOX_VERSION=$(docker run --rm selenium/node-firefox:${TAG_VERSION} firefox --version | awk '{print $3}') -GECKODRIVER_VERSION=$(docker run --rm selenium/node-firefox:${TAG_VERSION} geckodriver --version | awk 'NR==1{print $2}') -FFMPEG_VERSION=$(docker run --entrypoint="" --rm selenium/video:ffmpeg-6.1-${BUILD_DATE} ffmpeg -version | awk '{print $3}' | head -n 1) +CHROME_VERSION=$(docker run --rm ${NAMESPACE}/node-chrome:${TAG_VERSION} google-chrome --version | awk '{print $3}') +EDGE_VERSION=$(docker run --rm ${NAMESPACE}/node-edge:${TAG_VERSION} microsoft-edge --version | awk '{print $3}') +CHROMEDRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-chrome:${TAG_VERSION} chromedriver --version | awk '{print $2}') +EDGEDRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-edge:${TAG_VERSION} msedgedriver --version | awk '{print $4}') +FIREFOX_VERSION=$(docker run --rm ${NAMESPACE}/node-firefox:${TAG_VERSION} firefox --version | awk '{print $3}') +GECKODRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-firefox:${TAG_VERSION} geckodriver --version | awk 'NR==1{print $2}') +FFMPEG_VERSION=$(docker run --entrypoint="" --rm ${NAMESPACE}/video:ffmpeg-6.1-${BUILD_DATE} ffmpeg -version | awk '{print $3}' | head -n 1) echo "" >> release_notes.md @@ -37,7 +38,7 @@ echo "
" >> release_notes.md echo "Click to see published Docker images" >> release_notes.md echo "" >> release_notes.md echo '```' >> release_notes.md -docker images --filter=reference='selenium/*:*' --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}\t{{.Size}}" >> release_notes.md +docker images --filter=reference=${NAMESPACE}'/*:*' --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}\t{{.Size}}" >> release_notes.md echo '```' >> release_notes.md echo "" >> release_notes.md echo "
" >> release_notes.md From 0a8e23da8acefd03459db49365c2fcbb1addd006 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Wed, 10 Jan 2024 09:44:14 +0700 Subject: [PATCH 35/62] feat(chart): Enable HTTPS on distributed components (#2087) Signed-off-by: Viet Nguyen Duc --- SessionQueue/start-selenium-grid-session-queue.sh | 5 +++++ tests/SeleniumTests/__init__.py | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/SessionQueue/start-selenium-grid-session-queue.sh b/SessionQueue/start-selenium-grid-session-queue.sh index ac6f5a763..d5ea847ac 100755 --- a/SessionQueue/start-selenium-grid-session-queue.sh +++ b/SessionQueue/start-selenium-grid-session-queue.sh @@ -48,6 +48,11 @@ if [ ! -z "$SE_JAVA_SSL_TRUST_STORE" ]; then SE_JAVA_OPTS="$SE_JAVA_OPTS -Djdk.internal.httpclient.disableHostnameVerification=${SE_JAVA_DISABLE_HOSTNAME_VERIFICATION:-true}" fi +if [ ! -z "$SE_REGISTRATION_SECRET" ]; then + echo "Appending Selenium options: --registration-secret ${SE_REGISTRATION_SECRET}" + SE_OPTS="$SE_OPTS --registration-secret ${SE_REGISTRATION_SECRET}" +fi + EXTRA_LIBS="" if [ ! -z "$SE_ENABLE_TRACING" ]; then diff --git a/tests/SeleniumTests/__init__.py b/tests/SeleniumTests/__init__.py index 0938d6939..9cc62bc36 100644 --- a/tests/SeleniumTests/__init__.py +++ b/tests/SeleniumTests/__init__.py @@ -137,7 +137,9 @@ def run(self, test_classes): for test in suite: futures.append(executor.submit(test)) for future in concurrent.futures.as_completed(futures): - future.result() + result = future.result() + if not result.wasSuccessful(): + raise Exception("Parallel tests failed") class JobAutoscalingTests(unittest.TestCase): def test_parallel_autoscaling(self): From 61781f38e6b611ab8758df190ab0cc0e0c13bb72 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Wed, 10 Jan 2024 09:10:50 +0530 Subject: [PATCH 36/62] [build] Update workflows Signed-off-by: Viet Nguyen Duc --- .github/workflows/deploy.yml | 16 ++++++++-------- .github/workflows/helm-chart-release.yml | 2 ++ .github/workflows/nightly.yaml | 2 ++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 21d0b60a7..e066b1ffc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -57,19 +57,19 @@ jobs: max_attempts: 3 command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release - name: Tag images as latest - uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2 + uses: nick-invision/retry@master with: timeout_minutes: 20 max_attempts: 3 command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make tag_latest - name: Deploy latest tag - uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2 + uses: nick-invision/retry@master with: timeout_minutes: 20 max_attempts: 3 command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release_latest - name: Tag browser images - uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2 + uses: nick-invision/retry@master with: timeout_minutes: 20 max_attempts: 3 @@ -88,12 +88,12 @@ jobs: run: ./generate_release_notes.sh ${LATEST_TAG} origin/trunk ${GRID_VERSION} ${BUILD_DATE} - name: Create Release id: create_release - uses: actions/create-release@v1 + uses: ncipollo/release-action@main env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ env.GRID_VERSION }}-${{ env.BUILD_DATE }} - release_name: ${{ env.GRID_VERSION }}-${{ env.BUILD_DATE }} - body_path: release_notes.md - draft: false + tag: ${{ env.GRID_VERSION }}-${{ env.BUILD_DATE }} + name: ${{ env.GRID_VERSION }}-${{ env.BUILD_DATE }} + bodyFile: "release_notes.md" + generateReleaseNotes: true prerelease: ${{ env.PRERELEASE }} diff --git a/.github/workflows/helm-chart-release.yml b/.github/workflows/helm-chart-release.yml index 252ca1840..f847f9b33 100644 --- a/.github/workflows/helm-chart-release.yml +++ b/.github/workflows/helm-chart-release.yml @@ -25,5 +25,7 @@ jobs: - name: Run chart-releaser uses: helm/chart-releaser-action@v1.6.0 + with: + mark_as_latest: false env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index d71eb25f1..37bf11004 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -72,6 +72,8 @@ jobs: - name: Create Nightly Release id: create_release uses: ncipollo/release-action@main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: #artifacts: replacesArtifacts: true From 4bc9bc3e0b4c5ba9ed2724466fe62ab19a1e7028 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Wed, 10 Jan 2024 14:51:23 +0700 Subject: [PATCH 37/62] build(chart): Chart built on top of Nightly images (#2089) build(chart): Chart built on top of Nightly images Signed-off-by: Viet Nguyen Duc --- .github/workflows/nightly.yaml | 26 ++++++++++++++++++++++---- Makefile | 4 ++++ README.md | 9 +++++++++ charts/selenium-grid/README.md | 9 +++++++++ generate_release_notes.sh | 2 +- 5 files changed, 45 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 37bf11004..968b65e38 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -61,21 +61,39 @@ jobs: timeout_minutes: 20 max_attempts: 3 command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release_nightly - - name: Sets env var for the next tag - run: echo "NEXT_TAG=nightly" >> $GITHUB_ENV - name: Get current latest tag - run: echo "LATEST_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV + run: echo "LATEST_TAG=$(git describe --tags --abbrev=0 --exclude=nightly --exclude=selenium-grid*)" >> $GITHUB_ENV - name: Display latest tag run: echo ${LATEST_TAG} + - name: Sets env var for nightly tag + run: | + echo "NEXT_TAG=nightly" >> $GITHUB_ENV + echo "FILTER_IMAGE_TAG=nightly" >> $GITHUB_ENV - name: Create release notes (release_notes.md) run: ./generate_release_notes.sh ${LATEST_TAG} origin/trunk ${GRID_VERSION} ${BUILD_DATE} + + - name: Set up Python + uses: actions/setup-python@v5.0.0 + with: + python-version: '3.11' + check-latest: true + - name: Update tag in docs and files + run: ./update_tag_in_docs_and_files.sh ${LATEST_TAG} ${NEXT_TAG} + - name: Setup environment to build chart + run: make chart_setup_env + - name: Build and lint charts + run: | + make chart_build_nightly + echo "CHART_PACKAGE_PATH=$(cat /tmp/selenium_chart_version)" >> $GITHUB_ENV + echo "CHART_FILE_NAME=$(basename $(cat /tmp/selenium_chart_version))" >> $GITHUB_ENV + - name: Create Nightly Release id: create_release uses: ncipollo/release-action@main env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - #artifacts: + artifacts: "${{ env.CHART_PACKAGE_PATH }}" replacesArtifacts: true bodyFile: "release_notes.md" generateReleaseNotes: true diff --git a/Makefile b/Makefile index b0dd7c237..6bd98fb51 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ BASE_RELEASE_NIGHTLY := $(or $(BASE_RELEASE_NIGHTLY),$(BASE_RELEASE_NIGHTLY),nig BASE_VERSION_NIGHTLY := $(or $(BASE_VERSION_NIGHTLY),$(BASE_VERSION_NIGHTLY),4.17.0-SNAPSHOT) VERSION := $(or $(VERSION),$(VERSION),$(BASE_VERSION)) TAG_VERSION := $(VERSION)-$(BUILD_DATE) +CHART_VERSION_NIGHTLY := $(or $(CHART_VERSION_NIGHTLY),$(CHART_VERSION_NIGHTLY),1.0.0-nightly) NAMESPACE := $(or $(NAMESPACE),$(NAMESPACE),$(NAME)) AUTHORS := $(or $(AUTHORS),$(AUTHORS),SeleniumHQ) PUSH_IMAGE := $(or $(PUSH_IMAGE),$(PUSH_IMAGE),false) @@ -417,6 +418,9 @@ chart_cluster_setup: chart_cluster_cleanup: ./tests/charts/make/chart_cluster_cleanup.sh +chart_build_nightly: + VERSION=$(CHART_VERSION_NIGHTLY) ./tests/charts/make/chart_build.sh + chart_build: VERSION=$(TAG_VERSION) ./tests/charts/make/chart_build.sh diff --git a/README.md b/README.md index 44fe851b6..926e8cfbb 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Talk to us at https://www.selenium.dev/support/ * [Quick start](#quick-start) * [Experimental Mult-Arch aarch64/armhf/amd64 Images](#experimental-mult-arch-aarch64armhfamd64-images) +* [Nightly Images](#nightly-images) * [Dev and Beta Channel Browser Images](#dev-and-beta-channel-browser-images) + [Dev and Beta Standalone Mode](#dev-and-beta-standalone-mode) + [Dev and Beta on the Grid](#dev-and-beta-on-the-grid) @@ -106,6 +107,14 @@ in _this_ repository (SeleniumHQ/docker-selenium) instead of the experimental on ___ +## Nightly Images + +Nightly images are built on top of the [Nightly](https://github.com/SeleniumHQ/selenium/releases/tag/nightly) build on the upstream project [Selenium](https://github.com/SeleniumHQ/selenium) with the latest changes on main branch in this repository. The image tag is `nightly`. This is not recommended to use images in production. It is only for testing purpose. + +```bash +$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:nightly +``` + ## Dev and Beta Channel Browser Images To run tests or otherwise work with pre-release browsers, Google, Mozilla, and Microsoft maintain a Dev and Beta release channel for those who need to see what's soon to be released to the general population. diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index ae3a4c00d..30d0ccdfd 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -8,6 +8,7 @@ This chart enables the creation of a Selenium Grid Server in Kubernetes. * [Contents](#contents) * [Introduction](#introduction) * [Installing the chart](#installing-the-chart) + * [Installing the Nightly chart](#installing-the-nightly-chart) * [Enable Selenium Grid Autoscaling](#enable-selenium-grid-autoscaling) * [Settings common for both `job` and `deployment` scalingType](#settings-common-for-both-job-and-deployment-scalingtype) * [Settings when scalingType with `deployment`](#settings-when-scalingtype-with-deployment-) @@ -67,6 +68,14 @@ helm install selenium-grid --set ingress.hostname=selenium-grid.k8s.local docker # Notes: In case you want to set hostname is selenium-grid.local. You need to add the IP and hostname to the local host file in `/etc/hosts` ``` +### Installing the Nightly chart + +Nightly chart is built from the latest main branch of this repository with using Nightly images. It is not recommended to use this chart in production. It is only for testing purpose. The procedure to install the Nightly chart is the same as the above, only different on the version, it is `1.0.0-nightly` + +```bash +helm install selenium-grid docker-selenium/selenium-grid --version 1.0.0-nightly +``` + ## Enable Selenium Grid Autoscaling Selenium Grid has the ability to autoscaling browser nodes up/down based on the pending requests in the diff --git a/generate_release_notes.sh b/generate_release_notes.sh index d76c2912c..85f15cc55 100755 --- a/generate_release_notes.sh +++ b/generate_release_notes.sh @@ -38,7 +38,7 @@ echo "
" >> release_notes.md echo "Click to see published Docker images" >> release_notes.md echo "" >> release_notes.md echo '```' >> release_notes.md -docker images --filter=reference=${NAMESPACE}'/*:*' --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}\t{{.Size}}" >> release_notes.md +docker images --filter=reference=${NAMESPACE}'/*:'${FILTER_IMAGE_TAG:-"*"} --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}\t{{.Size}}" >> release_notes.md echo '```' >> release_notes.md echo "" >> release_notes.md echo "
" >> release_notes.md From d6beb0690cc127c1bd2d008fb46c659b89c768e4 Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Wed, 10 Jan 2024 09:46:16 +0100 Subject: [PATCH 38/62] Updating var name skip ci --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 926e8cfbb..525259e6c 100644 --- a/README.md +++ b/README.md @@ -865,12 +865,12 @@ captured in the same video. [Chrome](https://developers.google.com/web/updates/2017/04/headless-chrome), When using headless mode, there's no need for the [Xvfb](https://en.wikipedia.org/wiki/Xvfb) server to be started. -To avoid starting the server you can set the `START_XVFB` environment variable to `false` +To avoid starting the server you can set the `SE_START_XVFB` environment variable to `false` (or any other value than `true`), for example: ``` bash $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ - -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e START_XVFB=false --shm-size="2g" selenium/node-chrome:4.16.1-20231219 + -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e SE_START_XVFB=false --shm-size="2g" selenium/node-chrome:4.16.1-20231219 ``` For more information, see this GitHub [issue](https://github.com/SeleniumHQ/docker-selenium/issues/567). From c70621735d71c9862c5c030bca7152d6bb9b829c Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Wed, 10 Jan 2024 15:53:53 +0530 Subject: [PATCH 39/62] 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 From 503f55de93bb02ae46cbd56c2e1c4f3a73b98d41 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Thu, 11 Jan 2024 05:50:25 +0530 Subject: [PATCH 40/62] [build] Refresh tag an artifacts in Nightly build Signed-off-by: Viet Nguyen Duc --- .github/workflows/nightly.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 968b65e38..a4a3a4a91 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -71,7 +71,6 @@ jobs: echo "FILTER_IMAGE_TAG=nightly" >> $GITHUB_ENV - name: Create release notes (release_notes.md) run: ./generate_release_notes.sh ${LATEST_TAG} origin/trunk ${GRID_VERSION} ${BUILD_DATE} - - name: Set up Python uses: actions/setup-python@v5.0.0 with: @@ -86,7 +85,12 @@ jobs: make chart_build_nightly echo "CHART_PACKAGE_PATH=$(cat /tmp/selenium_chart_version)" >> $GITHUB_ENV echo "CHART_FILE_NAME=$(basename $(cat /tmp/selenium_chart_version))" >> $GITHUB_ENV - + - name: Delete previous nightly tag if any + uses: dev-drprasad/delete-tag-and-release@master + with: + tag_name: ${{ env.BASE_RELEASE }} + github_token: ${{ secrets.GITHUB_TOKEN }} + delete_release: true - name: Create Nightly Release id: create_release uses: ncipollo/release-action@main @@ -98,6 +102,6 @@ jobs: bodyFile: "release_notes.md" generateReleaseNotes: true name: Nightly - tag: nightly + tag: ${{ env.BASE_RELEASE }} allowUpdates: true prerelease: ${{ env.PRERELEASE }} From 408d43049d946e9285e38744e0d20091da11a992 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Thu, 11 Jan 2024 11:08:03 +0700 Subject: [PATCH 41/62] [build] Default image namespace for Nightly build on schedule trigger [skip ci] --- .github/workflows/nightly.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index a4a3a4a91..53d060fd3 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -28,7 +28,7 @@ jobs: echo "PRERELEASE=true" >> $GITHUB_ENV echo "NAME=${NAMESPACE}" >> $GITHUB_ENV env: - NAMESPACE: ${{ github.event.inputs.NAMESPACE }} + NAMESPACE: ${{ github.event.inputs.NAMESPACE || 'selenium' }} - name: Build base image to get Grid version run: VERSION="local" BUILD_DATE=${BUILD_DATE} make base_nightly - name: Get Grid version From 9f36b854213108835384969162e31bd2732742c1 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Fri, 12 Jan 2024 22:48:30 +0530 Subject: [PATCH 42/62] [build] Fix duplicated Nightly releases creation Signed-off-by: Viet Nguyen Duc --- .github/workflows/deploy.yml | 14 ++++++++------ .github/workflows/nightly.yaml | 30 +++++++++++++++--------------- charts/selenium-grid/README.md | 4 ++++ 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e066b1ffc..acf71f7f7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -11,6 +11,7 @@ jobs: if: contains(toJson(github.event.commits), '[deploy]') == true name: Deploy Docker images runs-on: ubuntu-latest + permissions: write-all steps: - name: Checkout code uses: actions/checkout@v4 @@ -88,12 +89,13 @@ jobs: run: ./generate_release_notes.sh ${LATEST_TAG} origin/trunk ${GRID_VERSION} ${BUILD_DATE} - name: Create Release id: create_release - uses: ncipollo/release-action@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@master with: - tag: ${{ env.GRID_VERSION }}-${{ env.BUILD_DATE }} + token: ${{ secrets.GITHUB_TOKEN }} + tag_name: ${{ env.GRID_VERSION }}-${{ env.BUILD_DATE }} name: ${{ env.GRID_VERSION }}-${{ env.BUILD_DATE }} - bodyFile: "release_notes.md" - generateReleaseNotes: true + body_path: "release_notes.md" + generate_release_notes: true prerelease: ${{ env.PRERELEASE }} + draft: false + append_body: false diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 53d060fd3..58164e47e 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -13,6 +13,7 @@ jobs: deploy: name: Nightly build runs-on: ubuntu-latest + permissions: write-all steps: - name: Checkout code uses: actions/checkout@v4 @@ -86,22 +87,21 @@ jobs: echo "CHART_PACKAGE_PATH=$(cat /tmp/selenium_chart_version)" >> $GITHUB_ENV echo "CHART_FILE_NAME=$(basename $(cat /tmp/selenium_chart_version))" >> $GITHUB_ENV - name: Delete previous nightly tag if any - uses: dev-drprasad/delete-tag-and-release@master + uses: cb80/delrel@latest with: - tag_name: ${{ env.BASE_RELEASE }} - github_token: ${{ secrets.GITHUB_TOKEN }} - delete_release: true + tag: ${{ env.BASE_RELEASE }} + token: ${{ secrets.GITHUB_TOKEN }} - name: Create Nightly Release id: create_release - uses: ncipollo/release-action@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@master with: - artifacts: "${{ env.CHART_PACKAGE_PATH }}" - replacesArtifacts: true - bodyFile: "release_notes.md" - generateReleaseNotes: true - name: Nightly - tag: ${{ env.BASE_RELEASE }} - allowUpdates: true - prerelease: ${{ env.PRERELEASE }} + token: ${{ secrets.GITHUB_TOKEN }} + tag_name: ${{ env.BASE_RELEASE }} + name: "Nightly" + body_path: "release_notes.md" + files: | + ${{ env.CHART_PACKAGE_PATH }} + generate_release_notes: true + draft: false + prerelease: true + append_body: true diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index 30d0ccdfd..8655e0a02 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -73,6 +73,10 @@ helm install selenium-grid --set ingress.hostname=selenium-grid.k8s.local docker Nightly chart is built from the latest main branch of this repository with using Nightly images. It is not recommended to use this chart in production. It is only for testing purpose. The procedure to install the Nightly chart is the same as the above, only different on the version, it is `1.0.0-nightly` ```bash +# List all versions Nightly in the docker-selenium repo +helm search repo docker-selenium --devel + +# Install basic grid Nightly version helm install selenium-grid docker-selenium/selenium-grid --version 1.0.0-nightly ``` From b62a56f0a20a41afca7c3e043623b6126b736c6b Mon Sep 17 00:00:00 2001 From: David <48491431+Auto81@users.noreply.github.com> Date: Thu, 18 Jan 2024 13:57:14 +0000 Subject: [PATCH 43/62] Documentation: Add example for setting SE_NODE_GRID_URL variable (#2094) Add example for setting SE_NODE_GRID_URL [skip ci] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 525259e6c..2f1907457 100644 --- a/README.md +++ b/README.md @@ -828,7 +828,7 @@ docker run -d -e SE_SCREEN_WIDTH=1366 -e SE_SCREEN_HEIGHT=768 -e SE_SCREEN_DEPTH In some use cases, you might need to set the Grid URL to the Node, for example, if you'd like to access the BiDi/CDP endpoint. This is also needed when you want to use the new `RemoteWebDriver.builder()` or `Augmenter()` present in Selenium 4 (since they setup the BiDi/CDP connection implicitly). You can do that through the `SE_NODE_GRID_URL` environment -variable. Setting this env var is needed if you want to see the live view while sessions are executing. +variable, eg `-e SE_NODE_GRID_URL=http://:4444`. Setting this env var is needed if you want to see the live view while sessions are executing. Grid has a default session timeout of 300 seconds, where the session can be in a stale state until it is killed. You can use `SE_NODE_SESSION_TIMEOUT` to overwrite that value in seconds. From e521d9952adbc746d25f3ef9dea326c7edd4ee67 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Fri, 19 Jan 2024 08:46:15 +0700 Subject: [PATCH 44/62] feat(chart): videoRecorder getting scripts from external files (#2095) Signed-off-by: Viet Nguyen Duc --- .github/workflows/build-test.yml | 4 + .github/workflows/helm-chart-test.yml | 8 +- .github/workflows/nightly.yaml | 10 +- .github/workflows/test-video.yml | 4 + Makefile | 10 +- charts/selenium-grid/README.md | 7 + .../selenium-grid/configs/node/nodePreStop.sh | 7 + .../configs/uploader/s3/entry_point.sh | 44 ++++++ charts/selenium-grid/configs/video/video.sh | 136 ++++++++++++++++++ charts/selenium-grid/templates/_helpers.tpl | 32 ++++- .../templates/chrome-node-hpa.yaml | 8 ++ .../templates/edge-node-hpa.yaml | 8 ++ .../templates/firefox-node-hpa.yaml | 8 ++ .../templates/node-configmap.yaml | 9 +- .../templates/server-configmap.yaml | 1 + charts/selenium-grid/templates/video-cm.yaml | 95 +----------- charts/selenium-grid/values.yaml | 40 +++--- tests/SeleniumTests/__init__.py | 11 +- tests/charts/templates/render/dummy.yaml | 13 ++ 19 files changed, 320 insertions(+), 135 deletions(-) create mode 100644 charts/selenium-grid/configs/node/nodePreStop.sh create mode 100644 charts/selenium-grid/configs/uploader/s3/entry_point.sh create mode 100755 charts/selenium-grid/configs/video/video.sh diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index b40db3af6..d0b68d0f5 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -2,7 +2,11 @@ name: Build & test on: push: + paths-ignore: + - '**.md' pull_request: + paths-ignore: + - '**.md' permissions: contents: read diff --git a/.github/workflows/helm-chart-test.yml b/.github/workflows/helm-chart-test.yml index 42408e0e3..5e2bb614f 100644 --- a/.github/workflows/helm-chart-test.yml +++ b/.github/workflows/helm-chart-test.yml @@ -2,7 +2,11 @@ name: Lint and Test Helm Charts on: push: + paths-ignore: + - '**.md' pull_request: + paths-ignore: + - '**.md' workflow_dispatch: permissions: @@ -15,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - test-strategy: [chart_test, chart_test_parallel_autoscaling, chart_test_https_tls] + test-strategy: [chart_test, chart_test_parallel_autoscaling, chart_test_https, chart_test_parallel_autoscaling_https] steps: - uses: actions/checkout@v4 - name: Output Docker info @@ -49,7 +53,7 @@ jobs: - name: Setup Kubernetes environment run: make chart_setup_env - name: Build Docker images - run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build + run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build_nightly - name: Build and lint charts run: | BUILD_DATE=${BUILD_DATE} make chart_build diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 58164e47e..44183bc86 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -87,7 +87,7 @@ jobs: echo "CHART_PACKAGE_PATH=$(cat /tmp/selenium_chart_version)" >> $GITHUB_ENV echo "CHART_FILE_NAME=$(basename $(cat /tmp/selenium_chart_version))" >> $GITHUB_ENV - name: Delete previous nightly tag if any - uses: cb80/delrel@latest + uses: cb80/delrel@main with: tag: ${{ env.BASE_RELEASE }} token: ${{ secrets.GITHUB_TOKEN }} @@ -104,4 +104,10 @@ jobs: generate_release_notes: true draft: false prerelease: true - append_body: true + append_body: false + - name: Update tag nightly + uses: richardsimko/update-tag@v1.0.11 + with: + tag_name: ${{ env.BASE_RELEASE }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-video.yml b/.github/workflows/test-video.yml index 02aa7f7c4..04bf156d0 100644 --- a/.github/workflows/test-video.yml +++ b/.github/workflows/test-video.yml @@ -2,7 +2,11 @@ name: Test video files on: push: + paths-ignore: + - '**.md' pull_request: + paths-ignore: + - '**.md' permissions: contents: read diff --git a/Makefile b/Makefile index 46522b156..4984fa37c 100644 --- a/Makefile +++ b/Makefile @@ -426,6 +426,9 @@ chart_build_nightly: chart_build: VERSION=$(TAG_VERSION) ./tests/charts/make/chart_build.sh +chart_test_https: + SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_PORT=443 make chart_test + chart_test: chart_test_template \ chart_test_chrome \ chart_test_firefox \ @@ -443,13 +446,12 @@ chart_test_firefox: chart_test_edge: VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/charts/make/chart_test.sh NodeEdge +chart_test_parallel_autoscaling_https: + SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_PORT=443 make chart_test_parallel_autoscaling + chart_test_parallel_autoscaling: VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/charts/make/chart_test.sh JobAutoscaling -chart_test_https_tls: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_PORT=443 \ - ./tests/charts/make/chart_test.sh JobAutoscaling - .PHONY: \ all \ base \ diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index 8655e0a02..a11e3bcd5 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -524,6 +524,8 @@ This table contains the configuration parameters of the chart and their default | `chromeNode.hpa.url` | `{{ include "seleniumGrid.graphqlURL" . }}` | Graphql Url of the hub or the router | | `chromeNode.hpa.browserName` | `chrome` | BrowserName from the capability | | `chromeNode.hpa.browserVersion` | `` | BrowserVersion from the capability | +| `chromeNode.sidecars` | `[]` | Add a sidecars proxy in the same pod of the browser node | +| `chromeNode.initContainers` | `[]` | Add initContainers in the same pod of the browser node | | `chromeNode.scaledOptions` | See `values.yaml` | Override the global `autoscaling.scaledOptions` with specific scaled options for chrome nodes | | `chromeNode.scaledJobOptions` | See `values.yaml` | Override the global `autoscaling.scaledJobOptions` with specific scaled options for chrome nodes | | `chromeNode.scaledObjectOptions` | See `values.yaml` | Override the global `autoscaling.scaledObjectOptions` with specific scaled options for chrome nodes | @@ -565,6 +567,8 @@ This table contains the configuration parameters of the chart and their default | `firefoxNode.hpa.url` | `{{ include "seleniumGrid.graphqlURL" . }}` | Graphql Url of the hub or the router | | `firefoxNode.hpa.browserName` | `firefox` | BrowserName from the capability | | `firefoxNode.hpa.browserVersion` | `` | BrowserVersion from the capability | +| `firefoxNode.sidecars` | `[]` | Add a sidecars proxy in the same pod of the browser node | +| `firefoxNode.initContainers` | `[]` | Add initContainers in the same pod of the browser node | | `firefoxNode.scaledOptions` | See `values.yaml` | Override the global `autoscaling.scaledOptions` with specific scaled options for firefox nodes | | `firefoxNode.scaledJobOptions` | See `values.yaml` | Override the global `autoscaling.scaledJobOptions` with specific scaled options for firefox nodes | | `firefoxNode.scaledObjectOptions` | See `values.yaml` | Override the global `autoscaling.scaledObjectOptions` with specific scaled options for firefox nodes | @@ -606,6 +610,8 @@ This table contains the configuration parameters of the chart and their default | `edgeNode.hpa.url` | `{{ include "seleniumGrid.graphqlURL" . }}` | Graphql Url of the hub or the router | | `edgeNode.hpa.browserName` | `edge` | BrowserName from the capability | | `edgeNode.hpa.browserVersion` | `` | BrowserVersion from the capability | +| `edgeNode.sidecars` | `[]` | Add a sidecars proxy in the same pod of the browser node | +| `edgeNode.initContainers` | `[]` | Add initContainers in the same pod of the browser node | | `edgeNode.scaledOptions` | See `values.yaml` | Override the global `autoscaling.scaledOptions` with specific scaled options for edge nodes | | `edgeNode.scaledJobOptions` | See `values.yaml` | Override the global `autoscaling.scaledJobOptions` with specific scaled options for edge nodes | | `edgeNode.scaledObjectOptions` | See `values.yaml` | Override the global `autoscaling.scaledObjectOptions` with specific scaled options for edge nodes | @@ -623,6 +629,7 @@ This table contains the configuration parameters of the chart and their default | `videoRecorder.terminationGracePeriodSeconds` | `30` | Time to graceful terminate container (default: 30s) | | `videoRecorder.startupProbe` | `{}` | Probe to check pod is started successfully | | `videoRecorder.livenessProbe` | `{}` | Liveness probe settings | +| `videoRecorder.lifecycle` | `{}` | Define lifecycle events for video recorder | | `videoRecorder.volume.name.folder` | `video` | Name is used to set for the volume to persist and share output video folder in container | | `videoRecorder.volume.name.scripts` | `video-scripts` | Name is used to set for the volume to persist and share video recorder scripts in container | | `videoRecorder.extraVolumeMounts` | `[]` | Extra mounts of declared ExtraVolumes into pod | diff --git a/charts/selenium-grid/configs/node/nodePreStop.sh b/charts/selenium-grid/configs/node/nodePreStop.sh new file mode 100644 index 000000000..dded38676 --- /dev/null +++ b/charts/selenium-grid/configs/node/nodePreStop.sh @@ -0,0 +1,7 @@ +#!/bin/bash +if curl -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status; then + curl -k -X POST ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/se/grid/node/drain --header 'X-REGISTRATION-SECRET;' + while curl -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status; do sleep 1; done +else + echo "Node is already drained. Shutting down gracefully!" +fi diff --git a/charts/selenium-grid/configs/uploader/s3/entry_point.sh b/charts/selenium-grid/configs/uploader/s3/entry_point.sh new file mode 100644 index 000000000..e2d3d8f5f --- /dev/null +++ b/charts/selenium-grid/configs/uploader/s3/entry_point.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +SE_VIDEO_FOLDER=${SE_VIDEO_FOLDER:-"/videos"} + +if [[ -z "${AWS_REGION}" ]] || [[ -z "${AWS_ACCESS_KEY_ID}" ]] || [[ -z "${AWS_SECRET_ACCESS_KEY}" ]]; +then + echo "AWS credentials needed to provide for configuring AWS CLI" +fi + +aws configure set region ${AWS_REGION} --profile s3-profile +aws configure set aws_access_key_id ${AWS_ACCESS_KEY_ID} --profile s3-profile +aws configure set aws_secret_access_key ${AWS_SECRET_ACCESS_KEY} --profile s3-profile +aws configure --profile s3-profile + +function consume_force_exit() { + rm -f ${SE_VIDEO_FOLDER}/force_exit + echo "Force exit signal consumed" +} +trap consume_force_exit EXIT + +while [ ! -p ${SE_VIDEO_FOLDER}/uploadpipe ]; +do + echo "Waiting for ${SE_VIDEO_FOLDER}/uploadpipe to be created" + sleep 1 +done + +echo "Waiting for video files put into pipe for proceeding to upload" + +while read FILE DESTINATION < ${SE_VIDEO_FOLDER}/uploadpipe +do + if [ "${FILE}" = "exit" ]; + then + exit + else [ "$FILE" != "" ] && [ "$DESTINATION" != "" ]; + echo "Uploading ${FILE} to ${DESTINATION}" + aws s3 cp "${FILE}" "${DESTINATION}" + fi + if [ -f ${SE_VIDEO_FOLDER}/force_exit ] && [ ! -s ${SE_VIDEO_FOLDER}/uploadpipe ]; + then + exit + fi +done + +consume_force_exit diff --git a/charts/selenium-grid/configs/video/video.sh b/charts/selenium-grid/configs/video/video.sh new file mode 100755 index 000000000..921d53399 --- /dev/null +++ b/charts/selenium-grid/configs/video/video.sh @@ -0,0 +1,136 @@ +#!/usr/bin/env bash + +function create_pipe() { + if [[ "$UPLOAD_DESTINATION_PREFIX" != "false" ]]; + then + echo "Create pipe if not exists for video upload stream" + if [ ! -p ${SE_VIDEO_FOLDER}/uploadpipe ]; + then + mkfifo ${SE_VIDEO_FOLDER}/uploadpipe + fi + fi +} +create_pipe + +function wait_util_force_exit_consume() { + if [[ "$UPLOAD_DESTINATION_PREFIX" != "false" ]]; + then + while [[ -f ${SE_VIDEO_FOLDER}/force_exit ]] + do + echo "Waiting for force exit file to be consumed by uploader" + sleep 1 + done + echo "Ready to shutdown the recorder" + fi +} + +function add_exit_signal() { + if [[ "$UPLOAD_DESTINATION_PREFIX" != "false" ]]; + then + echo "exit" > ${SE_VIDEO_FOLDER}/uploadpipe & + echo "exit" > ${SE_VIDEO_FOLDER}/force_exit + fi +} + +function exit_on_max_session_reach() { + if [ $max_recorded_count -gt 0 ] && [ $recorded_count -ge $max_recorded_count ]; + then + echo "Node will be drained since max sessions reached count number ($max_recorded_count)" + exit + fi +} + +function finish { + add_exit_signal + wait_util_force_exit_consume + kill -INT `cat /var/run/supervisor/supervisord.pid` +} +trap finish EXIT + +FRAME_RATE=${FRAME_RATE:-$SE_FRAME_RATE} +CODEC=${CODEC:-$SE_CODEC} +PRESET=${PRESET:-$SE_PRESET} +DISPLAY_CONTAINER_NAME=${DISPLAY_CONTAINER_NAME:-"localhost"} +export DISPLAY=${DISPLAY_CONTAINER_NAME}:${DISPLAY_NUM}.0 + +max_attempts=600 +attempts=0 +if [[ "$UPLOAD_DESTINATION_PREFIX" = "" ]] +then + echo Upload destination not known since UPLOAD_DESTINATION_PREFIX is not set. Exiting video recorder. + exit +fi +echo Checking if the display is open +until xset b off || [[ $attempts = $max_attempts ]] +do + echo Waiting before next display check + sleep 0.5 + attempts=$((attempts+1)) +done +if [[ $attempts = $max_attempts ]] +then + echo Can not open display, exiting. + exit +fi +VIDEO_SIZE=$(xdpyinfo | grep 'dimensions:' | awk '{print $2}') + +recording_started="false" +video_file_name="" +video_file="" +prev_session_id="" +attempts=0 +max_recorded_count=${SE_DRAIN_AFTER_SESSION_COUNT:-0} +recorded_count=0 +echo Checking if node API responds +until curl -sk --request GET ${SE_SERVER_PROTOCOL}://${DISPLAY_CONTAINER_NAME}:${SE_NODE_PORT}/status || [[ $attempts = $max_attempts ]] +do + echo Waiting before next API check + sleep 0.5 + attempts=$((attempts+1)) +done +if [[ $attempts = $max_attempts ]] +then + echo Can not reach node API, exiting. + exit +fi +while curl -sk --request GET ${SE_SERVER_PROTOCOL}://${DISPLAY_CONTAINER_NAME}:${SE_NODE_PORT}/status > /tmp/status.json +do + session_id=$(jq -r '.[]?.node?.slots | .[0]?.session?.sessionId' /tmp/status.json) + echo $session_id + if [[ "$session_id" != "null" && "$session_id" != "" && "$recording_started" = "false" ]] + then + video_file_name="$session_id.mp4" + video_file="${SE_VIDEO_FOLDER}/$video_file_name" + echo "Starting to record video" + ffmpeg -nostdin -y -f x11grab -video_size ${VIDEO_SIZE} -r ${FRAME_RATE} -i ${DISPLAY} -codec:v ${CODEC} ${PRESET} -pix_fmt yuv420p $video_file & + recording_started="true" + echo "Video recording started" + elif [[ "$session_id" != "$prev_session_id" && "$recording_started" = "true" ]] + then + echo "Stopping to record video" + pkill -INT ffmpeg + recorded_count=$((recorded_count+1)) + recording_started="false" + if [[ "$UPLOAD_DESTINATION_PREFIX" != "false" ]] + then + upload_destination=${UPLOAD_DESTINATION_PREFIX}/${video_file_name} + echo "Uploading video to $upload_destination" + echo $video_file $upload_destination >> ${SE_VIDEO_FOLDER}/uploadpipe & + fi + if [ $max_recorded_count -gt 0 ] && [ $recorded_count -ge $max_recorded_count ]; + then + echo "Node will be drained since max sessions reached count number ($max_recorded_count)" + exit + fi + + elif [[ $recording_started = "true" ]] + then + echo "Video recording in progress" + sleep 1 + else + echo "No session in progress" + sleep 1 + fi + prev_session_id=$session_id +done +echo "Node API is not responding, exiting." diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index e033bdac4..a5963d86f 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -317,6 +317,10 @@ template: {{- with .node.hostAliases }} hostAliases: {{ toYaml . | nindent 6 }} {{- end }} + initContainers: + {{- if .node.initContainers }} + {{- toYaml .node.initContainers | nindent 6 }} + {{- end }} containers: - name: {{.name}} {{- $imageTag := default .Values.global.seleniumGrid.nodesImageTag .node.imageTag }} @@ -436,6 +440,12 @@ template: image: {{ printf "%s/%s:%s" $imageRegistry .Values.videoRecorder.imageName $imageTag }} imagePullPolicy: {{ .Values.videoRecorder.imagePullPolicy }} env: + - name: SE_NODE_PORT + value: {{ .node.port | quote }} + - name: DISPLAY_CONTAINER_NAME + valueFrom: + fieldRef: + fieldPath: status.podIP - name: UPLOAD_DESTINATION_PREFIX value: {{ .Values.videoRecorder.uploadDestinationPrefix | quote }} {{- with .Values.videoRecorder.extraEnvironmentVariables }} @@ -444,6 +454,10 @@ template: envFrom: - configMapRef: name: {{ .Values.busConfigMap.name }} + - configMapRef: + name: {{ .Values.nodeConfigMap.name }} + - configMapRef: + name: {{ .Values.serverConfigMap.name }} {{- with .Values.videoRecorder.extraEnvFrom }} {{- tpl (toYaml .) $ | nindent 8 }} {{- end }} @@ -467,6 +481,9 @@ template: {{- with .Values.videoRecorder.livenessProbe }} livenessProbe: {{- toYaml . | nindent 10 }} {{- end }} + {{- with .Values.videoRecorder.lifecycle }} + lifecycle: {{- toYaml . | nindent 10 }} + {{- end }} {{- if .uploader }} - name: uploader image: {{ printf "%s:%s" .uploader.imageName .uploader.imageTag }} @@ -687,9 +704,12 @@ Default specs of VolumeMounts and Volumes for video recorder {{- end -}} {{- define "seleniumGrid.video.volumeMounts.default" -}} -- name: {{ include "seleniumGrid.video.volume.name.scripts" . }} - mountPath: /opt/bin/video.sh - subPath: video.sh +{{- $root := . -}} +{{- range $path, $bytes := .Files.Glob "configs/video/*" }} +- name: {{ include "seleniumGrid.video.volume.name.scripts" $ }} + mountPath: /opt/bin/{{ base $path }} + subPath: {{ base $path }} +{{- end }} - name: {{ include "seleniumGrid.video.volume.name.folder" . }} mountPath: /videos {{- end -}} @@ -704,6 +724,12 @@ Default specs of VolumeMounts and Volumes for video recorder {{- end -}} {{- define "seleniumGrid.video.uploader.volumeMounts.default" -}} +{{- $root := . -}} +{{- range $path, $bytes := .Files.Glob (printf "configs/uploader/%s/*" $.Values.videoRecorder.uploader) }} +- name: {{ include "seleniumGrid.video.volume.name.scripts" $ }} + mountPath: /opt/bin/{{ base $path }} + subPath: {{ base $path }} +{{- end }} - name: {{ include "seleniumGrid.video.volume.name.folder" . }} mountPath: /videos {{- end -}} diff --git a/charts/selenium-grid/templates/chrome-node-hpa.yaml b/charts/selenium-grid/templates/chrome-node-hpa.yaml index 74c588198..107e87b8b 100644 --- a/charts/selenium-grid/templates/chrome-node-hpa.yaml +++ b/charts/selenium-grid/templates/chrome-node-hpa.yaml @@ -5,11 +5,19 @@ metadata: name: selenium-grid-chrome-scaledobject namespace: {{ .Release.Namespace }} annotations: + helm.sh/resource-policy: delete {{- with .Values.autoscaling.annotations }} {{- toYaml . | nindent 4 }} {{- end }} labels: deploymentName: {{ template "seleniumGrid.chromeNode.fullname" . }} + {{- include "seleniumGrid.commonLabels" . | nindent 4 }} + {{- with .Values.chromeNode.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.customLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- $podScope := deepCopy . -}} {{- $_ := set $podScope "name" (include "seleniumGrid.chromeNode.fullname" .) -}} diff --git a/charts/selenium-grid/templates/edge-node-hpa.yaml b/charts/selenium-grid/templates/edge-node-hpa.yaml index 0839a3bdd..32bd3968e 100644 --- a/charts/selenium-grid/templates/edge-node-hpa.yaml +++ b/charts/selenium-grid/templates/edge-node-hpa.yaml @@ -5,11 +5,19 @@ metadata: name: selenium-grid-edge-scaledobject namespace: {{ .Release.Namespace }} annotations: + helm.sh/resource-policy: delete {{- with .Values.autoscaling.annotations }} {{- toYaml . | nindent 4 }} {{- end }} labels: deploymentName: {{ template "seleniumGrid.edgeNode.fullname" . }} + {{- include "seleniumGrid.commonLabels" . | nindent 4 }} + {{- with .Values.edgeNode.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.customLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- $podScope := deepCopy . -}} {{- $_ := set $podScope "name" (include "seleniumGrid.edgeNode.fullname" .) -}} diff --git a/charts/selenium-grid/templates/firefox-node-hpa.yaml b/charts/selenium-grid/templates/firefox-node-hpa.yaml index ad18269a5..e331a3475 100644 --- a/charts/selenium-grid/templates/firefox-node-hpa.yaml +++ b/charts/selenium-grid/templates/firefox-node-hpa.yaml @@ -5,11 +5,19 @@ metadata: name: selenium-grid-firefox-scaledobject namespace: {{ .Release.Namespace }} annotations: + helm.sh/resource-policy: delete {{- with .Values.autoscaling.annotations }} {{- toYaml . | nindent 4 }} {{- end }} labels: deploymentName: {{ template "seleniumGrid.firefoxNode.fullname" . }} + {{- include "seleniumGrid.commonLabels" . | nindent 4 }} + {{- with .Values.firefoxNode.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.customLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- $podScope := deepCopy . -}} {{- $_ := set $podScope "name" (include "seleniumGrid.firefoxNode.fullname" .) -}} diff --git a/charts/selenium-grid/templates/node-configmap.yaml b/charts/selenium-grid/templates/node-configmap.yaml index 807e2036c..6f8062d17 100644 --- a/charts/selenium-grid/templates/node-configmap.yaml +++ b/charts/selenium-grid/templates/node-configmap.yaml @@ -14,11 +14,4 @@ metadata: data: SE_DRAIN_AFTER_SESSION_COUNT: '{{- and (eq (include "seleniumGrid.useKEDA" .) "true") (eq .Values.autoscaling.scalingType "job") | ternary "1" "0" -}}' SE_NODE_GRID_URL: '{{ include "seleniumGrid.url" .}}' - {{ .Values.nodeConfigMap.preStopScript }}: | - #!/bin/bash - if curl -sf 127.0.0.1:${SE_NODE_PORT}/status; then - curl -X POST 127.0.0.1:${SE_NODE_PORT}/se/grid/node/drain --header 'X-REGISTRATION-SECRET;' - while curl -sf 127.0.0.1:${SE_NODE_PORT}/status; do sleep 1; done - else - echo "Node is already drained. Shutting down gracefully!" - fi +{{ (.Files.Glob "configs/node/*").AsConfig | indent 2 }} diff --git a/charts/selenium-grid/templates/server-configmap.yaml b/charts/selenium-grid/templates/server-configmap.yaml index 3e4e4b766..dc3d80b73 100644 --- a/charts/selenium-grid/templates/server-configmap.yaml +++ b/charts/selenium-grid/templates/server-configmap.yaml @@ -12,6 +12,7 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} data: + SE_SERVER_PROTOCOL: {{ include "seleniumGrid.server.protocol" . | quote }} {{- if .Values.tls.enabled }} SE_HTTPS_CERTIFICATE: {{ printf "%s/%s" .Values.serverConfigMap.certVolumeMountPath .Values.serverConfigMap.certificateFile | quote }} SE_HTTPS_PRIVATE_KEY: {{ printf "%s/%s" .Values.serverConfigMap.certVolumeMountPath .Values.serverConfigMap.privateKeyFile | quote }} diff --git a/charts/selenium-grid/templates/video-cm.yaml b/charts/selenium-grid/templates/video-cm.yaml index 1b49e026e..34eb24f05 100644 --- a/charts/selenium-grid/templates/video-cm.yaml +++ b/charts/selenium-grid/templates/video-cm.yaml @@ -4,95 +4,8 @@ kind: ConfigMap metadata: name: {{ template "seleniumGrid.video.fullname" . }} data: - video.sh: | - #!/usr/bin/env bash - set -em - function finish { - echo exit > /videos/uploadpipe - kill -s SIGINT `cat /var/run/supervisor/supervisord.pid` - } - trap finish EXIT - FRAME_RATE=${FRAME_RATE:-$SE_FRAME_RATE} - CODEC=${CODEC:-$SE_CODEC} - PRESET=${PRESET:-$SE_PRESET} - export DISPLAY=localhost:${DISPLAY_NUM}.0 - - return_code=1 - max_attempts=600 - attempts=0 - if [ ! -p /videos/uploadpipe ]; - then - mkfifo /videos/uploadpipe - fi - if [[ "$UPLOAD_DESTINATION_PREFIX" = "" ]] - then - echo Upload destination not known since UPLOAD_DESTINATION_PREFIX is not set. Exiting video recorder. - exit - fi - echo Checking if the display is open - until xset b off || [[ $attempts = $max_attempts ]] - do - echo Waiting before next display check - sleep 0.5 - attempts=$((attempts+1)) - done - if [[ $attempts = $max_attempts ]] - then - echo Can not open display, exiting. - exit - fi - VIDEO_SIZE=$(xdpyinfo | grep 'dimensions:' | awk '{print $2}') - - recording_started="false" - video_file_name="" - video_file="" - prev_session_id="" - attempts=0 - echo Checking if node API responds - until curl -s --request GET http://localhost:5555/status || [[ $attempts = $max_attempts ]] - do - echo Waiting before next API check - sleep 0.5 - attempts=$((attempts+1)) - done - if [[ $attempts = $max_attempts ]] - then - echo Can not reach node API, exiting. - exit - fi - while curl -s --request GET http://localhost:5555/status > /tmp/status.json - do - session_id=$(jq -r '.[]?.node?.slots | .[0]?.session?.sessionId' /tmp/status.json) - echo $session_id - if [[ "$session_id" != "null" && "$session_id" != "" && "$recording_started" = "false" ]] - then - video_file_name="$session_id.mp4" - video_file="${SE_VIDEO_FOLDER:-/videos}/$video_file_name" - echo "Starting to record video" - ffmpeg -nostdin -y -f x11grab -video_size ${VIDEO_SIZE} -r ${FRAME_RATE} -i ${DISPLAY} -codec:v ${CODEC} ${PRESET} -pix_fmt yuv420p $video_file & - recording_started="true" - echo "Video recording started" - elif [[ "$session_id" != "$prev_session_id" && "$recording_started" = "true" ]] - then - echo "Stopping to record video" - kill -INT %1 - fg || echo ffmpeg exited with code $? - if [[ "$UPLOAD_DESTINATION_PREFIX" != "false" ]] - then - upload_destination=${UPLOAD_DESTINATION_PREFIX}${video_file_name} - echo "Uploading video to $upload_destination" - echo $video_file $upload_destination > /videos/uploadpipe - fi - recording_started="false" - elif [[ $recording_started = "true" ]] - then - echo "Video recording in progress" - sleep 1 - else - echo "No session in progress" - sleep 1 - fi - prev_session_id=$session_id - done - echo +{{ (.Files.Glob "configs/video/*").AsConfig | indent 2 }} +{{- if and $.Values.videoRecorder.uploadDestinationPrefix $.Values.videoRecorder.uploader }} +{{ (.Files.Glob (printf "configs/uploader/%s/*" $.Values.videoRecorder.uploader)).AsConfig | indent 2 }} +{{- end }} {{- end }} diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index 6f4e9b7c7..79f3eff62 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -649,6 +649,10 @@ chromeNode: # browserVersion: '91.0' # Optional. Only required when supporting multiple versions of browser in your Selenium Grid. unsafeSsl: '{{ include "seleniumGrid.graphqlURL.unsafeSsl" . }}' # Optional + # It is used to add initContainers in the same pod of the browser node. + # It should be set using the --set-json option + initContainers: [] + # It is used to add a sidecars proxy in the same pod of the browser node. # It means it will add a new container to the deployment itself. # It should be set using the --set-json option @@ -804,6 +808,10 @@ firefoxNode: sessionBrowserName: 'firefox' unsafeSsl: '{{ include "seleniumGrid.graphqlURL.unsafeSsl" . }}' # Optional + # It is used to add initContainers in the same pod of the browser node. + # It should be set using the --set-json option + initContainers: [] + # It is used to add a sidecars proxy in the same pod of the browser node. # It means it will add a new container to the deployment itself. # It should be set using the --set-json option @@ -958,6 +966,10 @@ edgeNode: sessionBrowserName: 'msedge' unsafeSsl: '{{ include "seleniumGrid.graphqlURL.unsafeSsl" . }}' # Optional + # It is used to add initContainers in the same pod of the browser node. + # It should be set using the --set-json option + initContainers: [] + # It is used to add a sidecars proxy in the same pod of the browser node. # It means it will add a new container to the deployment itself. # It should be set using the --set-json option @@ -1011,6 +1023,8 @@ videoRecorder: # Liveness probe settings livenessProbe: {} + # Define lifecycle events for video recorder + lifecycle: {} volume: # name: @@ -1042,33 +1056,15 @@ videoRecorder: imagePullPolicy: IfNotPresent securityContext: runAsUser: 0 - command: - - /bin/sh - args: - - -c - - | - while ! [ -p /videos/uploadpipe ] - do - echo Waiting for /videos/uploadpipe to be created - sleep 1 - done - echo Waiting for files to upload - while read FILE DESTINATION < /videos/uploadpipe - do - if [ "$FILE" = "exit" ] - then - echo "$FILE" - break - else - echo "Uploading $FILE to $DESTINATION" - aws s3 cp --no-progress $FILE $DESTINATION - fi - done + command: ["/bin/sh"] + args: ["-c", "/opt/bin/entry_point.sh"] extraEnvironmentVariables: # - name: AWS_ACCESS_KEY_ID # value: aws_access_key_id # - name: AWS_SECRET_ACCESS_KEY # value: aws_secret_access_key + # - name: AWS_REGION + # value: region # - name: # valueFrom: # secretKeyRef: diff --git a/tests/SeleniumTests/__init__.py b/tests/SeleniumTests/__init__.py index 9cc62bc36..3c94792b7 100644 --- a/tests/SeleniumTests/__init__.py +++ b/tests/SeleniumTests/__init__.py @@ -1,7 +1,7 @@ import unittest import concurrent.futures import os -import time +import traceback from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait @@ -137,8 +137,13 @@ def run(self, test_classes): for test in suite: futures.append(executor.submit(test)) for future in concurrent.futures.as_completed(futures): - result = future.result() - if not result.wasSuccessful(): + try: + result = future.result() + if not result.wasSuccessful(): + raise Exception("Test failed") + except Exception as e: + print(f"Test {str(test)} failed with exception: {str(e)}") + print(traceback.format_exc()) raise Exception("Parallel tests failed") class JobAutoscalingTests(unittest.TestCase): diff --git a/tests/charts/templates/render/dummy.yaml b/tests/charts/templates/render/dummy.yaml index a5587451a..c22418d88 100644 --- a/tests/charts/templates/render/dummy.yaml +++ b/tests/charts/templates/render/dummy.yaml @@ -78,3 +78,16 @@ firefoxNode: edgeNode: affinity: *affinity + +videoRecorder: + enabled: true + uploader: s3 + uploadDestinationPrefix: "s3://ndviet" + s3: + extraEnvironmentVariables: + - name: AWS_ACCESS_KEY_ID + value: "xxxx" + - name: AWS_SECRET_ACCESS_KEY + value: "xxxx" + - name: AWS_REGION + value: "ap-southeast-1" From 3beed0361a2d560b4e90d66eb6a27f63b6522adc Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Fri, 19 Jan 2024 09:09:25 +0700 Subject: [PATCH 45/62] Bump Geckodriver v0.34.0 --- NodeFirefox/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NodeFirefox/Dockerfile b/NodeFirefox/Dockerfile index 0150b61e3..251be9b29 100644 --- a/NodeFirefox/Dockerfile +++ b/NodeFirefox/Dockerfile @@ -26,7 +26,7 @@ RUN FIREFOX_DOWNLOAD_URL=$(if [ $FIREFOX_VERSION = "latest" ] || [ $FIREFOX_VERS # GeckoDriver #============ ARG GECKODRIVER_VERSION=latest -RUN GK_VERSION=$(if [ ${GECKODRIVER_VERSION:-latest} = "latest" ]; then echo "0.33.0"; else echo $GECKODRIVER_VERSION; fi) \ +RUN GK_VERSION=$(if [ ${GECKODRIVER_VERSION:-latest} = "latest" ]; then echo "0.34.0"; else echo $GECKODRIVER_VERSION; fi) \ && echo "Using GeckoDriver version: "$GK_VERSION \ && wget --no-verbose -O /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GK_VERSION/geckodriver-v$GK_VERSION-linux64.tar.gz \ && rm -rf /opt/geckodriver \ From 832a230206ac644bb009eff59f1a5eacc6120231 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Fri, 19 Jan 2024 09:45:45 +0700 Subject: [PATCH 46/62] Update base OS image and maven dependency versions as upstream (#2096) Signed-off-by: Viet Nguyen Duc --- .github/workflows/nightly.yaml | 12 ++++++------ Base/Dockerfile | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 44183bc86..3db7ffa42 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -41,6 +41,12 @@ jobs: echo ${GRID_VERSION} echo "BASE_VERSION=$(echo ${GRID_VERSION})" >> $GITHUB_ENV echo "BASE_RELEASE=nightly" >> $GITHUB_ENV + - name: Update tag nightly + uses: richardsimko/update-tag@v1.0.11 + with: + tag_name: ${{ env.BASE_RELEASE }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Remove local Docker tag run: docker rmi ${{ env.NAME }}/base:local-${BUILD_DATE} - name: Build images @@ -105,9 +111,3 @@ jobs: draft: false prerelease: true append_body: false - - name: Update tag nightly - uses: richardsimko/update-tag@v1.0.11 - with: - tag_name: ${{ env.BASE_RELEASE }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Base/Dockerfile b/Base/Dockerfile index 59856c38b..7fb2dd93f 100644 --- a/Base/Dockerfile +++ b/Base/Dockerfile @@ -1,12 +1,12 @@ -FROM ubuntu:jammy-20231128 +FROM ubuntu:jammy-20240111 LABEL authors="Selenium " # Arguments to define the version of dependencies to download ARG VERSION ARG RELEASE=selenium-${VERSION} # Default value should be aligned with upstream Selenium (https://github.com/SeleniumHQ/selenium/blob/trunk/java/maven_deps.bzl) -ARG OPENTELEMETRY_VERSION=1.28.0 -ARG GRPC_VERSION=1.57.1 +ARG OPENTELEMETRY_VERSION=1.33.0 +ARG GRPC_VERSION=1.60.1 #Arguments to define the user running Selenium ARG SEL_USER=seluser From 771a807feb9c2f3ae7f12d9464bd577aab32cd46 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Sun, 21 Jan 2024 09:31:26 +0700 Subject: [PATCH 47/62] feat(chart): Add RCLONE as default video uploader on Kubernetes (#2100) Signed-off-by: Viet Nguyen Duc --- .github/workflows/nightly.yaml | 7 +- .../update-dev-beta-browser-images.yml | 2 +- Makefile | 23 +++- Uploader/Dockerfile | 12 ++ charts/selenium-grid/README.md | 105 ++++++++++++++++-- .../configs/{video => recorder}/video.sh | 22 ++-- .../configs/uploader/rclone/entry_point.sh | 37 ++++++ .../configs/uploader/rclone/rclone.conf | 9 ++ charts/selenium-grid/templates/_helpers.tpl | 55 +++++---- .../templates/chrome-node-deployment.yaml | 2 +- .../templates/chrome-node-scaledjobs.yaml | 2 +- .../templates/edge-node-deployment.yaml | 2 +- .../templates/edge-node-scaledjob.yaml | 2 +- .../templates/firefox-node-deployment.yaml | 2 +- .../templates/firefox-node-scaledjob.yaml | 2 +- .../templates/node-configmap.yaml | 4 + charts/selenium-grid/templates/secrets.yaml | 12 ++ charts/selenium-grid/templates/video-cm.yaml | 9 +- charts/selenium-grid/values.yaml | 74 ++++++++++-- generate_release_notes.sh | 2 + tests/SeleniumTests/__init__.py | 15 ++- tests/charts/make/chart_test.sh | 9 +- tests/charts/templates/render/dummy.yaml | 22 ++-- 23 files changed, 344 insertions(+), 87 deletions(-) create mode 100644 Uploader/Dockerfile rename charts/selenium-grid/configs/{video => recorder}/video.sh (82%) create mode 100644 charts/selenium-grid/configs/uploader/rclone/entry_point.sh create mode 100644 charts/selenium-grid/configs/uploader/rclone/rclone.conf diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 3db7ffa42..85e81a071 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -1,11 +1,6 @@ name: Nightly on: workflow_dispatch: - inputs: - NAMESPACE: - description: 'Set image registry' - required: true - default: 'selenium' schedule: - cron: '0 1 * * *' @@ -29,7 +24,7 @@ jobs: echo "PRERELEASE=true" >> $GITHUB_ENV echo "NAME=${NAMESPACE}" >> $GITHUB_ENV env: - NAMESPACE: ${{ github.event.inputs.NAMESPACE || 'selenium' }} + NAMESPACE: ${{ secrets.DOCKER_NAMESPACE || 'selenium' }} - name: Build base image to get Grid version run: VERSION="local" BUILD_DATE=${BUILD_DATE} make base_nightly - name: Get Grid version diff --git a/.github/workflows/update-dev-beta-browser-images.yml b/.github/workflows/update-dev-beta-browser-images.yml index 4bcef2c5b..b3f29527e 100644 --- a/.github/workflows/update-dev-beta-browser-images.yml +++ b/.github/workflows/update-dev-beta-browser-images.yml @@ -17,7 +17,7 @@ jobs: browser: [chrome,firefox,edge] channel: [dev,beta] env: - NAME: selenium + NAME: ${{ secrets.DOCKER_NAMESPACE || 'selenium' }} BROWSER: ${{ matrix.browser }} CHANNEL: ${{ matrix.channel }} diff --git a/Makefile b/Makefile index 4984fa37c..6aa26ae82 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,8 @@ MAJOR_MINOR_PATCH := $(word 1,$(subst -, ,$(TAG_VERSION))) FFMPEG_TAG_VERSION := $(or $(FFMPEG_TAG_VERSION),$(FFMPEG_TAG_VERSION),ffmpeg-6.1) FFMPEG_BASED_NAME := $(or $(FFMPEG_BASED_NAME),$(FFMPEG_BASED_NAME),ndviet) FFMPEG_BASED_TAG := $(or $(FFMPEG_BASED_TAG),$(FFMPEG_BASED_TAG),6.1-ubuntu2204) +RCLONE_BASED_TAG := $(or $(RCLONE_BASED_TAG),$(RCLONE_BASED_TAG),1.65) +RCLONE_TAG_VERSION := $(or $(RCLONE_TAG_VERSION),$(RCLONE_TAG_VERSION),rclone-$(RCLONE_BASED_TAG)) all: hub \ distributor \ @@ -34,6 +36,7 @@ all: hub \ standalone_edge \ standalone_firefox \ standalone_docker \ + uploader \ video build_nightly: @@ -130,6 +133,9 @@ standalone_edge_dev: edge_dev standalone_edge_beta: edge_beta cd ./Standalone && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(NAME) --build-arg VERSION=beta --build-arg BASE=node-edge -t $(NAME)/standalone-edge:beta . +uploader: + cd ./Uploader && docker build $(BUILD_ARGS) --build-arg BASED_TAG=$(RCLONE_BASED_TAG) -t $(NAME)/uploader:$(RCLONE_TAG_VERSION)-$(BUILD_DATE) . + video: cd ./Video && docker build $(BUILD_ARGS) --build-arg NAMESPACE=$(FFMPEG_BASED_NAME) --build-arg BASED_TAG=$(FFMPEG_BASED_TAG) -t $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) . @@ -165,6 +171,7 @@ tag_latest: docker tag $(NAME)/standalone-firefox:$(TAG_VERSION) $(NAME)/standalone-firefox:latest docker tag $(NAME)/standalone-docker:$(TAG_VERSION) $(NAME)/standalone-docker:latest docker tag $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) $(NAME)/video:latest + docker tag $(NAME)/uploader:$(RCLONE_TAG_VERSION)-$(BUILD_DATE) $(NAME)/uploader:latest release_latest: docker push $(NAME)/base:latest @@ -184,6 +191,7 @@ release_latest: docker push $(NAME)/standalone-firefox:latest docker push $(NAME)/standalone-docker:latest docker push $(NAME)/video:latest + docker push $(NAME)/uploader:latest tag_nightly: docker tag $(NAME)/base:$(TAG_VERSION) $(NAME)/base:nightly @@ -203,6 +211,7 @@ tag_nightly: docker tag $(NAME)/standalone-firefox:$(TAG_VERSION) $(NAME)/standalone-firefox:nightly docker tag $(NAME)/standalone-docker:$(TAG_VERSION) $(NAME)/standalone-docker:nightly docker tag $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) $(NAME)/video:nightly + docker tag $(NAME)/uploader:$(RCLONE_TAG_VERSION)-$(BUILD_DATE) $(NAME)/uploader:nightly release_nightly: docker push $(NAME)/base:nightly @@ -222,6 +231,7 @@ release_nightly: docker push $(NAME)/standalone-firefox:nightly docker push $(NAME)/standalone-docker:nightly docker push $(NAME)/video:nightly + docker push $(NAME)/uploader:nightly tag_major_minor: docker tag $(NAME)/base:$(TAG_VERSION) $(NAME)/base:$(MAJOR) @@ -355,6 +365,7 @@ release: tag_major_minor docker push $(NAME)/standalone-firefox:$(MAJOR_MINOR_PATCH) docker push $(NAME)/standalone-docker:$(MAJOR_MINOR_PATCH) docker push $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) + docker push $(NAME)/uploader:$(RCLONE_TAG_VERSION)-$(BUILD_DATE) test: test_chrome \ test_firefox \ @@ -438,19 +449,23 @@ chart_test_template: ./tests/charts/bootstrap.sh chart_test_chrome: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/charts/make/chart_test.sh NodeChrome + VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) UPLOADER_TAG=$(RCLONE_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) \ + ./tests/charts/make/chart_test.sh NodeChrome chart_test_firefox: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/charts/make/chart_test.sh NodeFirefox + VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) UPLOADER_TAG=$(RCLONE_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) \ + ./tests/charts/make/chart_test.sh NodeFirefox chart_test_edge: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/charts/make/chart_test.sh NodeEdge + VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) UPLOADER_TAG=$(RCLONE_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) \ + ./tests/charts/make/chart_test.sh NodeEdge chart_test_parallel_autoscaling_https: SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_PORT=443 make chart_test_parallel_autoscaling chart_test_parallel_autoscaling: - VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/charts/make/chart_test.sh JobAutoscaling + VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) UPLOADER_TAG=$(RCLONE_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) \ + ./tests/charts/make/chart_test.sh JobAutoscaling .PHONY: \ all \ diff --git a/Uploader/Dockerfile b/Uploader/Dockerfile new file mode 100644 index 000000000..c04ebdafb --- /dev/null +++ b/Uploader/Dockerfile @@ -0,0 +1,12 @@ +ARG BASED_TAG +FROM rclone/rclone:${BASED_TAG} + +RUN apk update \ + && apk add --no-cache --update \ + bash \ + curl \ + wget \ + jq \ + && rm -rf /tmp/* /var/cache/apk/* + +USER rclone diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index a11e3bcd5..37ccfb347 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -18,10 +18,13 @@ This chart enables the creation of a Selenium Grid Server in Kubernetes. * [Ingress Configuration](#ingress-configuration) * [Configuration](#configuration) * [Configuration global](#configuration-global) - * [Configuration `global.K8S_PUBLIC_IP`](#configuration-globalk8spublicip) + * [Configuration `global.K8S_PUBLIC_IP`](#configuration-globalk8s_public_ip) * [Configuration of Nodes](#configuration-of-nodes) * [Container ports and Service ports](#container-ports-and-service-ports) * [Probes](#probes) + * [Configuration of video recorder and video uploader](#configuration-of-video-recorder-and-video-uploader) + * [Video recorder](#video-recorder) + * [Video uploader](#video-uploader) * [Configuration of Secure Communication (HTTPS)](#configuration-of-secure-communication-https) * [Secure Communication](#secure-communication) * [Node Registration](#node-registration) @@ -375,6 +378,87 @@ edgeNode: periodSeconds: 5 ``` +### Configuration of video recorder and video uploader + +#### Video recorder + +The video recorder is a sidecar that is deployed with the browser nodes. It is responsible for recording the video of the browser session. The video recorder is disabled by default. To enable it, you need to set the following values: + +```yaml +videoRecorder: + enabled: true +``` + +#### Video uploader + +The uploader is a sidecar that is deployed with the browser nodes. It is responsible for uploading the video to a remote location. The uploader is disabled by default. To enable it, you need to set the following values: + +```yaml +videoRecorder: + uploader: + enabled: true +``` + +By default, the uploader uses [RCLONE](https://rclone.org/) to upload the video to a remote location. RCLONE requires a configuration file to define different remote locations. Refer to [RCLONE docs](https://rclone.org/docs/#config-file) for more details. Config file might contain sensitive information such as access key, secret key, etc. hence it is stored in Secret. + +The uploader requires `destinationPrefix` to be set. It is used to instruct the uploader where to upload the video. The format of destinationPrefix is `remote-name://bucket-name/path`. The `remote-name` is configured in RCLONE. The bucket-name is the name of the bucket in the remote location. The path is the path to the folder in the bucket. + +By default, the config file is loaded from file [configs/uploader/rclone/rclone.conf](configs/uploader/rclone/rclone.conf) to the Secret. You can override the config file via `--set-file videoRecorder.uploader.config=/path/to/config` or set via YAML values. + +For example, to configure an S3 remote hosted on AWS with named `mys3` and the bucket name is `mybucket`, you can set the following values: + +```bash +videoRecorder: + uploader: + destinationPrefix: "mys3://mybucket" + config: | + [mys3] + type = s3 + provider = AWS + env_auth = true + region = ap-southeast-1 + location_constraint = ap-southeast-1 + acl = private + access_key_id = xxx + secret_access_key = xxx +``` + +You can prepare a config file with multiple remotes are defined. Ensure that `[remoteName]` is unique for each remote. +You also can replace your config to default file `configs/uploader/rclone/rclone.conf` in chart. + +Instead of using config file, another way that RCLONE also supports to pass the information via environment variables. ENV variable with format: `RCLONE_CONFIG_ + name of remote + _ + name of config file option` (make it all uppercase). In this case the remote name it can only contain letters, digits, or the _ (underscore) character. All those ENV variables can be set via `videoRecorder.uploader.secrets`, it will be stored in Secret. + +For example, the same above config can be set via ENV vars as below: + +```yaml +videoRecorder: + uploader: + destinationPrefix: "mys3://mybucket" + secrets: + RCLONE_CONFIG_MYS3_TYPE: "s3" + RCLONE_CONFIG_MYS3_PROVIDER: "GCS" + RCLONE_CONFIG_MYS3_ENV_AUTH: "true" + RCLONE_CONFIG_MYS3_REGION: "asia-southeast1" + RCLONE_CONFIG_MYS3_LOCATION_CONSTRAINT: "asia-southeast1" + RCLONE_CONFIG_MYS3_ACL: "private" + RCLONE_CONFIG_MYS3_ACCESS_KEY_ID: "xxx" + RCLONE_CONFIG_MYS3_SECRET_ACCESS_KEY: "xxx" +``` + +Those 2 ways are equivalent. You can choose one of them or combine them together. When both config file and ENV vars are set, value in `rclone.conf` will take precedence. + +Beside the configuration, the script for entry point of uploader container also needed. By default, it is loaded from file [configs/uploader/rclone/entry_point.sh](configs/uploader/rclone/entry_point.sh) to the ConfigMap. You can override the script via `--set-file videoRecorder.uploader.entryPoint=/path/to/script` or set via YAML values. For example: + +```yaml +videoRecorder: + uploader: + entryPoint: | + #!/bin/bash + echo "Your custom script" +``` + +You also can replace your script to default file `configs/uploader/rclone/entry_point.sh` in chart. + ### Configuration of Secure Communication (HTTPS) Selenium Grid supports secure communication between components. Refer to the [instructions](https://github.com/SeleniumHQ/selenium/blob/trunk/java/src/org/openqa/selenium/grid/commands/security.txt) and [options](https://www.selenium.dev/documentation/grid/configuration/cli_options/#server) are able to configure the secure communication. Below is the details on how to enable secure communication in Selenium Grid chart. @@ -620,8 +704,14 @@ This table contains the configuration parameters of the chart and their default | `videoRecorder.imageName` | `video` | Selenium video recorder image name | | `videoRecorder.imageTag` | `ffmpeg-6.1-20231219` | Image tag of video recorder | | `videoRecorder.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | -| `videoRecorder.uploader` | `false` | Name of the uploader to use. The value `false` is used to disable uploader. Supported default `s3` | -| `videoRecorder.uploadDestinationPrefix` | `false` | Destination URL for uploading video file. The value `false` is used to disable the uploading | +| `videoRecorder.uploader.enabled` | `false` | Enable the uploader for videos | +| `videoRecorder.uploader.destinationPrefix` | `` | Destination for uploading video file. It is following `rclone` config | +| `videoRecorder.uploader.name` | `rclone` | Name of the uploader to use. Supported default `rclone` | +| `videoRecorder.uploader.configFileName` | `rclone.conf` | Config file name for `rclone` in uploader container | +| `videoRecorder.uploader.entryPointFileName` | `entry_point.sh` | Script file name for uploader container entry point | +| `videoRecorder.uploader.config` | `` | Set value to uploader config file via YAML or `--set-file` | +| `videoRecorder.uploader.entryPoint` | `` | Set value to uploader entry point via YAML or `--set-file` | +| `videoRecorder.uploader.secrets` | `` | Environment variables to configure the uploader which store in Secret | | `videoRecorder.ports` | `[9000]` | Port list to enable on video recorder container | | `videoRecorder.resources` | `See values.yaml` | Resources for video recorder | | `videoRecorder.extraEnvironmentVariables` | `nil` | Custom environment variables for video recorder | @@ -634,11 +724,10 @@ This table contains the configuration parameters of the chart and their default | `videoRecorder.volume.name.scripts` | `video-scripts` | Name is used to set for the volume to persist and share video recorder scripts in container | | `videoRecorder.extraVolumeMounts` | `[]` | Extra mounts of declared ExtraVolumes into pod | | `videoRecorder.extraVolumes` | `[]` | Extra Volumes declarations to be used in the pod (can be any supported volume type: ConfigMap, Secret, PVC, NFS, etc.) | -| `videoRecorder.s3` | `See values.yaml` | Container spec for the uploader if `videoRecorder.uploader` is `s3`. Similarly, create for your new uploader | -| `videoRecorder.s3.resources` | `See values.yaml` | Resources for video uploader | -| `videoRecorder.s3.extraEnvironmentVariables` | `` | Custom environment variables for video uploader container | -| `videoRecorder.s3.extraEnvFrom` | `` | Custom environment taken from `configMap` or `secret` variables for video uploader | -| `videoRecorder.s3.extraVolumeMounts` | `[]` | Extra mounts of declared ExtraVolumes into pod of video uploader | +| `videoRecorder.rclone` | `See values.yaml` | Container spec for the uploader if `videoRecorder.uploader` is `s3`. Similarly, create for your new uploader | +| `videoRecorder.rclone.resources | `See values.yaml` | Resources for video uploader | +| `videoRecorder.rclone.extraEnvFrom` | `` | Custom environment taken from `configMap` or `secret` variables for video uploader | +| `videoRecorder.rclone.extraVolumeMounts` | `[]` | Extra mounts of declared ExtraVolumes into pod of video uploader | | `customLabels` | `{}` | Custom labels for k8s resources | | `ingress-nginx.enabled` | `false` | Enable the dependency chart Ingress controller for Kubernetes (https://github.com/kubernetes/ingress-nginx) | diff --git a/charts/selenium-grid/configs/video/video.sh b/charts/selenium-grid/configs/recorder/video.sh similarity index 82% rename from charts/selenium-grid/configs/video/video.sh rename to charts/selenium-grid/configs/recorder/video.sh index 921d53399..fb8d8b3ee 100755 --- a/charts/selenium-grid/configs/video/video.sh +++ b/charts/selenium-grid/configs/recorder/video.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash +UPLOAD_ENABLED=${UPLOAD_ENABLED:-"false"} + function create_pipe() { - if [[ "$UPLOAD_DESTINATION_PREFIX" != "false" ]]; + if [[ "${UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]]; then echo "Create pipe if not exists for video upload stream" if [ ! -p ${SE_VIDEO_FOLDER}/uploadpipe ]; @@ -13,7 +15,7 @@ function create_pipe() { create_pipe function wait_util_force_exit_consume() { - if [[ "$UPLOAD_DESTINATION_PREFIX" != "false" ]]; + if [[ "${UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]]; then while [[ -f ${SE_VIDEO_FOLDER}/force_exit ]] do @@ -25,9 +27,9 @@ function wait_util_force_exit_consume() { } function add_exit_signal() { - if [[ "$UPLOAD_DESTINATION_PREFIX" != "false" ]]; + if [[ "${UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]]; then - echo "exit" > ${SE_VIDEO_FOLDER}/uploadpipe & + echo "exit" >> ${SE_VIDEO_FOLDER}/uploadpipe & echo "exit" > ${SE_VIDEO_FOLDER}/force_exit fi } @@ -55,11 +57,6 @@ export DISPLAY=${DISPLAY_CONTAINER_NAME}:${DISPLAY_NUM}.0 max_attempts=600 attempts=0 -if [[ "$UPLOAD_DESTINATION_PREFIX" = "" ]] -then - echo Upload destination not known since UPLOAD_DESTINATION_PREFIX is not set. Exiting video recorder. - exit -fi echo Checking if the display is open until xset b off || [[ $attempts = $max_attempts ]] do @@ -111,11 +108,14 @@ do pkill -INT ffmpeg recorded_count=$((recorded_count+1)) recording_started="false" - if [[ "$UPLOAD_DESTINATION_PREFIX" != "false" ]] + if [[ "${UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]]; then upload_destination=${UPLOAD_DESTINATION_PREFIX}/${video_file_name} echo "Uploading video to $upload_destination" - echo $video_file $upload_destination >> ${SE_VIDEO_FOLDER}/uploadpipe & + echo $video_file ${UPLOAD_DESTINATION_PREFIX} >> ${SE_VIDEO_FOLDER}/uploadpipe & + elif [[ "${UPLOAD_ENABLED}" != "false" ]] && [[ -z "${UPLOAD_DESTINATION_PREFIX}" ]]; + then + echo Upload destination not known since UPLOAD_DESTINATION_PREFIX is not set. Continue without uploading. fi if [ $max_recorded_count -gt 0 ] && [ $recorded_count -ge $max_recorded_count ]; then diff --git a/charts/selenium-grid/configs/uploader/rclone/entry_point.sh b/charts/selenium-grid/configs/uploader/rclone/entry_point.sh new file mode 100644 index 000000000..ce9714bf7 --- /dev/null +++ b/charts/selenium-grid/configs/uploader/rclone/entry_point.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +SE_VIDEO_FOLDER=${SE_VIDEO_FOLDER:-"/videos"} +UPLOAD_CONFIG_DIRECTORY=${UPLOAD_CONFIG_DIRECTORY:-"/opt/bin"} +UPLOAD_CONFIG_FILE_NAME=${UPLOAD_CONFIG_FILE_NAME:-"rclone.conf"} +UPLOAD_COMMAND=${UPLOAD_COMMAND:-"copy"} + +function consume_force_exit() { + rm -f ${SE_VIDEO_FOLDER}/force_exit + echo "Force exit signal consumed" +} +trap consume_force_exit EXIT + +while [ ! -p ${SE_VIDEO_FOLDER}/uploadpipe ]; +do + echo "Waiting for ${SE_VIDEO_FOLDER}/uploadpipe to be created" + sleep 1 +done + +echo "Waiting for video files put into pipe for proceeding to upload" + +while read FILE DESTINATION < ${SE_VIDEO_FOLDER}/uploadpipe +do + if [ "${FILE}" = "exit" ]; + then + exit + else [ "$FILE" != "" ] && [ "$DESTINATION" != "" ]; + echo "Uploading ${FILE} to ${DESTINATION}" + rclone --config ${UPLOAD_CONFIG_DIRECTORY}/${UPLOAD_CONFIG_FILE_NAME} ${UPLOAD_COMMAND} ${UPLOAD_OPTS} "${FILE}" "${DESTINATION}" + fi + if [ -f ${SE_VIDEO_FOLDER}/force_exit ] && [ ! -s ${SE_VIDEO_FOLDER}/uploadpipe ]; + then + exit + fi +done + +consume_force_exit diff --git a/charts/selenium-grid/configs/uploader/rclone/rclone.conf b/charts/selenium-grid/configs/uploader/rclone/rclone.conf new file mode 100644 index 000000000..db0337c13 --- /dev/null +++ b/charts/selenium-grid/configs/uploader/rclone/rclone.conf @@ -0,0 +1,9 @@ +[mys3] +type = s3 +provider = AWS +env_auth = true +region = +location_constraint = +acl = private +access_key_id = +secret_access_key = diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index a5963d86f..e3448d22b 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -446,8 +446,6 @@ template: valueFrom: fieldRef: fieldPath: status.podIP - - name: UPLOAD_DESTINATION_PREFIX - value: {{ .Values.videoRecorder.uploadDestinationPrefix | quote }} {{- with .Values.videoRecorder.extraEnvironmentVariables }} {{- tpl (toYaml .) $ | nindent 8 }} {{- end }} @@ -475,6 +473,9 @@ template: {{- with .Values.videoRecorder.resources }} resources: {{- toYaml . | nindent 10 }} {{- end }} + {{- with .Values.videoRecorder.securityContext }} + securityContext: {{- toYaml . | nindent 10 }} + {{- end }} {{- with .Values.videoRecorder.startupProbe }} startupProbe: {{- toYaml . | nindent 10 }} {{- end }} @@ -484,21 +485,29 @@ template: {{- with .Values.videoRecorder.lifecycle }} lifecycle: {{- toYaml . | nindent 10 }} {{- end }} - {{- if .uploader }} + {{- if .Values.videoRecorder.uploader.enabled }} - name: uploader - image: {{ printf "%s:%s" .uploader.imageName .uploader.imageTag }} + {{- $imageTag := default .Values.global.seleniumGrid.uploaderImageTag .uploader.imageTag }} + {{- $imageRegistry := default .Values.global.seleniumGrid.imageRegistry .uploader.imageRegistry }} + image: {{ printf "%s/%s:%s" $imageRegistry .uploader.imageName $imageTag }} imagePullPolicy: {{ .uploader.imagePullPolicy }} - {{- with .uploader.command }} - command: {{- tpl (toYaml .) $ | nindent 8 }} + {{- if .uploader.command }} + command: {{- tpl (toYaml .uploader.command) $ | nindent 8 }} + {{- else }} + command: ["/bin/sh"] {{- end }} - {{- with .uploader.args }} - args: {{- tpl (toYaml .) $ | nindent 8 }} + {{- if .uploader.args }} + args: {{- tpl (toYaml .uploader.args) $ | nindent 8 }} + {{- else }} + args: ["-c", "{{ $.Values.videoRecorder.uploader.scriptMountPath }}/{{ $.Values.videoRecorder.uploader.entryPointFileName }}"] {{- end }} {{- with .uploader.extraEnvironmentVariables }} env: {{- tpl (toYaml .) $ | nindent 8 }} {{- end }} - {{- with .uploader.extraEnvFrom }} envFrom: + - secretRef: + name: {{ include "seleniumGrid.common.secrets" $ | quote }} + {{- with .uploader.extraEnvFrom }} {{- tpl (toYaml .) $ | nindent 10 }} {{- end }} volumeMounts: @@ -582,12 +591,12 @@ Get the url of the grid. If the external url can be figured out from the ingress {{- define "seleniumGrid.url.host" -}} {{- $host := printf "%s.%s" (include ($.Values.isolateComponents | ternary "seleniumGrid.router.fullname" "seleniumGrid.hub.fullname") $ ) (.Release.Namespace) -}} {{- if .Values.ingress.enabled -}} - {{- if and ( empty .Values.ingress.hostname) (not (empty .Values.global.K8S_PUBLIC_IP)) -}} + {{- if and (not .Values.ingress.hostname) .Values.global.K8S_PUBLIC_IP -}} {{- $host = .Values.global.K8S_PUBLIC_IP -}} {{- else if and .Values.ingress.hostname (ne .Values.ingress.hostname "selenium-grid.local") -}} {{- $host = .Values.ingress.hostname -}} {{- end -}} -{{- else if not (empty .Values.global.K8S_PUBLIC_IP) -}} +{{- else if .Values.global.K8S_PUBLIC_IP -}} {{- $host = .Values.global.K8S_PUBLIC_IP -}} {{- end -}} {{- $host }} @@ -658,7 +667,7 @@ Get the lifecycle of the pod is used for a Node to deregister from the Hub/Route {{- define "seleniumGrid.node.lifecycle" }} {{- $defaultDeregisterLifecycle := tpl (include "seleniumGrid.node.deregisterLifecycle" .) $ -}} {{- $lifecycle := toYaml (dict) -}} -{{- if and (and (eq .Values.autoscaling.scalingType "deployment") (eq (include "seleniumGrid.useKEDA" .) "true")) (empty .node.deregisterLifecycle) -}} +{{- if and (and (eq .Values.autoscaling.scalingType "deployment") (eq (include "seleniumGrid.useKEDA" .) "true")) (not .node.deregisterLifecycle) -}} {{- $lifecycle = merge ($lifecycle | fromYaml) (tpl (toYaml (default ($defaultDeregisterLifecycle | fromYaml) .Values.autoscaling.deregisterLifecycle)) $ | fromYaml) | toYaml -}} {{- else -}} {{- if eq (.node.deregisterLifecycle | toString | lower) "false" -}} @@ -667,7 +676,7 @@ Get the lifecycle of the pod is used for a Node to deregister from the Hub/Route {{- $lifecycle = (tpl (toYaml (default ($defaultDeregisterLifecycle | fromYaml) .node.deregisterLifecycle) ) $ | fromYaml) | toYaml -}} {{- end -}} {{- end -}} -{{- if not (empty .node.lifecycle) -}} +{{- if not .node.lifecycle -}} {{- $lifecycle = mergeOverwrite ($lifecycle | fromYaml) (tpl (toYaml .node.lifecycle) $ | fromYaml) | toYaml -}} {{- end -}} {{ if and $lifecycle (ne $lifecycle "{}") -}} @@ -705,7 +714,7 @@ Default specs of VolumeMounts and Volumes for video recorder {{- define "seleniumGrid.video.volumeMounts.default" -}} {{- $root := . -}} -{{- range $path, $bytes := .Files.Glob "configs/video/*" }} +{{- range $path, $bytes := .Files.Glob "configs/recorder/*.sh" }} - name: {{ include "seleniumGrid.video.volume.name.scripts" $ }} mountPath: /opt/bin/{{ base $path }} subPath: {{ base $path }} @@ -719,15 +728,23 @@ Default specs of VolumeMounts and Volumes for video recorder configMap: name: {{ template "seleniumGrid.video.fullname" . }} defaultMode: 0500 +- name: {{ template "seleniumGrid.common.secrets" . }} + secret: + secretName: {{ template "seleniumGrid.common.secrets" . }} - name: {{ include "seleniumGrid.video.volume.name.folder" . }} emptyDir: {} {{- end -}} {{- define "seleniumGrid.video.uploader.volumeMounts.default" -}} {{- $root := . -}} -{{- range $path, $bytes := .Files.Glob (printf "configs/uploader/%s/*" $.Values.videoRecorder.uploader) }} +{{- range $path, $bytes := .Files.Glob (printf "configs/uploader/%s/*.sh" $.Values.videoRecorder.uploader.name) }} - name: {{ include "seleniumGrid.video.volume.name.scripts" $ }} - mountPath: /opt/bin/{{ base $path }} + mountPath: {{ $.Values.videoRecorder.uploader.scriptMountPath }}/{{ base $path }} + subPath: {{ base $path }} +{{- end }} +{{- range $path, $bytes := .Files.Glob (printf "configs/uploader/%s/*.conf" $.Values.videoRecorder.uploader.name) }} +- name: {{ include "seleniumGrid.common.secrets" $ }} + mountPath: {{ $.Values.videoRecorder.uploader.scriptMountPath }}/{{ base $path }} subPath: {{ base $path }} {{- end }} - name: {{ include "seleniumGrid.video.volume.name.folder" . }} @@ -744,7 +761,7 @@ Default specs of VolumeMounts and Volumes for video recorder {{- end -}} {{- $defaultVolumeMounts := (include "seleniumGrid.video.volumeMounts.default" . | toString | fromYamlArray ) -}} {{- $videoVolumeMounts = include "utils.appendDefaultIfNotExist" (dict "currentArray" $videoVolumeMounts "defaultArray" $defaultVolumeMounts "uniqueKey" "mountPath") -}} -{{- not (empty $videoVolumeMounts) | ternary $videoVolumeMounts "" -}} +{{- not $videoVolumeMounts | ternary $videoVolumeMounts "" -}} {{- end -}} {{/* Combine videoRecorder.uploader.extraVolumeMounts with the default ones for container video uploader */}} @@ -757,7 +774,7 @@ Default specs of VolumeMounts and Volumes for video recorder {{- end }} {{- $defaultVolumeMounts := (include "seleniumGrid.video.uploader.volumeMounts.default" . | toString | fromYamlArray ) -}} {{- $videoUploaderVolumeMounts = include "utils.appendDefaultIfNotExist" (dict "currentArray" $videoUploaderVolumeMounts "defaultArray" $defaultVolumeMounts "uniqueKey" "mountPath") -}} -{{- not (empty $videoUploaderVolumeMounts) | ternary $videoUploaderVolumeMounts "" -}} +{{- not $videoUploaderVolumeMounts | ternary $videoUploaderVolumeMounts "" -}} {{- end -}} {{/* Combine videoRecorder.extraVolumes with the default ones for the node pod */}} @@ -770,7 +787,7 @@ Default specs of VolumeMounts and Volumes for video recorder {{- end -}} {{- $defaultVolumes := (include "seleniumGrid.video.volumes.default" . | toString | fromYamlArray ) -}} {{- $videoVolumes = include "utils.appendDefaultIfNotExist" (dict "currentArray" $videoVolumes "defaultArray" $defaultVolumes "uniqueKey" "name") -}} -{{- not (empty $videoVolumes) | ternary $videoVolumes "" -}} +{{- not $videoVolumes | ternary $videoVolumes "" -}} {{- end -}} {{/* diff --git a/charts/selenium-grid/templates/chrome-node-deployment.yaml b/charts/selenium-grid/templates/chrome-node-deployment.yaml index e3bf3f1d2..e826d3fbe 100644 --- a/charts/selenium-grid/templates/chrome-node-deployment.yaml +++ b/charts/selenium-grid/templates/chrome-node-deployment.yaml @@ -25,6 +25,6 @@ spec: {{- $podScope := deepCopy . -}} {{- $_ := set $podScope "name" (include "seleniumGrid.chromeNode.fullname" .) -}} {{- $_ = set $podScope "node" .Values.chromeNode -}} -{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}} +{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader.name | toString)) -}} {{- include "seleniumGrid.podTemplate" $podScope | nindent 2 }} {{- end }} diff --git a/charts/selenium-grid/templates/chrome-node-scaledjobs.yaml b/charts/selenium-grid/templates/chrome-node-scaledjobs.yaml index 0b0d34443..5654cd5a0 100644 --- a/charts/selenium-grid/templates/chrome-node-scaledjobs.yaml +++ b/charts/selenium-grid/templates/chrome-node-scaledjobs.yaml @@ -22,7 +22,7 @@ spec: {{- $podScope := deepCopy . -}} {{- $_ := set $podScope "name" (include "seleniumGrid.chromeNode.fullname" .) -}} {{- $_ = set $podScope "node" .Values.chromeNode -}} - {{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}} + {{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader.name | toString)) -}} {{- $_ = set $podScope "podTemplate" (include "seleniumGrid.podTemplate" $podScope | fromYaml) }} {{- include "seleniumGrid.autoscalingTemplate" $podScope | nindent 2 }} {{- end }} diff --git a/charts/selenium-grid/templates/edge-node-deployment.yaml b/charts/selenium-grid/templates/edge-node-deployment.yaml index 9802239e8..a518fd678 100644 --- a/charts/selenium-grid/templates/edge-node-deployment.yaml +++ b/charts/selenium-grid/templates/edge-node-deployment.yaml @@ -25,6 +25,6 @@ spec: {{- $podScope := deepCopy . -}} {{- $_ := set $podScope "name" (include "seleniumGrid.edgeNode.fullname" .) -}} {{- $_ = set $podScope "node" .Values.edgeNode -}} -{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}} +{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader.name | toString)) -}} {{- include "seleniumGrid.podTemplate" $podScope | nindent 2 }} {{- end }} diff --git a/charts/selenium-grid/templates/edge-node-scaledjob.yaml b/charts/selenium-grid/templates/edge-node-scaledjob.yaml index 132792c79..4a0e4fc51 100644 --- a/charts/selenium-grid/templates/edge-node-scaledjob.yaml +++ b/charts/selenium-grid/templates/edge-node-scaledjob.yaml @@ -22,7 +22,7 @@ spec: {{- $podScope := deepCopy . -}} {{- $_ := set $podScope "name" (include "seleniumGrid.edgeNode.fullname" .) -}} {{- $_ = set $podScope "node" .Values.edgeNode -}} - {{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}} + {{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader.name | toString)) -}} {{- $_ = set $podScope "podTemplate" (include "seleniumGrid.podTemplate" $podScope | fromYaml) }} {{- include "seleniumGrid.autoscalingTemplate" $podScope | nindent 2 }} {{- end }} diff --git a/charts/selenium-grid/templates/firefox-node-deployment.yaml b/charts/selenium-grid/templates/firefox-node-deployment.yaml index 5a1e96b55..f94bd052c 100644 --- a/charts/selenium-grid/templates/firefox-node-deployment.yaml +++ b/charts/selenium-grid/templates/firefox-node-deployment.yaml @@ -25,6 +25,6 @@ spec: {{- $podScope := deepCopy . -}} {{- $_ := set $podScope "name" (include "seleniumGrid.firefoxNode.fullname" .) -}} {{- $_ = set $podScope "node" .Values.firefoxNode -}} -{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}} +{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader.name | toString)) -}} {{- include "seleniumGrid.podTemplate" $podScope | nindent 2 }} {{- end }} diff --git a/charts/selenium-grid/templates/firefox-node-scaledjob.yaml b/charts/selenium-grid/templates/firefox-node-scaledjob.yaml index e7992c1fc..732ec8c9b 100644 --- a/charts/selenium-grid/templates/firefox-node-scaledjob.yaml +++ b/charts/selenium-grid/templates/firefox-node-scaledjob.yaml @@ -22,7 +22,7 @@ spec: {{- $podScope := deepCopy . -}} {{- $_ := set $podScope "name" (include "seleniumGrid.firefoxNode.fullname" .) -}} {{- $_ = set $podScope "node" .Values.firefoxNode -}} - {{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}} + {{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader.name | toString)) -}} {{- $_ = set $podScope "podTemplate" (include "seleniumGrid.podTemplate" $podScope | fromYaml) }} {{- include "seleniumGrid.autoscalingTemplate" $podScope | nindent 2 }} {{- end }} diff --git a/charts/selenium-grid/templates/node-configmap.yaml b/charts/selenium-grid/templates/node-configmap.yaml index 6f8062d17..dbb460026 100644 --- a/charts/selenium-grid/templates/node-configmap.yaml +++ b/charts/selenium-grid/templates/node-configmap.yaml @@ -14,4 +14,8 @@ metadata: data: SE_DRAIN_AFTER_SESSION_COUNT: '{{- and (eq (include "seleniumGrid.useKEDA" .) "true") (eq .Values.autoscaling.scalingType "job") | ternary "1" "0" -}}' SE_NODE_GRID_URL: '{{ include "seleniumGrid.url" .}}' + UPLOAD_ENABLED: '{{ .Values.videoRecorder.uploader.enabled }}' + UPLOAD_DESTINATION_PREFIX: '{{ .Values.videoRecorder.uploader.destinationPrefix }}' + UPLOAD_CONFIG_FILE_NAME: '{{ .Values.videoRecorder.uploader.configFileName }}' + UPLOAD_CONFIG_DIRECTORY: '{{ .Values.videoRecorder.uploader.scriptMountPath }}' {{ (.Files.Glob "configs/node/*").AsConfig | indent 2 }} diff --git a/charts/selenium-grid/templates/secrets.yaml b/charts/selenium-grid/templates/secrets.yaml index 06881d15a..932217efc 100644 --- a/charts/selenium-grid/templates/secrets.yaml +++ b/charts/selenium-grid/templates/secrets.yaml @@ -30,4 +30,16 @@ data: {{- if (include "seleniumGrid.tls.registrationSecret.enabled" $) }} SE_REGISTRATION_SECRET: {{ .Values.tls.registrationSecret.value | b64enc }} {{- end }} +{{- if .Values.videoRecorder.uploader.secrets }} +{{- range $name, $value := .Values.videoRecorder.uploader.secrets }} +{{- if not (empty $value) }} + {{ $name }}: {{ tpl ($value) $ | b64enc }} +{{- end }} +{{- end }} +{{- end }} +{{- if and .Values.videoRecorder.uploader.enabled .Values.videoRecorder.uploader.config }} + {{ .Values.videoRecorder.uploader.configFileName }}: {{ .Values.videoRecorder.uploader.config | b64enc }} +{{- else if and .Values.videoRecorder.uploader.enabled (not .Values.videoRecorder.uploader.config) }} +{{ (.Files.Glob (printf "configs/uploader/%s/*.conf" $.Values.videoRecorder.uploader.name)).AsSecrets | indent 2 }} +{{- end }} {{- end }} diff --git a/charts/selenium-grid/templates/video-cm.yaml b/charts/selenium-grid/templates/video-cm.yaml index 34eb24f05..7176dd15d 100644 --- a/charts/selenium-grid/templates/video-cm.yaml +++ b/charts/selenium-grid/templates/video-cm.yaml @@ -4,8 +4,11 @@ kind: ConfigMap metadata: name: {{ template "seleniumGrid.video.fullname" . }} data: -{{ (.Files.Glob "configs/video/*").AsConfig | indent 2 }} -{{- if and $.Values.videoRecorder.uploadDestinationPrefix $.Values.videoRecorder.uploader }} -{{ (.Files.Glob (printf "configs/uploader/%s/*" $.Values.videoRecorder.uploader)).AsConfig | indent 2 }} +{{ (.Files.Glob "configs/recorder/*").AsConfig | indent 2 }} +{{- if and .Values.videoRecorder.uploader.enabled .Values.videoRecorder.uploader.entryPoint }} +{{ .Values.videoRecorder.uploader.entryPointFileName | indent 2 -}}: | +{{ .Values.videoRecorder.uploader.entryPoint | indent 4 }} +{{- else if and .Values.videoRecorder.uploader.enabled (not .Values.videoRecorder.uploader.entryPoint) }} +{{ (.Files.Glob (printf "configs/uploader/%s/*.sh" $.Values.videoRecorder.uploader.name)).AsConfig | indent 2 }} {{- end }} {{- end }} diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index 79f3eff62..864fee8a3 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -12,6 +12,8 @@ global: nodesImageTag: 4.16.1-20231219 # Image tag for browser's video recorder videoImageTag: ffmpeg-6.1-20231219 + # Image tag for browser's uploader + uploaderImageTag: rclone-1.65-20231219 # Pull secret for all components, can be overridden individually imagePullSecret: "" # Log level for all components. Possible values describe here: https://www.selenium.dev/documentation/grid/configuration/cli_options/#logging @@ -985,13 +987,39 @@ videoRecorder: # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) - - # What uploader to use. See .videRecorder.s3 for how to create a new one. - # uploader: s3 - uploader: false - # Where to upload the video file. Should be set to something like 's3://myvideobucket/' - uploadDestinationPrefix: false - + uploader: + enabled: false + # Where to upload the video file e.g. remoteName://bucketName/path. Refer to destination syntax of rclone https://rclone.org/docs/ + destinationPrefix: + # What uploader to use. See .videRecorder.rclone for how to create a new one. + name: "rclone" + configFileName: "rclone.conf" + entryPointFileName: "entry_point.sh" + scriptMountPath: "/opt/bin" + # Config file for rclone. + config: + # Script to control the upload process. + entryPoint: + # For environment variables used in uploader which contains sensitive information, store in secret and refer envFrom + # Set config for rclone via ENV var with format: RCLONE_CONFIG_ + name of remote + _ + name of config file option (make it all uppercase) + secrets: + # RCLONE_CONFIG_S3_TYPE: "s3" + # RCLONE_CONFIG_S3_PROVIDER: "AWS" + # RCLONE_CONFIG_S3_ENV_AUTH: "true" + # RCLONE_CONFIG_S3_REGION: "ap-southeast-1" + # RCLONE_CONFIG_S3_LOCATION_CONSTRAINT: "ap-southeast-1" + # RCLONE_CONFIG_S3_ACL: "private" + # RCLONE_CONFIG_S3_ACCESS_KEY_ID: "xxx" + # RCLONE_CONFIG_S3_SECRET_ACCESS_KEY: "xxx" + # RCLONE_CONFIG_GS_TYPE: "s3" + # RCLONE_CONFIG_GS_PROVIDER: "GCS" + # RCLONE_CONFIG_GS_ENV_AUTH: "true" + # RCLONE_CONFIG_GS_REGION: "asia-southeast1" + # RCLONE_CONFIG_GS_LOCATION_CONSTRAINT: "asia-southeast1" + # RCLONE_CONFIG_GS_ACL: "private" + # RCLONE_CONFIG_GS_ACCESS_KEY_ID: "xxx" + # RCLONE_CONFIG_GS_SECRET_ACCESS_KEY: "xxx" + # RCLONE_CONFIG_GS_ENDPOINT: "https://storage.googleapis.com" ports: - 9000 resources: @@ -1001,6 +1029,9 @@ videoRecorder: limits: memory: "1Gi" cpu: "1" + # SecurityContext for recorder container + securityContext: + runAsUser: 0 extraEnvironmentVariables: # - name: SE_VIDEO_FOLDER # value: /videos @@ -1049,15 +1080,34 @@ videoRecorder: # persistentVolumeClaim: # claimName: video-pv-claim - # Container spec for the uploader if above it is defined as "uploader: s3" + # Container spec for the uploader if above it is defined as "uploader.name: rclone" + rclone: + # imageRegistry: selenium + imageName: uploader + # imageTag: "rclone-1.65-20240119" + imagePullPolicy: IfNotPresent + # SecurityContext for uploader container + securityContext: + runAsUser: 0 + command: [] + args: [] + extraEnvironmentVariables: + # Extra options for rclone. Refer to https://rclone.org/flags + - name: UPLOAD_OPTS + value: "--progress" + # - name: UPLOAD_COMMAND + # value: "copy" + + # Container spec for the uploader if above it is defined as "uploader.name: s3" s3: - imageName: public.ecr.aws/bitnami/aws-cli - imageTag: "2" + imageRegistry: public.ecr.aws + imageName: bitnami/aws-cli + imageTag: latest imagePullPolicy: IfNotPresent securityContext: runAsUser: 0 - command: ["/bin/sh"] - args: ["-c", "/opt/bin/entry_point.sh"] + command: [] + args: [] extraEnvironmentVariables: # - name: AWS_ACCESS_KEY_ID # value: aws_access_key_id diff --git a/generate_release_notes.sh b/generate_release_notes.sh index 85f15cc55..caf8f315f 100755 --- a/generate_release_notes.sh +++ b/generate_release_notes.sh @@ -19,6 +19,7 @@ EDGEDRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-edge:${TAG_VERSION} msedg FIREFOX_VERSION=$(docker run --rm ${NAMESPACE}/node-firefox:${TAG_VERSION} firefox --version | awk '{print $3}') GECKODRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-firefox:${TAG_VERSION} geckodriver --version | awk 'NR==1{print $2}') FFMPEG_VERSION=$(docker run --entrypoint="" --rm ${NAMESPACE}/video:ffmpeg-6.1-${BUILD_DATE} ffmpeg -version | awk '{print $3}' | head -n 1) +RCLONE_VERSION=$(docker run --entrypoint="" --rm ${NAMESPACE}/uploader:rclone-1.65-${BUILD_DATE} rclone version | head -n 1 | awk '{print $2}') echo "" >> release_notes.md @@ -31,6 +32,7 @@ echo "* EdgeDriver: ${EDGEDRIVER_VERSION}" >> release_notes.md echo "* Firefox: ${FIREFOX_VERSION}" >> release_notes.md echo "* GeckoDriver: ${GECKODRIVER_VERSION}" >> release_notes.md echo "* ffmpeg: ${FFMPEG_VERSION}" >> release_notes.md +echo "* rclone: ${RCLONE_VERSION}" >> release_notes.md echo "" >> release_notes.md echo "### Published Docker images" >> release_notes.md diff --git a/tests/SeleniumTests/__init__.py b/tests/SeleniumTests/__init__.py index 3c94792b7..f4eb967d9 100644 --- a/tests/SeleniumTests/__init__.py +++ b/tests/SeleniumTests/__init__.py @@ -25,8 +25,13 @@ def test_title(self): def test_with_frames(self): driver = self.driver driver.get('http://the-internet.herokuapp.com/nested_frames') - driver.switch_to.frame('frame-top') - driver.switch_to.frame('frame-middle') + wait = WebDriverWait(driver, WEB_DRIVER_WAIT_TIMEOUT) + frame_top = wait.until( + EC.frame_to_be_available_and_switch_to_it('frame-top') + ) + frame_middle = wait.until( + EC.frame_to_be_available_and_switch_to_it('frame-middle') + ) self.assertTrue(driver.find_element(By.ID, 'content').text == "MIDDLE", "content should be MIDDLE") # https://github.com/tourdedave/elemental-selenium-tips/blob/master/05-select-from-a-dropdown/python/dropdown.py @@ -140,11 +145,11 @@ def run(self, test_classes): try: result = future.result() if not result.wasSuccessful(): - raise Exception("Test failed") + raise Exception(f"Test {str(test)} failed") except Exception as e: - print(f"Test {str(test)} failed with exception: {str(e)}") + print(f"{str(test)} failed with exception: {str(e)}") print(traceback.format_exc()) - raise Exception("Parallel tests failed") + raise Exception(f"Parallel tests failed: {str(test)} failed with exception: {str(e)}") class JobAutoscalingTests(unittest.TestCase): def test_parallel_autoscaling(self): diff --git a/tests/charts/make/chart_test.sh b/tests/charts/make/chart_test.sh index 617d3ef6e..7c1984859 100755 --- a/tests/charts/make/chart_test.sh +++ b/tests/charts/make/chart_test.sh @@ -23,6 +23,8 @@ WEB_DRIVER_WAIT_TIMEOUT=${WEB_DRIVER_WAIT_TIMEOUT:-120} SKIP_CLEANUP=${SKIP_CLEANUP:-"false"} # For debugging purposes, retain the cluster after the test run CHART_CERT_PATH=${CHART_CERT_PATH:-"${CHART_PATH}/certs/selenium.pem"} SSL_CERT_DIR=${SSL_CERT_DIR:-"/etc/ssl/certs"} +VIDEO_TAG=${VIDEO_TAG:-"latest"} +UPLOADER_TAG=${UPLOADER_TAG:-"latest"} cleanup() { if [ "${SKIP_CLEANUP}" = "false" ]; then @@ -63,12 +65,15 @@ HELM_COMMAND_ARGS="${RELEASE_NAME} \ ${HELM_COMMAND_SET_AUTOSCALING} \ ${HELM_COMMAND_SET_TLS} \ --values ${TEST_VALUES_PATH}/${MATRIX_BROWSER}-values.yaml \ ---set global.seleniumGrid.imageTag=${VERSION} --set global.seleniumGrid.imageRegistry=${NAMESPACE} \ +--set global.seleniumGrid.imageRegistry=${NAMESPACE} \ +--set global.seleniumGrid.imageTag=${VERSION} \ --set global.seleniumGrid.nodesImageTag=${VERSION} \ +--set global.seleniumGrid.videoImageTag=${VIDEO_TAG} \ +--set global.seleniumGrid.uploaderImageTag=${UPLOADER_TAG} \ ${CHART_PATH} --namespace ${SELENIUM_NAMESPACE} --create-namespace" echo "Render manifests YAML for this deployment" -helm template ${HELM_COMMAND_ARGS} > tests/tests/cluster_deployment_manifests_${MATRIX_BROWSER}.yaml +helm template --debug ${HELM_COMMAND_ARGS} > tests/tests/cluster_deployment_manifests_${MATRIX_BROWSER}.yaml echo "Deploy Selenium Grid Chart" helm upgrade --install ${HELM_COMMAND_ARGS} diff --git a/tests/charts/templates/render/dummy.yaml b/tests/charts/templates/render/dummy.yaml index c22418d88..1e8411c6a 100644 --- a/tests/charts/templates/render/dummy.yaml +++ b/tests/charts/templates/render/dummy.yaml @@ -81,13 +81,15 @@ edgeNode: videoRecorder: enabled: true - uploader: s3 - uploadDestinationPrefix: "s3://ndviet" - s3: - extraEnvironmentVariables: - - name: AWS_ACCESS_KEY_ID - value: "xxxx" - - name: AWS_SECRET_ACCESS_KEY - value: "xxxx" - - name: AWS_REGION - value: "ap-southeast-1" + uploader: + enabled: true + destinationPrefix: "s3://ndviet" + secrets: + RCLONE_CONFIG_S3_TYPE: "s3" + RCLONE_CONFIG_S3_PROVIDER: "AWS" + RCLONE_CONFIG_S3_ENV_AUTH: "true" + RCLONE_CONFIG_S3_REGION: "ap-southeast-1" + RCLONE_CONFIG_S3_LOCATION_CONSTRAINT: "ap-southeast-1" + RCLONE_CONFIG_S3_ACL: "private" + RCLONE_CONFIG_S3_ACCESS_KEY_ID: "xxx" + RCLONE_CONFIG_S3_SECRET_ACCESS_KEY: "xxx" From e65da8371b36b5dcc8155353e6f65bda83629920 Mon Sep 17 00:00:00 2001 From: Amar Deep Singh <50517840+amardeep2006@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:11:25 +0530 Subject: [PATCH 48/62] feat(autoupgrade): auto upgrade os packages in rclone Uploader image (#2101) feat(autoupgrade): auto upgrade os packages --- Uploader/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Uploader/Dockerfile b/Uploader/Dockerfile index c04ebdafb..5bf8598e7 100644 --- a/Uploader/Dockerfile +++ b/Uploader/Dockerfile @@ -1,7 +1,7 @@ ARG BASED_TAG FROM rclone/rclone:${BASED_TAG} -RUN apk update \ +RUN apk update && apk upgrade \ && apk add --no-cache --update \ bash \ curl \ From 26c4f3e54534ed38f4134b56332259dd18c6882b Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Sun, 21 Jan 2024 17:26:09 +0530 Subject: [PATCH 49/62] [build]: Correct video and uploader image tag in chart Signed-off-by: Viet Nguyen Duc --- Makefile | 2 +- generate_release_notes.sh | 6 ++++-- update_tag_in_docs_and_files.sh | 10 ++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6aa26ae82..49e2986bd 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ FFMPEG_TAG_VERSION := $(or $(FFMPEG_TAG_VERSION),$(FFMPEG_TAG_VERSION),ffmpeg-6. FFMPEG_BASED_NAME := $(or $(FFMPEG_BASED_NAME),$(FFMPEG_BASED_NAME),ndviet) FFMPEG_BASED_TAG := $(or $(FFMPEG_BASED_TAG),$(FFMPEG_BASED_TAG),6.1-ubuntu2204) RCLONE_BASED_TAG := $(or $(RCLONE_BASED_TAG),$(RCLONE_BASED_TAG),1.65) -RCLONE_TAG_VERSION := $(or $(RCLONE_TAG_VERSION),$(RCLONE_TAG_VERSION),rclone-$(RCLONE_BASED_TAG)) +RCLONE_TAG_VERSION := $(or $(RCLONE_TAG_VERSION),$(RCLONE_TAG_VERSION),rclone-1.65) all: hub \ distributor \ diff --git a/generate_release_notes.sh b/generate_release_notes.sh index caf8f315f..f3fe9b954 100755 --- a/generate_release_notes.sh +++ b/generate_release_notes.sh @@ -5,6 +5,8 @@ HEAD_BRANCH=$2 GRID_VERSION=$3 BUILD_DATE=$4 NAMESPACE=${NAME:-selenium} +FFMPEG_TAG_VERSION=$(grep FFMPEG_TAG_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1) +RCLONE_TAG_VERSION=$(grep RCLONE_TAG_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1) TAG_VERSION=${GRID_VERSION}-${BUILD_DATE} @@ -18,8 +20,8 @@ CHROMEDRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-chrome:${TAG_VERSION} c EDGEDRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-edge:${TAG_VERSION} msedgedriver --version | awk '{print $4}') FIREFOX_VERSION=$(docker run --rm ${NAMESPACE}/node-firefox:${TAG_VERSION} firefox --version | awk '{print $3}') GECKODRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-firefox:${TAG_VERSION} geckodriver --version | awk 'NR==1{print $2}') -FFMPEG_VERSION=$(docker run --entrypoint="" --rm ${NAMESPACE}/video:ffmpeg-6.1-${BUILD_DATE} ffmpeg -version | awk '{print $3}' | head -n 1) -RCLONE_VERSION=$(docker run --entrypoint="" --rm ${NAMESPACE}/uploader:rclone-1.65-${BUILD_DATE} rclone version | head -n 1 | awk '{print $2}') +FFMPEG_VERSION=$(docker run --entrypoint="" --rm ${NAMESPACE}/video:${FFMPEG_TAG_VERSION}-${BUILD_DATE} ffmpeg -version | awk '{print $3}' | head -n 1) +RCLONE_VERSION=$(docker run --entrypoint="" --rm ${NAMESPACE}/uploader:${RCLONE_TAG_VERSION}-${BUILD_DATE} rclone version | head -n 1 | awk '{print $2}') echo "" >> release_notes.md diff --git a/update_tag_in_docs_and_files.sh b/update_tag_in_docs_and_files.sh index 11da34f95..745feb371 100755 --- a/update_tag_in_docs_and_files.sh +++ b/update_tag_in_docs_and_files.sh @@ -5,6 +5,8 @@ NEXT_TAG=$2 LATEST_DATE=$(echo ${LATEST_TAG} | sed 's/.*-//') NEXT_DATE=$(echo ${NEXT_TAG} | sed 's/.*-//') latest_chart_app_version=$(find . \( -type d -name .git -prune \) -o -type f -name 'Chart.yaml' -print0 | xargs -0 cat | grep ^appVersion | cut -d ':' -f 2 | tr -d '[:space:]') +FFMPEG_TAG_VERSION=$(grep FFMPEG_TAG_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1) +RCLONE_TAG_VERSION=$(grep RCLONE_TAG_VERSION Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1) echo -e "\033[0;32m Updating tag displayed in docs and files...\033[0m" echo -e "\033[0;32m LATEST_TAG -> ${LATEST_TAG}\033[0m" @@ -13,6 +15,14 @@ echo -e "\033[0;32m NEXT_TAG -> ${NEXT_TAG}\033[0m" # If you want to test this locally and you are using macOS, do `brew install gnu-sed` and change `sed` for `gsed`. find . \( -type d -name .git -prune \) -o -type f ! -name 'CHANGELOG.md' -print0 | xargs -0 sed -i "s/${LATEST_TAG}/${NEXT_TAG}/g" +if [[ "$NEXT_TAG" == "latest" ]] || [[ "$NEXT_TAG" == "nightly" ]]; then + # If you want to test this locally and you are using macOS, do `brew install gnu-sed` and change `sed` for `gsed`. + FFMPEG_LATEST_TAG=${FFMPEG_TAG_VERSION}-${LATEST_DATE} + RCLONE_LATEST_TAG=${RCLONE_TAG_VERSION}-${LATEST_DATE} + find . \( -type d -name .git -prune \) -o -type f ! -name 'CHANGELOG.md' -print0 | xargs -0 sed -i "s/${FFMPEG_LATEST_TAG}/${NEXT_TAG}/g" + find . \( -type d -name .git -prune \) -o -type f ! -name 'CHANGELOG.md' -print0 | xargs -0 sed -i "s/${RCLONE_LATEST_TAG}/${NEXT_TAG}/g" +fi + echo -e "\033[0;32m Updating date used in some docs and files...\033[0m" echo -e "\033[0;32m LATEST_DATE -> ${LATEST_DATE}\033[0m" echo -e "\033[0;32m NEXT_DATE -> ${NEXT_DATE}\033[0m" From 7485f7fce5125c80aef367fb64f0456319cf0b5b Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Mon, 22 Jan 2024 13:24:04 +0700 Subject: [PATCH 50/62] feat(chart): Bump dependency charts KEDA and Ingress-NGINX version (#2103) Bump dependency charts KEDA and Ingress-NGINX version Signed-off-by: Viet Nguyen Duc --- charts/selenium-grid/Chart.yaml | 4 ++-- tests/charts/make/chart_test.sh | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/charts/selenium-grid/Chart.yaml b/charts/selenium-grid/Chart.yaml index 63dad9e7b..16f1a7041 100644 --- a/charts/selenium-grid/Chart.yaml +++ b/charts/selenium-grid/Chart.yaml @@ -7,11 +7,11 @@ appVersion: 4.16.1-20231219 icon: https://github.com/SeleniumHQ/docker-selenium/raw/trunk/logo.png dependencies: - repository: https://kedacore.github.io/charts - version: 2.12.1 + version: 2.13.0 name: keda condition: autoscaling.enabled - repository: https://kubernetes.github.io/ingress-nginx - version: 4.8.3 + version: 4.9.0 name: ingress-nginx condition: ingress-nginx.enabled maintainers: diff --git a/tests/charts/make/chart_test.sh b/tests/charts/make/chart_test.sh index 7c1984859..dd95d81f7 100755 --- a/tests/charts/make/chart_test.sh +++ b/tests/charts/make/chart_test.sh @@ -19,6 +19,7 @@ SELENIUM_GRID_AUTOSCALING=${2:-"true"} SELENIUM_GRID_AUTOSCALING_MIN_REPLICA=${3:-"0"} WAIT_TIMEOUT=${WAIT_TIMEOUT:-"90s"} HUB_CHECKS_INTERVAL=${HUB_CHECKS_INTERVAL:-45} +HUB_CHECKS_MAX_ATTEMPTS=${HUB_CHECKS_MAX_ATTEMPTS:-6} WEB_DRIVER_WAIT_TIMEOUT=${WEB_DRIVER_WAIT_TIMEOUT:-120} SKIP_CLEANUP=${SKIP_CLEANUP:-"false"} # For debugging purposes, retain the cluster after the test run CHART_CERT_PATH=${CHART_CERT_PATH:-"${CHART_PATH}/certs/selenium.pem"} @@ -87,6 +88,7 @@ export SELENIUM_GRID_AUTOSCALING=${SELENIUM_GRID_AUTOSCALING} export SELENIUM_GRID_AUTOSCALING_MIN_REPLICA=${SELENIUM_GRID_AUTOSCALING_MIN_REPLICA} export RUN_IN_DOCKER_COMPOSE=true export HUB_CHECKS_INTERVAL=${HUB_CHECKS_INTERVAL} +export HUB_CHECKS_MAX_ATTEMPTS=${HUB_CHECKS_MAX_ATTEMPTS} export WEB_DRIVER_WAIT_TIMEOUT=${WEB_DRIVER_WAIT_TIMEOUT} ./tests/bootstrap.sh ${MATRIX_BROWSER} From 6f5f75b9520aad07c57ea0f33867d2982db0ccd3 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Tue, 23 Jan 2024 09:07:52 +0700 Subject: [PATCH 51/62] feat(chart): se:recordVideo should be used to determine if record video (#2104) Signed-off-by: Viet Nguyen Duc --- .github/workflows/helm-chart-release.yml | 1 + .../configs/recorder/graphQLRecordVideo.sh | 18 +++ .../selenium-grid/configs/recorder/video.sh | 21 ++-- .../rclone/{rclone.conf => config.conf} | 0 charts/selenium-grid/templates/_helpers.tpl | 107 +++++++++--------- .../templates/node-configmap.yaml | 14 ++- .../templates/recorder-configmap.yaml | 27 +++++ .../templates/router-deployment.yaml | 1 - charts/selenium-grid/templates/secrets.yaml | 12 +- .../templates/uploader-configmap.yaml | 26 +++++ charts/selenium-grid/templates/video-cm.yaml | 14 --- charts/selenium-grid/values.yaml | 47 +++++++- tests/SeleniumTests/__init__.py | 3 + 13 files changed, 198 insertions(+), 93 deletions(-) create mode 100755 charts/selenium-grid/configs/recorder/graphQLRecordVideo.sh rename charts/selenium-grid/configs/uploader/rclone/{rclone.conf => config.conf} (100%) create mode 100644 charts/selenium-grid/templates/recorder-configmap.yaml create mode 100644 charts/selenium-grid/templates/uploader-configmap.yaml delete mode 100644 charts/selenium-grid/templates/video-cm.yaml diff --git a/.github/workflows/helm-chart-release.yml b/.github/workflows/helm-chart-release.yml index f847f9b33..1f2b1f7c4 100644 --- a/.github/workflows/helm-chart-release.yml +++ b/.github/workflows/helm-chart-release.yml @@ -27,5 +27,6 @@ jobs: uses: helm/chart-releaser-action@v1.6.0 with: mark_as_latest: false + skip_existing: true env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/charts/selenium-grid/configs/recorder/graphQLRecordVideo.sh b/charts/selenium-grid/configs/recorder/graphQLRecordVideo.sh new file mode 100755 index 000000000..8061f9ae3 --- /dev/null +++ b/charts/selenium-grid/configs/recorder/graphQLRecordVideo.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Define parameters +SESSION_ID=$1 +GRAPHQL_ENDPOINT=${2:-$SE_NODE_GRID_GRAPHQL_URL} + +# Send GraphQL query +curl --retry 3 -k -X POST \ + -H "Content-Type: application/json" \ + --data '{"query":"{ session (id: \"'${SESSION_ID}'\") { id, capabilities, startTime, uri, nodeId, nodeUri, sessionDurationMillis, slot { id, stereotype, lastStarted } } } "}' \ + -s "${GRAPHQL_ENDPOINT}" > /tmp/graphQL_$SESSION_ID.json + +RECORD_VIDEO=$(jq -r '.data.session.capabilities | fromjson | ."se:recordVideo"' /tmp/graphQL_$SESSION_ID.json) + +if [ "${RECORD_VIDEO}" = "false" ]; then + echo "${RECORD_VIDEO}" +else + echo true +fi diff --git a/charts/selenium-grid/configs/recorder/video.sh b/charts/selenium-grid/configs/recorder/video.sh index fb8d8b3ee..e4648cada 100755 --- a/charts/selenium-grid/configs/recorder/video.sh +++ b/charts/selenium-grid/configs/recorder/video.sh @@ -1,9 +1,10 @@ #!/usr/bin/env bash -UPLOAD_ENABLED=${UPLOAD_ENABLED:-"false"} +VIDEO_UPLOAD_ENABLED=${VIDEO_UPLOAD_ENABLED:-"false"} +VIDEO_CONFIG_DIRECTORY=${VIDEO_CONFIG_DIRECTORY:-"/opt/bin"} function create_pipe() { - if [[ "${UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]]; + if [[ "${VIDEO_UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]]; then echo "Create pipe if not exists for video upload stream" if [ ! -p ${SE_VIDEO_FOLDER}/uploadpipe ]; @@ -15,7 +16,7 @@ function create_pipe() { create_pipe function wait_util_force_exit_consume() { - if [[ "${UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]]; + if [[ "${VIDEO_UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]]; then while [[ -f ${SE_VIDEO_FOLDER}/force_exit ]] do @@ -27,7 +28,7 @@ function wait_util_force_exit_consume() { } function add_exit_signal() { - if [[ "${UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]]; + if [[ "${VIDEO_UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]]; then echo "exit" >> ${SE_VIDEO_FOLDER}/uploadpipe & echo "exit" > ${SE_VIDEO_FOLDER}/force_exit @@ -93,8 +94,14 @@ fi while curl -sk --request GET ${SE_SERVER_PROTOCOL}://${DISPLAY_CONTAINER_NAME}:${SE_NODE_PORT}/status > /tmp/status.json do session_id=$(jq -r '.[]?.node?.slots | .[0]?.session?.sessionId' /tmp/status.json) - echo $session_id + echo "Session: $session_id is created" if [[ "$session_id" != "null" && "$session_id" != "" && "$recording_started" = "false" ]] + then + caps_se_video_record=$(bash ${VIDEO_CONFIG_DIRECTORY}/graphQLRecordVideo.sh "$session_id") + cat "/tmp/graphQL_$session_id.json"; echo + echo "se:recordVideo value is: $caps_se_video_record" + fi + if [[ "$session_id" != "null" && "$session_id" != "" && "$recording_started" = "false" && "$caps_se_video_record" = "true" ]] then video_file_name="$session_id.mp4" video_file="${SE_VIDEO_FOLDER}/$video_file_name" @@ -108,12 +115,12 @@ do pkill -INT ffmpeg recorded_count=$((recorded_count+1)) recording_started="false" - if [[ "${UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]]; + if [[ "${VIDEO_UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]]; then upload_destination=${UPLOAD_DESTINATION_PREFIX}/${video_file_name} echo "Uploading video to $upload_destination" echo $video_file ${UPLOAD_DESTINATION_PREFIX} >> ${SE_VIDEO_FOLDER}/uploadpipe & - elif [[ "${UPLOAD_ENABLED}" != "false" ]] && [[ -z "${UPLOAD_DESTINATION_PREFIX}" ]]; + elif [[ "${VIDEO_UPLOAD_ENABLED}" != "false" ]] && [[ -z "${UPLOAD_DESTINATION_PREFIX}" ]]; then echo Upload destination not known since UPLOAD_DESTINATION_PREFIX is not set. Continue without uploading. fi diff --git a/charts/selenium-grid/configs/uploader/rclone/rclone.conf b/charts/selenium-grid/configs/uploader/rclone/config.conf similarity index 100% rename from charts/selenium-grid/configs/uploader/rclone/rclone.conf rename to charts/selenium-grid/configs/uploader/rclone/config.conf diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index e3448d22b..d30a6d800 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -335,15 +335,15 @@ template: {{- end }} envFrom: - configMapRef: - name: {{ .Values.busConfigMap.name }} + name: {{ tpl (toYaml .Values.busConfigMap.name) $ }} - configMapRef: - name: {{ .Values.nodeConfigMap.name }} + name: {{ tpl (toYaml .Values.nodeConfigMap.name) $ }} - configMapRef: - name: {{ .Values.loggingConfigMap.name }} + name: {{ tpl (toYaml .Values.loggingConfigMap.name) $ }} - configMapRef: - name: {{ .Values.serverConfigMap.name }} + name: {{ tpl (toYaml .Values.serverConfigMap.name) $ }} - secretRef: - name: {{ include "seleniumGrid.common.secrets" $ | quote }} + name: {{ include "seleniumGrid.common.secrets" $ }} {{- with .node.extraEnvFrom }} {{- tpl (toYaml .) $ | nindent 10 }} {{- end }} @@ -364,9 +364,11 @@ template: volumeMounts: - name: dshm mountPath: /dev/shm - - name: {{ .Values.nodeConfigMap.scriptVolumeMountName }} - mountPath: /opt/selenium/{{ .Values.nodeConfigMap.preStopScript }} - subPath: {{ .Values.nodeConfigMap.preStopScript }} + {{- range $fileName, $value := .Values.nodeConfigMap.extraScripts }} + - name: {{ $.Values.nodeConfigMap.scriptVolumeMountName }} + mountPath: {{ $.Values.nodeConfigMap.extraScriptsDirectory }}/{{ $fileName }} + subPath: {{ $fileName }} + {{- end }} {{- if .Values.tls.enabled }} - name: {{ include "seleniumGrid.tls.fullname" $ | quote }} mountPath: {{ .Values.serverConfigMap.certVolumeMountPath }} @@ -451,11 +453,13 @@ template: {{- end }} envFrom: - configMapRef: - name: {{ .Values.busConfigMap.name }} + name: {{ tpl (toYaml .Values.busConfigMap.name) $ }} + - configMapRef: + name: {{ tpl (toYaml .Values.nodeConfigMap.name) $ }} - configMapRef: - name: {{ .Values.nodeConfigMap.name }} + name: {{ tpl (toYaml .Values.recorderConfigMap.name) $ }} - configMapRef: - name: {{ .Values.serverConfigMap.name }} + name: {{ tpl (toYaml .Values.serverConfigMap.name) $ }} {{- with .Values.videoRecorder.extraEnvFrom }} {{- tpl (toYaml .) $ | nindent 8 }} {{- end }} @@ -499,14 +503,16 @@ template: {{- if .uploader.args }} args: {{- tpl (toYaml .uploader.args) $ | nindent 8 }} {{- else }} - args: ["-c", "{{ $.Values.videoRecorder.uploader.scriptMountPath }}/{{ $.Values.videoRecorder.uploader.entryPointFileName }}"] + args: ["-c", "{{ $.Values.recorderConfigMap.extraScriptsDirectory }}/{{ $.Values.videoRecorder.uploader.entryPointFileName }}"] {{- end }} {{- with .uploader.extraEnvironmentVariables }} env: {{- tpl (toYaml .) $ | nindent 8 }} {{- end }} envFrom: + - configMapRef: + name: {{ tpl (toYaml .Values.uploaderConfigMap.name) $ }} - secretRef: - name: {{ include "seleniumGrid.common.secrets" $ | quote }} + name: {{ tpl (toYaml .Values.uploaderConfigMap.secretVolumeMountName) $ }} {{- with .uploader.extraEnvFrom }} {{- tpl (toYaml .) $ | nindent 10 }} {{- end }} @@ -655,7 +661,7 @@ Define preStop hook for the node pod. Node preStop script is stored in a ConfigM {{- define "seleniumGrid.node.deregisterLifecycle" -}} preStop: exec: - command: ["bash", "-c", "/opt/selenium/{{ .Values.nodeConfigMap.preStopScript }}"] + command: ["bash", "-c", "{{ $.Values.nodeConfigMap.extraScriptsDirectory }}/nodePreStop.sh"] {{- end -}} {{/* @@ -699,56 +705,45 @@ Define terminationGracePeriodSeconds of the node pod. {{- $period -}} {{- end -}} -{{/* -Default specs of VolumeMounts and Volumes for video recorder -*/}} -{{- define "seleniumGrid.video.volume.name.folder" -}} -{{- $name := default "video" (((.Values.videoRecorder).volume).name).folder -}} -{{- $name -}} -{{- end -}} - -{{- define "seleniumGrid.video.volume.name.scripts" -}} -{{- $name := default "video-scripts" (((.Values.videoRecorder).volume).name).scripts -}} -{{- $name -}} -{{- end -}} - {{- define "seleniumGrid.video.volumeMounts.default" -}} -{{- $root := . -}} -{{- range $path, $bytes := .Files.Glob "configs/recorder/*.sh" }} -- name: {{ include "seleniumGrid.video.volume.name.scripts" $ }} - mountPath: /opt/bin/{{ base $path }} - subPath: {{ base $path }} +{{- range $fileName, $value := .Values.recorderConfigMap.extraScripts }} +- name: {{ tpl (toYaml $.Values.recorderConfigMap.scriptVolumeMountName) $ }} + mountPath: {{ $.Values.recorderConfigMap.extraScriptsDirectory }}/{{ $fileName }} + subPath: {{ $fileName }} {{- end }} -- name: {{ include "seleniumGrid.video.volume.name.folder" . }} - mountPath: /videos +- name: {{ tpl (toYaml $.Values.recorderConfigMap.videoVolumeMountName) $ }} + mountPath: {{ $.Values.videoRecorder.targetFolder }} {{- end -}} {{- define "seleniumGrid.video.volumes.default" -}} -- name: {{ include "seleniumGrid.video.volume.name.scripts" . }} +- name: {{ tpl (toYaml $.Values.recorderConfigMap.videoVolumeMountName) $ }} + emptyDir: {} +- name: {{ tpl (toYaml $.Values.recorderConfigMap.scriptVolumeMountName) $ }} + configMap: + name: {{ tpl (toYaml $.Values.recorderConfigMap.name) $ }} + defaultMode: {{ $.Values.recorderConfigMap.defaultMode }} +- name: {{ tpl (toYaml $.Values.uploaderConfigMap.scriptVolumeMountName) $ }} configMap: - name: {{ template "seleniumGrid.video.fullname" . }} - defaultMode: 0500 -- name: {{ template "seleniumGrid.common.secrets" . }} + name: {{ tpl (toYaml $.Values.uploaderConfigMap.name) $ }} + defaultMode: {{ $.Values.uploaderConfigMap.defaultMode }} +- name: {{ tpl (toYaml $.Values.uploaderConfigMap.secretVolumeMountName) $ }} secret: - secretName: {{ template "seleniumGrid.common.secrets" . }} -- name: {{ include "seleniumGrid.video.volume.name.folder" . }} - emptyDir: {} + secretName: {{ tpl (toYaml $.Values.uploaderConfigMap.secretVolumeMountName) $ }} {{- end -}} {{- define "seleniumGrid.video.uploader.volumeMounts.default" -}} -{{- $root := . -}} -{{- range $path, $bytes := .Files.Glob (printf "configs/uploader/%s/*.sh" $.Values.videoRecorder.uploader.name) }} -- name: {{ include "seleniumGrid.video.volume.name.scripts" $ }} - mountPath: {{ $.Values.videoRecorder.uploader.scriptMountPath }}/{{ base $path }} - subPath: {{ base $path }} +{{- range $fileName, $value := .Values.uploaderConfigMap.extraScripts }} +- name: {{ tpl (toYaml $.Values.uploaderConfigMap.scriptVolumeMountName) $ }} + mountPath: {{ $.Values.uploaderConfigMap.extraScriptsDirectory }}/{{ $fileName }} + subPath: {{ $fileName }} {{- end }} -{{- range $path, $bytes := .Files.Glob (printf "configs/uploader/%s/*.conf" $.Values.videoRecorder.uploader.name) }} -- name: {{ include "seleniumGrid.common.secrets" $ }} - mountPath: {{ $.Values.videoRecorder.uploader.scriptMountPath }}/{{ base $path }} - subPath: {{ base $path }} +{{- range $fileName, $value := .Values.uploaderConfigMap.secretFiles }} +- name: {{ tpl (toYaml $.Values.uploaderConfigMap.secretVolumeMountName) $ }} + mountPath: {{ $.Values.uploaderConfigMap.extraScriptsDirectory }}/{{ $fileName }} + subPath: {{ $fileName }} {{- end }} -- name: {{ include "seleniumGrid.video.volume.name.folder" . }} - mountPath: /videos +- name: {{ tpl (toYaml $.Values.recorderConfigMap.videoVolumeMountName) $ }} + mountPath: {{ $.Values.videoRecorder.targetFolder }} {{- end -}} {{/* Combine videoRecorder.extraVolumeMounts with the default ones for container video recorder */}} @@ -759,9 +754,9 @@ Default specs of VolumeMounts and Volumes for video recorder {{- $videoVolumeMounts = append $videoVolumeMounts . -}} {{- end -}} {{- end -}} -{{- $defaultVolumeMounts := (include "seleniumGrid.video.volumeMounts.default" . | toString | fromYamlArray ) -}} +{{- $defaultVolumeMounts := (include "seleniumGrid.video.volumeMounts.default" $ | toString | fromYamlArray ) -}} {{- $videoVolumeMounts = include "utils.appendDefaultIfNotExist" (dict "currentArray" $videoVolumeMounts "defaultArray" $defaultVolumeMounts "uniqueKey" "mountPath") -}} -{{- not $videoVolumeMounts | ternary $videoVolumeMounts "" -}} +{{- not (empty $videoVolumeMounts) | ternary $videoVolumeMounts "" -}} {{- end -}} {{/* Combine videoRecorder.uploader.extraVolumeMounts with the default ones for container video uploader */}} @@ -774,7 +769,7 @@ Default specs of VolumeMounts and Volumes for video recorder {{- end }} {{- $defaultVolumeMounts := (include "seleniumGrid.video.uploader.volumeMounts.default" . | toString | fromYamlArray ) -}} {{- $videoUploaderVolumeMounts = include "utils.appendDefaultIfNotExist" (dict "currentArray" $videoUploaderVolumeMounts "defaultArray" $defaultVolumeMounts "uniqueKey" "mountPath") -}} -{{- not $videoUploaderVolumeMounts | ternary $videoUploaderVolumeMounts "" -}} +{{- not (empty $videoUploaderVolumeMounts) | ternary $videoUploaderVolumeMounts "" -}} {{- end -}} {{/* Combine videoRecorder.extraVolumes with the default ones for the node pod */}} @@ -787,7 +782,7 @@ Default specs of VolumeMounts and Volumes for video recorder {{- end -}} {{- $defaultVolumes := (include "seleniumGrid.video.volumes.default" . | toString | fromYamlArray ) -}} {{- $videoVolumes = include "utils.appendDefaultIfNotExist" (dict "currentArray" $videoVolumes "defaultArray" $defaultVolumes "uniqueKey" "name") -}} -{{- not $videoVolumes | ternary $videoVolumes "" -}} +{{- not (empty $videoVolumes) | ternary $videoVolumes "" -}} {{- end -}} {{/* diff --git a/charts/selenium-grid/templates/node-configmap.yaml b/charts/selenium-grid/templates/node-configmap.yaml index dbb460026..a746a96ec 100644 --- a/charts/selenium-grid/templates/node-configmap.yaml +++ b/charts/selenium-grid/templates/node-configmap.yaml @@ -14,8 +14,12 @@ metadata: data: SE_DRAIN_AFTER_SESSION_COUNT: '{{- and (eq (include "seleniumGrid.useKEDA" .) "true") (eq .Values.autoscaling.scalingType "job") | ternary "1" "0" -}}' SE_NODE_GRID_URL: '{{ include "seleniumGrid.url" .}}' - UPLOAD_ENABLED: '{{ .Values.videoRecorder.uploader.enabled }}' - UPLOAD_DESTINATION_PREFIX: '{{ .Values.videoRecorder.uploader.destinationPrefix }}' - UPLOAD_CONFIG_FILE_NAME: '{{ .Values.videoRecorder.uploader.configFileName }}' - UPLOAD_CONFIG_DIRECTORY: '{{ .Values.videoRecorder.uploader.scriptMountPath }}' -{{ (.Files.Glob "configs/node/*").AsConfig | indent 2 }} + SE_NODE_GRID_GRAPHQL_URL: '{{ include "seleniumGrid.graphqlURL" .}}' +{{- range $fileName, $value := .Values.nodeConfigMap.extraScripts }} + {{- if not (empty $value) }} +{{ $fileName | indent 2 -}}: | +{{ $value | indent 4 }} + {{- else }} +{{ ($.Files.Glob (printf "configs/node/%s" $fileName)).AsConfig | indent 2 }} + {{- end }} +{{- end }} diff --git a/charts/selenium-grid/templates/recorder-configmap.yaml b/charts/selenium-grid/templates/recorder-configmap.yaml new file mode 100644 index 000000000..db4e46d65 --- /dev/null +++ b/charts/selenium-grid/templates/recorder-configmap.yaml @@ -0,0 +1,27 @@ +{{- if .Values.videoRecorder.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Values.recorderConfigMap.name }} + namespace: {{ .Release.Namespace }} +{{- with .Values.recorderConfigMap.annotations }} + annotations: {{- toYaml . | nindent 4 }} +{{- end }} + labels: + {{- include "seleniumGrid.commonLabels" . | nindent 4 }} + {{- with .Values.customLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +data: + VIDEO_UPLOAD_ENABLED: '{{ .Values.videoRecorder.uploader.enabled }}' + VIDEO_CONFIG_DIRECTORY: '{{ .Values.recorderConfigMap.extraScriptsDirectory }}' + UPLOAD_DESTINATION_PREFIX: '{{ .Values.videoRecorder.uploader.destinationPrefix }}' +{{- range $fileName, $value := .Values.recorderConfigMap.extraScripts }} +{{- if not (empty $value) }} +{{ $fileName | indent 2 -}}: | +{{ $value | indent 4 }} +{{- else }} +{{ ($.Files.Glob (printf "configs/recorder/%s" $fileName)).AsConfig | indent 2 }} +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/selenium-grid/templates/router-deployment.yaml b/charts/selenium-grid/templates/router-deployment.yaml index 647b5f1ab..469dc1652 100644 --- a/charts/selenium-grid/templates/router-deployment.yaml +++ b/charts/selenium-grid/templates/router-deployment.yaml @@ -110,7 +110,6 @@ spec: {{- if .Values.components.router.livenessProbe.enabled }} livenessProbe: {{- with .Values.components.router.livenessProbe }} - livenessProbe: {{- if (ne (include "seleniumGrid.probe.fromUserDefine" .) "{}") }} {{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }} {{- else }} diff --git a/charts/selenium-grid/templates/secrets.yaml b/charts/selenium-grid/templates/secrets.yaml index 932217efc..95eec5c82 100644 --- a/charts/selenium-grid/templates/secrets.yaml +++ b/charts/selenium-grid/templates/secrets.yaml @@ -37,9 +37,13 @@ data: {{- end }} {{- end }} {{- end }} -{{- if and .Values.videoRecorder.uploader.enabled .Values.videoRecorder.uploader.config }} - {{ .Values.videoRecorder.uploader.configFileName }}: {{ .Values.videoRecorder.uploader.config | b64enc }} -{{- else if and .Values.videoRecorder.uploader.enabled (not .Values.videoRecorder.uploader.config) }} -{{ (.Files.Glob (printf "configs/uploader/%s/*.conf" $.Values.videoRecorder.uploader.name)).AsSecrets | indent 2 }} +{{- if and .Values.videoRecorder.uploader.enabled }} +{{- range $fileName, $value := .Values.uploaderConfigMap.secretFiles }} +{{- if not (empty $value) }} + {{ $fileName }}: {{ $value | b64enc }} +{{- else }} +{{ ($.Files.Glob (printf "configs/uploader/%s/%s" $.Values.videoRecorder.uploader.name $fileName)).AsSecrets | indent 2 }} +{{- end }} +{{- end }} {{- end }} {{- end }} diff --git a/charts/selenium-grid/templates/uploader-configmap.yaml b/charts/selenium-grid/templates/uploader-configmap.yaml new file mode 100644 index 000000000..a443a80c9 --- /dev/null +++ b/charts/selenium-grid/templates/uploader-configmap.yaml @@ -0,0 +1,26 @@ +{{- if .Values.videoRecorder.uploader.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Values.uploaderConfigMap.name }} + namespace: {{ .Release.Namespace }} +{{- with .Values.uploaderConfigMap.annotations }} + annotations: {{- toYaml . | nindent 4 }} +{{- end }} + labels: + {{- include "seleniumGrid.commonLabels" . | nindent 4 }} + {{- with .Values.customLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} +data: + UPLOAD_CONFIG_DIRECTORY: '{{ .Values.uploaderConfigMap.extraScriptsDirectory }}' + UPLOAD_CONFIG_FILE_NAME: '{{ .Values.videoRecorder.uploader.configFileName }}' +{{- range $fileName, $value := .Values.uploaderConfigMap.extraScripts }} +{{- if not (empty $value) }} +{{ $fileName | indent 2 -}}: | +{{ $value | indent 4 }} +{{- else }} +{{ ($.Files.Glob (printf "configs/uploader/%s/%s" $.Values.videoRecorder.uploader.name $fileName)).AsConfig | indent 2 }} +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/selenium-grid/templates/video-cm.yaml b/charts/selenium-grid/templates/video-cm.yaml deleted file mode 100644 index 7176dd15d..000000000 --- a/charts/selenium-grid/templates/video-cm.yaml +++ /dev/null @@ -1,14 +0,0 @@ -{{- if .Values.videoRecorder.enabled }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "seleniumGrid.video.fullname" . }} -data: -{{ (.Files.Glob "configs/recorder/*").AsConfig | indent 2 }} -{{- if and .Values.videoRecorder.uploader.enabled .Values.videoRecorder.uploader.entryPoint }} -{{ .Values.videoRecorder.uploader.entryPointFileName | indent 2 -}}: | -{{ .Values.videoRecorder.uploader.entryPoint | indent 4 }} -{{- else if and .Values.videoRecorder.uploader.enabled (not .Values.videoRecorder.uploader.entryPoint) }} -{{ (.Files.Glob (printf "configs/uploader/%s/*.sh" $.Values.videoRecorder.uploader.name)).AsConfig | indent 2 }} -{{- end }} -{{- end }} diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index 864fee8a3..f915d12c6 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -104,12 +104,50 @@ nodeConfigMap: # Default mode for ConfigMap is mounted as file defaultMode: 0755 # File name of preStop script in ConfigMap - preStopScript: nodePreStop.sh + extraScriptsDirectory: "/opt/selenium" + extraScripts: + nodePreStop.sh: # Name of volume mount is used to mount scripts in the ConfigMap scriptVolumeMountName: node-helper-scripts # Custom annotations for configmap annotations: {} +recorderConfigMap: + name: selenium-recorder-config + # Default mode for ConfigMap is mounted as file + defaultMode: 0755 + # Directory where the extra scripts are mounted to + extraScriptsDirectory: "/opt/bin" + # List of extra scripts to be mounted to the container. Format as `filename: content` + extraScripts: + video.sh: + graphQLRecordVideo.sh: + # Name of volume mount is used to mount scripts in the ConfigMap + scriptVolumeMountName: recorder-helper-scripts + videoVolumeMountName: videos + # Custom annotations for configmap + annotations: {} + +uploaderConfigMap: + name: selenium-uploader-config + # Default mode for ConfigMap is mounted as file + defaultMode: 0755 + # Directory where the extra scripts are mounted to + extraScriptsDirectory: "/opt/bin" + # List of extra scripts to be mounted to the container. Format as `filename: content` + extraScripts: + entry_point.sh: + # Extra files stored in Secret to be mounted to the container. + secretFiles: + config.conf: + # Name of volume mount is used to mount scripts in the ConfigMap + scriptVolumeMountName: uploader-helper-scripts + # Name of Secret is used to store the `secretFiles` + secretVolumeMountName: '{{ include "seleniumGrid.common.secrets" $ }}' + # Custom annotations for configmap + annotations: {} + + # ConfigMap that contains common environment variables for Logging (https://www.selenium.dev/documentation/grid/configuration/cli_options/#logging) loggingConfigMap: name: selenium-logging-config @@ -987,19 +1025,16 @@ videoRecorder: # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) + targetFolder: "/videos" uploader: enabled: false # Where to upload the video file e.g. remoteName://bucketName/path. Refer to destination syntax of rclone https://rclone.org/docs/ destinationPrefix: # What uploader to use. See .videRecorder.rclone for how to create a new one. name: "rclone" - configFileName: "rclone.conf" + configFileName: "config.conf" entryPointFileName: "entry_point.sh" scriptMountPath: "/opt/bin" - # Config file for rclone. - config: - # Script to control the upload process. - entryPoint: # For environment variables used in uploader which contains sensitive information, store in secret and refer envFrom # Set config for rclone via ENV var with format: RCLONE_CONFIG_ + name of remote + _ + name of config file option (make it all uppercase) secrets: diff --git a/tests/SeleniumTests/__init__.py b/tests/SeleniumTests/__init__.py index f4eb967d9..756c26931 100644 --- a/tests/SeleniumTests/__init__.py +++ b/tests/SeleniumTests/__init__.py @@ -99,6 +99,7 @@ def setUp(self): options = ChromeOptions() options.enable_downloads = True options.add_argument('disable-features=DownloadBubble,DownloadBubbleV2') + options.set_capability('se:recordVideo', True) self.driver = webdriver.Remote( options=options, command_executor="%s://%s:%s" % (SELENIUM_GRID_PROTOCOL,SELENIUM_GRID_HOST,SELENIUM_GRID_PORT) @@ -109,6 +110,7 @@ def setUp(self): options = EdgeOptions() options.enable_downloads = True options.add_argument('disable-features=DownloadBubble,DownloadBubbleV2') + options.set_capability('se:recordVideo', True) self.driver = webdriver.Remote( options=options, command_executor="%s://%s:%s" % (SELENIUM_GRID_PROTOCOL,SELENIUM_GRID_HOST,SELENIUM_GRID_PORT) @@ -123,6 +125,7 @@ def setUp(self): options = FirefoxOptions() options.profile = profile options.enable_downloads = True + options.set_capability('se:recordVideo', True) self.driver = webdriver.Remote( options=options, command_executor="%s://%s:%s" % (SELENIUM_GRID_PROTOCOL,SELENIUM_GRID_HOST,SELENIUM_GRID_PORT) From b596eaef0fe07a0abc347e5994926692bf7caa24 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Tue, 23 Jan 2024 15:49:13 +0700 Subject: [PATCH 52/62] feat(chart): Configuration extra scripts mount to container (#2105) * feat(chart): Configuration extra scripts mount to container Signed-off-by: Viet Nguyen Duc * Update Chart table of contents [skip ci] Signed-off-by: Viet Nguyen Duc * Video image is missing in CI test Signed-off-by: Viet Nguyen Duc --------- Signed-off-by: Viet Nguyen Duc --- charts/selenium-grid/README.md | 94 ++++++++++++++++--- .../configs/uploader/rclone/entry_point.sh | 2 +- .../templates/node-configmap.yaml | 12 ++- .../templates/recorder-configmap.yaml | 6 +- charts/selenium-grid/templates/secrets.yaml | 6 +- .../templates/uploader-configmap.yaml | 6 +- tests/charts/bootstrap.sh | 6 ++ tests/charts/ci/auth-ingress-values.yaml | 28 ++++++ tests/charts/make/chart_cluster_setup.sh | 2 +- .../charts/templates/render/dummy_external.sh | 2 + 10 files changed, 140 insertions(+), 24 deletions(-) create mode 100644 tests/charts/templates/render/dummy_external.sh diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index 37ccfb347..161fdcb80 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -18,10 +18,11 @@ This chart enables the creation of a Selenium Grid Server in Kubernetes. * [Ingress Configuration](#ingress-configuration) * [Configuration](#configuration) * [Configuration global](#configuration-global) - * [Configuration `global.K8S_PUBLIC_IP`](#configuration-globalk8s_public_ip) + * [Configuration `global.K8S_PUBLIC_IP`](#configuration-globalk8spublicip) * [Configuration of Nodes](#configuration-of-nodes) * [Container ports and Service ports](#container-ports-and-service-ports) * [Probes](#probes) + * [Configuration extra scripts mount to container](#configuration-extra-scripts-mount-to-container) * [Configuration of video recorder and video uploader](#configuration-of-video-recorder-and-video-uploader) * [Video recorder](#video-recorder) * [Video uploader](#video-uploader) @@ -378,6 +379,52 @@ edgeNode: periodSeconds: 5 ``` +### Configuration extra scripts mount to container + +This is supported for containers of browser node, video recorder and video uploader. By default, in these containers, there are scripts, config files implemented. In case you want to customize or replace them with your own implementation. Instead of forking the chart, use volume mount. Now, from your external files, you can insert them into ConfigMap via Helm CLI `--set-file` or compose them in your own YAML values file and pass to Helm CLI `--values` when deploying chart. Any files name that you defined will be picked up into ConfigMap and mounted to the container. + +```yaml +nodeConfigMap: + extraScriptsDirectory: "/opt/selenium" + extraScripts: + nodePreStop.sh: | + #!/bin/bash + echo "Your custom script" + +recorderConfigMap: + extraScriptsDirectory: "/opt/selenium" + extraScripts: + video.sh: | + #!/bin/bash + echo "Your custom script" + videoPreStop.sh: | + #!/bin/bash + echo "My new script" + +uploaderConfigMap: + extraScriptsDirectory: "/opt/bin" + extraScripts: + entry_point.sh: | + #!/bin/bash + echo "Your custom entry point" + secretFiles: + config.conf: | + [myremote] + type = s3 +``` + +Via Helm CLI, you can pass your own files to particular config key. Note that, the file name contains dot `.` for file extension, it will impact to the key name convention in Helm CLI. In this case, be careful to escape the dot `.` in the file name. For example a command in Unix: + +```bash +helm upgrade -i test \ + --set-file 'nodeConfigMap.extraScripts.nodePreStop\.sh=/path/to/myScript.sh' \ + --set-file 'recorderConfigMap.extraScripts.video\.sh=/path/to/myCustom.sh' \ + selenium-grid +``` + +Files in `.extraScripts` will be mounted to the container with the same name within directory is defined in `.extraScriptsDirectory`. For example, in the above config, `nodePreStop.sh` will be mounted to `/opt/selenium/nodePreStop.sh` in the node container. + + ### Configuration of video recorder and video uploader #### Video recorder @@ -389,6 +436,20 @@ videoRecorder: enabled: true ``` +At chart deployment level, that config will enable video container always. In addition, you can disable video recording process via session capability `se:recordVideo`. For example in Python binding: + +```python +from selenium.webdriver.chrome.options import Options as ChromeOptions +from selenium import webdriver + +options = ChromeOptions() +options.set_capability('se:recordVideo', False) +driver = webdriver.Remote(options=options, command_executor="http://localhost:4444") +) +``` + +In Node will perform query GraphQL and extract the value of `se:recordVideo` in capabilities before deciding to start video recording process or not. By default, the script is loaded from file [configs/recorder/graphQLRecordVideo.sh](configs/recorder/graphQLRecordVideo.sh) to the ConfigMap. You can customize by reading on section [Configuration extra scripts mount to container](#configuration-extra-scripts-mount-to-container). + #### Video uploader The uploader is a sidecar that is deployed with the browser nodes. It is responsible for uploading the video to a remote location. The uploader is disabled by default. To enable it, you need to set the following values: @@ -401,17 +462,16 @@ videoRecorder: By default, the uploader uses [RCLONE](https://rclone.org/) to upload the video to a remote location. RCLONE requires a configuration file to define different remote locations. Refer to [RCLONE docs](https://rclone.org/docs/#config-file) for more details. Config file might contain sensitive information such as access key, secret key, etc. hence it is stored in Secret. -The uploader requires `destinationPrefix` to be set. It is used to instruct the uploader where to upload the video. The format of destinationPrefix is `remote-name://bucket-name/path`. The `remote-name` is configured in RCLONE. The bucket-name is the name of the bucket in the remote location. The path is the path to the folder in the bucket. +The uploader requires `destinationPrefix` to be set. It is used to instruct the uploader where to upload the video. The format of destinationPrefix is `remote-name://bucket-name/path`. The `remote-name` is configured in RCLONE. The `bucket-name` is the name of the bucket in the remote location. The `path` is the path to the folder in the bucket. -By default, the config file is loaded from file [configs/uploader/rclone/rclone.conf](configs/uploader/rclone/rclone.conf) to the Secret. You can override the config file via `--set-file videoRecorder.uploader.config=/path/to/config` or set via YAML values. +By default, the config file is loaded from file [configs/uploader/rclone/config.conf](configs/uploader/rclone/config.conf) to the Secret. You can override the config file via `--set-file uploaderConfigMap.secretFiles.config.conf=/path/to/your_config.conf` or set via YAML values. For example, to configure an S3 remote hosted on AWS with named `mys3` and the bucket name is `mybucket`, you can set the following values: ```bash -videoRecorder: - uploader: - destinationPrefix: "mys3://mybucket" - config: | +uploaderConfigMap: + secretFiles: + config.conf: | [mys3] type = s3 provider = AWS @@ -421,10 +481,14 @@ videoRecorder: acl = private access_key_id = xxx secret_access_key = xxx + +videoRecorder: + uploader: + destinationPrefix: "mys3://mybucket/subFolder" ``` You can prepare a config file with multiple remotes are defined. Ensure that `[remoteName]` is unique for each remote. -You also can replace your config to default file `configs/uploader/rclone/rclone.conf` in chart. +You also can replace your config to default file `configs/uploader/rclone/config.conf` in chart. Instead of using config file, another way that RCLONE also supports to pass the information via environment variables. ENV variable with format: `RCLONE_CONFIG_ + name of remote + _ + name of config file option` (make it all uppercase). In this case the remote name it can only contain letters, digits, or the _ (underscore) character. All those ENV variables can be set via `videoRecorder.uploader.secrets`, it will be stored in Secret. @@ -445,16 +509,16 @@ videoRecorder: RCLONE_CONFIG_MYS3_SECRET_ACCESS_KEY: "xxx" ``` -Those 2 ways are equivalent. You can choose one of them or combine them together. When both config file and ENV vars are set, value in `rclone.conf` will take precedence. +Those 2 ways are equivalent. You can choose one of them or combine them together. When both config file and ENV vars are set, value in `config.conf` will take precedence. -Beside the configuration, the script for entry point of uploader container also needed. By default, it is loaded from file [configs/uploader/rclone/entry_point.sh](configs/uploader/rclone/entry_point.sh) to the ConfigMap. You can override the script via `--set-file videoRecorder.uploader.entryPoint=/path/to/script` or set via YAML values. For example: +Beside the configuration, the script for entry point of uploader container also needed. By default, it is loaded from file [configs/uploader/rclone/entry_point.sh](configs/uploader/rclone/entry_point.sh) to the ConfigMap. You can override the script via `--set-file uploaderConfigMap.extraScripts.entry_point.sh=/path/to/your_script.sh` or set via YAML values. For example: ```yaml -videoRecorder: - uploader: - entryPoint: | +uploaderConfigMap: + extraScripts: + entry_point.sh: | #!/bin/bash - echo "Your custom script" + echo "Your custom entry point" ``` You also can replace your script to default file `configs/uploader/rclone/entry_point.sh` in chart. @@ -707,7 +771,7 @@ This table contains the configuration parameters of the chart and their default | `videoRecorder.uploader.enabled` | `false` | Enable the uploader for videos | | `videoRecorder.uploader.destinationPrefix` | `` | Destination for uploading video file. It is following `rclone` config | | `videoRecorder.uploader.name` | `rclone` | Name of the uploader to use. Supported default `rclone` | -| `videoRecorder.uploader.configFileName` | `rclone.conf` | Config file name for `rclone` in uploader container | +| `videoRecorder.uploader.configFileName` | `config.conf` | Config file name for `rclone` in uploader container | | `videoRecorder.uploader.entryPointFileName` | `entry_point.sh` | Script file name for uploader container entry point | | `videoRecorder.uploader.config` | `` | Set value to uploader config file via YAML or `--set-file` | | `videoRecorder.uploader.entryPoint` | `` | Set value to uploader entry point via YAML or `--set-file` | diff --git a/charts/selenium-grid/configs/uploader/rclone/entry_point.sh b/charts/selenium-grid/configs/uploader/rclone/entry_point.sh index ce9714bf7..be4657514 100644 --- a/charts/selenium-grid/configs/uploader/rclone/entry_point.sh +++ b/charts/selenium-grid/configs/uploader/rclone/entry_point.sh @@ -2,7 +2,7 @@ SE_VIDEO_FOLDER=${SE_VIDEO_FOLDER:-"/videos"} UPLOAD_CONFIG_DIRECTORY=${UPLOAD_CONFIG_DIRECTORY:-"/opt/bin"} -UPLOAD_CONFIG_FILE_NAME=${UPLOAD_CONFIG_FILE_NAME:-"rclone.conf"} +UPLOAD_CONFIG_FILE_NAME=${UPLOAD_CONFIG_FILE_NAME:-"config.conf"} UPLOAD_COMMAND=${UPLOAD_COMMAND:-"copy"} function consume_force_exit() { diff --git a/charts/selenium-grid/templates/node-configmap.yaml b/charts/selenium-grid/templates/node-configmap.yaml index a746a96ec..0bb72acb4 100644 --- a/charts/selenium-grid/templates/node-configmap.yaml +++ b/charts/selenium-grid/templates/node-configmap.yaml @@ -16,10 +16,14 @@ data: SE_NODE_GRID_URL: '{{ include "seleniumGrid.url" .}}' SE_NODE_GRID_GRAPHQL_URL: '{{ include "seleniumGrid.graphqlURL" .}}' {{- range $fileName, $value := .Values.nodeConfigMap.extraScripts }} - {{- if not (empty $value) }} +{{- if not (empty $value) }} {{ $fileName | indent 2 -}}: | {{ $value | indent 4 }} - {{- else }} -{{ ($.Files.Glob (printf "configs/node/%s" $fileName)).AsConfig | indent 2 }} - {{- end }} +{{- else }} +{{- $files := $.Files.Glob (printf "configs/node/%s" $fileName) }} +{{- $cfg := $files.AsConfig }} +{{- if and (gt (len $files) 0) (ne $cfg "") }} +{{ indent 2 $cfg }} +{{- end }} +{{- end }} {{- end }} diff --git a/charts/selenium-grid/templates/recorder-configmap.yaml b/charts/selenium-grid/templates/recorder-configmap.yaml index db4e46d65..c573d2c9f 100644 --- a/charts/selenium-grid/templates/recorder-configmap.yaml +++ b/charts/selenium-grid/templates/recorder-configmap.yaml @@ -21,7 +21,11 @@ data: {{ $fileName | indent 2 -}}: | {{ $value | indent 4 }} {{- else }} -{{ ($.Files.Glob (printf "configs/recorder/%s" $fileName)).AsConfig | indent 2 }} +{{- $files := $.Files.Glob (printf "configs/recorder/%s" $fileName) }} +{{- $cfg := $files.AsConfig }} +{{- if and (gt (len $files) 0) (ne $cfg "") }} +{{ indent 2 $cfg }} +{{- end }} {{- end }} {{- end }} {{- end }} diff --git a/charts/selenium-grid/templates/secrets.yaml b/charts/selenium-grid/templates/secrets.yaml index 95eec5c82..5d76c6930 100644 --- a/charts/selenium-grid/templates/secrets.yaml +++ b/charts/selenium-grid/templates/secrets.yaml @@ -42,7 +42,11 @@ data: {{- if not (empty $value) }} {{ $fileName }}: {{ $value | b64enc }} {{- else }} -{{ ($.Files.Glob (printf "configs/uploader/%s/%s" $.Values.videoRecorder.uploader.name $fileName)).AsSecrets | indent 2 }} +{{- $files := $.Files.Glob (printf "configs/uploader/%s/%s" $.Values.videoRecorder.uploader.name $fileName) }} +{{- $cfg := $files.AsSecrets }} +{{- if and (gt (len $files) 0) (ne $cfg "") }} +{{ indent 2 $cfg }} +{{- end }} {{- end }} {{- end }} {{- end }} diff --git a/charts/selenium-grid/templates/uploader-configmap.yaml b/charts/selenium-grid/templates/uploader-configmap.yaml index a443a80c9..912b0fd83 100644 --- a/charts/selenium-grid/templates/uploader-configmap.yaml +++ b/charts/selenium-grid/templates/uploader-configmap.yaml @@ -20,7 +20,11 @@ data: {{ $fileName | indent 2 -}}: | {{ $value | indent 4 }} {{- else }} -{{ ($.Files.Glob (printf "configs/uploader/%s/%s" $.Values.videoRecorder.uploader.name $fileName)).AsConfig | indent 2 }} +{{- $files := $.Files.Glob (printf "configs/uploader/%s/%s" $.Values.videoRecorder.uploader.name $fileName) }} +{{- $cfg := $files.AsConfig }} +{{- if and (gt (len $files) 0) (ne $cfg "") }} +{{ indent 2 $cfg }} +{{- end }} {{- end }} {{- end }} {{- end }} diff --git a/tests/charts/bootstrap.sh b/tests/charts/bootstrap.sh index f1ade17d1..33721c44b 100755 --- a/tests/charts/bootstrap.sh +++ b/tests/charts/bootstrap.sh @@ -13,6 +13,12 @@ python -m pip install pyyaml==6.0.1 \ cd .. helm template dummy --values tests/charts/templates/render/dummy.yaml \ + --set-file 'nodeConfigMap.extraScripts.nodePreStop\.sh=tests/charts/templates/render/dummy_external.sh' \ + --set-file 'recorderConfigMap.extraScripts.video\.sh=tests/charts/templates/render/dummy_external.sh' \ + --set-file 'recorderConfigMap.extraScripts.graphQLRecordVideo\.sh=tests/charts/templates/render/dummy_external.sh' \ + --set-file 'recorderConfigMap.extraScripts.newInsertScript\.sh=tests/charts/templates/render/dummy_external.sh' \ + --set-file 'uploaderConfigMap.extraScripts.entry_point\.sh=tests/charts/templates/render/dummy_external.sh' \ + --set-file 'uploaderConfigMap.secretFiles.config\.conf=tests/charts/templates/render/dummy_external.sh' \ charts/selenium-grid > ./tests/tests/dummy_template_manifests.yaml python tests/charts/templates/test.py "./tests/tests/dummy_template_manifests.yaml" diff --git a/tests/charts/ci/auth-ingress-values.yaml b/tests/charts/ci/auth-ingress-values.yaml index 4ccd0a6f2..91d853aca 100644 --- a/tests/charts/ci/auth-ingress-values.yaml +++ b/tests/charts/ci/auth-ingress-values.yaml @@ -41,3 +41,31 @@ ingress-nginx: kind: DaemonSet service: type: ClusterIP + +videoRecorder: + enabled: true + uploader: + enabled: false + name: rclone + destinationPrefix: "gs://ndviet" + secrets: + RCLONE_CONFIG_S3_TYPE: "s3" + RCLONE_CONFIG_S3_PROVIDER: "AWS" + RCLONE_CONFIG_S3_ENV_AUTH: "true" + RCLONE_CONFIG_S3_REGION: "ap-southeast-1" + RCLONE_CONFIG_S3_LOCATION_CONSTRAINT: "ap-southeast-1" + RCLONE_CONFIG_S3_ACL: "private" + RCLONE_CONFIG_S3_ACCESS_KEY_ID: "****" + RCLONE_CONFIG_S3_SECRET_ACCESS_KEY: "****" + RCLONE_CONFIG_GS_TYPE: "s3" + RCLONE_CONFIG_GS_PROVIDER: "GCS" + RCLONE_CONFIG_GS_ENV_AUTH: "true" + RCLONE_CONFIG_GS_REGION: "asia-southeast1" + RCLONE_CONFIG_GS_LOCATION_CONSTRAINT: "asia-southeast1" + RCLONE_CONFIG_GS_ACL: "private" + RCLONE_CONFIG_GS_ACCESS_KEY_ID: "****" + RCLONE_CONFIG_GS_SECRET_ACCESS_KEY: "****" + RCLONE_CONFIG_GS_ENDPOINT: "https://storage.googleapis.com" + AWS_REGION: "ap-southeast-1" + AWS_ACCESS_KEY_ID: "****" + AWS_SECRET_ACCESS_KEY: "****" diff --git a/tests/charts/make/chart_cluster_setup.sh b/tests/charts/make/chart_cluster_setup.sh index c87cbc5b1..e413bd984 100755 --- a/tests/charts/make/chart_cluster_setup.sh +++ b/tests/charts/make/chart_cluster_setup.sh @@ -39,7 +39,7 @@ echo "Install KEDA core on kind kubernetes cluster" kubectl apply --server-side -f https://github.com/kedacore/keda/releases/download/v2.12.1/keda-2.12.1-core.yaml echo "Load built local Docker Images into Kind Cluster" -image_list=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep ${NAMESPACE} | grep ${VERSION}) +image_list=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep ${NAMESPACE} | grep ${BUILD_DATE:-$VERSION}) for image in $image_list; do kind load docker-image --name ${CLUSTER_NAME} "$image" done diff --git a/tests/charts/templates/render/dummy_external.sh b/tests/charts/templates/render/dummy_external.sh new file mode 100644 index 000000000..076ed75c5 --- /dev/null +++ b/tests/charts/templates/render/dummy_external.sh @@ -0,0 +1,2 @@ +#!/bin/bash +echo "Your custom script patch to chart rendering" From 19b1df5e337c870a0e039bcb8713c70cf3130e87 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Tue, 23 Jan 2024 18:09:48 +0530 Subject: [PATCH 53/62] [build] Update CI use vars.DOCKER_NAMESPACE [skip ci] Signed-off-by: Viet Nguyen Duc --- .github/workflows/deploy.yml | 10 +++++++--- .github/workflows/helm-chart-test.yml | 2 +- .github/workflows/nightly.yaml | 2 +- .../workflows/update-dev-beta-browser-images.yml | 2 +- tag_and_push_browser_images.sh | 13 +++++++------ 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index acf71f7f7..36f738f01 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -21,21 +21,25 @@ jobs: - name: Output Docker info run: docker info - name: Sets build date - run: echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV + run: | + echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV + echo "NAME=${NAMESPACE}" >> $GITHUB_ENV + env: + NAMESPACE: ${{ vars.DOCKER_NAMESPACE || 'selenium' }} - name: Sets prerelease to false by default run: echo "PRERELEASE=false" >> $GITHUB_ENV - name: Build base image to get Grid version run: VERSION="local" BUILD_DATE=${BUILD_DATE} make base - name: Get Grid version # sed used to remove last comma of Selenium version output - run: echo "GRID_VERSION=$(docker run --rm selenium/base:local-${BUILD_DATE} java -jar /opt/selenium/selenium-server.jar hub --version | awk '{print $3}' | sed 's/\(.*\),/\1 /')" | awk '{$1=$1;print}' >> $GITHUB_ENV + run: echo "GRID_VERSION=$(docker run --rm ${NAME}/base:local-${BUILD_DATE} java -jar /opt/selenium/selenium-server.jar hub --version | awk '{print $3}' | sed 's/\(.*\),/\1 /')" | awk '{$1=$1;print}' >> $GITHUB_ENV - name: Is it a prerelease? run: echo "GRID_VERSION=${GRID_VERSION}-prerelease" >> $GITHUB_ENV && echo "PRERELEASE=true" >> $GITHUB_ENV if: contains(toJson(github.event.commits), '[prerelease]') == true - name: Display Grid version run: echo ${GRID_VERSION} - name: Remove local Docker tag - run: docker rmi selenium/base:local-${BUILD_DATE} + run: docker rmi ${NAME}/base:local-${BUILD_DATE} - name: Sets env var for the next tag run: echo "NEXT_TAG=${GRID_VERSION}-${BUILD_DATE}" >> $GITHUB_ENV - name: Get latest tag diff --git a/.github/workflows/helm-chart-test.yml b/.github/workflows/helm-chart-test.yml index 5e2bb614f..7d6697e82 100644 --- a/.github/workflows/helm-chart-test.yml +++ b/.github/workflows/helm-chart-test.yml @@ -53,7 +53,7 @@ jobs: - name: Setup Kubernetes environment run: make chart_setup_env - name: Build Docker images - run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build_nightly + run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build - name: Build and lint charts run: | BUILD_DATE=${BUILD_DATE} make chart_build diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 85e81a071..9c2319bba 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -24,7 +24,7 @@ jobs: echo "PRERELEASE=true" >> $GITHUB_ENV echo "NAME=${NAMESPACE}" >> $GITHUB_ENV env: - NAMESPACE: ${{ secrets.DOCKER_NAMESPACE || 'selenium' }} + NAMESPACE: ${{ vars.DOCKER_NAMESPACE || 'selenium' }} - name: Build base image to get Grid version run: VERSION="local" BUILD_DATE=${BUILD_DATE} make base_nightly - name: Get Grid version diff --git a/.github/workflows/update-dev-beta-browser-images.yml b/.github/workflows/update-dev-beta-browser-images.yml index b3f29527e..1a0036574 100644 --- a/.github/workflows/update-dev-beta-browser-images.yml +++ b/.github/workflows/update-dev-beta-browser-images.yml @@ -17,7 +17,7 @@ jobs: browser: [chrome,firefox,edge] channel: [dev,beta] env: - NAME: ${{ secrets.DOCKER_NAMESPACE || 'selenium' }} + NAME: ${{ vars.DOCKER_NAMESPACE || 'selenium' }} BROWSER: ${{ matrix.browser }} CHANNEL: ${{ matrix.channel }} diff --git a/tag_and_push_browser_images.sh b/tag_and_push_browser_images.sh index aa2744e66..2f14e15e9 100755 --- a/tag_and_push_browser_images.sh +++ b/tag_and_push_browser_images.sh @@ -7,6 +7,7 @@ PUSH_IMAGE="${4:-false}" BROWSER=$5 TAG_VERSION=${VERSION}-${BUILD_DATE} +NAMESPACE=${NAME:-selenium} function short_version() { local __long_version=$1 @@ -20,12 +21,12 @@ echo "Tagging images for browser ${BROWSER}, version ${VERSION}, build date ${BU case "${BROWSER}" in chrome) - CHROME_VERSION=$(docker run --rm selenium/node-chrome:${TAG_VERSION} google-chrome --version | awk '{print $3}') + CHROME_VERSION=$(docker run --rm ${NAMESPACE}/node-chrome:${TAG_VERSION} google-chrome --version | awk '{print $3}') echo "Chrome version -> "${CHROME_VERSION} CHROME_SHORT_VERSION="$(short_version ${CHROME_VERSION})" echo "Short Chrome version -> "${CHROME_SHORT_VERSION} - CHROMEDRIVER_VERSION=$(docker run --rm selenium/node-chrome:${TAG_VERSION} chromedriver --version | awk '{print $2}') + CHROMEDRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-chrome:${TAG_VERSION} chromedriver --version | awk '{print $2}') echo "ChromeDriver version -> "${CHROMEDRIVER_VERSION} CHROMEDRIVER_SHORT_VERSION="$(short_version ${CHROMEDRIVER_VERSION})" echo "Short ChromeDriver version -> "${CHROMEDRIVER_SHORT_VERSION} @@ -64,12 +65,12 @@ chrome) ;; edge) - EDGE_VERSION=$(docker run --rm selenium/node-edge:${TAG_VERSION} microsoft-edge --version | awk '{print $3}') + EDGE_VERSION=$(docker run --rm ${NAMESPACE}/node-edge:${TAG_VERSION} microsoft-edge --version | awk '{print $3}') echo "Edge version -> "${EDGE_VERSION} EDGE_SHORT_VERSION="$(short_version ${EDGE_VERSION})" echo "Short Edge version -> "${EDGE_SHORT_VERSION} - EDGEDRIVER_VERSION=$(docker run --rm selenium/node-edge:${TAG_VERSION} msedgedriver --version | awk '{print $4}') + EDGEDRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-edge:${TAG_VERSION} msedgedriver --version | awk '{print $4}') echo "EdgeDriver version -> "${EDGEDRIVER_VERSION} EDGEDRIVER_SHORT_VERSION="$(short_version ${EDGEDRIVER_VERSION})" echo "Short EdgeDriver version -> "${EDGEDRIVER_SHORT_VERSION} @@ -108,11 +109,11 @@ edge) ;; firefox) - FIREFOX_VERSION=$(docker run --rm selenium/node-firefox:${TAG_VERSION} firefox --version | awk '{print $3}') + FIREFOX_VERSION=$(docker run --rm ${NAMESPACE}/node-firefox:${TAG_VERSION} firefox --version | awk '{print $3}') echo "Firefox version -> "${FIREFOX_VERSION} FIREFOX_SHORT_VERSION="$(short_version ${FIREFOX_VERSION})" echo "Short Firefox version -> "${FIREFOX_SHORT_VERSION} - GECKODRIVER_VERSION=$(docker run --rm selenium/node-firefox:${TAG_VERSION} geckodriver --version | awk 'NR==1{print $2}') + GECKODRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-firefox:${TAG_VERSION} geckodriver --version | awk 'NR==1{print $2}') echo "GeckoDriver version -> "${GECKODRIVER_VERSION} GECKODRIVER_SHORT_VERSION="$(short_version ${GECKODRIVER_VERSION})" echo "Short GeckoDriver version -> "${GECKODRIVER_SHORT_VERSION} From acb7fe731719529f7f3f961ff8be4dbfa2daaa07 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Tue, 23 Jan 2024 18:12:56 +0530 Subject: [PATCH 54/62] feat(chart): Add node registration secret to exec preStop container Update default scalingStrategy.strategy: accurate [skip ci] Signed-off-by: Viet Nguyen Duc --- charts/selenium-grid/configs/node/nodePreStop.sh | 9 ++++++++- charts/selenium-grid/templates/_helpers.tpl | 2 +- charts/selenium-grid/values.yaml | 2 +- tests/charts/ci/JobAutoscaling-values.yaml | 2 +- tests/charts/refValues/sample-aws.yaml | 2 +- tests/charts/refValues/simplex-minikube.yaml | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/charts/selenium-grid/configs/node/nodePreStop.sh b/charts/selenium-grid/configs/node/nodePreStop.sh index dded38676..7b6397b6d 100644 --- a/charts/selenium-grid/configs/node/nodePreStop.sh +++ b/charts/selenium-grid/configs/node/nodePreStop.sh @@ -1,6 +1,13 @@ #!/bin/bash +if [ ! -z "${SE_REGISTRATION_SECRET}" ]; +then + HEADERS="X-REGISTRATION-SECRET: ${SE_REGISTRATION_SECRET}" +else + HEADERS="X-REGISTRATION-SECRET;" +fi + if curl -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status; then - curl -k -X POST ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/se/grid/node/drain --header 'X-REGISTRATION-SECRET;' + curl -k -X POST ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/se/grid/node/drain --header "${HEADERS}" while curl -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status; do sleep 1; done else echo "Node is already drained. Shutting down gracefully!" diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index d30a6d800..ce7a49b48 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -177,7 +177,7 @@ Secret TLS fullname Is registration secret enabled */}} {{- define "seleniumGrid.tls.registrationSecret.enabled" -}} -{{- and .Values.tls.enabled .Values.tls.registrationSecret.enabled | ternary "true" "" -}} +{{- .Values.tls.registrationSecret.enabled | ternary "true" "" -}} {{- end -}} {{/* diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index f915d12c6..5d365c100 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -517,7 +517,7 @@ autoscaling: scaledJobOptions: scalingStrategy: # Change this to "accurate" when the calculation problem is fixed - strategy: default + strategy: accurate # Number of Completed jobs should be kept successfulJobsHistoryLimit: 0 # Number of Failed jobs should be kept (for troubleshooting purposes) diff --git a/tests/charts/ci/JobAutoscaling-values.yaml b/tests/charts/ci/JobAutoscaling-values.yaml index 35742e41a..ad8fe12f3 100644 --- a/tests/charts/ci/JobAutoscaling-values.yaml +++ b/tests/charts/ci/JobAutoscaling-values.yaml @@ -3,7 +3,7 @@ isolateComponents: false autoscaling: enableWithExistingKEDA: true scalingType: job - strategy: default + strategy: accurate scaledOptions: minReplicaCount: 0 maxReplicaCount: 5 diff --git a/tests/charts/refValues/sample-aws.yaml b/tests/charts/refValues/sample-aws.yaml index 097eb4277..88f9c7f58 100644 --- a/tests/charts/refValues/sample-aws.yaml +++ b/tests/charts/refValues/sample-aws.yaml @@ -44,7 +44,7 @@ autoscaling: successfulJobsHistoryLimit: 0 failedJobsHistoryLimit: 5 scalingStrategy: - strategy: default + strategy: accurate hub: subPath: *gridAppRoot diff --git a/tests/charts/refValues/simplex-minikube.yaml b/tests/charts/refValues/simplex-minikube.yaml index a67b0bbf2..109d91750 100644 --- a/tests/charts/refValues/simplex-minikube.yaml +++ b/tests/charts/refValues/simplex-minikube.yaml @@ -56,7 +56,7 @@ autoscaling: successfulJobsHistoryLimit: 0 failedJobsHistoryLimit: 5 scalingStrategy: - strategy: default + strategy: accurate hub: subPath: *gridAppRoot From 84ac1f8cba6f300436f0e38c10855ae5bc97d212 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Tue, 23 Jan 2024 22:56:39 +0700 Subject: [PATCH 55/62] Bump released Selenium 4.17.0 (#2106) Signed-off-by: Viet Nguyen Duc [skip ci] --- Makefile | 8 ++++---- tests/bootstrap.sh | 2 +- tests/charts/ci/JobAutoscaling-values.yaml | 4 +++- tests/charts/refValues/sample-aws.yaml | 2 +- tests/charts/refValues/simplex-minikube.yaml | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 49e2986bd..8d0227d01 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,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.16.0) -BASE_VERSION := $(or $(BASE_VERSION),$(BASE_VERSION),4.16.1) +BASE_RELEASE := $(or $(BASE_RELEASE),$(BASE_RELEASE),selenium-4.17.0) +BASE_VERSION := $(or $(BASE_VERSION),$(BASE_VERSION),4.17.0) 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),4.16.1) +BASE_VERSION_NIGHTLY := $(or $(BASE_VERSION_NIGHTLY),$(BASE_VERSION_NIGHTLY),4.18.0-SNAPSHOT) +VERSION := $(or $(VERSION),$(VERSION),4.17.0) TAG_VERSION := $(VERSION)-$(BUILD_DATE) CHART_VERSION_NIGHTLY := $(or $(CHART_VERSION_NIGHTLY),$(CHART_VERSION_NIGHTLY),1.0.0-nightly) NAMESPACE := $(or $(NAMESPACE),$(NAMESPACE),$(NAME)) diff --git a/tests/bootstrap.sh b/tests/bootstrap.sh index 3d02bf550..24d3c9980 100755 --- a/tests/bootstrap.sh +++ b/tests/bootstrap.sh @@ -7,7 +7,7 @@ if [ "${CI:-false}" = "false" ]; then source docker-selenium-tests/bin/activate fi -python -m pip install selenium==4.16.0 \ +python -m pip install selenium==4.17.2 \ docker===6.1.3 \ | grep -v 'Requirement already satisfied' diff --git a/tests/charts/ci/JobAutoscaling-values.yaml b/tests/charts/ci/JobAutoscaling-values.yaml index ad8fe12f3..2e689b57c 100644 --- a/tests/charts/ci/JobAutoscaling-values.yaml +++ b/tests/charts/ci/JobAutoscaling-values.yaml @@ -3,7 +3,9 @@ isolateComponents: false autoscaling: enableWithExistingKEDA: true scalingType: job - strategy: accurate + scaledJobOptions: + scalingStrategy: + strategy: default scaledOptions: minReplicaCount: 0 maxReplicaCount: 5 diff --git a/tests/charts/refValues/sample-aws.yaml b/tests/charts/refValues/sample-aws.yaml index 88f9c7f58..097eb4277 100644 --- a/tests/charts/refValues/sample-aws.yaml +++ b/tests/charts/refValues/sample-aws.yaml @@ -44,7 +44,7 @@ autoscaling: successfulJobsHistoryLimit: 0 failedJobsHistoryLimit: 5 scalingStrategy: - strategy: accurate + strategy: default hub: subPath: *gridAppRoot diff --git a/tests/charts/refValues/simplex-minikube.yaml b/tests/charts/refValues/simplex-minikube.yaml index 109d91750..a67b0bbf2 100644 --- a/tests/charts/refValues/simplex-minikube.yaml +++ b/tests/charts/refValues/simplex-minikube.yaml @@ -56,7 +56,7 @@ autoscaling: successfulJobsHistoryLimit: 0 failedJobsHistoryLimit: 5 scalingStrategy: - strategy: accurate + strategy: default hub: subPath: *gridAppRoot From 3be1d4287c65ede51be4fc7e7fbc922bf0d359ce Mon Sep 17 00:00:00 2001 From: Bas M Date: Tue, 23 Jan 2024 17:00:56 +0100 Subject: [PATCH 56/62] feat(chart): templating in name(Override) (#2107) Co-authored-by: Viet Nguyen Duc [skip ci] --- charts/selenium-grid/templates/_helpers.tpl | 34 +++++++++---------- .../templates/distributor-deployment.yaml | 6 ++-- .../templates/event-bus-configmap.yaml | 2 +- .../templates/event-bus-deployment.yaml | 4 +-- .../templates/hub-deployment.yaml | 4 +-- charts/selenium-grid/templates/ingress.yaml | 8 ++--- .../templates/logging-configmap.yaml | 2 +- .../templates/node-configmap.yaml | 2 +- .../templates/router-deployment.yaml | 4 +-- .../templates/server-configmap.yaml | 2 +- .../templates/session-map-deployment.yaml | 6 ++-- .../templates/session-queuer-deployment.yaml | 4 +-- .../templates/tls-cert-secret.yaml | 2 +- 13 files changed, 40 insertions(+), 40 deletions(-) diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index ce7a49b48..c41e6d604 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -43,70 +43,70 @@ helm.sh/chart: {{ include "seleniumGrid.chart" . }} Selenium Hub fullname */}} {{- define "seleniumGrid.hub.fullname" -}} -{{- default "selenium-hub" .Values.hub.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- tpl (default "selenium-hub" .Values.hub.nameOverride) $ | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Event bus fullname */}} {{- define "seleniumGrid.eventBus.fullname" -}} -{{- default "selenium-event-bus" .Values.components.eventBus.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- tpl (default "selenium-event-bus" .Values.components.eventBus.nameOverride) $ | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Router fullname */}} {{- define "seleniumGrid.router.fullname" -}} -{{- default "selenium-router" .Values.components.router.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- tpl (default "selenium-router" .Values.components.router.nameOverride) $ | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Distributor fullname */}} {{- define "seleniumGrid.distributor.fullname" -}} -{{- default "selenium-distributor" .Values.components.distributor.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- tpl (default "selenium-distributor" .Values.components.distributor.nameOverride) $ | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* SessionMap fullname */}} {{- define "seleniumGrid.sessionMap.fullname" -}} -{{- default "selenium-session-map" .Values.components.sessionMap.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- tpl (default "selenium-session-map" .Values.components.sessionMap.nameOverride) $ | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* SessionQueue fullname */}} {{- define "seleniumGrid.sessionQueue.fullname" -}} -{{- default "selenium-session-queue" .Values.components.sessionQueue.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- tpl (default "selenium-session-queue" .Values.components.sessionQueue.nameOverride) $ | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Chrome node fullname */}} {{- define "seleniumGrid.chromeNode.fullname" -}} -{{- default "selenium-chrome-node" .Values.chromeNode.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- tpl (default "selenium-chrome-node" .Values.chromeNode.nameOverride) $ | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Firefox node fullname */}} {{- define "seleniumGrid.firefoxNode.fullname" -}} -{{- default "selenium-firefox-node" .Values.firefoxNode.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- tpl (default "selenium-firefox-node" .Values.firefoxNode.nameOverride) $ | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Edge node fullname */}} {{- define "seleniumGrid.edgeNode.fullname" -}} -{{- default "selenium-edge-node" .Values.edgeNode.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- tpl (default "selenium-edge-node" .Values.edgeNode.nameOverride) $ | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Ingress fullname */}} {{- define "seleniumGrid.ingress.fullname" -}} -{{- default "selenium-ingress" .Values.ingress.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- tpl (default "selenium-ingress" .Values.ingress.nameOverride) $ | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* @@ -170,7 +170,7 @@ Get probe settings Secret TLS fullname */}} {{- define "seleniumGrid.tls.fullname" -}} -{{- default "selenium-tls-secret" .Values.tls.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- ( tpl (default "selenium-tls-secret" .Values.tls.nameOverride) $ )| trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* @@ -197,7 +197,7 @@ Get default certificate file name in chart Common secrets cross components */}} {{- define "seleniumGrid.common.secrets" -}} -{{- default "selenium-secrets" .Values.secrets.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- tpl (default "selenium-secrets" .Values.secrets.nameOverride) $ | trunc 63 | trimSuffix "-" -}} {{- end -}} {{- define "seleniumGrid.ingress.nginx.annotations.default" -}} @@ -231,14 +231,14 @@ nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" Service Account fullname */}} {{- define "seleniumGrid.serviceAccount.fullname" -}} -{{- .Values.serviceAccount.name | default "selenium-serviceaccount" | trunc 63 | trimSuffix "-" -}} +{{- tpl (.Values.serviceAccount.name | default "selenium-serviceaccount") $ | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Video ConfigMap fullname */}} {{- define "seleniumGrid.video.fullname" -}} -{{- default "selenium-video" .Values.videoRecorder.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- tpl (default "selenium-video" .Values.videoRecorder.nameOverride) $ | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* @@ -547,7 +547,7 @@ template: volumes: - name: {{ .Values.nodeConfigMap.scriptVolumeMountName }} configMap: - name: {{ .Values.nodeConfigMap.name }} + name: {{ tpl .Values.nodeConfigMap.name $ }} defaultMode: {{ .Values.nodeConfigMap.defaultMode }} - name: dshm emptyDir: @@ -599,8 +599,8 @@ Get the url of the grid. If the external url can be figured out from the ingress {{- if .Values.ingress.enabled -}} {{- if and (not .Values.ingress.hostname) .Values.global.K8S_PUBLIC_IP -}} {{- $host = .Values.global.K8S_PUBLIC_IP -}} - {{- else if and .Values.ingress.hostname (ne .Values.ingress.hostname "selenium-grid.local") -}} - {{- $host = .Values.ingress.hostname -}} + {{- else if and .Values.ingress.hostname (ne (tpl .Values.ingress.hostname $) "selenium-grid.local") -}} + {{- $host = (tpl .Values.ingress.hostname $) -}} {{- end -}} {{- else if .Values.global.K8S_PUBLIC_IP -}} {{- $host = .Values.global.K8S_PUBLIC_IP -}} diff --git a/charts/selenium-grid/templates/distributor-deployment.yaml b/charts/selenium-grid/templates/distributor-deployment.yaml index 52578d6c7..c1848faa4 100644 --- a/charts/selenium-grid/templates/distributor-deployment.yaml +++ b/charts/selenium-grid/templates/distributor-deployment.yaml @@ -46,11 +46,11 @@ spec: {{- end }} envFrom: - configMapRef: - name: {{ .Values.busConfigMap.name }} + name: {{ tpl .Values.busConfigMap.name $ }} - configMapRef: - name: {{ .Values.loggingConfigMap.name }} + name: {{ tpl .Values.loggingConfigMap.name $ }} - configMapRef: - name: {{ .Values.serverConfigMap.name }} + name: {{ tpl .Values.serverConfigMap.name $ }} - secretRef: name: {{ include "seleniumGrid.common.secrets" $ | quote }} {{- with .Values.components.extraEnvFrom }} diff --git a/charts/selenium-grid/templates/event-bus-configmap.yaml b/charts/selenium-grid/templates/event-bus-configmap.yaml index ad2b33756..0515aff22 100644 --- a/charts/selenium-grid/templates/event-bus-configmap.yaml +++ b/charts/selenium-grid/templates/event-bus-configmap.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Values.busConfigMap.name }} + name: {{ tpl .Values.busConfigMap.name $ }} namespace: {{ .Release.Namespace }} {{- with .Values.busConfigMap.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/selenium-grid/templates/event-bus-deployment.yaml b/charts/selenium-grid/templates/event-bus-deployment.yaml index ef29a6908..e783625a9 100644 --- a/charts/selenium-grid/templates/event-bus-deployment.yaml +++ b/charts/selenium-grid/templates/event-bus-deployment.yaml @@ -44,9 +44,9 @@ spec: {{- end }} envFrom: - configMapRef: - name: {{ .Values.loggingConfigMap.name }} + name: {{ tpl .Values.loggingConfigMap.name $ }} - configMapRef: - name: {{ .Values.serverConfigMap.name }} + name: {{ tpl .Values.serverConfigMap.name $ }} - secretRef: name: {{ include "seleniumGrid.common.secrets" $ | quote }} {{- with .Values.components.extraEnvFrom }} diff --git a/charts/selenium-grid/templates/hub-deployment.yaml b/charts/selenium-grid/templates/hub-deployment.yaml index 00fea3f12..60d10d8ed 100644 --- a/charts/selenium-grid/templates/hub-deployment.yaml +++ b/charts/selenium-grid/templates/hub-deployment.yaml @@ -104,9 +104,9 @@ spec: {{- end }} envFrom: - configMapRef: - name: {{ .Values.loggingConfigMap.name }} + name: {{ tpl .Values.loggingConfigMap.name $ }} - configMapRef: - name: {{ .Values.serverConfigMap.name }} + name: {{ tpl .Values.serverConfigMap.name $ }} - secretRef: name: {{ include "seleniumGrid.common.secrets" $ | quote }} {{- with .Values.hub.extraEnvFrom }} diff --git a/charts/selenium-grid/templates/ingress.yaml b/charts/selenium-grid/templates/ingress.yaml index 2f8195b6e..6f53995da 100644 --- a/charts/selenium-grid/templates/ingress.yaml +++ b/charts/selenium-grid/templates/ingress.yaml @@ -32,24 +32,24 @@ spec: {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} ingressClassName: {{ .Values.ingress.className }} {{- end }} - {{- if and (or .Values.tls.enabled .Values.tls.ingress.generateTLS) .Values.ingress.hostname (not .Values.ingress.tls) }} + {{- if and (or .Values.tls.enabled .Values.tls.ingress.generateTLS) (tpl .Values.ingress.hostname $) (not .Values.ingress.tls) }} tls: - hosts: - - {{ .Values.ingress.hostname | quote }} + - {{ tpl .Values.ingress.hostname $ | quote }} secretName: {{ include "seleniumGrid.tls.fullname" . | quote }} {{- else if .Values.ingress.tls }} tls: {{- range .Values.ingress.tls }} - hosts: {{- range .hosts }} - - {{ . | quote }} + - {{ tpl . $ | quote }} {{- end }} secretName: {{ tpl (.secretName) $ | quote }} {{- end }} {{- end }} rules: {{- if $.Values.ingress.hostname }} - - host: {{ .Values.ingress.hostname }} + - host: {{ tpl $.Values.ingress.hostname $ }} http: {{- else }} - http: diff --git a/charts/selenium-grid/templates/logging-configmap.yaml b/charts/selenium-grid/templates/logging-configmap.yaml index 36acc3bde..a8c8de1f2 100644 --- a/charts/selenium-grid/templates/logging-configmap.yaml +++ b/charts/selenium-grid/templates/logging-configmap.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Values.loggingConfigMap.name }} + name: {{ tpl .Values.loggingConfigMap.name $ }} namespace: {{ .Release.Namespace }} {{- with .Values.loggingConfigMap.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/selenium-grid/templates/node-configmap.yaml b/charts/selenium-grid/templates/node-configmap.yaml index 0bb72acb4..bdd72461a 100644 --- a/charts/selenium-grid/templates/node-configmap.yaml +++ b/charts/selenium-grid/templates/node-configmap.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Values.nodeConfigMap.name }} + name: {{ tpl .Values.nodeConfigMap.name $ }} namespace: {{ .Release.Namespace }} {{- with .Values.nodeConfigMap.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/selenium-grid/templates/router-deployment.yaml b/charts/selenium-grid/templates/router-deployment.yaml index 469dc1652..65a980403 100644 --- a/charts/selenium-grid/templates/router-deployment.yaml +++ b/charts/selenium-grid/templates/router-deployment.yaml @@ -58,9 +58,9 @@ spec: {{- end }} envFrom: - configMapRef: - name: {{ .Values.loggingConfigMap.name }} + name: {{ tpl .Values.loggingConfigMap.name $ }} - configMapRef: - name: {{ .Values.serverConfigMap.name }} + name: {{ tpl .Values.serverConfigMap.name $ }} - secretRef: name: {{ include "seleniumGrid.common.secrets" $ | quote }} {{- with .Values.components.extraEnvFrom }} diff --git a/charts/selenium-grid/templates/server-configmap.yaml b/charts/selenium-grid/templates/server-configmap.yaml index dc3d80b73..33b573aa5 100644 --- a/charts/selenium-grid/templates/server-configmap.yaml +++ b/charts/selenium-grid/templates/server-configmap.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Values.serverConfigMap.name }} + name: {{ tpl .Values.serverConfigMap.name $ }} namespace: {{ .Release.Namespace }} {{- with .Values.busConfigMap.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/selenium-grid/templates/session-map-deployment.yaml b/charts/selenium-grid/templates/session-map-deployment.yaml index 27d120540..52c5ca42e 100644 --- a/charts/selenium-grid/templates/session-map-deployment.yaml +++ b/charts/selenium-grid/templates/session-map-deployment.yaml @@ -37,13 +37,13 @@ spec: {{- end }} envFrom: - configMapRef: - name: {{ .Values.loggingConfigMap.name }} + name: {{ tpl .Values.loggingConfigMap.name $ }} - configMapRef: - name: {{ .Values.serverConfigMap.name }} + name: {{ tpl .Values.serverConfigMap.name $ }} - secretRef: name: {{ include "seleniumGrid.common.secrets" $ | quote }} - configMapRef: - name: {{ .Values.busConfigMap.name }} + name: {{ tpl .Values.busConfigMap.name $ }} {{- with .Values.components.extraEnvFrom }} {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/selenium-grid/templates/session-queuer-deployment.yaml b/charts/selenium-grid/templates/session-queuer-deployment.yaml index 546090e43..332db749e 100644 --- a/charts/selenium-grid/templates/session-queuer-deployment.yaml +++ b/charts/selenium-grid/templates/session-queuer-deployment.yaml @@ -37,9 +37,9 @@ spec: {{- end }} envFrom: - configMapRef: - name: {{ .Values.loggingConfigMap.name }} + name: {{ tpl .Values.loggingConfigMap.name $ }} - configMapRef: - name: {{ .Values.serverConfigMap.name }} + name: {{ tpl .Values.serverConfigMap.name $ }} - secretRef: name: {{ include "seleniumGrid.common.secrets" $ | quote }} {{- with .Values.components.extraEnvFrom }} diff --git a/charts/selenium-grid/templates/tls-cert-secret.yaml b/charts/selenium-grid/templates/tls-cert-secret.yaml index 000a1e5a7..1ed202e1f 100644 --- a/charts/selenium-grid/templates/tls-cert-secret.yaml +++ b/charts/selenium-grid/templates/tls-cert-secret.yaml @@ -14,7 +14,7 @@ data: {{- if and .Values.ingress.enabled .Values.tls.ingress.generateTLS (not .Values.tls.enabled) }} {{- $name := default "SeleniumHQ" .Values.tls.ingress.defaultName -}} {{- $days := default 365 (.Values.tls.ingress.defaultDays | int) -}} - {{- $cn := ternary .Values.tls.ingress.defaultCN .Values.ingress.hostname (empty .Values.ingress.hostname) -}} + {{- $cn := ternary .Values.tls.ingress.defaultCN (tpl .Values.ingress.hostname $) (empty .Values.ingress.hostname) -}} {{- $server := genSelfSignedCert $cn ( default nil .Values.tls.ingress.defaultIPList ) ( default nil .Values.tls.ingress.defaultSANList ) $days }} tls.crt: {{ $server.Cert | b64enc }} tls.key: {{ $server.Key | b64enc }} From 618470e8e1d47f91dd98165e93a58dd8862d6367 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Tue, 23 Jan 2024 22:23:19 +0530 Subject: [PATCH 57/62] feat(chart): templating in name(Override) for new object [deploy] Signed-off-by: Viet Nguyen Duc --- charts/selenium-grid/templates/_helpers.tpl | 13 ++++++++++--- .../selenium-grid/templates/recorder-configmap.yaml | 2 +- .../selenium-grid/templates/uploader-configmap.yaml | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index c41e6d604..ee293c1eb 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -235,10 +235,17 @@ Service Account fullname {{- end -}} {{/* -Video ConfigMap fullname +Recorder ConfigMap fullname */}} -{{- define "seleniumGrid.video.fullname" -}} -{{- tpl (default "selenium-video" .Values.videoRecorder.nameOverride) $ | trunc 63 | trimSuffix "-" -}} +{{- define "seleniumGrid.recorder.fullname" -}} +{{- tpl (default "selenium-recorder-config" .Values.recorderConfigMap.name) $ | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Uploader ConfigMap fullname +*/}} +{{- define "seleniumGrid.uploader.fullname" -}} +{{- tpl (default "selenium-uploader-config" .Values.uploaderConfigMap.name) $ | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* diff --git a/charts/selenium-grid/templates/recorder-configmap.yaml b/charts/selenium-grid/templates/recorder-configmap.yaml index c573d2c9f..d11dd3fd5 100644 --- a/charts/selenium-grid/templates/recorder-configmap.yaml +++ b/charts/selenium-grid/templates/recorder-configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Values.recorderConfigMap.name }} + name: {{ template "seleniumGrid.recorder.fullname" $ }} namespace: {{ .Release.Namespace }} {{- with .Values.recorderConfigMap.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/selenium-grid/templates/uploader-configmap.yaml b/charts/selenium-grid/templates/uploader-configmap.yaml index 912b0fd83..bf36f9600 100644 --- a/charts/selenium-grid/templates/uploader-configmap.yaml +++ b/charts/selenium-grid/templates/uploader-configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Values.uploaderConfigMap.name }} + name: {{ template "seleniumGrid.uploader.fullname" $ }} namespace: {{ .Release.Namespace }} {{- with .Values.uploaderConfigMap.annotations }} annotations: {{- toYaml . | nindent 4 }} From 48759d2015ac00be5ad41caabdec365bb04861f3 Mon Sep 17 00:00:00 2001 From: Selenium CI Bot Date: Tue, 23 Jan 2024 17:03:50 +0000 Subject: [PATCH 58/62] Update tag in docs and files --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- NodeDocker/config.toml | 8 +- README.md | 134 ++++++++++++------------ charts/selenium-grid/Chart.yaml | 4 +- charts/selenium-grid/README.md | 14 +-- charts/selenium-grid/values.yaml | 28 ++--- docker-compose-v2-tracing.yml | 8 +- docker-compose-v2.yml | 8 +- docker-compose-v3-basicauth.yml | 8 +- docker-compose-v3-dev.yml | 8 +- docker-compose-v3-dynamic-grid.yml | 4 +- docker-compose-v3-full-grid-dev.yml | 16 +-- docker-compose-v3-full-grid-swarm.yml | 8 +- docker-compose-v3-full-grid-tracing.yml | 16 +-- docker-compose-v3-full-grid.yml | 16 +-- docker-compose-v3-swarm.yml | 8 +- docker-compose-v3-tracing.yml | 8 +- docker-compose-v3-video.yml | 14 +-- docker-compose-v3.yml | 8 +- 19 files changed, 160 insertions(+), 160 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 20f98a2ff..4efd11f18 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -56,7 +56,7 @@ body: attributes: label: Docker Selenium version (image tag) description: What version of Docker Selenium are you using? - placeholder: 4.16.1-20231219? Please use the full tag, avoid "latest" + placeholder: 4.17.0-20240123? Please use the full tag, avoid "latest" validations: required: true - type: input diff --git a/NodeDocker/config.toml b/NodeDocker/config.toml index f1916a401..ec3e0a1a0 100644 --- a/NodeDocker/config.toml +++ b/NodeDocker/config.toml @@ -2,9 +2,9 @@ # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.16.1-20231219", '{"browserName": "firefox", "platformName": "linux"}', - "selenium/standalone-chrome:4.16.1-20231219", '{"browserName": "chrome", "platformName": "linux"}', - "selenium/standalone-edge:4.16.1-20231219", '{"browserName": "MicrosoftEdge", "platformName": "linux"}' + "selenium/standalone-firefox:4.17.0-20240123", '{"browserName": "firefox", "platformName": "linux"}', + "selenium/standalone-chrome:4.17.0-20240123", '{"browserName": "chrome", "platformName": "linux"}', + "selenium/standalone-edge:4.17.0-20240123", '{"browserName": "MicrosoftEdge", "platformName": "linux"}' ] # URL for connecting to the docker daemon @@ -14,7 +14,7 @@ configs = [ # socat -4 TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-6.1-20231219" +video-image = "selenium/video:ffmpeg-6.1-20240123" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values diff --git a/README.md b/README.md index 2f1907457..788687a6e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ The project is made possible by volunteer contributors who have put in thousands and made the source code freely available under the [Apache License 2.0](LICENSE.md). These Docker images come with a handful of tags to simplify its usage, have a look at them in one of -our [releases](https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.16.1-20231219). +our [releases](https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.17.0-20240123). To get notifications of new releases, add yourself as a "Releases only" watcher. @@ -66,7 +66,7 @@ Talk to us at https://www.selenium.dev/support/ 1. Start a Docker container with Firefox ```bash -docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231219 +docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-firefox:4.17.0-20240123 ``` 2. Point your WebDriver tests to http://localhost:4444 @@ -261,17 +261,17 @@ For more information on the Dev and Beta channel container images, see the blog ![Firefox](https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_24x24.png) Firefox ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231219 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-firefox:4.17.0-20240123 ``` ![Chrome](https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_24x24.png) Chrome ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231219 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-chrome:4.17.0-20240123 ``` ![Edge](https://raw.githubusercontent.com/alrra/browser-logos/main/src/edge/edge_24x24.png) Edge ```bash -docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-edge:4.16.1-20231219 +docker run -d -p 4444:4444 --shm-size="2g" selenium/standalone-edge:4.17.0-20240123 ``` _Note: Only one Standalone container can run on port_ `4444` _at the same time._ @@ -290,44 +290,44 @@ A Docker [network](https://docs.docker.com/engine/reference/commandline/network_ ```bash $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231219 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.17.0-20240123 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.16.1-20231219 + selenium/node-chrome:4.17.0-20240123 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.16.1-20231219 + selenium/node-edge:4.17.0-20240123 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.16.1-20231219 + selenium/node-firefox:4.17.0-20240123 ``` ##### Windows PowerShell ```powershell $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231219 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.17.0-20240123 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-chrome:4.16.1-20231219 + selenium/node-chrome:4.17.0-20240123 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-edge:4.16.1-20231219 + selenium/node-edge:4.17.0-20240123 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` --shm-size="2g" ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` - selenium/node-firefox:4.16.1-20231219 + selenium/node-firefox:4.17.0-20240123 ``` When you are done using the Grid, and the containers have exited, the network can be removed with the following command: @@ -344,7 +344,7 @@ configured to expose different ports. ##### Hub - Machine/VM 1 ```bash -$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.16.1-20231219 +$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.17.0-20240123 ``` ##### Node Chrome - Machine/VM 2 @@ -358,7 +358,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-chrome:4.16.1-20231219 + selenium/node-chrome:4.17.0-20240123 ``` ###### Windows PowerShell @@ -370,7 +370,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-chrome:4.16.1-20231219 + selenium/node-chrome:4.17.0-20240123 ``` @@ -385,7 +385,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-edge:4.16.1-20231219 + selenium/node-edge:4.17.0-20240123 ``` ###### Windows PowerShell @@ -397,7 +397,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-edge:4.16.1-20231219 + selenium/node-edge:4.17.0-20240123 ``` ##### Node Firefox - Machine/VM 4 @@ -411,7 +411,7 @@ $ docker run -d -p 5555:5555 \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ - selenium/node-firefox:4.16.1-20231219 + selenium/node-firefox:4.17.0-20240123 ``` ###### Windows PowerShell @@ -423,7 +423,7 @@ $ docker run -d -p 5555:5555 ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` - selenium/node-firefox:4.16.1-20231219 + selenium/node-firefox:4.17.0-20240123 ``` ##### Node Chrome - Machine/VM 4 @@ -438,7 +438,7 @@ $ docker run -d -p 5556:5556 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -e SE_NODE_HOST= \ -e SE_NODE_PORT=5556 \ - selenium/node-chrome:4.16.1-20231219 + selenium/node-chrome:4.17.0-20240123 ``` ###### Windows PowerShell @@ -451,7 +451,7 @@ $ docker run -d -p 5556:5556 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -e SE_NODE_HOST= ` -e SE_NODE_PORT=5556 ` - selenium/node-chrome:4.16.1-20231219 + selenium/node-chrome:4.17.0-20240123 ``` #### Docker Compose @@ -483,7 +483,7 @@ ___ ## Video recording -Tests execution can be recorded by using the `selenium/video:ffmpeg-6.1-20231219` +Tests execution can be recorded by using the `selenium/video:ffmpeg-6.1-20240123` Docker image. One container is needed per each container where a browser is running. This means if you are running 5 Nodes/Standalone containers, you will need 5 video containers, the mapping is 1-1. @@ -509,8 +509,8 @@ This example shows how to start the containers manually: ``` bash $ docker network create grid -$ docker run -d -p 4444:4444 -p 6900:5900 --net grid --name selenium --shm-size="2g" selenium/standalone-chrome:4.16.1-20231219 -$ docker run -d --net grid --name video -v /tmp/videos:/videos selenium/video:ffmpeg-6.1-20231219 +$ docker run -d -p 4444:4444 -p 6900:5900 --net grid --name selenium --shm-size="2g" selenium/standalone-chrome:4.17.0-20240123 +$ docker run -d --net grid --name video -v /tmp/videos:/videos selenium/video:ffmpeg-6.1-20240123 # Run your tests $ docker stop video && docker rm video $ docker stop selenium && docker rm selenium @@ -542,9 +542,9 @@ You can save this file locally and name it, for example, `config.toml`. # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.16.1-20231219", '{"browserName": "firefox"}', - "selenium/standalone-chrome:4.16.1-20231219", '{"browserName": "chrome"}', - "selenium/standalone-edge:4.16.1-20231219", '{"browserName": "MicrosoftEdge"}' + "selenium/standalone-firefox:4.17.0-20240123", '{"browserName": "firefox"}', + "selenium/standalone-chrome:4.17.0-20240123", '{"browserName": "chrome"}', + "selenium/standalone-edge:4.17.0-20240123", '{"browserName": "MicrosoftEdge"}' ] # URL for connecting to the docker daemon @@ -557,7 +557,7 @@ configs = [ # Linux: varies from machine to machine, please mount /var/run/docker.sock. If this does not work, please create an issue. url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-6.1-20231219" +video-image = "selenium/video:ffmpeg-6.1-20240123" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values @@ -576,28 +576,28 @@ virtual machines. ```bash $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231219 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.17.0-20240123 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/node-docker:4.16.1-20231219 + selenium/node-docker:4.17.0-20240123 ``` #### Windows PowerShell ```powershell $ docker network create grid -$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231219 +$ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.17.0-20240123 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub ` -e SE_EVENT_BUS_PUBLISH_PORT=4442 ` -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/node-docker:4.16.1-20231219 + selenium/node-docker:4.17.0-20240123 ``` To have the assets saved on your host, please mount your host path to `/opt/selenium/assets`. @@ -618,7 +618,7 @@ docker run --rm --name selenium-docker -p 4444:4444 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/standalone-docker:4.16.1-20231219 + selenium/standalone-docker:4.17.0-20240123 ``` #### Windows PowerShell @@ -628,7 +628,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/standalone-docker:4.16.1-20231219 + selenium/standalone-docker:4.17.0-20240123 ``` ### Using Dynamic Grid in different machines/VMs @@ -636,7 +636,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` #### Hub - Machine/VM 1 ```bash -$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.16.1-20231219 +$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.17.0-20240123 ``` #### Node Chrome - Machine/VM 2 @@ -651,7 +651,7 @@ $ docker run -d -p 5555:5555 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/node-docker:4.16.1-20231219 + selenium/node-docker:4.17.0-20240123 ``` #### Windows PowerShell @@ -664,7 +664,7 @@ $ docker run -d -p 5555:5555 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/node-docker:4.16.1-20231219 + selenium/node-docker:4.17.0-20240123 ``` Complete the `[server]` section in the `config.toml` file. @@ -673,9 +673,9 @@ Complete the `[server]` section in the `config.toml` file. # Configs have a mapping between the Docker image to use and the capabilities that need to be matched to # start a container with the given image. configs = [ - "selenium/standalone-firefox:4.16.1-20231219", "{\"browserName\": \"firefox\"}", - "selenium/standalone-chrome:4.16.1-20231219", "{\"browserName\": \"chrome\"}", - "selenium/standalone-edge:4.16.1-20231219", "{\"browserName\": \"MicrosoftEdge\"}" + "selenium/standalone-firefox:4.17.0-20240123", "{\"browserName\": \"firefox\"}", + "selenium/standalone-chrome:4.17.0-20240123", "{\"browserName\": \"chrome\"}", + "selenium/standalone-edge:4.17.0-20240123", "{\"browserName\": \"MicrosoftEdge\"}" ] # URL for connecting to the docker daemon @@ -688,7 +688,7 @@ configs = [ # Linux: varies from machine to machine, please mount /var/run/docker.sock. If this does not work, please create an issue. url = "http://127.0.0.1:2375" # Docker image used for video recording -video-image = "selenium/video:ffmpeg-6.1-20231219" +video-image = "selenium/video:ffmpeg-6.1-20240123" # Uncomment the following section if you are running the node on a separate VM # Fill out the placeholders with appropriate values @@ -722,7 +722,7 @@ docker run --rm --name selenium-docker -p 4444:4444 \ -v ${PWD}/config.toml:/opt/bin/config.toml \ -v ${PWD}/assets:/opt/selenium/assets \ -v /var/run/docker.sock:/var/run/docker.sock \ - selenium/standalone-docker:4.16.1-20231219 + selenium/standalone-docker:4.17.0-20240123 ``` #### Windows PowerShell @@ -733,7 +733,7 @@ docker run --rm --name selenium-docker -p 4444:4444 ` -v ${PWD}/config.toml:/opt/bin/config.toml ` -v ${PWD}/assets:/opt/selenium/assets ` -v /var/run/docker.sock:/var/run/docker.sock ` - selenium/standalone-docker:4.16.1-20231219 + selenium/standalone-docker:4.17.0-20240123 ``` @@ -771,7 +771,7 @@ ___ You can pass `SE_OPTS` variable with additional command line parameters for starting a hub or a node. ``` bash -$ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub selenium/hub:4.16.1-20231219 +$ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub selenium/hub:4.17.0-20240123 ``` ### SE_JAVA_OPTS Java Environment Options @@ -779,7 +779,7 @@ $ docker run -d -p 4444:4444 -e SE_OPTS="--log-level FINE" --name selenium-hub s You can pass `SE_JAVA_OPTS` environment variable to the Java process. ``` bash -$ docker run -d -p 4444:4444 -e SE_JAVA_OPTS=-Xmx512m --name selenium-hub selenium/hub:4.16.1-20231219 +$ docker run -d -p 4444:4444 -e SE_JAVA_OPTS=-Xmx512m --name selenium-hub selenium/hub:4.17.0-20240123 ``` ### Node configuration options @@ -801,7 +801,7 @@ $ docker run -d \ -e SE_EVENT_BUS_HOST= \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e SE_NODE_STEREOTYPE="{\"browserName\":\"${SE_NODE_BROWSER_NAME}\",\"browserVersion\":\"${SE_NODE_BROWSER_VERSION}\",\"platformName\": \"Linux\"}" \ - --shm-size="2g" selenium/node-chrome:4.16.1-20231219 + --shm-size="2g" selenium/node-chrome:4.17.0-20240123 ``` ### Setting Sub Path @@ -820,7 +820,7 @@ These settings can be adjusted by specifying `SE_SCREEN_WIDTH`, `SE_SCREEN_HEIGH environmental variables when starting the container. ``` bash -docker run -d -e SE_SCREEN_WIDTH=1366 -e SE_SCREEN_HEIGHT=768 -e SE_SCREEN_DEPTH=24 -e SE_SCREEN_DPI=74 selenium/standalone-firefox:4.16.1-20231219 +docker run -d -e SE_SCREEN_WIDTH=1366 -e SE_SCREEN_HEIGHT=768 -e SE_SCREEN_DEPTH=24 -e SE_SCREEN_DPI=74 selenium/standalone-firefox:4.17.0-20240123 ``` ### Grid Url and Session Timeout @@ -870,7 +870,7 @@ To avoid starting the server you can set the `SE_START_XVFB` environment variabl ``` bash $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ - -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e SE_START_XVFB=false --shm-size="2g" selenium/node-chrome:4.16.1-20231219 + -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e SE_START_XVFB=false --shm-size="2g" selenium/node-chrome:4.17.0-20240123 ``` For more information, see this GitHub [issue](https://github.com/SeleniumHQ/docker-selenium/issues/567). @@ -883,7 +883,7 @@ pod and then scale a new one after N sessions. Set the environment variable `SE_ a value higher than zero to enable this behaviour. ``` bash -$ docker run -e SE_DRAIN_AFTER_SESSION_COUNT=5 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231219 +$ docker run -e SE_DRAIN_AFTER_SESSION_COUNT=5 --shm-size="2g" selenium/standalone-firefox:4.17.0-20240123 ``` With the previous command, the Standalone container will shut down after 5 sessions have been executed. @@ -986,22 +986,22 @@ $ docker network create grid $ docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub \ --health-cmd='/opt/bin/check-grid.sh --host 0.0.0.0 --port 4444' \ --health-interval=15s --health-timeout=30s --health-retries=5 \ - selenium/hub:4.16.1-20231219 + selenium/hub:4.17.0-20240123 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.16.1-20231219 + selenium/node-chrome:4.17.0-20240123 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.16.1-20231219 + selenium/node-edge:4.17.0-20240123 $ docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.16.1-20231219 + selenium/node-firefox:4.17.0-20240123 ``` **Note:** The `\` line delimiter won't work on Windows-based terminals, try either `^` or a backtick. @@ -1134,7 +1134,7 @@ RUN mkdir -p -m755 /seluser/.pki/nssdb \ && chown -R 1200:1201 /seluser # Start from Selenium image and add relevant files from build image -FROM selenium/node-chrome:4.16.1-20231219 +FROM selenium/node-chrome:4.17.0-20240123 USER root COPY --from=build /seluser/ /home/seluser/ USER seluser @@ -1149,7 +1149,7 @@ RUN mkdir -p "/distribution" "/certs" && \ echo '{ "policies": { "Certificates": { "Install": ["/opt/firefox-latest/YOUR_CA.pem"] }} }' >"/distribution/policies.json" # Start from Selenium image and add relevant files from build image -FROM selenium/node-firefox:4.16.1-20231219 +FROM selenium/node-firefox:4.17.0-20240123 USER root COPY --from=build /certs /opt/firefox-latest COPY --from=build /distribution /opt/firefox-latest/distribution @@ -1172,9 +1172,9 @@ You can override it with the `SE_VNC_PORT` environment variable in case you want Here is an example with the standalone images, the same concept applies to the node images. ``` bash -$ docker run -d -p 4444:4444 -p 5900:5900 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231219 -$ docker run -d -p 4445:4444 -p 5901:5900 --shm-size="2g" selenium/standalone-edge:4.16.1-20231219 -$ docker run -d -p 4446:4444 -p 5902:5900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231219 +$ docker run -d -p 4444:4444 -p 5900:5900 --shm-size="2g" selenium/standalone-chrome:4.17.0-20240123 +$ docker run -d -p 4445:4444 -p 5901:5900 --shm-size="2g" selenium/standalone-edge:4.17.0-20240123 +$ docker run -d -p 4446:4444 -p 5902:5900 --shm-size="2g" selenium/standalone-firefox:4.17.0-20240123 ``` Then, you would use in your VNC client: @@ -1202,9 +1202,9 @@ You can also override it with the `SE_NO_VNC_PORT` environment variable in case Here is an example with the standalone images, the same concept applies to the node images. ``` bash -$ docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:4.16.1-20231219 -$ docker run -d -p 4445:4444 -p 7901:7900 --shm-size="2g" selenium/standalone-edge:4.16.1-20231219 -$ docker run -d -p 4446:4444 -p 7902:7900 --shm-size="2g" selenium/standalone-firefox:4.16.1-20231219 +$ docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:4.17.0-20240123 +$ docker run -d -p 4445:4444 -p 7901:7900 --shm-size="2g" selenium/standalone-edge:4.17.0-20240123 +$ docker run -d -p 4446:4444 -p 7902:7900 --shm-size="2g" selenium/standalone-firefox:4.17.0-20240123 ``` Then, you would use in your browser: @@ -1229,28 +1229,28 @@ In order to enable tracing in the Selenium Grid container, the following command ```bash docker network create grid docker run -d -p 16686:16686 -p 14250:14250 --net grid --name jaeger jaegertracing/all-in-one:1.17 -docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.16.1-20231219 +docker run -d -p 4442-4444:4442-4444 --net grid --name selenium-hub selenium/hub:4.17.0-20240123 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ -e JAVA_OPTS="-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-chrome" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-chrome:4.16.1-20231219 + selenium/node-chrome:4.17.0-20240123 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ -e JAVA_OPTS="-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-edge" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-edge:4.16.1-20231219 + selenium/node-edge:4.17.0-20240123 docker run -d --net grid -e SE_EVENT_BUS_HOST=selenium-hub \ --shm-size="2g" \ -e SE_ENABLE_TRACING=true \ -e JAVA_OPTS="-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-firefox" \ -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \ - selenium/node-firefox:4.16.1-20231219 + selenium/node-firefox:4.17.0-20240123 ``` You can also refer to the below docker-compose yaml files to be able to start a simple grid (or) a dynamic grid. @@ -1310,7 +1310,7 @@ container in the following way: ```bash docker run -d -p 4444:4444 --shm-size="2g" \ -v /home/ubuntu/files:/home/seluser/Downloads \ - selenium/standalone-chrome:4.16.1-20231219 + selenium/standalone-chrome:4.17.0-20240123 ``` That will mount the host `/home/ubuntu/files` directory diff --git a/charts/selenium-grid/Chart.yaml b/charts/selenium-grid/Chart.yaml index 16f1a7041..a6cfa81bf 100644 --- a/charts/selenium-grid/Chart.yaml +++ b/charts/selenium-grid/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: selenium-grid description: A Helm chart for creating a Selenium Grid Server in Kubernetes type: application -version: 0.26.4 -appVersion: 4.16.1-20231219 +version: 0.27.0 +appVersion: 4.17.0-20240123 icon: https://github.com/SeleniumHQ/docker-selenium/raw/trunk/logo.png dependencies: - repository: https://kedacore.github.io/charts diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index 161fdcb80..029aa1bef 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -274,9 +274,9 @@ For now, global configuration supported is: |---------------------------------------|-----------------------|----------------------------------------| | `global.K8S_PUBLIC_IP` | `""` | Public IP of the host running K8s | | `global.seleniumGrid.imageRegistry` | `selenium` | Distribution registry to pull images | -| `global.seleniumGrid.imageTag` | `4.16.1-20231219` | Image tag for all selenium components | -| `global.seleniumGrid.nodesImageTag` | `4.16.1-20231219` | Image tag for browser's nodes | -| `global.seleniumGrid.videoImageTag` | `ffmpeg-6.1-20231219` | Image tag for browser's video recorder | +| `global.seleniumGrid.imageTag` | `4.17.0-20240123` | Image tag for all selenium components | +| `global.seleniumGrid.nodesImageTag` | `4.17.0-20240123` | Image tag for browser's nodes | +| `global.seleniumGrid.videoImageTag` | `ffmpeg-6.1-20240123` | Image tag for browser's video recorder | | `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images | | `global.seleniumGrid.imagePullSecret` | `""` | Pull secret to be used for all images | | `global.seleniumGrid.affinity` | `{}` | Affinity assigned globally | @@ -639,7 +639,7 @@ This table contains the configuration parameters of the chart and their default | `chromeNode.replicas` | `1` | Number of chrome nodes. Disabled if autoscaling is enabled. | | `chromeNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `chromeNode.imageName` | `node-chrome` | Image of chrome nodes | -| `chromeNode.imageTag` | `4.16.1-20231219` | Image of chrome nodes | +| `chromeNode.imageTag` | `4.17.0-20240123` | Image of chrome nodes | | `chromeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `chromeNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `chromeNode.ports` | `[]` | Extra ports list to enable on container (e.g VNC, NoVNC, SSH if any) | @@ -682,7 +682,7 @@ This table contains the configuration parameters of the chart and their default | `firefoxNode.replicas` | `1` | Number of firefox nodes. Disabled if autoscaling is enabled. | | `firefoxNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `firefoxNode.imageName` | `node-firefox` | Image of firefox nodes | -| `firefoxNode.imageTag` | `4.16.1-20231219` | Image of firefox nodes | +| `firefoxNode.imageTag` | `4.17.0-20240123` | Image of firefox nodes | | `firefoxNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `firefoxNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `firefoxNode.ports` | `[]` | Extra ports list to enable on container (e.g VNC, NoVNC, SSH if any) | @@ -725,7 +725,7 @@ This table contains the configuration parameters of the chart and their default | `edgeNode.replicas` | `1` | Number of edge nodes. Disabled if autoscaling is enabled. | | `edgeNode.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `edgeNode.imageName` | `node-edge` | Image of edge nodes | -| `edgeNode.imageTag` | `4.16.1-20231219` | Image of edge nodes | +| `edgeNode.imageTag` | `4.17.0-20240123` | Image of edge nodes | | `edgeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `edgeNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) | | `edgeNode.ports` | `[]` | Extra ports list to enable on container (e.g VNC, NoVNC, SSH if any) | @@ -766,7 +766,7 @@ This table contains the configuration parameters of the chart and their default | `videoRecorder.enabled` | `false` | Enable video recorder for node | | `videoRecorder.imageRegistry` | `nil` | Distribution registry to pull the image (this overwrites `.global.seleniumGrid.imageRegistry` value) | | `videoRecorder.imageName` | `video` | Selenium video recorder image name | -| `videoRecorder.imageTag` | `ffmpeg-6.1-20231219` | Image tag of video recorder | +| `videoRecorder.imageTag` | `ffmpeg-6.1-20240123` | Image tag of video recorder | | `videoRecorder.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) | | `videoRecorder.uploader.enabled` | `false` | Enable the uploader for videos | | `videoRecorder.uploader.destinationPrefix` | `` | Destination for uploading video file. It is following `rclone` config | diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index 5d365c100..33139674f 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -7,13 +7,13 @@ global: # Image registry for all selenium components imageRegistry: selenium # Image tag for all selenium components - imageTag: 4.16.1-20231219 + imageTag: 4.17.0-20240123 # Image tag for browser's nodes - nodesImageTag: 4.16.1-20231219 + nodesImageTag: 4.17.0-20240123 # Image tag for browser's video recorder - videoImageTag: ffmpeg-6.1-20231219 + videoImageTag: ffmpeg-6.1-20240123 # Image tag for browser's uploader - uploaderImageTag: rclone-1.65-20231219 + uploaderImageTag: rclone-1.65-20240123 # Pull secret for all components, can be overridden individually imagePullSecret: "" # Log level for all components. Possible values describe here: https://www.selenium.dev/documentation/grid/configuration/cli_options/#logging @@ -183,7 +183,7 @@ components: # Router image name imageName: router # Router image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231219 + # imageTag: 4.17.0-20240123 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -245,7 +245,7 @@ components: # Distributor image name imageName: distributor # Distributor image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231219 + # imageTag: 4.17.0-20240123 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -278,7 +278,7 @@ components: # Event Bus image name imageName: event-bus # Event Bus image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231219 + # imageTag: 4.17.0-20240123 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -317,7 +317,7 @@ components: # Session Map image name imageName: sessions # Session Map image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231219 + # imageTag: 4.17.0-20240123 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -348,7 +348,7 @@ components: # Session Queue image name imageName: session-queue # Session Queue image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231219 + # imageTag: 4.17.0-20240123 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent @@ -402,7 +402,7 @@ hub: # Selenium Hub image name imageName: hub # Selenium Hub image tag (this overwrites global.seleniumGrid.imageTag parameter) - # imageTag: 4.16.1-20231219 + # imageTag: 4.17.0-20240123 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -556,7 +556,7 @@ chromeNode: # Image of chrome nodes imageName: node-chrome # Image of chrome nodes (this overwrites global.seleniumGrid.nodesImageTag) - # imageTag: 4.16.1-20231219 + # imageTag: 4.17.0-20240123 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -716,7 +716,7 @@ firefoxNode: # Image of firefox nodes imageName: node-firefox # Image of firefox nodes (this overwrites global.seleniumGrid.nodesImageTag) - # imageTag: 4.16.1-20231219 + # imageTag: 4.17.0-20240123 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -874,7 +874,7 @@ edgeNode: # Image of edge nodes imageName: node-edge # Image of edge nodes (this overwrites global.seleniumGrid.nodesImageTag) - # imageTag: 4.16.1-20231219 + # imageTag: 4.17.0-20240123 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) @@ -1021,7 +1021,7 @@ videoRecorder: # Image of video recorder imageName: video # Image of video recorder - # imageTag: ffmpeg-6.1-20231219 + # imageTag: ffmpeg-6.1-20240123 # Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) imagePullPolicy: IfNotPresent # Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) diff --git a/docker-compose-v2-tracing.yml b/docker-compose-v2-tracing.yml index fc5469aa4..5cdb207b6 100644 --- a/docker-compose-v2-tracing.yml +++ b/docker-compose-v2-tracing.yml @@ -9,7 +9,7 @@ services: - "16686:16686" - "14250:14250" chrome: - image: selenium/node-chrome:4.16.1-20231219 + image: selenium/node-chrome:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -23,7 +23,7 @@ services: - "6900:5900" edge: - image: selenium/node-edge:4.16.1-20231219 + image: selenium/node-edge:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -37,7 +37,7 @@ services: - "6901:5900" firefox: - image: selenium/node-firefox:4.16.1-20231219 + image: selenium/node-firefox:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -51,7 +51,7 @@ services: - "6902:5900" selenium-hub: - image: selenium/hub:4.16.1-20231219 + image: selenium/hub:4.17.0-20240123 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v2.yml b/docker-compose-v2.yml index c0b92ae28..69b904718 100644 --- a/docker-compose-v2.yml +++ b/docker-compose-v2.yml @@ -4,7 +4,7 @@ version: '2' services: chrome: - image: selenium/node-chrome:4.16.1-20231219 + image: selenium/node-chrome:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -16,7 +16,7 @@ services: - "6900:5900" edge: - image: selenium/node-edge:4.16.1-20231219 + image: selenium/node-edge:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -28,7 +28,7 @@ services: - "6901:5900" firefox: - image: selenium/node-firefox:4.16.1-20231219 + image: selenium/node-firefox:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -40,7 +40,7 @@ services: - "6902:5900" selenium-hub: - image: selenium/hub:4.16.1-20231219 + image: selenium/hub:4.17.0-20240123 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v3-basicauth.yml b/docker-compose-v3-basicauth.yml index 05b1e2f55..6d24ba9ae 100644 --- a/docker-compose-v3-basicauth.yml +++ b/docker-compose-v3-basicauth.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.16.1-20231219 + image: selenium/node-chrome:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -14,7 +14,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231219 + image: selenium/node-edge:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231219 + image: selenium/node-firefox:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -34,7 +34,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.16.1-20231219 + image: selenium/hub:4.17.0-20240123 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-dev.yml b/docker-compose-v3-dev.yml index 2a638496a..fa40c2b2d 100644 --- a/docker-compose-v3-dev.yml +++ b/docker-compose-v3-dev.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.16.1-20231219 + image: selenium/node-chrome:4.17.0-20240123 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -16,7 +16,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231219 + image: selenium/node-edge:4.17.0-20240123 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -28,7 +28,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231219 + image: selenium/node-firefox:4.17.0-20240123 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -40,7 +40,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.16.1-20231219 + image: selenium/hub:4.17.0-20240123 container_name: selenium-hub volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar diff --git a/docker-compose-v3-dynamic-grid.yml b/docker-compose-v3-dynamic-grid.yml index 83f6185c1..8edc27303 100644 --- a/docker-compose-v3-dynamic-grid.yml +++ b/docker-compose-v3-dynamic-grid.yml @@ -4,7 +4,7 @@ version: "3" services: node-docker: - image: selenium/node-docker:4.16.1-20231219 + image: selenium/node-docker:4.17.0-20240123 volumes: - ./assets:/opt/selenium/assets - ./NodeDocker/config.toml:/opt/bin/config.toml @@ -17,7 +17,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.16.1-20231219 + image: selenium/hub:4.17.0-20240123 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-full-grid-dev.yml b/docker-compose-v3-full-grid-dev.yml index 4f4d131b6..c79948cc8 100644 --- a/docker-compose-v3-full-grid-dev.yml +++ b/docker-compose-v3-full-grid-dev.yml @@ -4,7 +4,7 @@ version: "3" services: selenium-event-bus: - image: selenium/event-bus:4.16.1-20231219 + image: selenium/event-bus:4.17.0-20240123 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-event-bus @@ -14,7 +14,7 @@ services: - "5557:5557" selenium-sessions: - image: selenium/sessions:4.16.1-20231219 + image: selenium/sessions:4.17.0-20240123 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-sessions @@ -28,7 +28,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-session-queue: - image: selenium/session-queue:4.16.1-20231219 + image: selenium/session-queue:4.17.0-20240123 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-session-queue @@ -36,7 +36,7 @@ services: - "5559:5559" selenium-distributor: - image: selenium/distributor:4.16.1-20231219 + image: selenium/distributor:4.17.0-20240123 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-distributor @@ -56,7 +56,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 selenium-router: - image: selenium/router:4.16.1-20231219 + image: selenium/router:4.17.0-20240123 volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar container_name: selenium-router @@ -75,7 +75,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 chrome: - image: selenium/node-chrome:4.16.1-20231219 + image: selenium/node-chrome:4.17.0-20240123 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -87,7 +87,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231219 + image: selenium/node-edge:4.17.0-20240123 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar @@ -99,7 +99,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231219 + image: selenium/node-firefox:4.17.0-20240123 shm_size: 2gb volumes: - ./selenium_server_deploy.jar:/opt/selenium/selenium-server.jar diff --git a/docker-compose-v3-full-grid-swarm.yml b/docker-compose-v3-full-grid-swarm.yml index 636efd51b..e7df09dba 100644 --- a/docker-compose-v3-full-grid-swarm.yml +++ b/docker-compose-v3-full-grid-swarm.yml @@ -7,7 +7,7 @@ version: '3.7' services: chrome: - image: selenium/node-chrome:4.16.1-20231219 + image: selenium/node-chrome:4.17.0-20240123 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -18,7 +18,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' edge: - image: selenium/node-edge:4.16.1-20231219 + image: selenium/node-edge:4.17.0-20240123 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -29,7 +29,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' firefox: - image: selenium/node-firefox:4.16.1-20231219 + image: selenium/node-firefox:4.17.0-20240123 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -40,7 +40,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' selenium-hub: - image: selenium/hub:4.16.1-20231219 + image: selenium/hub:4.17.0-20240123 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v3-full-grid-tracing.yml b/docker-compose-v3-full-grid-tracing.yml index 781357aa4..5ddfd0cee 100644 --- a/docker-compose-v3-full-grid-tracing.yml +++ b/docker-compose-v3-full-grid-tracing.yml @@ -9,7 +9,7 @@ services: - "16686:16686" - "14250:14250" selenium-event-bus: - image: selenium/event-bus:4.16.1-20231219 + image: selenium/event-bus:4.17.0-20240123 container_name: selenium-event-bus ports: - "4442:4442" @@ -21,7 +21,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-event-bus selenium-sessions: - image: selenium/sessions:4.16.1-20231219 + image: selenium/sessions:4.17.0-20240123 container_name: selenium-sessions ports: - "5556:5556" @@ -34,7 +34,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-sessions selenium-session-queue: - image: selenium/session-queue:4.16.1-20231219 + image: selenium/session-queue:4.17.0-20240123 container_name: selenium-session-queue ports: - "5559:5559" @@ -42,7 +42,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-session-queue selenium-distributor: - image: selenium/distributor:4.16.1-20231219 + image: selenium/distributor:4.17.0-20240123 container_name: selenium-distributor ports: - "5553:5553" @@ -61,7 +61,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-distributor selenium-router: - image: selenium/router:4.16.1-20231219 + image: selenium/router:4.17.0-20240123 container_name: selenium-router ports: - "4444:4444" @@ -79,7 +79,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-router chrome: - image: selenium/node-chrome:4.16.1-20231219 + image: selenium/node-chrome:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-event-bus @@ -90,7 +90,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-chrome edge: - image: selenium/node-edge:4.16.1-20231219 + image: selenium/node-edge:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-event-bus @@ -101,7 +101,7 @@ services: - SE_ENABLE_TRACING=true - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-edge firefox: - image: selenium/node-firefox:4.16.1-20231219 + image: selenium/node-firefox:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-event-bus diff --git a/docker-compose-v3-full-grid.yml b/docker-compose-v3-full-grid.yml index af9266fef..b97282e4f 100644 --- a/docker-compose-v3-full-grid.yml +++ b/docker-compose-v3-full-grid.yml @@ -4,7 +4,7 @@ version: "3" services: selenium-event-bus: - image: selenium/event-bus:4.16.1-20231219 + image: selenium/event-bus:4.17.0-20240123 container_name: selenium-event-bus ports: - "4442:4442" @@ -12,7 +12,7 @@ services: - "5557:5557" selenium-sessions: - image: selenium/sessions:4.16.1-20231219 + image: selenium/sessions:4.17.0-20240123 container_name: selenium-sessions ports: - "5556:5556" @@ -24,13 +24,13 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-session-queue: - image: selenium/session-queue:4.16.1-20231219 + image: selenium/session-queue:4.17.0-20240123 container_name: selenium-session-queue ports: - "5559:5559" selenium-distributor: - image: selenium/distributor:4.16.1-20231219 + image: selenium/distributor:4.17.0-20240123 container_name: selenium-distributor ports: - "5553:5553" @@ -48,7 +48,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 selenium-router: - image: selenium/router:4.16.1-20231219 + image: selenium/router:4.17.0-20240123 container_name: selenium-router ports: - "4444:4444" @@ -65,7 +65,7 @@ services: - SE_SESSION_QUEUE_PORT=5559 chrome: - image: selenium/node-chrome:4.16.1-20231219 + image: selenium/node-chrome:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-event-bus @@ -75,7 +75,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231219 + image: selenium/node-edge:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-event-bus @@ -85,7 +85,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231219 + image: selenium/node-firefox:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-event-bus diff --git a/docker-compose-v3-swarm.yml b/docker-compose-v3-swarm.yml index 636efd51b..e7df09dba 100644 --- a/docker-compose-v3-swarm.yml +++ b/docker-compose-v3-swarm.yml @@ -7,7 +7,7 @@ version: '3.7' services: chrome: - image: selenium/node-chrome:4.16.1-20231219 + image: selenium/node-chrome:4.17.0-20240123 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -18,7 +18,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' edge: - image: selenium/node-edge:4.16.1-20231219 + image: selenium/node-edge:4.17.0-20240123 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -29,7 +29,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' firefox: - image: selenium/node-firefox:4.16.1-20231219 + image: selenium/node-firefox:4.17.0-20240123 shm_size: 2gb environment: - SE_EVENT_BUS_HOST=selenium-hub @@ -40,7 +40,7 @@ services: entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' selenium-hub: - image: selenium/hub:4.16.1-20231219 + image: selenium/hub:4.17.0-20240123 ports: - "4442:4442" - "4443:4443" diff --git a/docker-compose-v3-tracing.yml b/docker-compose-v3-tracing.yml index a8c012ec3..7b099880f 100644 --- a/docker-compose-v3-tracing.yml +++ b/docker-compose-v3-tracing.yml @@ -9,7 +9,7 @@ services: - "16686:16686" - "14250:14250" chrome: - image: selenium/node-chrome:4.16.1-20231219 + image: selenium/node-chrome:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -21,7 +21,7 @@ services: - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-chrome edge: - image: selenium/node-edge:4.16.1-20231219 + image: selenium/node-edge:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -33,7 +33,7 @@ services: - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-edge firefox: - image: selenium/node-firefox:4.16.1-20231219 + image: selenium/node-firefox:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -45,7 +45,7 @@ services: - JAVA_OPTS=-Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://jaegar:14250 -Dotel.resource.attributes=service.name=selenium-node-firefox selenium-hub: - image: selenium/hub:4.16.1-20231219 + image: selenium/hub:4.17.0-20240123 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3-video.yml b/docker-compose-v3-video.yml index 484e55806..dd6199369 100644 --- a/docker-compose-v3-video.yml +++ b/docker-compose-v3-video.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.16.1-20231219 + image: selenium/node-chrome:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -14,7 +14,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231219 + image: selenium/node-edge:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231219 + image: selenium/node-firefox:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -34,7 +34,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 chrome_video: - image: selenium/video:ffmpeg-6.1-20231219 + image: selenium/video:ffmpeg-6.1-20240123 volumes: - /tmp/videos:/videos depends_on: @@ -44,7 +44,7 @@ services: - FILE_NAME=chrome_video.mp4 edge_video: - image: selenium/video:ffmpeg-6.1-20231219 + image: selenium/video:ffmpeg-6.1-20240123 volumes: - /tmp/videos:/videos depends_on: @@ -54,7 +54,7 @@ services: - FILE_NAME=edge_video.mp4 firefox_video: - image: selenium/video:ffmpeg-6.1-20231219 + image: selenium/video:ffmpeg-6.1-20240123 volumes: - /tmp/videos:/videos depends_on: @@ -64,7 +64,7 @@ services: - FILE_NAME=firefox_video.mp4 selenium-hub: - image: selenium/hub:4.16.1-20231219 + image: selenium/hub:4.17.0-20240123 container_name: selenium-hub ports: - "4442:4442" diff --git a/docker-compose-v3.yml b/docker-compose-v3.yml index e863abebf..97d111701 100644 --- a/docker-compose-v3.yml +++ b/docker-compose-v3.yml @@ -4,7 +4,7 @@ version: "3" services: chrome: - image: selenium/node-chrome:4.16.1-20231219 + image: selenium/node-chrome:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -14,7 +14,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 edge: - image: selenium/node-edge:4.16.1-20231219 + image: selenium/node-edge:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -24,7 +24,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: - image: selenium/node-firefox:4.16.1-20231219 + image: selenium/node-firefox:4.17.0-20240123 shm_size: 2gb depends_on: - selenium-hub @@ -34,7 +34,7 @@ services: - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 selenium-hub: - image: selenium/hub:4.16.1-20231219 + image: selenium/hub:4.17.0-20240123 container_name: selenium-hub ports: - "4442:4442" From e43f301ed6cd47ca095898dd7b374f5e0ef12434 Mon Sep 17 00:00:00 2001 From: Selenium CI Bot Date: Wed, 24 Jan 2024 03:55:23 +0000 Subject: [PATCH 59/62] Update chart CHANGELOG [skip ci] --- charts/selenium-grid/CHANGELOG.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/charts/selenium-grid/CHANGELOG.md b/charts/selenium-grid/CHANGELOG.md index 747eb3b22..01678d5ca 100644 --- a/charts/selenium-grid/CHANGELOG.md +++ b/charts/selenium-grid/CHANGELOG.md @@ -1,3 +1,26 @@ +## :heavy_check_mark: selenium-grid-0.27.0 + +- Chart is using image tag 4.17.0-20240123 + +### Added +- feat(chart): templating in name(Override) for new object [deploy] Signed-off-by: Viet Nguyen Duc :: Viet Nguyen Duc +- feat(chart): templating in name(Override) (#2107) :: Bas M +- feat(chart): Add node registration secret to exec preStop container Update default scalingStrategy.strategy: accurate [skip ci] :: Viet Nguyen Duc +- feat(chart): Configuration extra scripts mount to container (#2105) :: Viet Nguyen Duc +- feat(chart): Bump dependency charts KEDA and Ingress-NGINX version (#2103) :: Viet Nguyen Duc +- feat(chart): Add RCLONE as default video uploader on Kubernetes (#2100) :: Viet Nguyen Duc +- feat(chart): videoRecorder getting scripts from external files (#2095) :: Viet Nguyen Duc +- feat(chart): Add config to control disabling Grid UI (#2083) :: Viet Nguyen Duc +- feat(chart): Simplify to enable HTTPS/TLS in Selenium Grid on Kubernetes (#2080) :: Viet Nguyen Duc +- feat(chart): Simplify config ports, probes, lifecycle hooks for Nodes (#2077) :: Viet Nguyen Duc + +### Changed +- Update tag in docs and files :: Selenium CI Bot +- feat(chart): se:recordVideo should be used to determine if record video (#2104) :: Viet Nguyen Duc +- [build] Fix duplicated Nightly releases creation :: Viet Nguyen Duc +- build(chart): Chart built on top of Nightly images (#2089) :: Viet Nguyen Duc +- Update chart CHANGELOG [skip ci] :: Selenium CI Bot + ## :heavy_check_mark: selenium-grid-0.26.4 - Chart is using image tag 4.16.1-20231219 From 2595484cb4a059bb0a0697349ac13e11b6d49b18 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Wed, 24 Jan 2024 15:05:26 +0530 Subject: [PATCH 60/62] test(chart): Update nginx config in CI tests Signed-off-by: Viet Nguyen Duc --- tests/charts/ci/auth-ingress-values.yaml | 3 ++- tests/charts/refValues/simplex-minikube.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/charts/ci/auth-ingress-values.yaml b/tests/charts/ci/auth-ingress-values.yaml index 91d853aca..c597ebc2a 100644 --- a/tests/charts/ci/auth-ingress-values.yaml +++ b/tests/charts/ci/auth-ingress-values.yaml @@ -37,7 +37,8 @@ components: ingress-nginx: enabled: true controller: - hostNetwork: true + hostPort: + enabled: true kind: DaemonSet service: type: ClusterIP diff --git a/tests/charts/refValues/simplex-minikube.yaml b/tests/charts/refValues/simplex-minikube.yaml index a67b0bbf2..3541ac2db 100644 --- a/tests/charts/refValues/simplex-minikube.yaml +++ b/tests/charts/refValues/simplex-minikube.yaml @@ -91,7 +91,8 @@ ingress-nginx: # Set controller default certificate use the same with Selenium Grid extraArgs: default-ssl-certificate: '$(POD_NAMESPACE)/selenium-tls-secret' - hostNetwork: true + hostPort: + enabled: true kind: DaemonSet service: type: ClusterIP From 9b7343b5a43a45d78c629fe9138eff0bef55de30 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Wed, 24 Jan 2024 16:21:06 +0530 Subject: [PATCH 61/62] test(chart) against build multi Signed-off-by: Viet Nguyen Duc --- .github/workflows/helm-chart-test.yml | 2 +- Makefile | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/helm-chart-test.yml b/.github/workflows/helm-chart-test.yml index 7d6697e82..6716d0770 100644 --- a/.github/workflows/helm-chart-test.yml +++ b/.github/workflows/helm-chart-test.yml @@ -53,7 +53,7 @@ jobs: - name: Setup Kubernetes environment run: make chart_setup_env - name: Build Docker images - run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build + run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build_multi - name: Build and lint charts run: | BUILD_DATE=${BUILD_DATE} make chart_build diff --git a/Makefile b/Makefile index ed3c43e1d..0fd7118d6 100644 --- a/Makefile +++ b/Makefile @@ -161,6 +161,8 @@ all_multi: base_multi \ sessions_multi \ sessionqueue_multi \ event_bus_multi \ + uploader_multi \ + video_multi build_multi: all_multi @@ -208,6 +210,12 @@ standalone_chromium_multi: chromium_multi standalone_docker_multi: docker_multi cd ./StandaloneDocker && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) $(FROM_IMAGE_ARGS) -t $(NAME)/standalone-docker:$(TAG_VERSION) . +uploader_multi: + cd ./Uploader && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg BASED_TAG=$(RCLONE_BASED_TAG) -t $(NAME)/uploader:$(RCLONE_TAG_VERSION)-$(BUILD_DATE) . + +video_multi: + cd ./Video && docker buildx build --platform $(PLATFORMS) $(BUILD_ARGS) --build-arg NAMESPACE=$(FFMPEG_BASED_NAME) --build-arg BASED_TAG=$(FFMPEG_BASED_TAG) -t $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) . + # https://github.com/SeleniumHQ/docker-selenium/issues/992 # Additional tags for browser images tag_and_push_browser_images: tag_and_push_chrome_images tag_and_push_firefox_images tag_and_push_edge_images From 5b4985be1707cc9ac04b3c8e8f19c8e044cc313b Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Wed, 24 Jan 2024 16:30:50 +0530 Subject: [PATCH 62/62] Sync update from upstream Signed-off-by: Viet Nguyen Duc --- NodeBase/Dockerfile | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/NodeBase/Dockerfile b/NodeBase/Dockerfile index 21afac5ba..f71b2fa95 100644 --- a/NodeBase/Dockerfile +++ b/NodeBase/Dockerfile @@ -151,26 +151,6 @@ COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-node.sh \ #============================== COPY selenium.conf /etc/supervisor/conf.d/ -#============================== -# Generating the VNC password as seluser -# So the service can be started with seluser -#============================== - -RUN mkdir -p ${HOME}/.vnc \ - && x11vnc -storepasswd secret ${HOME}/.vnc/passwd - -# Added to avoid the following sudo error while running multi-arch builds: -# "sudo: effective uid is not 0, is /usr/bin/sudo on a file system with -# the 'nosuid' option set or an NFS file system without root privileges?" -USER root - -#========== -# Relaxing permissions for OpenShift and other non-sudo environments -#========== -RUN sudo chmod -R 775 ${HOME} \ - && sudo chgrp -R 0 ${HOME} \ - && sudo chmod -R g=u ${HOME} - #============================== # Scripts to run fluxbox, x11vnc and noVNC #============================== @@ -219,15 +199,6 @@ ENV SE_NODE_OVERRIDE_MAX_SESSIONS false # Following line fixes https://github.com/SeleniumHQ/docker-selenium/issues/87 ENV DBUS_SESSION_BUS_ADDRESS=/dev/null -# Added to avoid sudo-related multi-arch build errors -USER root - -# Creating base directory for Xvfb -RUN mkdir -p /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix - -# Added to avoid sudo-related multi-arch build errors -USER 1200 - # Copying configuration script generator COPY --chown="${SEL_UID}:${SEL_GID}" generate_config /opt/bin/generate_config