Skip to content

Commit

Permalink
Jupyter Visual Studio Code (#21)
Browse files Browse the repository at this point in the history
* Start script Visual Studio Code for Jupyter notebooks

* Docs for Visual Studio Code integration with Jupyter notebooks
  • Loading branch information
td-sclemens authored Feb 19, 2024
1 parent 53a8d43 commit 10b1fdb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions jupyter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ VOLUME /notebooks
VOLUME /home/docker/.jupyter
EXPOSE 8888
COPY JUPYTER.md /assets/
COPY code /assets/
COPY entrypoint.sh /usr/local/bin/
ENTRYPOINT ["entrypoint.sh"]
CMD [ \
Expand Down
17 changes: 17 additions & 0 deletions jupyter/JUPYTER.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,23 @@ To install a new dependency (like in this example `pandas`), run the following:
poetry add pandas
```


## Visual Studio Code integration

First make sure your notebook server is running (`riptide status`), otherwise start it.

Start VSC from the project directory with `./code`.
This will start it with a setting, that allows connections to the Riptide server, without rejecting the certificate.

Make sure you have the official VSC extensions `Python` and `Jupyter` installed.

Now open your notebook in VSC.
Click on `Select Kernel` and choose `Existing Jupyter Server`.
Finally, type the server URL (given by `riptide status`) and select the shown kernel.

Now you should be able to run cells inside the notebook with your Riptide service.


## Troubleshooting

If something is not working as expected, you can attach to the logs:
Expand Down
3 changes: 3 additions & 0 deletions jupyter/code
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

NODE_TLS_REJECT_UNAUTHORIZED=0 code .
1 change: 1 addition & 0 deletions jupyter/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -x

NEW_VENV=false
cp /assets/JUPYTER.md /src
cp /assets/code /src

# create new venv if not existing
if [ ! -d .venv ]; then
Expand Down

0 comments on commit 10b1fdb

Please sign in to comment.