Skip to content

Commit 3f1bbb1

Browse files
committed
Docker: Update Python 3.13 in Base for other dependencies
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent a4f170e commit 3f1bbb1

File tree

3 files changed

+37
-41
lines changed

3 files changed

+37
-41
lines changed

.github/workflows/release-chrome-for-testing-versions.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,16 @@ jobs:
134134
max_attempts: 3
135135
retry_wait_seconds: 60
136136
command: |
137-
make test_chrome
137+
make test_chrome-for-testing
138138
- name: Test images Standalone with Grid core ${{ env.GRID_VERSION }} and ${{ env.BROWSER_NAME }} v${{ env.BROWSER_VERSION }}
139139
uses: nick-invision/retry@master
140140
with:
141141
timeout_minutes: 20
142142
max_attempts: 3
143143
retry_wait_seconds: 60
144144
command: |
145-
make test_chrome_standalone \
146-
&& make test_chrome_standalone_java
145+
make test_chrome-for-testing_standalone \
146+
&& make test_chrome-for-testing_standalone_java
147147
- name: Push images with Grid core ${{ env.GRID_VERSION }} and ${{ env.BROWSER_NAME }} v${{ env.BROWSER_VERSION }}
148148
if: env.PUSH_IMAGE == 'true'
149149
run: |

Base/Dockerfile

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ ARG OPENTELEMETRY_VERSION=1.55.0
1111
ARG GRPC_VERSION=1.76.0
1212
ARG NETTY_VERSION=4.2.7.Final
1313
ARG CS_VERSION=2.1.25-M18
14-
ARG ENVSUBST_VERSION=1.4.6
14+
ARG ENVSUBST_VERSION=1.4.7
1515
ARG CURL_VERSION=8.16.0
16+
ARG PYTHON_VERSION=3.13
1617

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

71+
#========================================
72+
# Add normal user and group without password sudo
73+
#========================================
74+
RUN --mount=type=secret,id=SEL_PASSWD \
75+
groupadd ${SEL_GROUP} \
76+
--gid ${SEL_GID} \
77+
&& useradd ${SEL_USER} \
78+
--create-home \
79+
--gid ${SEL_GID} \
80+
--shell /bin/bash \
81+
--uid ${SEL_UID} \
82+
&& usermod -a -G sudo ${SEL_USER} \
83+
&& echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers \
84+
&& echo "${SEL_USER}:$(cat /run/secrets/SEL_PASSWD)" | chpasswd
85+
7086
#========================================
7187
# Install Python for utilities
7288
#========================================
7389
ENV PATH="$VENV_PATH/bin:$PATH" \
7490
VIRTUAL_ENV="$VENV_PATH"
7591

76-
RUN apt-get -qqy update \
92+
RUN gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys F23C5A6CF475977595C89F51BA6932366A755776 \
93+
&& gpg --export F23C5A6CF475977595C89F51BA6932366A755776 > /usr/share/keyrings/deadsnakes.pgp \
94+
&& 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 \
95+
&& apt-get -qqy update \
7796
&& apt-get upgrade -yq \
78-
&& apt-get -qqy --no-install-recommends install \
79-
python3 python3-pip python3-venv \
80-
&& python3 -m pip install --upgrade setuptools virtualenv --break-system-packages \
97+
&& apt-get -qqy --no-install-recommends install python${PYTHON_VERSION} python${PYTHON_VERSION}-venv \
98+
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 \
99+
&& update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 \
100+
&& python3 -m ensurepip --upgrade \
101+
&& python3 -m pip install --upgrade pip virtualenv --break-system-packages \
81102
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
82103
&& echo "source $VENV_PATH/bin/activate" >> /etc/bash.bashrc
83104

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

89-
RUN --mount=type=secret,id=SEL_PASSWD \
90-
if [ "${TARGETARCH}" = "arm" ] && [ "${TARGETVARIANT}" = "v7" ]; then \
110+
RUN if [ "${TARGETARCH}" = "arm" ] && [ "${TARGETVARIANT}" = "v7" ]; then \
91111
export ARCH=armhf ; \
92112
else \
93113
export ARCH=$(dpkg --print-architecture) ; \
@@ -100,19 +120,6 @@ RUN --mount=type=secret,id=SEL_PASSWD \
100120
&& ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime && \
101121
dpkg-reconfigure -f noninteractive tzdata && \
102122
cat /etc/timezone \
103-
#========================================
104-
# Add normal user and group without password sudo
105-
#========================================
106-
&& groupadd ${SEL_GROUP} \
107-
--gid ${SEL_GID} \
108-
&& useradd ${SEL_USER} \
109-
--create-home \
110-
--gid ${SEL_GID} \
111-
--shell /bin/bash \
112-
--uid ${SEL_UID} \
113-
&& usermod -a -G sudo ${SEL_USER} \
114-
&& echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers \
115-
&& echo "${SEL_USER}:$(cat /run/secrets/SEL_PASSWD)" | chpasswd \
116123
#==========
117124
# Selenium & relaxing permissions for OpenShift and other non-sudo environments
118125
#==========
@@ -189,7 +196,7 @@ RUN ARCH=$(if [ "$(dpkg --print-architecture)" = "amd64" ]; then echo "x86_64";
189196
USER ${SEL_UID}:${SEL_GID}
190197

191198
RUN python3 -m venv $VENV_PATH \
192-
&& $VENV_PATH/bin/python3 -m pip install --upgrade pip setuptools virtualenv psutil requests \
199+
&& $VENV_PATH/bin/python3 -m pip install --upgrade pip psutil requests \
193200
&& wget -q https://github.com/Supervisor/supervisor/archive/refs/heads/main.zip -O /tmp/supervisor.zip \
194201
&& unzip /tmp/supervisor.zip -d /tmp \
195202
&& cd /tmp/supervisor-main \

tests/build-backward-compatible/bootstrap.sh

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env bash
2+
set -e # Exit immediately if a command exits with a non-zero status
3+
24
cd tests || true
35

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

32+
# Trap errors and exit with the correct error code
33+
trap 'exit_code=$?; echo "Error: Command failed with exit code $exit_code on line $LINENO"; exit $exit_code' ERR
34+
3035
for CDP_VERSION in "${VERSION_LIST[@]}"; do
3136
python3 tests/build-backward-compatible/builder.py ${SELENIUM_VERSION} ${CDP_VERSION} ${BROWSER}
3237
export $(cat .env | xargs)
@@ -35,10 +40,6 @@ for CDP_VERSION in "${VERSION_LIST[@]}"; do
3540
BUILD_ARGS="--build-arg FIREFOX_VERSION=${FIREFOX_VERSION} --build-arg FIREFOX_DOWNLOAD_URL=${FIREFOX_DOWNLOAD_URL}"
3641
if [ "${REUSE_BASE}" = "true" ]; then
3742
BUILD_ARGS="${BUILD_ARGS}" PLATFORMS=${PLATFORMS} make firefox_only
38-
if [ $? -ne 0 ]; then
39-
echo "Error building Node image"
40-
exit 1
41-
fi
4243
BUILD_ARGS="${BUILD_ARGS}" PLATFORMS=${PLATFORMS} make standalone_firefox_only
4344
else
4445
BUILD_ARGS="${BUILD_ARGS}" PLATFORMS=${PLATFORMS} make standalone_firefox
@@ -53,10 +54,6 @@ for CDP_VERSION in "${VERSION_LIST[@]}"; do
5354
BUILD_ARGS="--build-arg EDGE_VERSION=${EDGE_VERSION}"
5455
if [ "${REUSE_BASE}" = "true" ]; then
5556
BUILD_ARGS="${BUILD_ARGS}" make edge_only
56-
if [ $? -ne 0 ]; then
57-
echo "Error building Node image"
58-
exit 1
59-
fi
6057
BUILD_ARGS="${BUILD_ARGS}" make standalone_edge_only
6158
else
6259
BUILD_ARGS="${BUILD_ARGS}" make standalone_edge
@@ -71,10 +68,6 @@ for CDP_VERSION in "${VERSION_LIST[@]}"; do
7168
BUILD_ARGS="--build-arg CHROME_VERSION=${CHROME_VERSION}"
7269
if [ "${REUSE_BASE}" = "true" ]; then
7370
BUILD_ARGS="${BUILD_ARGS}" make chrome_only
74-
if [ $? -ne 0 ]; then
75-
echo "Error building Node image"
76-
exit 1
77-
fi
7871
BUILD_ARGS="${BUILD_ARGS}" make standalone_chrome_only
7972
else
8073
BUILD_ARGS="${BUILD_ARGS}" make standalone_chrome
@@ -88,11 +81,7 @@ for CDP_VERSION in "${VERSION_LIST[@]}"; do
8881
if [ -n "${CFT_VERSION}" ]; then
8982
BUILD_ARGS="--build-arg CFT_VERSION=${CFT_VERSION} --build-arg INSTALL_CFT=true"
9083
if [ "${REUSE_BASE}" = "true" ]; then
91-
BUILD_ARGS="${BUILD_ARGS}" make chrome_only
92-
if [ $? -ne 0 ]; then
93-
echo "Error building Node image"
94-
exit 1
95-
fi
84+
BUILD_ARGS="${BUILD_ARGS}" make chrome-for-testing_only
9685
BUILD_ARGS="${BUILD_ARGS}" make standalone_chrome-for-testing_only
9786
else
9887
BUILD_ARGS="${BUILD_ARGS}" make standalone_chrome-for-testing

0 commit comments

Comments
 (0)