Skip to content

Commit 3983e2d

Browse files
Use official spark image (#2899)
1 parent f414b85 commit 3983e2d

File tree

4 files changed

+47
-22
lines changed

4 files changed

+47
-22
lines changed

plugins/spark/v3.5/getting-started/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ services:
5454
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
5555
POLARIS_HOST: polaris
5656
volumes:
57-
- ./notebooks:/home/jovyan/notebooks
57+
- ./notebooks:/home/spark/notebooks

plugins/spark/v3.5/getting-started/notebooks/Dockerfile

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,35 @@
1717
# under the License.
1818
#
1919

20-
FROM jupyter/all-spark-notebook:spark-3.5.0
20+
FROM docker.io/apache/spark:3.5.6-java17
2121

22-
ENV LANGUAGE='en_US:en'
22+
ENV PYTHONPATH="${SPARK_HOME}/python/:${SPARK_HOME}/python/lib/py4j-0.10.9.7-src.zip:/home/spark/venv/lib/python3.10/site-packages"
23+
ENV PYSPARK_PYTHON=/home/spark/venv/bin/python
2324

2425
USER root
2526

26-
# Generic table support requires delta 3.2.1
27-
# Install Spark 3.5.6
28-
RUN wget -q https://www.apache.org/dyn/closer.lua/spark/spark-3.5.6/spark-3.5.6-bin-hadoop3.tgz?action=download \
29-
&& tar -xzf spark-3.5.6-bin-hadoop3.tgz \
30-
&& mv spark-3.5.6-bin-hadoop3 /opt/spark \
31-
&& rm spark-3.5.6-bin-hadoop3.tgz
27+
RUN apt-get update -y && \
28+
apt-get install -y python3-venv && \
29+
mkdir -p /home/spark && \
30+
chown -R spark /home/spark
3231

33-
# Set environment variables
34-
ENV SPARK_HOME=/opt/spark
35-
ENV PATH=$SPARK_HOME/bin:$PATH
32+
USER spark
3633

37-
USER jovyan
34+
WORKDIR /home/spark
3835

39-
COPY --chown=jovyan client /home/jovyan/client
40-
COPY --chown=jovyan regtests/requirements.txt /tmp
41-
COPY --chown=jovyan plugins/spark/v3.5/spark/build/2.12/libs /home/jovyan/polaris_libs
42-
RUN pip install -r /tmp/requirements.txt
43-
RUN cd client/python && poetry lock && \
44-
python3 -m poetry install && \
45-
pip install -e .
36+
COPY --chown=spark client /home/spark/client
37+
COPY --chown=spark plugins/spark/v3.5/getting-started/notebooks/requirements.txt /tmp/notebook_requirements.txt
38+
COPY --chown=spark regtests/requirements.txt /tmp
39+
COPY --chown=spark plugins/spark/v3.5/spark/build/2.12/libs /home/spark/polaris_libs
4640

47-
WORKDIR /home/jovyan/
41+
SHELL ["/bin/bash", "-c"]
42+
43+
RUN python3 -m venv /home/spark/venv && \
44+
source /home/spark/venv/bin/activate && \
45+
pip install -r /tmp/requirements.txt -r /tmp/notebook_requirements.txt && \
46+
cd client/python && \
47+
poetry lock && \
48+
poetry install --all-extras
49+
50+
EXPOSE 8888
51+
CMD ["/home/spark/venv/bin/jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--NotebookApp.token=''"]

plugins/spark/v3.5/getting-started/notebooks/SparkPolaris.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@
839839
"name": "python",
840840
"nbconvert_exporter": "python",
841841
"pygments_lexer": "ipython3",
842-
"version": "3.11.6"
842+
"version": "3.10.12"
843843
},
844844
"toc-autonumbering": false,
845845
"toc-showmarkdowntxt": false,
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
jupyterlab==4.4.10
21+
ipykernel==7.0.1

0 commit comments

Comments
 (0)