Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions .github/workflows/release-chrome-for-testing-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,16 @@ jobs:
max_attempts: 3
retry_wait_seconds: 60
command: |
make test_chrome
make test_chrome-for-testing
- name: Test images Standalone with Grid core ${{ env.GRID_VERSION }} and ${{ env.BROWSER_NAME }} v${{ env.BROWSER_VERSION }}
uses: nick-invision/retry@master
with:
timeout_minutes: 20
max_attempts: 3
retry_wait_seconds: 60
command: |
make test_chrome_standalone \
&& make test_chrome_standalone_java
make test_chrome-for-testing_standalone \
&& make test_chrome-for-testing_standalone_java
- name: Push images with Grid core ${{ env.GRID_VERSION }} and ${{ env.BROWSER_NAME }} v${{ env.BROWSER_VERSION }}
if: env.PUSH_IMAGE == 'true'
run: |
Expand Down
49 changes: 28 additions & 21 deletions Base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ ARG OPENTELEMETRY_VERSION=1.55.0
ARG GRPC_VERSION=1.76.0
ARG NETTY_VERSION=4.2.7.Final
ARG CS_VERSION=2.1.25-M18
ARG ENVSUBST_VERSION=1.4.6
ARG ENVSUBST_VERSION=1.4.7
ARG CURL_VERSION=8.16.0
ARG PYTHON_VERSION=3.13

#Arguments to define the user running Selenium
ARG SEL_USER=seluser
Expand Down Expand Up @@ -67,17 +68,37 @@ RUN apt-get -qqy update \
ca-certificates \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

#========================================
# Add normal user and group without password sudo
#========================================
RUN --mount=type=secret,id=SEL_PASSWD \
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}:$(cat /run/secrets/SEL_PASSWD)" | chpasswd

#========================================
# Install Python for utilities
#========================================
ENV PATH="$VENV_PATH/bin:$PATH" \
VIRTUAL_ENV="$VENV_PATH"

RUN apt-get -qqy update \
RUN gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys F23C5A6CF475977595C89F51BA6932366A755776 \
&& gpg --export F23C5A6CF475977595C89F51BA6932366A755776 > /usr/share/keyrings/deadsnakes.pgp \
&& echo "deb [signed-by=/usr/share/keyrings/deadsnakes.pgp] https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu noble main" | tee /etc/apt/sources.list.d/deadsnakes.list \
&& apt-get -qqy update \
&& apt-get upgrade -yq \
&& apt-get -qqy --no-install-recommends install \
python3 python3-pip python3-venv \
&& python3 -m pip install --upgrade setuptools virtualenv --break-system-packages \
&& apt-get -qqy --no-install-recommends install python${PYTHON_VERSION} python${PYTHON_VERSION}-venv \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 \
&& update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 \
&& python3 -m ensurepip --upgrade \
&& python3 -m pip install --upgrade pip virtualenv --break-system-packages \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
&& echo "source $VENV_PATH/bin/activate" >> /etc/bash.bashrc

Expand All @@ -86,8 +107,7 @@ RUN ARCH=$(if [ "$(dpkg --print-architecture)" = "arm64" ]; then echo "aarch64";
&& chmod +x /usr/bin/curl \
&& curl --version

RUN --mount=type=secret,id=SEL_PASSWD \
if [ "${TARGETARCH}" = "arm" ] && [ "${TARGETVARIANT}" = "v7" ]; then \
RUN if [ "${TARGETARCH}" = "arm" ] && [ "${TARGETVARIANT}" = "v7" ]; then \
export ARCH=armhf ; \
else \
export ARCH=$(dpkg --print-architecture) ; \
Expand All @@ -100,19 +120,6 @@ RUN --mount=type=secret,id=SEL_PASSWD \
&& ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata && \
cat /etc/timezone \
#========================================
# Add normal user and group without password sudo
#========================================
&& 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}:$(cat /run/secrets/SEL_PASSWD)" | chpasswd \
#==========
# Selenium & relaxing permissions for OpenShift and other non-sudo environments
#==========
Expand Down Expand Up @@ -189,7 +196,7 @@ RUN ARCH=$(if [ "$(dpkg --print-architecture)" = "amd64" ]; then echo "x86_64";
USER ${SEL_UID}:${SEL_GID}

RUN python3 -m venv $VENV_PATH \
&& $VENV_PATH/bin/python3 -m pip install --upgrade pip setuptools virtualenv psutil requests \
&& $VENV_PATH/bin/python3 -m pip install --upgrade pip psutil requests \
&& wget -q https://github.com/Supervisor/supervisor/archive/refs/heads/main.zip -O /tmp/supervisor.zip \
&& unzip /tmp/supervisor.zip -d /tmp \
&& cd /tmp/supervisor-main \
Expand Down
23 changes: 6 additions & 17 deletions tests/build-backward-compatible/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
set -e # Exit immediately if a command exits with a non-zero status

cd tests || true

if [ "${CI:-false}" = "false" ]; then
Expand Down Expand Up @@ -27,6 +29,9 @@ mkdir -p CHANGELOG/${SELENIUM_VERSION}
python3 tests/build-backward-compatible/fetch_firefox_version.py
python3 tests/build-backward-compatible/fetch_version.py

# Trap errors and exit with the correct error code
trap 'exit_code=$?; echo "Error: Command failed with exit code $exit_code on line $LINENO"; exit $exit_code' ERR

for CDP_VERSION in "${VERSION_LIST[@]}"; do
python3 tests/build-backward-compatible/builder.py ${SELENIUM_VERSION} ${CDP_VERSION} ${BROWSER}
export $(cat .env | xargs)
Expand All @@ -35,10 +40,6 @@ for CDP_VERSION in "${VERSION_LIST[@]}"; do
BUILD_ARGS="--build-arg FIREFOX_VERSION=${FIREFOX_VERSION} --build-arg FIREFOX_DOWNLOAD_URL=${FIREFOX_DOWNLOAD_URL}"
if [ "${REUSE_BASE}" = "true" ]; then
BUILD_ARGS="${BUILD_ARGS}" PLATFORMS=${PLATFORMS} make firefox_only
if [ $? -ne 0 ]; then
echo "Error building Node image"
exit 1
fi
BUILD_ARGS="${BUILD_ARGS}" PLATFORMS=${PLATFORMS} make standalone_firefox_only
else
BUILD_ARGS="${BUILD_ARGS}" PLATFORMS=${PLATFORMS} make standalone_firefox
Expand All @@ -53,10 +54,6 @@ for CDP_VERSION in "${VERSION_LIST[@]}"; do
BUILD_ARGS="--build-arg EDGE_VERSION=${EDGE_VERSION}"
if [ "${REUSE_BASE}" = "true" ]; then
BUILD_ARGS="${BUILD_ARGS}" make edge_only
if [ $? -ne 0 ]; then
echo "Error building Node image"
exit 1
fi
BUILD_ARGS="${BUILD_ARGS}" make standalone_edge_only
else
BUILD_ARGS="${BUILD_ARGS}" make standalone_edge
Expand All @@ -71,10 +68,6 @@ for CDP_VERSION in "${VERSION_LIST[@]}"; do
BUILD_ARGS="--build-arg CHROME_VERSION=${CHROME_VERSION}"
if [ "${REUSE_BASE}" = "true" ]; then
BUILD_ARGS="${BUILD_ARGS}" make chrome_only
if [ $? -ne 0 ]; then
echo "Error building Node image"
exit 1
fi
BUILD_ARGS="${BUILD_ARGS}" make standalone_chrome_only
else
BUILD_ARGS="${BUILD_ARGS}" make standalone_chrome
Expand All @@ -88,11 +81,7 @@ for CDP_VERSION in "${VERSION_LIST[@]}"; do
if [ -n "${CFT_VERSION}" ]; then
BUILD_ARGS="--build-arg CFT_VERSION=${CFT_VERSION} --build-arg INSTALL_CFT=true"
if [ "${REUSE_BASE}" = "true" ]; then
BUILD_ARGS="${BUILD_ARGS}" make chrome_only
if [ $? -ne 0 ]; then
echo "Error building Node image"
exit 1
fi
BUILD_ARGS="${BUILD_ARGS}" make chrome-for-testing_only
BUILD_ARGS="${BUILD_ARGS}" make standalone_chrome-for-testing_only
else
BUILD_ARGS="${BUILD_ARGS}" make standalone_chrome-for-testing
Expand Down
Loading