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

feat: Documentation update for newer versions Jupyter notebook #902

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Enable basic DependaBot scanning for pip packages and GitHub actions used in CI
- Add CI support for release proces with [release.yaml](.github/workflows/release.yml) workflow
- Release documentation is updated acrodingly in [RELEASING.md](./RELEASING.md)
- Update README.md with installation methods on newer Jupyter and JupyterLab releases

## 0.21.0

Expand Down
8 changes: 2 additions & 6 deletions Dockerfile.jupyter
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,15 @@ RUN if [ "$dev_mode" = "true" ]; then \
cd sparkmagic && pip install -e . && cd ../ ; \
else pip install sparkmagic ; fi

# Jupyter extensions changed in >7.x.x
# For now (workaround), let's pin to 6 to avoid breaking things
# xref: https://github.com/jupyter-incubator/sparkmagic/issues/825
RUN pip install notebook==6.5.5

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 pip install ipywidgets
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/sparkrkernel
RUN jupyter serverextension enable --py sparkmagic
RUN jupyter server extension enable --py sparkmagic

USER root
RUN chown $NB_USER /home/$NB_USER/.sparkmagic/config.json
Expand Down
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,42 @@ See the [Sending Local Data to Spark notebook](examples/Send%20local%20data%20to

## Installation

### Jupyter Notebook 7.x / JupyterLab 3.x

1. Install the library

pip install sparkmagic

2. Make sure that ipywidgets is properly installed by running

jupyter nbextension enable --py --sys-prefix widgetsnbextension
pip install ipywidgets

3. (Optional) Install the wrapper kernels. Do `pip show sparkmagic` and it will show the path where `sparkmagic` is installed at. `cd` to that location and do:
jupyter-kernelspec install sparkmagic/kernels/sparkkernel
jupyter-kernelspec install sparkmagic/kernels/pysparkkernel
jupyter-kernelspec install sparkmagic/kernels/sparkrkernel

4. (Optional) Modify the configuration file at ~/.sparkmagic/config.json. Look at the [example_config.json](sparkmagic/example_config.json)

5. (Optional) Enable the server extension so that clusters can be programatically changed:

jupyter server extension enable --py sparkmagic

### Jupyter Notebook 5.2 or earlier / JupyterLab 1 or 2

1. Install the library

pip install sparkmagic

2. Make sure that ipywidgets is properly installed by running

3. If you're using JupyterLab, you'll need to run another command:
jupyter nbextension enable --py --sys-prefix widgetsnbextension

3. If you're using JupyterLab 1 or 2, you'll need to run another command:

jupyter labextension install "@jupyter-widgets/jupyterlab-manager"

4. (Optional) Install the wrapper kernels. Do `pip show sparkmagic` and it will show the path where `sparkmagic` is installed at. `cd` to that location and do:

jupyter-kernelspec install sparkmagic/kernels/sparkkernel
jupyter-kernelspec install sparkmagic/kernels/pysparkkernel
jupyter-kernelspec install sparkmagic/kernels/sparkrkernel
Expand Down
Loading