Skip to content

Commit ee32469

Browse files
committed
[SPARK-55358][PYTHON][INFRA] Upgrade Python 3.12 test image to Ubuntu 24.04
### What changes were proposed in this pull request? Upgrade Python 3.12 test image to Ubuntu 24.04 ### Why are the changes needed? Ubuntu 22.04 is kind of out of date, we haven't upgrade the OS version for years. And we started to face test failure specific to old versions (#54129) ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? CI ### Was this patch authored or co-authored using generative AI tooling? No Closes #54130 from zhengruifeng/test_ubuntu_2404. Authored-by: Ruifeng Zheng <[email protected]> Signed-off-by: Ruifeng Zheng <[email protected]>
1 parent 861ba53 commit ee32469

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ jobs:
630630
env: ${{ fromJSON(inputs.envs) }}
631631
shell: 'script -q -e -c "bash {0}"'
632632
run: |
633+
uname -a
633634
for py in $(echo $PYTHON_TO_TEST | tr "," "\n")
634635
do
635636
$py --version

dev/spark-test-image/python-312/Dockerfile

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
# limitations under the License.
1616
#
1717

18-
# Image for building and testing Spark branches. Based on Ubuntu 22.04.
18+
# Image for building and testing Spark branches. Based on Ubuntu 24.04.
1919
# See also in https://hub.docker.com/_/ubuntu
20-
FROM ubuntu:jammy-20240911.1
20+
FROM ubuntu:noble
2121
LABEL org.opencontainers.image.authors="Apache Spark project <[email protected]>"
2222
LABEL org.opencontainers.image.licenses="Apache-2.0"
2323
LABEL org.opencontainers.image.ref.name="Apache Spark Infra Image For PySpark with Python 3.12"
2424
# Overwrite this label to avoid exposing the underlying Ubuntu OS version label
2525
LABEL org.opencontainers.image.version=""
2626

27-
ENV FULL_REFRESH_DATE=20260203
27+
ENV FULL_REFRESH_DATE=20260204
2828

2929
ENV DEBIAN_FRONTEND=noninteractive
3030
ENV DEBCONF_NONINTERACTIVE_SEEN=true
@@ -41,27 +41,23 @@ RUN apt-get update && apt-get install -y \
4141
libopenblas-dev \
4242
libssl-dev \
4343
openjdk-17-jdk-headless \
44+
python3.12 \
45+
python3-pip \
46+
python3-venv \
4447
pkg-config \
4548
tzdata \
4649
software-properties-common \
4750
zlib1g-dev
4851

49-
# Install Python 3.12
50-
RUN add-apt-repository ppa:deadsnakes/ppa
51-
RUN apt-get update && apt-get install -y \
52-
python3.12 \
53-
&& apt-get autoremove --purge -y \
54-
&& apt-get clean \
55-
&& rm -rf /var/lib/apt/lists/*
56-
57-
5852
ARG BASIC_PIP_PKGS="numpy pyarrow>=22.0.0 six==1.16.0 pandas==2.3.3 scipy plotly<6.0.0 mlflow>=2.8.1 coverage matplotlib openpyxl memory-profiler>=0.61.0 scikit-learn>=1.3.2 pystack>=1.6.0 psutil"
5953
# Python deps for Spark Connect
6054
ARG CONNECT_PIP_PKGS="grpcio==1.76.0 grpcio-status==1.76.0 protobuf==6.33.5 googleapis-common-protos==1.71.0 zstandard==0.25.0 graphviz==0.20.3"
6155

6256
# Install Python 3.12 packages
63-
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12
64-
RUN python3.12 -m pip install --ignore-installed 'blinker>=1.6.2' # mlflow needs this
57+
ENV VIRTUAL_ENV /opt/spark-venv
58+
RUN python3.12 -m venv $VIRTUAL_ENV
59+
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
60+
6561
RUN python3.12 -m pip install $BASIC_PIP_PKGS unittest-xml-reporting $CONNECT_PIP_PKGS lxml && \
6662
python3.12 -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu && \
6763
python3.12 -m pip install torcheval && \

0 commit comments

Comments
 (0)