Skip to content
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

[SEDONA-715] Add apache zeppelin notebook support for the docker image #1826

Merged
merged 4 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ dependency-reduced-pom.xml
__pycache__
/.bsp
/.scala-build
.DS_Store
17 changes: 15 additions & 2 deletions docker/sedona-spark-jupyterlab/sedona-jupyterlab.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,42 @@ ARG spark_xml_version=0.16.0
ARG sedona_version=1.5.1
ARG geotools_wrapper_version=1.5.1-28.2
ARG spark_extension_version=2.11.0
ARG zeppelin_version=0.12.0

# Set up envs
ENV SHARED_WORKSPACE=${shared_workspace}
ENV SPARK_HOME /usr/local/lib/python3.10/dist-packages/pyspark
ENV SEDONA_HOME /opt/sedona
ENV ZEPPELIN_HOME /opt/zeppelin
RUN mkdir ${SEDONA_HOME}

ENV SPARK_MASTER_HOST localhost
ENV SPARK_MASTER_PORT 7077
ENV PYTHONPATH=$SPARK_HOME/python
ENV PYSPARK_PYTHON python3
ENV PYSPARK_DRIVER_PYTHON jupyter

COPY ./ ${SEDONA_HOME}/

RUN chmod +x ${SEDONA_HOME}/docker/spark.sh
RUN chmod +x ${SEDONA_HOME}/docker/sedona.sh
RUN chmod +x ${SEDONA_HOME}/docker/zeppelin/install-zeppelin.sh
RUN ${SEDONA_HOME}/docker/spark.sh ${spark_version} ${hadoop_s3_version} ${aws_sdk_version} ${spark_xml_version}

# Install Python dependencies
COPY docker/sedona-spark-jupyterlab/requirements.txt /opt/requirements.txt
RUN pip3 install -r /opt/requirements.txt
RUN pip3 install --default-timeout=100 -r /opt/requirements.txt

RUN ${SEDONA_HOME}/docker/sedona.sh ${sedona_version} ${geotools_wrapper_version} ${spark_version} ${spark_extension_version}
RUN ${SEDONA_HOME}/docker/zeppelin/install-zeppelin.sh ${zeppelin_version} /opt
# Set up Zeppelin configuration
COPY docker/zeppelin/conf/zeppelin-site.xml ${ZEPPELIN_HOME}/conf/
RUN mkdir ${ZEPPELIN_HOME}/helium
RUN mkdir ${ZEPPELIN_HOME}/leaflet
RUN mkdir ${ZEPPELIN_HOME}/notebook/sedona-tutorial
COPY zeppelin/ ${ZEPPELIN_HOME}/leaflet
COPY docker/zeppelin/conf/sedona-zeppelin.json ${ZEPPELIN_HOME}/helium/
COPY docker/zeppelin/examples/*.zpln ${ZEPPELIN_HOME}/notebook/sedona-tutorial/
COPY docker/zeppelin/examples/arealm.csv /opt/workspace/examples/data/

COPY docs/usecases/*.ipynb /opt/workspace/examples/
COPY docs/usecases/*.py /opt/workspace/examples/
Expand All @@ -69,6 +81,7 @@ EXPOSE 8888
EXPOSE 8080
EXPOSE 8081
EXPOSE 4040
EXPOSE 8085

WORKDIR ${SHARED_WORKSPACE}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Allow files and folders with a pattern starting with !
!docker/**
!zeppelin/**
!docs/usecases/**
!python/**
!spark-shaded/target/**
1 change: 1 addition & 0 deletions docker/sedona-spark-jupyterlab/start.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,6 @@ echo "spark.executor.memory $EXECUTOR_MEM" >> "${SPARK_HOME}"/conf/spark-default
service ssh start
"${SPARK_HOME}"/sbin/start-all.sh

"${ZEPPELIN_HOME}"/bin/zeppelin-daemon.sh start
# Start jupyter lab
exec jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root --NotebookApp.token=
8 changes: 8 additions & 0 deletions docker/zeppelin/conf/sedona-zeppelin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "VISUALIZATION",
"name": "sedona-zeppelin",
"description": "Zeppelin visualization support for Sedona",
"artifact": "/opt/zeppelin/leaflet",
"license": "BSD-2-Clause",
"icon": "<i class='fa fa-globe'></i>"
}
Loading
Loading