Skip to content

Commit d4affd4

Browse files
feat: update notebook server images (kubeflow/kubeflow#7687)
Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>
1 parent 95f002b commit d4affd4

File tree

29 files changed

+199
-137
lines changed

29 files changed

+199
-137
lines changed

components/example-notebook-servers/base/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ ENV S6_BEHAVIOUR_IF_STAGE2_FAILS 2
3939
# args - software versions
4040
# https://kubernetes.io/releases/
4141
# https://github.com/just-containers/s6-overlay/releases
42-
ARG KUBECTL_VERSION=v1.29.9
43-
ARG S6_VERSION=v3.2.0.0
42+
ARG KUBECTL_VERSION=v1.31.6
43+
ARG S6_VERSION=v3.2.0.2
4444

4545
# set shell to bash
4646
SHELL ["/bin/bash", "-c"]

components/example-notebook-servers/codeserver-python/Dockerfile

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ ARG TARGETARCH
1010
USER root
1111

1212
# args - software versions
13-
# https://github.com/microsoft/vscode-python/releases
14-
ARG CODESERVER_PYTHON_VERSION=2024.14.1
15-
ARG MINIFORGE_VERSION=24.7.1-2
16-
ARG PIP_VERSION=24.2
17-
ARG PYTHON_VERSION=3.11.10
13+
# https://open-vsx.org/extension/ms-python/python
14+
# https://open-vsx.org/extension/ms-toolsai/jupyter
15+
# https://github.com/ipython/ipykernel/releases
16+
ARG CODESERVER_PYTHON_VERSION=2025.0.0
17+
ARG CODESERVER_JUPYTER_VERSION=2024.11.0
18+
ARG IPYKERNEL_VERSION=6.29.5
19+
ARG MINIFORGE_VERSION=24.11.3-0
20+
ARG PIP_VERSION=24.3.1
21+
ARG PYTHON_VERSION=3.11.11
1822

1923
# setup environment for conda
2024
ENV CONDA_DIR /opt/conda
@@ -52,15 +56,26 @@ RUN case "${TARGETARCH}" in \
5256
&& conda update -y -q --all \
5357
&& conda clean -a -f -y
5458

59+
# install - ipykernel
60+
# NOTE: we need this for jupyter codeserver extension to work
61+
RUN echo "ipykernel ==${IPYKERNEL_VERSION}" >> ${CONDA_DIR}/conda-meta/pinned \
62+
&& conda install -y -q \
63+
ipykernel==${IPYKERNEL_VERSION} \
64+
&& conda clean -a -f -y
65+
5566
# install - requirements.txt
5667
COPY --chown=${NB_USER}:${NB_GID} requirements.txt /tmp
5768
RUN python3 -m pip install -r /tmp/requirements.txt --quiet --no-cache-dir \
5869
&& rm -f /tmp/requirements.txt
5970

6071
# install - codeserver extensions
6172
RUN code-server --install-extension "ms-python.python@${CODESERVER_PYTHON_VERSION}" --force \
73+
&& code-server --install-extension "ms-toolsai.jupyter@${CODESERVER_JUPYTER_VERSION}" --force \
6274
&& code-server --list-extensions --show-versions
6375

76+
# home - pre-populate home with files for this image
77+
COPY --chown=${NB_USER}:${NB_GID} home/. ${HOME}/
78+
6479
# s6 - 01-copy-tmp-home
6580
# NOTE: the contents of $HOME_TMP are copied to $HOME at runtime
6681
# this is a workaround because a PVC will be mounted at $HOME
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# About the Code-Server Python Image
2+
3+
This file contains notes about the Kubeflow Notebooks _Code-Server Python_ image.
4+
5+
## Jupyter Extension required HTTPS
6+
7+
This image comes with the jupyter extension installed, which allows you to run and edit jupyter notebooks in code-server.
8+
9+
However, because the jupyter extension uses [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API), it requires HTTPS to work.
10+
That is, if you access this notebook over HTTP, the Jupyter extension will NOT work.
11+
12+
Additionally, if you are using __Chrome__, the HTTPS certificate must be __valid__ and trusted by your browser.
13+
As a workaround, if you have a self-signed HTTPS certificate, you could use Firefox, or set the [`unsafely-treat-insecure-origin-as-secure`](chrome://flags/#unsafely-treat-insecure-origin-as-secure) flag in Chrome.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# kubeflow packages
2-
kfp==2.9.0
2+
kfp==2.11.0

components/example-notebook-servers/codeserver/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ARG TARGETARCH
99

1010
# args - software versions
1111
# https://github.com/coder/code-server/releases
12-
ARG CODESERVER_VERSION=4.93.1
12+
ARG CODESERVER_VERSION=4.96.4
1313

1414
USER root
1515

components/example-notebook-servers/codeserver/s6/services.d/code-server/run

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
#!/command/with-contenv bash
22

3-
cd "${HOME}"
3+
# many tools default to using the home directory for runtime data.
4+
# as we mount a PVC to the home directory, these files might have the wrong permissions.
5+
# to avoid this, we set the runtime directory to a path that is NOT a persistent volume.
6+
export XDG_RUNTIME_DIR="/tmp/runtime-${NB_USER}"
7+
mkdir -p "${XDG_RUNTIME_DIR}"
8+
chmod 700 "${XDG_RUNTIME_DIR}"
9+
10+
cd "${HOME}" || { echo "ERROR: failed to cd to ${HOME}"; exit 1; }
411
echo "INFO: starting code-server..."
512
exec 2>&1
613
exec /usr/bin/code-server \

components/example-notebook-servers/jupyter-pytorch-cuda-full/Dockerfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ FROM $BASE_IMG
88
# install - conda packages
99
# NOTE: we use mamba to speed things up
1010
RUN mamba install -y -q \
11-
bokeh==3.3.4 \
12-
cloudpickle==2.2.1 \
13-
dill==0.3.8 \
14-
ipympl==0.9.4 \
15-
matplotlib==3.8.4 \
16-
numpy==1.24.4 \
17-
pandas==2.1.4 \
18-
scikit-image==0.22.0 \
19-
scikit-learn==1.3.2 \
20-
scipy==1.11.3 \
11+
bokeh==3.6.3 \
12+
cloudpickle==3.1.1 \
13+
dill==0.3.9 \
14+
ipympl==0.9.6 \
15+
matplotlib==3.10.0 \
16+
numpy==1.26.4 \
17+
pandas==2.2.3 \
18+
scikit-image==0.25.1 \
19+
scikit-learn==1.6.1 \
20+
scipy==1.15.1 \
2121
seaborn==0.13.2 \
22-
xgboost==1.7.6 \
22+
xgboost==2.1.4 \
2323
&& mamba clean -a -f -y
2424

2525
# install - requirements.txt
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# kubeflow packages
2-
kfp==2.9.0
2+
kfp==2.11.0
33

44
# jupyterlab extensions
5-
jupyterlab-git==0.50.1
5+
jupyterlab-git==0.50.2

components/example-notebook-servers/jupyter-pytorch-cuda/Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,23 @@ FROM $BASE_IMG
99
# https://github.com/pytorch/pytorch/releases
1010
# https://github.com/pytorch/audio/releases
1111
# https://github.com/pytorch/vision/releases
12-
ARG PYTORCH_VERSION=2.3.1
13-
ARG TORCHAUDIO_VERSION=2.3.1
14-
ARG TORCHVISION_VERSION=0.18.1
12+
# NOTE: correct version alignments are found at https://pytorch.org/get-started/previous-versions/
13+
# they sometimes forget to publish a github release of `torchaudio` or `torchvision` when the cut a
14+
# patch release of `torch`, but they still publish a patch of `torchaudio` and `torchvision` on pypi
15+
# TODO: it seems like torch 2.6.0+ with CUDA 12.6+ will have experimental aarch64 support
16+
# when updating past that version, remember to test building these images on arm
17+
ARG PYTORCH_VERSION=2.5.1
18+
ARG TORCHAUDIO_VERSION=2.5.1
19+
ARG TORCHVISION_VERSION=0.20.1
1520

1621
# nvidia container toolkit
1722
# https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html
1823
ENV NVIDIA_VISIBLE_DEVICES all
1924
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
20-
ENV NVIDIA_REQUIRE_CUDA "cuda>=12.1"
25+
ENV NVIDIA_REQUIRE_CUDA "cuda>=12.4"
2126

2227
# install - pytorch (cuda)
23-
RUN python3 -m pip install --quiet --no-cache-dir --index-url https://download.pytorch.org/whl/cu121 \
28+
RUN python3 -m pip install --quiet --no-cache-dir --index-url https://download.pytorch.org/whl/cu124 \
2429
torch==${PYTORCH_VERSION} \
2530
torchaudio==${TORCHAUDIO_VERSION} \
2631
torchvision==${TORCHVISION_VERSION}

components/example-notebook-servers/jupyter-pytorch-full/Dockerfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ FROM $BASE_IMG
88
# install - conda packages
99
# NOTE: we use mamba to speed things up
1010
RUN mamba install -y -q \
11-
bokeh==3.3.4 \
12-
cloudpickle==2.2.1 \
13-
dill==0.3.8 \
14-
ipympl==0.9.4 \
15-
matplotlib==3.8.4 \
16-
numpy==1.24.4 \
17-
pandas==2.1.4 \
18-
scikit-image==0.22.0 \
19-
scikit-learn==1.3.2 \
20-
scipy==1.11.3 \
11+
bokeh==3.6.3 \
12+
cloudpickle==3.1.1 \
13+
dill==0.3.9 \
14+
ipympl==0.9.6 \
15+
matplotlib==3.10.0 \
16+
numpy==1.26.4 \
17+
pandas==2.2.3 \
18+
scikit-image==0.25.1 \
19+
scikit-learn==1.6.1 \
20+
scipy==1.15.1 \
2121
seaborn==0.13.2 \
22-
xgboost==1.7.6 \
22+
xgboost==2.1.4 \
2323
&& mamba clean -a -f -y
2424

2525
# install - requirements.txt

0 commit comments

Comments
 (0)