forked from jupyter-incubator/sparkmagic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.jupyter
45 lines (33 loc) · 1.78 KB
/
Dockerfile.jupyter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM jupyter/base-notebook:ae885c0a6226
ARG dev_mode=false
USER root
# This is needed because requests-kerberos fails to install on debian due to missing linux headers
RUN conda install requests-kerberos -y
USER $NB_USER
RUN pip install --upgrade pip
RUN pip install --upgrade --ignore-installed setuptools
COPY examples /home/jovyan/work
# Install sparkmagic - if DEV_MODE is set, use the one in the host directory.
# Otherwise, just install from pip.
COPY hdijupyterutils hdijupyterutils/
COPY autovizwidget autovizwidget/
COPY sparkmagic sparkmagic/
RUN if [ "$dev_mode" = "true" ]; then \
cd hdijupyterutils && pip install . && cd ../ && \
cd autovizwidget && pip install . && cd ../ && \
cd sparkmagic && pip install . && cd ../ ; \
else pip install sparkmagic ; fi
RUN mkdir /home/$NB_USER/.sparkmagic
COPY sparkmagic/example_config.json /home/$NB_USER/.sparkmagic/config.json
RUN sed -i 's/localhost/spark/g' /home/$NB_USER/.sparkmagic/config.json
RUN jupyter nbextension enable --py --sys-prefix widgetsnbextension
RUN jupyter-kernelspec install --user $(pip show sparkmagic | grep Location | cut -d" " -f2)/sparkmagic/kernels/sparkkernel
RUN jupyter-kernelspec install --user $(pip show sparkmagic | grep Location | cut -d" " -f2)/sparkmagic/kernels/pysparkkernel
RUN jupyter-kernelspec install --user $(pip show sparkmagic | grep Location | cut -d" " -f2)/sparkmagic/kernels/pyspark3kernel
RUN jupyter-kernelspec install --user $(pip show sparkmagic | grep Location | cut -d" " -f2)/sparkmagic/kernels/sparkrkernel
RUN jupyter serverextension enable --py sparkmagic
USER root
RUN chown $NB_USER /home/$NB_USER/.sparkmagic/config.json
RUN rm -rf hdijupyterutils/ autovizwidget/ sparkmagic/
CMD ["start-notebook.sh", "--NotebookApp.iopub_data_rate_limit=1000000000"]
USER $NB_USER