Skip to content

Commit

Permalink
update: Selenium Grid 4.24.0
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 committed Aug 29, 2024
1 parent 6216a4d commit a7e5c40
Show file tree
Hide file tree
Showing 11 changed files with 196 additions and 23 deletions.
6 changes: 2 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ jobs:
- run:
name: "Setup environment"
command: |
make chart_setup_env
make set_containerd_image_store
make setup_dev_env
- run:
name: "Print system info"
command: |
Expand Down Expand Up @@ -235,8 +234,7 @@ jobs:
- run:
name: "Set up Kubernetes environment"
command: |
make chart_setup_env
make set_containerd_image_store
make setup_dev_env
CLUSTER=${CLUSTER} KUBERNETES_VERSION=${KUBERNETES_VERSION} NAME=${NAMESPACE} VERSION=${BRANCH} \
BUILD_DATE=${BUILD_DATE} make chart_cluster_setup
- run:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ jobs:
timeout_minutes: 10
max_attempts: 3
command: |
make chart_setup_env
make set_containerd_image_store
make setup_dev_env
- name: Output Docker info
run: docker info
- name: Set Selenium base version
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ jobs:
timeout_minutes: 10
max_attempts: 3
command: |
make chart_setup_env
make set_containerd_image_store
make setup_dev_env
- name: Output Docker info
run: docker info
- name: Set up Python
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm-chart-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
with:
timeout_minutes: 10
max_attempts: 3
command: make chart_setup_env
command: make setup_dev_env
- name: Build Helm chart
uses: nick-invision/retry@master
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/helm-chart-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ jobs:
timeout_minutes: 10
max_attempts: 3
command: |
make chart_setup_env
make set_containerd_image_store
make setup_dev_env
- name: Output Docker info
run: docker info
- name: Set up Python
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ jobs:
timeout_minutes: 10
max_attempts: 3
command: |
make chart_setup_env
make set_containerd_image_store
make setup_dev_env
- name: Output Docker info
run: docker info
- name: Set Selenium base version
Expand Down
22 changes: 13 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
NAME := $(or $(NAME),$(NAME),selenium)
CURRENT_DATE := $(shell date '+%Y%m%d')
BUILD_DATE := $(or $(BUILD_DATE),$(BUILD_DATE),$(CURRENT_DATE))
BASE_RELEASE := $(or $(BASE_RELEASE),$(BASE_RELEASE),selenium-4.23.0)
BASE_VERSION := $(or $(BASE_VERSION),$(BASE_VERSION),4.23.1)
BINDING_VERSION := $(or $(BINDING_VERSION),$(BINDING_VERSION),4.23.1)
BASE_RELEASE := $(or $(BASE_RELEASE),$(BASE_RELEASE),selenium-4.24.0)
BASE_VERSION := $(or $(BASE_VERSION),$(BASE_VERSION),4.24.0)
BINDING_VERSION := $(or $(BINDING_VERSION),$(BINDING_VERSION),4.24.0)
BASE_RELEASE_NIGHTLY := $(or $(BASE_RELEASE_NIGHTLY),$(BASE_RELEASE_NIGHTLY),nightly)
BASE_VERSION_NIGHTLY := $(or $(BASE_VERSION_NIGHTLY),$(BASE_VERSION_NIGHTLY),4.24.0-SNAPSHOT)
VERSION := $(or $(VERSION),$(VERSION),4.23.1)
BASE_VERSION_NIGHTLY := $(or $(BASE_VERSION_NIGHTLY),$(BASE_VERSION_NIGHTLY),4.25.0-SNAPSHOT)
VERSION := $(or $(VERSION),$(VERSION),4.24.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))
Expand Down Expand Up @@ -42,6 +42,13 @@ all: hub \
standalone_docker \
video

check_dev_env:
./tests/charts/make/chart_check_env.sh

setup_dev_env:
./tests/charts/make/chart_setup_env.sh ; \
make set_containerd_image_store

set_containerd_image_store:
sudo mkdir -p /etc/docker
sudo mv /etc/docker/daemon.json /etc/docker/daemon.json.bak || true
Expand Down Expand Up @@ -75,7 +82,7 @@ set_build_multiarch:
build_nightly:
BASE_VERSION=$(BASE_VERSION_NIGHTLY) BASE_RELEASE=$(BASE_RELEASE_NIGHTLY) make build

build: all
build: check_dev_env all
docker images | grep $(NAME)

ci: build test
Expand Down Expand Up @@ -775,9 +782,6 @@ test_node_docker: hub standalone_docker standalone_chrome standalone_firefox sta
test_custom_ca_cert:
VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/customCACert/bootstrap.sh

chart_setup_env:
./tests/charts/make/chart_setup_env.sh

chart_cluster_setup:
VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) BUILD_DATE=$(BUILD_DATE) ./tests/charts/make/chart_cluster_setup.sh
make set_containerd_image_store
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ Nightly images are built on top of the [Nightly](https://github.com/SeleniumHQ/s
$ docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:nightly
```

Check out the docker compose to get started with Nightly images [docker-compose-v3-full-grid-nightly.yml](docker-compose-v3-full-grid-nightly.yml)

## 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.
Expand Down
3 changes: 2 additions & 1 deletion charts/selenium-grid/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ We have a CI pipeline to test the Helm chart with the following test cases.
| HTTPS `tls.enabled` | | | x | | x |
| Enable tracing | x | x | | x | |
| Enable video recorder | x | x | x | x | x |
| Enable video uploader | x | x | x | x | x |
| Test headless | | x | x | | |

## Test Chart Template
Expand Down Expand Up @@ -78,7 +79,7 @@ Run entire commands to build and test Docker images with Helm charts in local en
cd ../..

# Setup Kubernetes environment
make chart_setup_env
make setup_dev_env

# Build Docker images
make build
Expand Down
128 changes: 128 additions & 0 deletions docker-compose-v3-full-grid-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# To execute this docker compose yml file use `docker compose -f docker-compose-v3-full-grid-nightly.yml up --force-recreate`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker compose -f docker-compose-v3-full-grid-nightly.yml down`
version: "3"
services:
selenium-event-bus:
image: selenium/event-bus:nightly
container_name: selenium-event-bus
ports:
- "4442:4442"
- "4443:4443"
- "5557:5557"

selenium-sessions:
image: selenium/sessions:nightly
container_name: selenium-sessions
ports:
- "5556:5556"
depends_on:
- selenium-event-bus
environment:
- SE_EVENT_BUS_HOST=selenium-event-bus
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443

selenium-session-queue:
image: selenium/session-queue:nightly
container_name: selenium-session-queue
ports:
- "5559:5559"

selenium-distributor:
image: selenium/distributor:nightly
container_name: selenium-distributor
ports:
- "5553:5553"
depends_on:
- selenium-event-bus
- selenium-sessions
- selenium-session-queue
environment:
- SE_EVENT_BUS_HOST=selenium-event-bus
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
- SE_SESSIONS_MAP_HOST=selenium-sessions
- SE_SESSIONS_MAP_PORT=5556
- SE_SESSION_QUEUE_HOST=selenium-session-queue
- SE_SESSION_QUEUE_PORT=5559

selenium-router:
image: selenium/router:nightly
container_name: selenium-router
ports:
- "4444:4444"
depends_on:
- selenium-distributor
- selenium-sessions
- selenium-session-queue
environment:
- SE_DISTRIBUTOR_HOST=selenium-distributor
- SE_DISTRIBUTOR_PORT=5553
- SE_SESSIONS_MAP_HOST=selenium-sessions
- SE_SESSIONS_MAP_PORT=5556
- SE_SESSION_QUEUE_HOST=selenium-session-queue
- SE_SESSION_QUEUE_PORT=5559

chrome:
image: selenium/node-chrome:nightly
shm_size: 2gb
depends_on:
- selenium-event-bus
environment:
- SE_EVENT_BUS_HOST=selenium-event-bus
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443

edge:
image: selenium/node-edge:nightly
shm_size: 2gb
depends_on:
- selenium-event-bus
environment:
- SE_EVENT_BUS_HOST=selenium-event-bus
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443

firefox:
image: selenium/node-firefox:nightly
shm_size: 2gb
depends_on:
- selenium-event-bus
environment:
- SE_EVENT_BUS_HOST=selenium-event-bus
- SE_EVENT_BUS_PUBLISH_PORT=4442
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443

chrome_video:
image: selenium/video:nightly
volumes:
- /tmp/videos:/videos
depends_on:
- chrome
environment:
- DISPLAY_CONTAINER_NAME=chrome
- SE_NODE_GRID_URL=http://selenium-router:4444
- SE_VIDEO_FILE_NAME=auto

edge_video:
image: selenium/video:nightly
volumes:
- /tmp/videos:/videos
depends_on:
- edge
environment:
- DISPLAY_CONTAINER_NAME=edge
- SE_NODE_GRID_URL=http://selenium-router:4444
- SE_VIDEO_FILE_NAME=auto

firefox_video:
image: selenium/video:nightly
volumes:
- /tmp/videos:/videos
depends_on:
- firefox
environment:
- DISPLAY_CONTAINER_NAME=firefox
- SE_NODE_GRID_URL=http://selenium-router:4444
- SE_VIDEO_FILE_NAME=auto
44 changes: 44 additions & 0 deletions tests/charts/make/chart_check_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

REQUIRED_VERSION="24.0.9"
DOCKER_VERSION=$(docker --version | grep -oP '\d+\.\d+\.\d+')
version_greater_equal() {
[ "$1" = "$2" ] && return 0
local IFS=.
local i ver1=($1) ver2=($2)
for ((i=0; i<${#ver1[@]}; i++)); do
[ -z "${ver2[i]}" ] && ver2[i]=0
((10#${ver1[i]} > 10#${ver2[i]})) && return 0
((10#${ver1[i]} < 10#${ver2[i]})) && return 1
done
return 0
}
if version_greater_equal "$DOCKER_VERSION" "$REQUIRED_VERSION"; then
echo "Docker engine version is $DOCKER_VERSION"
EXIT_CODE=0
else
echo "Docker engine version is $DOCKER_VERSION, which does not meet the requirement."
EXIT_CODE=1
fi

DOCKER_CONFIG_FILE="/etc/docker/daemon.json"
if [ ! -f "$DOCKER_CONFIG_FILE" ]; then
echo "Docker configuration file not found at $DOCKER_CONFIG_FILE"
EXIT_CODE=1
fi
if cat "$DOCKER_CONFIG_FILE" | grep -q containerd; then
echo "The containerd feature is enabled in Docker engine. $(cat $DOCKER_CONFIG_FILE)"
else
echo "The containerd feature is not enabled in Docker engine. $(cat $DOCKER_CONFIG_FILE)"
EXIT_CODE=1
fi

echo "==============================="
if [ "$EXIT_CODE" -eq 1 ]; then
echo "Check failed."
echo "Please run the following command setup development environment: make setup_dev_env"
exit $EXIT_CODE
else
echo "All checks passed."
exit 0
fi

0 comments on commit a7e5c40

Please sign in to comment.