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

Update to latest Debian (Bookworm/12) #54

Open
wants to merge 8 commits into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -55,6 +55,6 @@ body:
attributes:
label: Docker Selenium version (tag)
description: What version of Docker Selenium are you using?
placeholder: 4.12.1-20230920? Please use the full tag, avoid "latest"
placeholder: 4.15.0-20231110? Please use the full tag, avoid "latest"
validations:
required: true
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ jobs:
- name: Output Docker info
run: docker info
- name: Set up Python 3.8
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: 3.8
- name: Get branch name (only for push to branch)
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -51,25 +51,25 @@ jobs:
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
- name: Deploy new images
uses: nick-invision/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2
uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2
with:
timeout_minutes: 20
max_attempts: 3
command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release
- name: Tag images as latest
uses: nick-invision/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2
uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2
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@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2
uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2
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@943e742917ac94714d2f408a0e8320f2d1fcafcd # v2
uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2
with:
timeout_minutes: 20
max_attempts: 3
@@ -80,7 +80,7 @@ jobs:
git config --local user.name "Selenium CI Bot"
git commit -m "Update tag in docs and files [skip ci]" -a
- name: Push changes
uses: ad-m/github-push-action@40bf560936a8022e68a3c00e7d2abefaf01305a6 # master
uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # master
with:
github_token: ${{ secrets.SELENIUM_CI_TOKEN }}
branch: trunk
2 changes: 1 addition & 1 deletion .github/workflows/helm-chart-release.yml
Original file line number Diff line number Diff line change
@@ -23,6 +23,6 @@ jobs:
git config user.email "[email protected]"

- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.5.0
uses: helm/chart-releaser-action@v1.6.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
50 changes: 50 additions & 0 deletions .github/workflows/helm-chart-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Lint and Test Helm Charts

on:
push:
paths:
- 'charts/selenium-grid/**'
pull_request:
paths:
- 'charts/selenium-grid/**'
workflow_dispatch:

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.13.2

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
check-latest: true

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config tests/chart-test.yaml)
if [[ -n "$changed" ]]; then
echo "{changed}={true}" >> $GITHUB_OUTPUT
fi

- name: Run chart-testing (lint)
run: ct lint --config tests/chart-test.yaml

- name: Create kind cluster
uses: helm/[email protected]

- name: Run chart-testing (install)
run: ct install --all --config tests/chart-test.yaml
2 changes: 1 addition & 1 deletion .github/workflows/lock.yml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@be8aa5be94131386884a6da4189effda9b14aa21 # v3
- uses: dessant/lock-threads@d42e5f49803f3c4e14ffee0378e31481265dda22 # v3
with:
process-only: 'issues'
issue-lock-inactive-days: '30'
2 changes: 1 addition & 1 deletion .github/workflows/test-video.yml
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ jobs:
- name: Output Docker info
run: docker info
- name: Set up Python 3.8
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: 3.8
- name: Get branch name (only for push to branch)
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -147,4 +147,5 @@ ENV/

# End of https://www.gitignore.io/api/python
.DS_Store

/charts/*/charts
/charts/*/**.lock
20 changes: 11 additions & 9 deletions Base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# FROM ubuntu:focal-20210416
#FROM ubuntu:focal-20210416
#FROM ubuntu:focal-20210827
#FROM ubuntu:focal-20211006
#FROM ubuntu:focal-20220302
#FROM ubuntu:focal-20220415
#FROM ubuntu:focal-20220531
#FROM ubuntu:focal-20230301
FROM debian:bullseye
FROM debian:bookworm
LABEL authors="Selenium <[email protected]>"

#================================================
@@ -33,7 +33,6 @@ RUN apt-get -qqy update \
acl \
bzip2 \
ca-certificates \
openjdk-11-jre-headless \
tzdata \
sudo \
unzip \
@@ -42,7 +41,12 @@ RUN apt-get -qqy update \
curl \
supervisor \
gnupg2 \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
&& mkdir -p /etc/apt/keyrings \
&& wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc \
&& echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list \
&& apt-get update -y \
&& apt-get install temurin-11-jre -y \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

#===================

@@ -51,7 +55,7 @@ RUN if [ $TARGETARCH = "arm" ] && [ $TARGETVARIANT = "v7" ]; then \
else \
export ARCH=$TARGETARCH ; \
fi \
&& sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/java-11-openjdk-$ARCH/conf/security/java.security
&& sed -i 's/securerandom\.source=file:\/dev\/random/securerandom\.source=file:\/dev\/urandom/' ./usr/lib/jvm/temurin-11-jre-$ARCH/conf/security/java.security


#===================
@@ -93,10 +97,8 @@ COPY supervisord.conf /etc
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 \
&& wget --no-verbose https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.10.0/selenium-server-4.10.0.jar \
&& wget --no-verbose https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.15.0/selenium-server-4.15.0.jar \
-O /opt/selenium/selenium-server.jar \
&& wget --no-verbose https://repo1.maven.org/maven2/org/seleniumhq/selenium/selenium-http-jdk-client/4.10.0/selenium-http-jdk-client-4.10.0.jar \
-O /opt/selenium/selenium-http-jdk-client.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
@@ -115,7 +117,7 @@ RUN if [ `arch` = "aarch64" ]; then \
fi

RUN if [ -f "/tmp/cs" ]; then \
/tmp/cs fetch --classpath --cache /external_jars io.opentelemetry:opentelemetry-exporter-otlp:1.28.0 io.opentelemetry:opentelemetry-exporter-jaeger:1.28.0 io.grpc:grpc-netty:1.57.1 > /external_jars/.classpath.txt ; \
/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 ; \
fi

RUN if [ -f "/tmp/cs" ]; then chmod 664 /external_jars/.classpath.txt ; fi
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ BUILD_ARGS := $(BUILD_ARGS)
MAJOR := $(word 1,$(subst ., ,$(TAG_VERSION)))
MINOR := $(word 2,$(subst ., ,$(TAG_VERSION)))
MAJOR_MINOR_PATCH := $(word 1,$(subst -, ,$(TAG_VERSION)))
FFMPEG_TAG_VERSION := $(or $(FFMPEG_TAG_VERSION),$(FFMPEG_TAG_VERSION),ffmpeg-4.3.1)
FFMPEG_TAG_VERSION := $(or $(FFMPEG_TAG_VERSION),$(FFMPEG_TAG_VERSION),ffmpeg-6.0)
PLATFORMS := $(or $(PLATFORMS),$(PLATFORMS),linux/arm64)

all: hub \
@@ -498,9 +498,9 @@ test_video: video hub chrome firefox edge
done
# Using ffmpeg to verify file integrity
# https://superuser.com/questions/100288/how-can-i-check-the-integrity-of-a-video-file-avi-mpeg-mp4
docker run -v $$(pwd):$$(pwd) -w $$(pwd) jrottenberg/ffmpeg:4.3.1-ubuntu2004 -v error -i ./tests/videos/chrome_video.mp4 -f null - 2>error.log
docker run -v $$(pwd):$$(pwd) -w $$(pwd) jrottenberg/ffmpeg:4.3.1-ubuntu2004 -v error -i ./tests/videos/firefox_video.mp4 -f null - 2>error.log
docker run -v $$(pwd):$$(pwd) -w $$(pwd) jrottenberg/ffmpeg:4.3.1-ubuntu2004 -v error -i ./tests/videos/edge_video.mp4 -f null - 2>error.log
docker run -v $$(pwd):$$(pwd) -w $$(pwd) jrottenberg/ffmpeg:6.0-alpine -v error -i ./tests/videos/chrome_video.mp4 -f null - 2>error.log
docker run -v $$(pwd):$$(pwd) -w $$(pwd) jrottenberg/ffmpeg:6.0-alpine -v error -i ./tests/videos/firefox_video.mp4 -f null - 2>error.log
docker run -v $$(pwd):$$(pwd) -w $$(pwd) jrottenberg/ffmpeg:6.0-alpine -v error -i ./tests/videos/edge_video.mp4 -f null - 2>error.log

.PHONY: \
all \
9 changes: 4 additions & 5 deletions NodeBase/Dockerfile
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ RUN apt-get update -qqy \
#================
# libfontconfig ~1 MB
# libfreetype6 ~1 MB
# xfonts-cyrillic ~2 MB
# xfonts-cyrillic ~2 MB (no longer supported on Debian bookworm)
# xfonts-scalable ~2 MB
# fonts-liberation ~3 MB
# fonts-ipafont-gothic ~13 MB
@@ -78,7 +78,6 @@ RUN apt-get -qqy update \
&& apt-get -qqy --no-install-recommends install \
libfontconfig \
libfreetype6 \
xfonts-cyrillic \
xfonts-scalable \
fonts-liberation \
fonts-ipafont-gothic \
@@ -139,9 +138,9 @@ 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
# "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
USER root

#==========
# Relaxing permissions for OpenShift and other non-sudo environments
@@ -179,7 +178,7 @@ ENV DISPLAY_NUM 99
# Path to the Configfile
ENV CONFIG_FILE=/opt/selenium/config.toml
ENV GENERATE_CONFIG true
# Drain the Node after N sessions.
# Drain the Node after N sessions.
# A value higher than zero enables the feature
ENV SE_DRAIN_AFTER_SESSION_COUNT 0
# Setting Selenium Manager to work offline
3 changes: 2 additions & 1 deletion NodeBase/generate_config
Original file line number Diff line number Diff line change
@@ -62,9 +62,10 @@ elif [[ "${SE_NODE_BROWSER_NAME}" == "firefox" ]]; then
elif [[ "${SE_NODE_BROWSER_NAME}" == "MicrosoftEdge" ]]; then
SE_NODE_BROWSER_VERSION=$(short_version $(microsoft-edge --version | awk '{print $3}'))
fi
SE__BROWSER_BINARY_LOCATION=$(cat /opt/selenium/browser_binary_location)

if [[ -z "$SE_NODE_STEREOTYPE" ]]; then
SE_NODE_STEREOTYPE="{\"browserName\": \"${SE_NODE_BROWSER_NAME}\", \"browserVersion\": \"${SE_NODE_BROWSER_VERSION}\", \"platformName\": \"Linux\"}"
SE_NODE_STEREOTYPE="{\"browserName\": \"${SE_NODE_BROWSER_NAME}\", \"browserVersion\": \"${SE_NODE_BROWSER_VERSION}\", \"platformName\": \"Linux\", ${SE__BROWSER_BINARY_LOCATION}}"
else
SE_NODE_STEREOTYPE="$SE_NODE_STEREOTYPE"
fi
19 changes: 16 additions & 3 deletions NodeBase/start-selenium-node.sh
Original file line number Diff line number Diff line change
@@ -31,6 +31,11 @@ if [ ! -z "$SE_OPTS" ]; then
echo "Appending Selenium options: ${SE_OPTS}"
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}"
fi

if [ "$GENERATE_CONFIG" = true ]; then
echo "Generating Selenium Config"
/opt/bin/generate_config
@@ -40,7 +45,8 @@ EXTRA_LIBS="/opt/selenium/selenium-http-jdk-client.jar"

if [ ! -z "$SE_ENABLE_TRACING" ]; then
EXTERNAL_JARS=$(</external_jars/.classpath.txt)
EXTRA_LIBS=${EXTRA_LIBS}:${EXTERNAL_JARS}
[ -n "$EXTRA_LIBS" ] && [ -n "${EXTERNAL_JARS}" ] && EXTRA_LIBS=${EXTRA_LIBS}:
EXTRA_LIBS="--ext "${EXTRA_LIBS}${EXTERNAL_JARS}
echo "Tracing is enabled"
echo "Classpath will be enriched with these external jars : " ${EXTRA_LIBS}
else
@@ -51,9 +57,16 @@ echo "Selenium Grid Node configuration: "
cat "$CONFIG_FILE"
echo "Starting Selenium Grid Node..."

java ${JAVA_OPTS:-$SE_JAVA_OPTS} -Dwebdriver.http.factory=jdk-http-client \
CHROME_DRIVER_PATH_PROPERTY=-Dwebdriver.chrome.driver=/usr/bin/chromedriver
EDGE_DRIVER_PATH_PROPERTY=-Dwebdriver.edge.driver=/usr/bin/msedgedriver
GECKO_DRIVER_PATH_PROPERTY=-Dwebdriver.gecko.driver=/usr/bin/geckodriver

java ${JAVA_OPTS:-$SE_JAVA_OPTS} \
${CHROME_DRIVER_PATH_PROPERTY} \
${EDGE_DRIVER_PATH_PROPERTY} \
${GECKO_DRIVER_PATH_PROPERTY} \
-jar /opt/selenium/selenium-server.jar \
--ext ${EXTRA_LIBS} node \
${EXTRA_LIBS} node \
--bind-host ${SE_BIND_HOST} \
--config "$CONFIG_FILE" \
${SE_OPTS}
2 changes: 1 addition & 1 deletion NodeBase/start-xvfb.sh
Original file line number Diff line number Diff line change
@@ -19,5 +19,5 @@ if [ "${START_XVFB:-$SE_START_XVFB}" = true ] ; then
--server-args="-screen 0 ${GEOMETRY} -fbdir /var/tmp -dpi ${SCREEN_DPI} -listen tcp -noreset -ac +extension RANDR" \
/usr/bin/fluxbox -display ${DISPLAY}
else
echo "Xvfb and Fluxbox won't start. Chrome/Firefox/Node can only run in headless mode. Remember to set the 'headless' flag in your test."
echo "Xvfb and Fluxbox won't start. Chrome/Firefox/Edge can only run in headless mode. Remember to set the 'headless' flag in your test."
fi
2 changes: 2 additions & 0 deletions NodeChrome/Dockerfile
Original file line number Diff line number Diff line change
@@ -59,3 +59,5 @@ RUN if [ ! -z "$CHROME_DRIVER_VERSION" ]; \
# Dumping Browser name and version for config
#============================================
RUN echo "chrome" > /opt/selenium/browser_name
RUN google-chrome --version | awk '{print $3}' > /opt/selenium/browser_version
RUN echo "\"goog:chromeOptions\": {\"binary\": \"/usr/bin/google-chrome\"}" > /opt/selenium/browser_binary_location
6 changes: 4 additions & 2 deletions NodeChromium/Dockerfile
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@ LABEL authors=${AUTHORS}

USER root

# Install Chromium
# Install Chromium
# RUN echo "deb http://http.us.debian.org/debian/ stable non-free contrib main" >> /etc/apt/sources.list \
RUN echo "deb http://deb.debian.org/debian/ sid main" >> /etc/apt/sources.list \
RUN echo "deb http://deb.debian.org/debian/ bookworm main" >> /etc/apt/sources.list \
&& apt-get update -qqy \
# && apt-get -qqy install chromium=89.0.4389.82-1 \
# && apt-get -qqy install chromium=90.0.4430.212-1 \
@@ -32,6 +32,8 @@ RUN apt-get update -qqy \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

RUN echo "chromium" > /opt/selenium/browser_name
RUN google-chrome --version | awk '{print $3}' > /opt/selenium/browser_version
RUN echo "\"goog:chromeOptions\": {\"binary\": \"/usr/bin/chromium\"}" > /opt/selenium/browser_binary_location

USER 1200

8 changes: 4 additions & 4 deletions NodeDocker/config.toml
Original file line number Diff line number Diff line change
@@ -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.12.1-20230920", '{"browserName": "firefox", "platformName": "linux"}',
"selenium/standalone-chrome:4.12.1-20230920", '{"browserName": "chrome", "platformName": "linux"}',
"selenium/standalone-edge:4.12.1-20230920", '{"browserName": "MicrosoftEdge", "platformName": "linux"}'
"selenium/standalone-firefox:4.15.0-20231110", '{"browserName": "firefox", "platformName": "linux"}',
"selenium/standalone-chrome:4.15.0-20231110", '{"browserName": "chrome", "platformName": "linux"}',
"selenium/standalone-edge:4.15.0-20231110", '{"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-4.3.1-20230920"
video-image = "selenium/video:ffmpeg-6.0-20231110"

# Uncomment the following section if you are running the node on a separate VM
# Fill out the placeholders with appropriate values
7 changes: 7 additions & 0 deletions NodeFirefox/99firefox-unstable
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Package: *
Pin: release a=stable
Pin-Priority: 900

Package: *
Pin: release a=unstable
Pin-Priority: 10
Loading