From 0f1a7988af3a37f8033e6404b57c50089a823a1f Mon Sep 17 00:00:00 2001 From: Simon Li Date: Thu, 8 Apr 2021 22:42:29 +0100 Subject: [PATCH 1/3] `singleuser.cmd` defaults to Docker image default This is breaking change. Instead of setting the start command to `jupyterhub-singleuser` it now defaults to whatever was set in the Docker image. --- jupyterhub/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jupyterhub/values.yaml b/jupyterhub/values.yaml index ae22f36294..fae75db178 100644 --- a/jupyterhub/values.yaml +++ b/jupyterhub/values.yaml @@ -374,7 +374,7 @@ singleuser: extraResource: limits: {} guarantees: {} - cmd: jupyterhub-singleuser + cmd: defaultUrl: extraPodConfig: {} profileList: [] From 4a6eac79ae94a50c4379bf405d7cdf9060ecfc69 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sun, 2 May 2021 19:22:13 +0100 Subject: [PATCH 2/3] Add documentation for breaking change --- CHANGELOG.md | 13 +++++++++++++ .../jupyterhub/customizing/user-environment.md | 13 +++++++++++++ jupyterhub/schema.yaml | 13 ++++++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 739647adfd..5f084701cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ Here you can find upgrade changes in between releases and upgrade instructions. +## [UNRELEASED] + +#### Breaking changes + +- **`singleuser.cmd` does not default to `jupyterhub-singleuser` - [#2138](https://github.com/jupyterhub/zero-to-jupyterhub-k8s/pull/2138)** + + Previous versions of Z2JH ignored the command (`CMD`) configured in the singleuser image by default. + This is no longer the case, when a singleuser pod is started the `CMD` from the container image will be used. + If you want to revert to the previous behaviour set `singleuser.cmd=jupyterhub-singleuser`. + + This change was made to make it easier to support custom startup scripts such as those used in [`docker-stacks`](https://github.com/jupyter/docker-stacks), + as well as alternatives to jupyter-notebook including [Jupyterlab](https://jupyterlab.readthedocs.io/en/stable/getting_started/overview.html) and other applications based on [jupyter-server](https://jupyter-server.readthedocs.io/). + ## [0.11] ### [0.11.1] - 2021-01-15 diff --git a/doc/source/jupyterhub/customizing/user-environment.md b/doc/source/jupyterhub/customizing/user-environment.md index 709982613e..c95b602668 100644 --- a/doc/source/jupyterhub/customizing/user-environment.md +++ b/doc/source/jupyterhub/customizing/user-environment.md @@ -69,6 +69,19 @@ If you'd like users to select an environment from **multiple docker images**, see {ref}`multiple-profiles`. ``` +The Docker image will be started with the [`ENTRYPOINT`](https://docs.docker.com/engine/reference/builder/#entrypoint) and [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd) defined in the image. +You can override `CMD`, by setting `singleuser.cmd`. + +```{note} +In versions of Z2JH prior to 1.0.0 the images default was overridden. +To restore this behaviour: +``` + +```yaml +singleuser: + cmd: jupyterhub-singleuser +``` + (jupyterlab-by-default)= ## Use JupyterLab by default diff --git a/jupyterhub/schema.yaml b/jupyterhub/schema.yaml index cfb0bc1232..ef926ff64b 100644 --- a/jupyterhub/schema.yaml +++ b/jupyterhub/schema.yaml @@ -1681,7 +1681,18 @@ properties: type: string cmd: type: [array, string, "null"] - description: *kubespawner-native-config-description + description: | + The command and arguments passed to the container. + This is the equivalent of the `CMD` Dockerfile instruction. + If not set the default from the container image will be used. + + Note that in versions of Z2JH prior to 1.0.0 this was set to + `jupyterhub-singleuser` instead of using the image's default. + + See the [KubeSpawner + documentation](https://jupyterhub-kubespawner.readthedocs.io/en/latest/spawner.html) + for more information. + defaultUrl: type: [string, "null"] description: *kubespawner-native-config-description From cf130f3002792e0567cd123f5513abdf85c5e05d Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sun, 2 May 2021 21:19:23 +0100 Subject: [PATCH 3/3] Fix formatting --- .../jupyterhub/customizing/user-environment.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/source/jupyterhub/customizing/user-environment.md b/doc/source/jupyterhub/customizing/user-environment.md index c95b602668..e09ff37028 100644 --- a/doc/source/jupyterhub/customizing/user-environment.md +++ b/doc/source/jupyterhub/customizing/user-environment.md @@ -72,15 +72,16 @@ see {ref}`multiple-profiles`. The Docker image will be started with the [`ENTRYPOINT`](https://docs.docker.com/engine/reference/builder/#entrypoint) and [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd) defined in the image. You can override `CMD`, by setting `singleuser.cmd`. -```{note} -In versions of Z2JH prior to 1.0.0 the images default was overridden. +````{note} +In versions of Z2JH prior to 1.0.0 the image's default was overridden. To restore this behaviour: -``` -```yaml -singleuser: - cmd: jupyterhub-singleuser -``` + ```yaml + singleuser: + cmd: jupyterhub-singleuser + ``` + +```` (jupyterlab-by-default)=