Skip to content
This repository was archived by the owner on Jun 22, 2024. It is now read-only.

Commit 496b79a

Browse files
committed
Merge pull request #72 from seleniumhq-community/4.19.1 [deploy]
Sync upstream 4.19.1 Signed-off-by: Viet Nguyen Duc <[email protected]>
2 parents 80438d8 + 2339d4a commit 496b79a

File tree

17 files changed

+129
-29
lines changed

17 files changed

+129
-29
lines changed

.circleci/config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ workflows:
338338
jobs:
339339
- deploy-multi-arch-full-grid:
340340
name: deploy-multi-arch-base
341-
platforms: linux/arm64,linux/amd64,linux/arm/v7
341+
platforms: linux/arm64,linux/amd64
342342
build-args: --push
343343
make-targets: base_multi
344344
machine-type: ubuntu2004arm64large
@@ -349,7 +349,7 @@ workflows:
349349
- deploy-multi-arch-full-grid:
350350
name: deploy-multi-arch-full-grid
351351
requires: [deploy-multi-arch-base]
352-
platforms: linux/arm64,linux/amd64,linux/arm/v7
352+
platforms: linux/arm64,linux/amd64
353353
build-args: --push
354354
make-targets: grid_multi
355355
machine-type: ubuntu2004arm64
@@ -360,7 +360,7 @@ workflows:
360360
- deploy-multi-arch-full-grid:
361361
name: deploy-multi-arch-node-base
362362
requires: [deploy-multi-arch-base]
363-
platforms: linux/arm64,linux/amd64,linux/arm/v7
363+
platforms: linux/arm64,linux/amd64
364364
build-args: --push
365365
make-targets: node_base_multi
366366
machine-type: ubuntu2004arm64large
@@ -371,7 +371,7 @@ workflows:
371371
- deploy-multi-arch-full-grid:
372372
name: deploy-multi-arch-firefox
373373
requires: [deploy-multi-arch-node-base]
374-
platforms: linux/arm64,linux/amd64,linux/arm/v7
374+
platforms: linux/arm64,linux/amd64
375375
build-args: --push
376376
make-targets: firefox_multi
377377
machine-type: ubuntu2004arm64large
@@ -382,7 +382,7 @@ workflows:
382382
- deploy-multi-arch-full-grid:
383383
name: deploy-multi-arch-chromium
384384
requires: [deploy-multi-arch-node-base]
385-
platforms: linux/arm64,linux/amd64,linux/arm/v7
385+
platforms: linux/arm64,linux/amd64
386386
build-args: --push
387387
make-targets: chromium_multi
388388
machine-type: ubuntu2004arm64large
@@ -393,7 +393,7 @@ workflows:
393393
- deploy-multi-arch-full-grid:
394394
name: deploy-multi-arch-release-notes
395395
requires: [deploy-multi-arch-firefox,deploy-multi-arch-chromium]
396-
platforms: linux/arm64,linux/amd64,linux/arm/v7
396+
platforms: linux/arm64,linux/amd64
397397
build-args: --push
398398
make-targets: tag_and_push_multi_arch_browser_images
399399
machine-type: ubuntu2004arm64

.github/workflows/test-video.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test video files
1+
name: Test Docker Selenium
22
concurrency:
33
group: ${{ github.workflow }}
44

@@ -36,7 +36,7 @@ jobs:
3636
strategy:
3737
fail-fast: false
3838
matrix:
39-
test-strategy: [test_video, test_parallel]
39+
test-strategy: [test_video, test_parallel, test_node_docker]
4040
steps:
4141
- uses: actions/checkout@main
4242
- name: Output Docker info

Base/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ LABEL authors="Selenium <[email protected]>"
66
ARG VERSION
77
ARG RELEASE=selenium-${VERSION}
88
# Default value should be aligned with upstream Selenium (https://github.com/SeleniumHQ/selenium/blob/trunk/java/maven_deps.bzl)
9-
ARG OPENTELEMETRY_VERSION=1.35.0
10-
ARG GRPC_VERSION=1.61.1
9+
ARG OPENTELEMETRY_VERSION=1.36.0
10+
ARG GRPC_VERSION=1.62.2
1111

1212
#Arguments to define the user running Selenium
1313
ARG SEL_USER=seluser

Makefile

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ NAME := $(or $(NAME),$(NAME),selenium)
22
CURRENT_DATE := $(shell date '+%Y%m%d')
33
BUILD_DATE := $(or $(BUILD_DATE),$(BUILD_DATE),$(CURRENT_DATE))
44
BASE_RELEASE := $(or $(BASE_RELEASE),$(BASE_RELEASE),selenium-4.19.0)
5-
BASE_VERSION := $(or $(BASE_VERSION),$(BASE_VERSION),4.19.0)
5+
BASE_VERSION := $(or $(BASE_VERSION),$(BASE_VERSION),4.19.1)
66
BASE_RELEASE_NIGHTLY := $(or $(BASE_RELEASE_NIGHTLY),$(BASE_RELEASE_NIGHTLY),nightly)
77
BASE_VERSION_NIGHTLY := $(or $(BASE_VERSION_NIGHTLY),$(BASE_VERSION_NIGHTLY),4.20.0-SNAPSHOT)
8-
VERSION := $(or $(VERSION),$(VERSION),4.19.0)
8+
VERSION := $(or $(VERSION),$(VERSION),4.19.1)
99
TAG_VERSION := $(VERSION)-$(BUILD_DATE)
1010
CHART_VERSION_NIGHTLY := $(or $(CHART_VERSION_NIGHTLY),$(CHART_VERSION_NIGHTLY),1.0.0-nightly)
1111
NAMESPACE := $(or $(NAMESPACE),$(NAMESPACE),$(NAME))
@@ -569,6 +569,25 @@ test_video: video hub chrome firefox edge
569569
docker run -u $$(id -u) -v $$(pwd):$$(pwd) -w $$(pwd) $(FFMPEG_BASED_NAME)/ffmpeg:$(FFMPEG_BASED_TAG) -v error -i ./tests/videos/firefox_video.mp4 -f null - 2>error.log
570570
docker run -u $$(id -u) -v $$(pwd):$$(pwd) -w $$(pwd) $(FFMPEG_BASED_NAME)/ffmpeg:$(FFMPEG_BASED_TAG) -v error -i ./tests/videos/edge_video.mp4 -f null - 2>error.log
571571

572+
test_node_docker: docker hub chrome firefox edge
573+
rm -rf ./tests/videos; mkdir -p ./tests/videos
574+
for node in StandaloneChrome StandaloneFirefox StandaloneEdge ; do \
575+
cd tests || true ; \
576+
echo NAMESPACE=$(NAME) > .env ; \
577+
echo TAG=$(TAG_VERSION) >> .env ; \
578+
echo VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) >> .env ; \
579+
echo TEST_DRAIN_AFTER_SESSION_COUNT=$(or $(TEST_DRAIN_AFTER_SESSION_COUNT), 0) >> .env ; \
580+
echo TEST_PARALLEL_HARDENING=$(or $(TEST_PARALLEL_HARDENING), "false") >> .env ; \
581+
echo LOG_LEVEL=$(or $(LOG_LEVEL), "INFO") >> .env ; \
582+
echo REQUEST_TIMEOUT=$(or $(REQUEST_TIMEOUT), 30) >> .env ; \
583+
echo NODE=$$node >> .env ; \
584+
echo UID=$$(id -u) >> .env ; \
585+
export $$(cat .env | xargs) ; \
586+
envsubst < config.toml > ./videos/config.toml ; \
587+
docker-compose -f docker-compose-v3-test-node-docker.yaml up --no-log-prefix --exit-code-from tests --build ; \
588+
if [ $$? -ne 0 ]; then exit 1; fi ; \
589+
done
590+
572591
test_custom_ca_cert:
573592
VERSION=$(TAG_VERSION) NAMESPACE=$(NAMESPACE) ./tests/customCACert/bootstrap.sh
574593

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# Docker images for Selenium, built for Debian ARM64, ARM/v7, and AMD64
23

34
[![seleniumhq-community](https://circleci.com/gh/seleniumhq-community/docker-seleniarm.svg?style=shield)](https://app.circleci.com/pipelines/github/seleniumhq-community/docker-seleniarm)

build-and-push.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RELEASE=$(grep BASE_RELEASE Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1)
55
NAME="${NAME:-seleniarm}"
66
VERSION="${VERSION:-$SELENIUM_VERSION}"
77
BUILD_DATE="${BUILD_DATE:-$(date '+%Y%m%d')}"
8-
PLATFORMS="${PLATFORMS:-linux/arm64,linux/arm/v7,linux/amd64}"
8+
PLATFORMS="${PLATFORMS:-linux/arm64,linux/amd64}"
99
BUILD_ARGS=--push
1010

1111
FROM_IMAGE_ARGS="--build-arg NAMESPACE=$NAME --build-arg VERSION=$VERSION-$BUILD_DATE"

build-locally.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RELEASE=$(grep BASE_RELEASE Makefile | sed 's/.*,\([^)]*\))/\1/p' | head -n 1)
55
NAME="${NAME:-seleniarm}"
66
VERSION="${VERSION:-$SELENIUM_VERSION}"
77
BUILD_DATE="${BUILD_DATE:-$(date '+%Y%m%d')}"
8-
PLATFORMS="${PLATFORMS:-linux/arm64,linux/arm/v7,linux/amd64}"
8+
PLATFORMS="${PLATFORMS:-linux/arm64,linux/amd64}"
99
#BUILD_ARGS=--push
1010

1111
FROM_IMAGE_ARGS="--build-arg NAMESPACE=$NAME --build-arg VERSION=$VERSION-$BUILD_DATE"

charts/selenium-grid/configs/node/nodePreStop.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
probe_name="lifecycle.${1:-"preStop"}"
44

55
max_time=3
6+
retry_time=5
67

78
ID=$(echo $RANDOM)
89
tmp_node_file="/tmp/nodeProbe${ID}"
910

1011
function on_exit() {
1112
rm -rf ${tmp_node_file}
13+
echo "$(date +%FT%T%Z) [${probe_name}] - Exiting Node preStop..."
1214
}
1315
trap on_exit EXIT
1416

@@ -89,8 +91,12 @@ if curl -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/st
8991
fi
9092
signal_node_to_drain
9193
# Wait for the current session to be finished if any
92-
while curl -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status -o ${tmp_node_file};
93-
do
94+
while true; do
95+
# Attempt the cURL request and capture the exit status
96+
endpoint_http_code=$(curl --retry ${retry_time} -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status -o ${tmp_node_file} -w "%{http_code}")
97+
endpoint_status=$?
98+
echo "$(date +%FT%T%Z) [${probe_name}] - Fetch the Node status via cURL with exit status: ${endpoint_status}, HTTP code: ${endpoint_http_code}"
99+
94100
SLOT_HAS_SESSION=$(jq -e ".value.node.slots[]|select(.session != null).id.id" ${tmp_node_file} | tr -d '"' || "")
95101
if [ -z "${SLOT_HAS_SESSION}" ]; then
96102
echo "$(date +%FT%T%Z) [${probe_name}] - There is no session running. Node is ready to be terminated."
@@ -99,7 +105,13 @@ if curl -m ${max_time} -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/st
99105
exit 0
100106
else
101107
echo "$(date +%FT%T%Z) [${probe_name}] - Node preStop is waiting for current session on slot ${SLOT_HAS_SESSION} to be finished. Node details: message: $(jq -r '.value.message' ${tmp_node_file} || "unknown"), availability: $(jq -r '.value.node.availability' ${tmp_node_file} || "unknown")"
102-
sleep 1;
108+
sleep 2;
109+
fi
110+
111+
# If the cURL command failed, break the loop
112+
if [ ${endpoint_status} -ne 0 ] || [ "${endpoint_http_code}" != "200" ]; then
113+
echo "$(date +%FT%T%Z) [${probe_name}] - Node endpoint returned status ${endpoint_http_code:-"exit ${endpoint_status}"}, probably Node draining complete!"
114+
break
103115
fi
104116
done
105117
else

charts/selenium-grid/values.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ nodeConfigMap:
113113
# Directory where the extra scripts are mounted to
114114
extraScriptsDirectory: "/opt/selenium"
115115
extraScripts:
116-
nodePreStop.sh:
117-
nodeProbe.sh:
116+
nodePreStop.sh: ""
117+
nodeProbe.sh: ""
118118
# Name of volume mount is used to mount scripts in the ConfigMap
119119
scriptVolumeMountName:
120120
# Automatic browser leftovers cleanup stuck browser processes, tmp files
@@ -136,8 +136,8 @@ recorderConfigMap:
136136
extraScriptsDirectory: "/opt/bin"
137137
# List of extra scripts to be mounted to the container. Format as `filename: content`
138138
extraScripts:
139-
# video.sh:
140-
# video_graphQLQuery.sh:
139+
# video.sh: ""
140+
# video_graphQLQuery.sh: ""
141141
# Name of volume mount is used to mount scripts in the ConfigMap
142142
scriptVolumeMountName:
143143
videoVolumeMountName: videos
@@ -154,7 +154,7 @@ uploaderConfigMap:
154154
extraScriptsDirectory: "/opt/bin"
155155
# List of extra scripts to be mounted to the container. Format as `filename: content`
156156
extraScripts:
157-
upload.sh:
157+
upload.sh: ""
158158
# Extra files stored in Secret to be mounted to the container.
159159
secretFiles:
160160
upload.conf: "[sample]"

tests/bootstrap.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ if [ "${CI:-false}" = "false" ]; then
88
fi
99

1010
python -m pip install selenium==4.19.0 \
11-
docker===6.1.3 \
11+
docker===7.0.0 \
12+
chardet \
1213
| grep -v 'Requirement already satisfied'
1314

1415
if [ "${SELENIUM_GRID_PROTOCOL}" = "https" ]; then

tests/charts/bootstrap.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ python -m pip install pyyaml==6.0.1 \
1313

1414
cd ..
1515

16+
helm package charts/selenium-grid --version 1.0.0-SNAPSHOT -d tests/tests
17+
1618
RELEASE_NAME="selenium"
1719

1820
helm template ${RELEASE_NAME} --values tests/charts/templates/render/dummy.yaml \
1921
--set-file 'nodeConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \
2022
--set-file 'recorderConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \
2123
--set-file 'uploaderConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \
22-
charts/selenium-grid > ./tests/tests/dummy_template_manifests.yaml
24+
tests/tests/selenium-grid-1.0.0-SNAPSHOT.tgz > ./tests/tests/dummy_template_manifests.yaml
2325

2426
python tests/charts/templates/test.py "./tests/tests/dummy_template_manifests.yaml" ${RELEASE_NAME}
2527
if [ $? -ne 0 ]; then
@@ -30,14 +32,15 @@ fi
3032
rm -rf tests/charts/umbrella-charts/Chart.lock tests/charts/umbrella-charts/charts
3133
helm dependency update tests/charts/umbrella-charts
3234
helm dependency build tests/charts/umbrella-charts
35+
helm package tests/charts/umbrella-charts --version 1.0.0-SNAPSHOT -d tests/tests
3336

3437
RELEASE_NAME="test"
3538

3639
helm template ${RELEASE_NAME} --values tests/charts/templates/render/dummy_solution.yaml \
3740
--set-file 'selenium-grid.nodeConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \
3841
--set-file 'selenium-grid.recorderConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \
3942
--set-file 'selenium-grid.uploaderConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \
40-
tests/charts/umbrella-charts > ./tests/tests/dummy_solution_template_manifests.yaml
43+
tests/tests/umbrella-charts-1.0.0-SNAPSHOT.tgz > ./tests/tests/dummy_solution_template_manifests.yaml
4144

4245
python tests/charts/templates/test.py "./tests/tests/dummy_solution_template_manifests.yaml" ${RELEASE_NAME}
4346
if [ $? -ne 0 ]; then

tests/charts/ci/base-auth-ingress-values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
global:
22
seleniumGrid:
33
logLevel: INFO
4+
stdoutProbeLog: true
45

56
ingress:
67
className: nginx

tests/charts/make/chart_setup_env.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ if [ "$(uname -m)" = "x86_64" ]; then
2828
sudo apt-get install -yq docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
2929
sudo docker version
3030
echo "==============================="
31+
echo "Installing Docker compose for AMD64 / x86_64"
32+
DOCKER_COMPOSE_VERSION="v2.26.0"
33+
curl -fsSL -o ./docker-compose "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64"
34+
chmod +x ./docker-compose
35+
sudo mv ./docker-compose /usr/libexec/docker/cli-plugins
36+
docker compose version
37+
echo "==============================="
3138
if [ "${CLUSTER}" = "kind" ]; then
3239
echo "Installing kind for AMD64 / x86_64"
3340
curl -fsSL -o ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64

tests/charts/templates/test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ def test_extra_script_import_to_node_configmap(self):
154154
for doc in LIST_OF_DOCUMENTS:
155155
if doc['metadata']['name'] in resources_name and doc['kind'] == 'ConfigMap':
156156
logger.info(f"Assert default file is imported to Node ConfigMap")
157-
self.assertTrue(doc['data']['nodeProbe.sh'] is not None)
158-
self.assertTrue(doc['data']['nodePreStop.sh'] is not None)
159-
self.assertTrue(doc['data']['nodeCustomTask.sh'] is not None)
160-
self.assertTrue(doc['data']['setFromCommand.sh'] is not None)
157+
self.assertTrue(doc['data']['nodeProbe.sh'] != "")
158+
self.assertTrue(doc['data']['nodePreStop.sh'] != "")
159+
self.assertTrue(doc['data']['nodeCustomTask.sh'] != "")
160+
self.assertTrue(doc['data']['setFromCommand.sh'] != "")
161161
count += 1
162162
self.assertEqual(count, len(resources_name), "No node config resources found")
163163

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
global:
2+
seleniumGrid:
3+
imageRegistry: selenium
4+
5+
selenium-grid:
6+
enabled: true

tests/config.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[docker]
2+
3+
configs = [
4+
"${NAMESPACE}/standalone-firefox:${TAG}", '{"browserName": "firefox", "platformName": "linux"}',
5+
"${NAMESPACE}/standalone-chrome:${TAG}", '{"browserName": "chrome", "platformName": "linux"}',
6+
"${NAMESPACE}/standalone-edge:${TAG}", '{"browserName": "MicrosoftEdge", "platformName": "linux"}'
7+
]
8+
9+
url = "http://127.0.0.1:2375"
10+
11+
video-image = "${NAMESPACE}/video:${VIDEO_TAG}"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: "3"
2+
services:
3+
node-docker:
4+
image: ${NAMESPACE}/node-docker:${TAG}
5+
volumes:
6+
- ./videos:/opt/selenium/assets
7+
- ./videos/config.toml:/opt/bin/config.toml
8+
- /var/run/docker.sock:/var/run/docker.sock
9+
depends_on:
10+
- selenium-hub
11+
environment:
12+
- SE_EVENT_BUS_HOST=selenium-hub
13+
- SE_EVENT_BUS_PUBLISH_PORT=4442
14+
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443
15+
- SE_NODE_ENABLE_MANAGED_DOWNLOADS=true
16+
- SE_LOG_LEVEL=FINE
17+
18+
selenium-hub:
19+
image: ${NAMESPACE}/hub:${TAG}
20+
container_name: selenium-hub
21+
environment:
22+
- SE_LOG_LEVEL=${LOG_LEVEL}
23+
- SE_SESSION_REQUEST_TIMEOUT=${REQUEST_TIMEOUT}
24+
ports:
25+
- "4442:4442"
26+
- "4443:4443"
27+
- "4444:4444"
28+
29+
tests:
30+
image: docker-selenium-tests:latest
31+
build:
32+
context: ./
33+
dockerfile: ./Dockerfile
34+
depends_on:
35+
- selenium-hub
36+
environment:
37+
- RUN_IN_DOCKER_COMPOSE=true
38+
- SELENIUM_GRID_HOST=selenium-hub
39+
command: ["./bootstrap.sh", "${NODE}"]

0 commit comments

Comments
 (0)