Skip to content

Start using spark4-preview versions #2159

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

Merged
merged 5 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 2024-10-22
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will describe the release schedule in this PR: #2072


Affected: `pyspark-notebook` and `all-spark-notebook` images users

- **Breaking:** Start using Spark 4.0.0 preview versions ([#2159](https://github.com/jupyter/docker-stacks/pull/2159)).

Reason: Spark v3 is not compatible with Python 3.12, and [the voting group has decided](https://github.com/jupyter/docker-stacks/pull/2072#issuecomment-2414123851) to switch to Spark v4 preview version.

## 2024-10-09

Affected: users building a custom set of images
Expand Down
2 changes: 1 addition & 1 deletion images/pyspark-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ USER ${NB_UID}
RUN mamba install --yes \
'grpcio-status' \
'grpcio' \
'pandas=2.0.3' \
'pandas=2.2.2' \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went with 2.2.2, becuase preview2 supports this version

'pyarrow' && \
mamba clean --all -f -y && \
fix-permissions "${CONDA_DIR}" && \
Expand Down
2 changes: 1 addition & 1 deletion images/pyspark-notebook/setup_spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_latest_spark_version() -> str:
stable_versions = [
ref.removeprefix("spark-").removesuffix("/")
for ref in all_refs
if ref.startswith("spark-") and "incubating" not in ref and "preview" not in ref
if ref.startswith("spark-") and "incubating" not in ref
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only line we will have to revert to start using stable versions again (that's why I made a separate commit improving spark setup scripts)

]

# Compare versions semantically
Expand Down
12 changes: 10 additions & 2 deletions tests/pyspark-notebook/test_spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@
import logging

from tests.conftest import TrackedContainer
from tests.run_command import run_command

LOGGER = logging.getLogger(__name__)


def test_spark_shell(container: TrackedContainer) -> None:
"""Checking if Spark (spark-shell) is running properly"""
logs = run_command(container, 'spark-shell <<< "1+1"', timeout=60)
logs = container.run_and_wait(
timeout=60,
no_warnings=False,
tty=True,
command=["bash", "-c", 'spark-shell <<< "1+1"'],
)
warnings = TrackedContainer.get_warnings(logs)
assert len(warnings) == 1
assert "Using incubator modules: jdk.incubator.vector" in warnings[0]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this might disappear when we switch to JDK 21, but that's a separate story and won't be a part of the switch to Python 3.12


assert "res0: Int = 2" in logs, "spark-shell does not work"
2 changes: 1 addition & 1 deletion tests/pyspark-notebook/units/unit_pandas_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Distributed under the terms of the Modified BSD License.
import pandas

assert pandas.__version__ == "2.0.3"
assert pandas.__version__ == "2.2.2"
Loading