jupyter / docker-stacks

Ready-to-run Docker images containing Jupyter applications
https://jupyter-docker-stacks.readthedocs.io
Other
7.79k stars 2.98k forks source link

Add a new tag to JupyterLab images to match Helm Chart/`k8s-hub` image #2118

Open jrdnbradford opened 3 weeks ago

jrdnbradford commented 3 weeks ago

What docker image(s) is this feature applicable to?

all-spark-notebook, base-notebook, datascience-notebook, docker-stacks-foundation, julia-notebook, minimal-notebook, pyspark-notebook, pytorch-notebook, r-notebook, scipy-notebook, tensorflow-notebook

What change(s) are you proposing?

Add a new k8s-hub-#.#.# tag to JupyterLab images in quay.io.

How does this affect the user?

For those using Z2JH with containers/automation, they must specify:

The versions of the k8s-hub image tag and the Helm Chart match, but they are distinct from the version of JupyterHub running on JupyterLab. For instance, Helm Chart/k8s-hub version 3.3.7 has JupyterHub version 4.1.5.

To ensure that JupyterHub running in the k8s-hub image and set up via the Helm chart match the version installed in the user-facing JupyterLab image, some work is required.

Adding a k8s-hub-#.#.# tag to JupyterLab images would allow Z2JH admins to set one variable (the k8s-hub/Helm Chart version) to ensure the software matches amongst the user and hub environments.

ARG VERSION=3.3.7
FROM quay.io/jupyterhub/k8s-hub:$VERSION
ARG VERSION=3.3.7
# Pull an R notebook tagged with k8s-hub-$VERSION so we know
# it has JupyterHub 4.1.5 which matches quay.io/jupyterhub/k8s-hub:$VERSION
# and the Helm Chart
FROM quay.io/jupyter/r-notebook:k8s-hub-$VERSION
VERSION=3.3.7
helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
helm repo update
helm upgrade --install jupyterhub jupyterhub/jupyterhub \
        --version=$VERSION \
        ...

This would allow better automation and make it more difficult for admins to have versions of the Hub image and JupyterLab out of sync.

Anything else?

No response

manics commented 3 weeks ago

Technically this is doable- the information can be programatically queried from the appVersion field https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/3.3.7/jupyterhub/Chart.yaml#L5 in the published Helm chart package.

The problem is it's not a one-to-one mapping since only the major version of JupyterHub needs to match, so a given image would need to be tagged with multiple helm chart versions.

I can definitely see how it could make things easier for admins, but major releases of Z2JH are infrequent and often involve other breaking changes, so it's vital to read the changelog. Given that a major bump in the JupyterHub version necessitates a major bump in Z2JH I think this reduces the benefit of the additional tag.

jrdnbradford commented 3 weeks ago

Ah, good info, thanks @manics. I agree.

mathbunnyru commented 1 week ago

There is an example how to add a new tagger, if someone needs it: https://github.com/jupyter/docker-stacks/pull/1791/files