-
Notifications
You must be signed in to change notification settings - Fork 29.2k
[SPARK-55392][PYTHON][INFRA] Upgrade Python 3.14 test image to Ubuntu 24.04 #54175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,16 +15,16 @@ | |
| # limitations under the License. | ||
| # | ||
|
|
||
| # Image for building and testing Spark branches. Based on Ubuntu 22.04. | ||
| # Image for building and testing Spark branches. Based on Ubuntu 24.04. | ||
| # See also in https://hub.docker.com/_/ubuntu | ||
| FROM ubuntu:jammy-20240911.1 | ||
| FROM ubuntu:noble | ||
| LABEL org.opencontainers.image.authors="Apache Spark project <[email protected]>" | ||
| LABEL org.opencontainers.image.licenses="Apache-2.0" | ||
| LABEL org.opencontainers.image.ref.name="Apache Spark Infra Image For PySpark with Python 3.14" | ||
| # Overwrite this label to avoid exposing the underlying Ubuntu OS version label | ||
| LABEL org.opencontainers.image.version="" | ||
|
|
||
| ENV FULL_REFRESH_DATE=20260203 | ||
| ENV FULL_REFRESH_DATE=20260206 | ||
|
|
||
| ENV DEBIAN_FRONTEND=noninteractive | ||
| ENV DEBCONF_NONINTERACTIVE_SEEN=true | ||
|
|
@@ -54,14 +54,17 @@ RUN apt-get update && apt-get install -y \ | |
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Setup virtual environment | ||
| ENV VIRTUAL_ENV=/opt/spark-venv | ||
| RUN python3.14 -m venv --without-pip $VIRTUAL_ENV | ||
| ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||
|
|
||
| # Install Python 3.14 packages | ||
| RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.14 | ||
|
|
||
| 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" | ||
| # Python deps for Spark Connect | ||
| 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" | ||
|
|
||
| # Install Python 3.14 packages | ||
| RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.14 | ||
| RUN python3.14 -m pip install --ignore-installed 'blinker>=1.6.2' # mlflow needs this | ||
| RUN python3.14 -m pip install $BASIC_PIP_PKGS unittest-xml-reporting $CONNECT_PIP_PKGS lxml && \ | ||
| python3.14 -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu && \ | ||
| python3.14 -m pip install torcheval && \ | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit weird, why don't we activate virtual env normally? I think it does more than changing PATH. Why do we need the venv in the first place?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a AI-recommended approach, and the source is https://pythonspeed.com/articles/activate-virtualenv-dockerfile/
it said the the normal way to activate venv only take effect in its
RUNcommand, I didn't try it though