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

Upgrade Workbench JupyterLab to 4.x #852

Merged
merged 4 commits into from
Oct 2, 2024
Merged
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
27 changes: 12 additions & 15 deletions r-session-complete/Dockerfile.ubuntu2204
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,18 @@ RUN ln -s /lib/rstudio-server/bin/quarto/bin/quarto /usr/local/bin/quarto
### Install TinyTeX using Quarto ###
RUN $SCRIPTS_DIR/install_quarto.sh --install-tinytex --add-path-tinytex

RUN /opt/python/"${PYTHON_VERSION}"/bin/pip install \
jupyter \
jupyterlab=="${JUPYTERLAB_VERSION}" \
rsconnect_jupyter \
rsconnect_python \
rsp_jupyter \
workbench_jupyterlab \
&& ln -s /opt/python/"${PYTHON_VERSION}"/bin/jupyter /usr/local/bin/jupyter \
&& /opt/python/"${PYTHON_VERSION}"/bin/jupyter-nbextension install --sys-prefix --py rsp_jupyter \
&& /opt/python/"${PYTHON_VERSION}"/bin/jupyter-nbextension enable --sys-prefix --py rsp_jupyter \
&& /opt/python/"${PYTHON_VERSION}"/bin/jupyter-nbextension install --sys-prefix --py rsconnect_jupyter \
&& /opt/python/"${PYTHON_VERSION}"/bin/jupyter-nbextension enable --sys-prefix --py rsconnect_jupyter \
&& /opt/python/"${PYTHON_VERSION}"/bin/jupyter-serverextension enable --sys-prefix --py rsconnect_jupyter

ENV PATH="/opt/python/${PYTHON_VERSION}/bin:${PATH}"
RUN /opt/python/"${PYTHON_VERSION}"/bin/python -m venv /opt/python/jupyter \
&& /opt/python/jupyter/bin/python -m pip install \
jupyterlab~=4.2.4 \
notebook \
pwb_jupyterlab~=1.0 \
&& ln -s /opt/python/jupyter/bin/jupyter /usr/local/bin/jupyter \
&& /opt/python/jupyter/bin/python -m pip install ipykernel \
&& /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}" \
&& /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \
Copy link

@bjfletcher bjfletcher Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ianpittwood, JupyterLab has stopped working for us.

If I run:

docker run -it --platform linux/amd64 rstudio/r-session-complete:ubuntu2204-2024.09.0 bash

I see that the two python -m ipykernel install lines in your Dockerfile produce the following kernel configurations:

/usr/local/share/jupyter/kernels/py3.11.10/kernel.json

{
...
  "/opt/python/jupyter/bin/python",
...
 "display_name": "Python 3.11.10",
...
}

/usr/local/share/jupyter/kernels/py3.12.6/kernel.json

{
...
  "/opt/python/jupyter/bin/python",
...
 "display_name": "Python 3.12.6",
...
}

Note how the paths for both 3.11 and 3.12 point to the same one Python binary, which is 3.12.

It'd be great if this is fixed because 3.12 doesn't work with most ML libraries/models.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out. This should fix the issue: #855

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ianpittwood . Sorry to be a pain, but !pip install <pkg> has been broken too.

&& /opt/python/jupyter/bin/python -m pip cache purge

ENV PATH="/opt/python/jupyter/bin:${PATH}"

COPY vscode.extensions.conf /etc/rstudio/vscode.extensions.conf

Expand Down
2 changes: 1 addition & 1 deletion r-session-complete/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ file:
filetype: symlink

command:
"echo '{ \"cells\": [], \"metadata\": {}, \"nbformat\": 4, \"nbformat_minor\": 2}' | /opt/python/{{.Env.PYTHON_VERSION}}/bin/jupyter nbconvert --to notebook --stdin --stdout":
"echo '{ \"cells\": [], \"metadata\": {}, \"nbformat\": 4, \"nbformat_minor\": 2}' | /opt/python/jupyter/bin/jupyter nbconvert --to notebook --stdin --stdout":
title: jupyter_works
timeout: 60000
exit-status: 0
Expand Down
20 changes: 6 additions & 14 deletions workbench-for-google-cloud-workstations/Dockerfile.ubuntu2204
Original file line number Diff line number Diff line change
Expand Up @@ -118,23 +118,15 @@ RUN mkdir -p /opt/rstudio-license/ \

### Install Jupyter and extensions ###
RUN /opt/python/"${PYTHON_VERSION_JUPYTER}"/bin/python -m venv /opt/python/jupyter \
&& /opt/python/jupyter/bin/pip install \
jupyter \
jupyterlab=="${JUPYTERLAB_VERSION}" \
rsconnect_jupyter \
rsconnect_python \
rsp_jupyter \
workbench_jupyterlab \
&& /opt/python/jupyter/bin/python -m pip install\
jupyterlab~=4.2.4 \
notebook \
pwb_jupyterlab~=1.0 \
&& ln -s /opt/python/jupyter/bin/jupyter /usr/local/bin/jupyter \
&& /opt/python/jupyter/bin/jupyter-nbextension install --sys-prefix --py rsp_jupyter \
&& /opt/python/jupyter/bin/jupyter-nbextension enable --sys-prefix --py rsp_jupyter \
&& /opt/python/jupyter/bin/jupyter-nbextension install --sys-prefix --py rsconnect_jupyter \
&& /opt/python/jupyter/bin/jupyter-nbextension enable --sys-prefix --py rsconnect_jupyter \
&& /opt/python/jupyter/bin/jupyter-serverextension enable --sys-prefix --py rsconnect_jupyter \
&& /opt/python/jupyter/bin/python -m pip install ipykernel \
&& /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}" \
&& /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \
&& /opt/python/${PYTHON_VERSION}/bin/python3 -m pip cache purge \
&& /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip cache purge
&& /opt/python/jupyter/bin/python3 -m pip cache purge

ADD --chmod=755 https://raw.githubusercontent.com/rstudio/wait-for-it/master/wait-for-it.sh /usr/local/bin/wait-for-it.sh

Expand Down
3 changes: 1 addition & 2 deletions workbench-for-google-cloud-workstations/conf/jupyter.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
notebooks-enabled=1
labs-enabled=1

jupyter-exe=/usr/local/bin/jupyter
jupyter-exe=/opt/python/jupyter/bin/jupyter
lab-args=--no-browser --allow-root --ip=0.0.0.0 --ServerApp.allow_origin="*" --ServerApp.allow_remote_access=True --LabApp.token="" --debug

default-session-cluster=Local
28 changes: 7 additions & 21 deletions workbench-for-microsoft-azure-ml/Dockerfile.ubuntu2204
Original file line number Diff line number Diff line change
Expand Up @@ -89,28 +89,14 @@ RUN apt-get update --fix-missing -qq \
### Install Jupyter and extensions ###
RUN /opt/python/"${PYTHON_VERSION_JUPYTER}"/bin/python -m venv /opt/python/jupyter \
&& /opt/python/jupyter/bin/pip install \
jupyter \
jupyterlab=="${JUPYTERLAB_VERSION}" \
rsconnect_jupyter \
rsconnect_python \
rsp_jupyter \
workbench_jupyterlab \
&& /opt/python/jupyter/bin/jupyter kernelspec remove python3 -f \
&& /opt/python/jupyter/bin/pip uninstall -y ipykernel \
jupyterlab~=4.2.4 \
notebook \
pwb_jupyterlab~=1.0 \
&& ln -s /opt/python/jupyter/bin/jupyter /usr/local/bin/jupyter \
&& /opt/python/jupyter/bin/jupyter-nbextension install --sys-prefix --py rsp_jupyter \
&& /opt/python/jupyter/bin/jupyter-nbextension enable --sys-prefix --py rsp_jupyter \
&& /opt/python/jupyter/bin/jupyter-nbextension install --sys-prefix --py rsconnect_jupyter \
&& /opt/python/jupyter/bin/jupyter-nbextension enable --sys-prefix --py rsconnect_jupyter \
&& /opt/python/jupyter/bin/jupyter-serverextension enable --sys-prefix --py rsconnect_jupyter \
&& /opt/python/${PYTHON_VERSION}/bin/pip install \
ipykernel \
virtualenv \
&& /opt/python/${PYTHON_VERSION}/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}" \
&& /opt/python/${PYTHON_VERSION_ALT}/bin/pip install \
ipykernel \
virtualenv \
&& /opt/python/${PYTHON_VERSION_ALT}/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}"
&& /opt/python/jupyter/bin/python -m pip install ipykernel \
&& /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}" \
&& /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \
&& /opt/python/jupyter/bin/python3 -m pip cache purge

### Install basic data science packages for Python and R ###
COPY deps/* /
Expand Down
3 changes: 1 addition & 2 deletions workbench-for-microsoft-azure-ml/conf/jupyter.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
notebooks-enabled=1
labs-enabled=1

jupyter-exe=/usr/local/bin/jupyter
jupyter-exe=/opt/python/jupyter/bin/jupyter
lab-args=--no-browser --allow-root --ip=0.0.0.0 --ServerApp.allow_origin="*" --ServerApp.allow_remote_access=True --LabApp.token="" --debug

default-session-cluster=Local
20 changes: 8 additions & 12 deletions workbench/Dockerfile.ubuntu2204
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,15 @@ COPY startup/* /startup/base/
COPY supervisord.conf /etc/supervisor/supervisord.conf

RUN /opt/python/"${PYTHON_VERSION_JUPYTER}"/bin/python -m venv /opt/python/jupyter \
&& /opt/python/jupyter/bin/pip install \
jupyter \
jupyterlab=="${JUPYTERLAB_VERSION}" \
rsconnect_jupyter \
rsconnect_python \
rsp_jupyter \
workbench_jupyterlab \
&& /opt/python/jupyter/bin/python -m pip install \
jupyterlab~=4.2.4 \
notebook \
pwb_jupyterlab~=1.0 \
&& ln -s /opt/python/jupyter/bin/jupyter /usr/local/bin/jupyter \
&& /opt/python/jupyter/bin/jupyter-nbextension install --sys-prefix --py rsp_jupyter \
&& /opt/python/jupyter/bin/jupyter-nbextension enable --sys-prefix --py rsp_jupyter \
&& /opt/python/jupyter/bin/jupyter-nbextension install --sys-prefix --py rsconnect_jupyter \
&& /opt/python/jupyter/bin/jupyter-nbextension enable --sys-prefix --py rsconnect_jupyter \
&& /opt/python/jupyter/bin/jupyter-serverextension enable --sys-prefix --py rsconnect_jupyter
&& /opt/python/jupyter/bin/python -m pip install ipykernel \
&& /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}" \
&& /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \
&& /opt/python/jupyter/bin/python -m pip cache purge

RUN curl -fsSL -o /usr/local/bin/wait-for-it.sh https://raw.githubusercontent.com/rstudio/wait-for-it/master/wait-for-it.sh && \
chmod +x /usr/local/bin/wait-for-it.sh
Expand Down
3 changes: 1 addition & 2 deletions workbench/conf/jupyter.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
notebooks-enabled=1
labs-enabled=1

# jupyter-exe=/usr/local/bin/jupyter
jupyter-exe=/opt/python/jupyter/bin/jupyter

default-session-cluster=Local
Loading