Skip to content

Commit a5d9b34

Browse files
MonkeyCanCodevchag
authored andcommitted
Change getting-start docker file to use official spark image from outdated jupyter image (apache#2943)
* Use official spark image * Use official spark image * Use official spark image * Use official spark image * Use official spark image
1 parent a89914f commit a5d9b34

File tree

5 files changed

+30
-14
lines changed

5 files changed

+30
-14
lines changed

getting-started/spark/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ services:
5252
AWS_REGION: us-west-2
5353
POLARIS_HOST: polaris
5454
volumes:
55-
- ./notebooks:/home/jovyan/notebooks
55+
- ./notebooks:/home/spark/notebooks

getting-started/spark/notebooks/Dockerfile

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,32 @@
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

24-
COPY --chown=jovyan client /home/jovyan/client
25-
COPY --chown=jovyan regtests/requirements.txt /tmp
26-
RUN pip install -r /tmp/requirements.txt && \
27-
cd client/python && poetry lock && \
28-
python3 -m poetry install && \
29-
pip install -e .
25+
USER root
3026

31-
WORKDIR /home/jovyan/
27+
RUN apt-get update -y && \
28+
apt-get install -y python3-venv && \
29+
mkdir -p /home/spark && \
30+
chown -R spark /home/spark
31+
32+
USER spark
33+
34+
WORKDIR /home/spark
35+
36+
COPY --chown=spark client /home/spark/client
37+
COPY --chown=spark regtests/requirements.txt /tmp
38+
COPY --chown=spark regtests/notebook_requirements.txt /tmp
39+
40+
RUN python3 -m venv /home/spark/venv && \
41+
. /home/spark/venv/bin/activate && \
42+
pip install -r /tmp/requirements.txt -r /tmp/notebook_requirements.txt && \
43+
cd client/python && \
44+
poetry lock && \
45+
poetry install --all-extras
46+
47+
EXPOSE 8888
48+
CMD ["/home/spark/venv/bin/jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--NotebookApp.token=''"]

getting-started/spark/notebooks/SparkPolaris.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@
792792
"name": "python",
793793
"nbconvert_exporter": "python",
794794
"pygments_lexer": "ipython3",
795-
"version": "3.11.6"
795+
"version": "3.10.12"
796796
},
797797
"toc-autonumbering": false,
798798
"toc-showmarkdowntxt": false,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,13 @@ USER spark
3434
WORKDIR /home/spark
3535

3636
COPY --chown=spark client /home/spark/client
37-
COPY --chown=spark plugins/spark/v3.5/getting-started/notebooks/requirements.txt /tmp/notebook_requirements.txt
3837
COPY --chown=spark regtests/requirements.txt /tmp
38+
COPY --chown=spark regtests/notebook_requirements.txt /tmp
3939
COPY --chown=spark plugins/spark/v3.5/spark/build/2.12/libs /home/spark/polaris_libs
4040

41-
SHELL ["/bin/bash", "-c"]
4241

4342
RUN python3 -m venv /home/spark/venv && \
44-
source /home/spark/venv/bin/activate && \
43+
. /home/spark/venv/bin/activate && \
4544
pip install -r /tmp/requirements.txt -r /tmp/notebook_requirements.txt && \
4645
cd client/python && \
4746
poetry lock && \

0 commit comments

Comments
 (0)