diff --git a/jupyter/Dockerfile b/jupyter/Dockerfile index 71b1728..ecc5894 100644 --- a/jupyter/Dockerfile +++ b/jupyter/Dockerfile @@ -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 [ \ diff --git a/jupyter/JUPYTER.md b/jupyter/JUPYTER.md index 810abfa..4930512 100644 --- a/jupyter/JUPYTER.md +++ b/jupyter/JUPYTER.md @@ -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: diff --git a/jupyter/code b/jupyter/code new file mode 100755 index 0000000..b17d4ee --- /dev/null +++ b/jupyter/code @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +NODE_TLS_REJECT_UNAUTHORIZED=0 code . diff --git a/jupyter/entrypoint.sh b/jupyter/entrypoint.sh index eba4847..1e3c728 100755 --- a/jupyter/entrypoint.sh +++ b/jupyter/entrypoint.sh @@ -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