From e11f31a7b6480f96e5e962b357ca2acc4c8167a2 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Mon, 6 Apr 2020 10:08:08 +0200 Subject: [PATCH 1/5] start-notebook.sh: pass NOTEBOOK_ARGS as docs say --- base-notebook/start-notebook.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/base-notebook/start-notebook.sh b/base-notebook/start-notebook.sh index 9d33dbd532..08f32e4b20 100755 --- a/base-notebook/start-notebook.sh +++ b/base-notebook/start-notebook.sh @@ -4,19 +4,22 @@ set -e +if [[ -n "${JUPYTERHUB_API_TOKEN}" ]]; then + echo "WARNING: use start-singleuser.sh instead of start-notebook.sh to start a server associated with JupyterHub." + exec /usr/local/bin/start-singleuser.sh "$@" + exit +fi + wrapper="" if [[ "${RESTARTABLE}" == "yes" ]]; then wrapper="run-one-constantly" fi -if [[ -n "${JUPYTERHUB_API_TOKEN}" ]]; then - # launched by JupyterHub, use single-user entrypoint - exec /usr/local/bin/start-singleuser.sh "$@" -elif [[ -n "${JUPYTER_ENABLE_LAB}" ]]; then - # shellcheck disable=SC1091 - . /usr/local/bin/start.sh ${wrapper} jupyter lab "$@" +if [[ -n "${JUPYTER_ENABLE_LAB}" ]]; then + # shellcheck disable=SC1091,SC2086 + exec /usr/local/bin/start.sh ${wrapper} ${NOTEBOOK_ARGS} jupyter lab "$@" else echo "WARN: Jupyter Notebook deprecation notice https://github.com/jupyter/docker-stacks#jupyter-notebook-deprecation-notice." - # shellcheck disable=SC1091 - . /usr/local/bin/start.sh ${wrapper} jupyter notebook "$@" + # shellcheck disable=SC1091,SC2086 + exec /usr/local/bin/start.sh ${wrapper} ${NOTEBOOK_ARGS} jupyter notebook "$@" fi From e7c38b57cfb0f70153563dd61f9b43cc4338ba46 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 12 Nov 2021 19:50:08 +0300 Subject: [PATCH 2/5] Update base-notebook/start-notebook.sh --- base-notebook/start-notebook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-notebook/start-notebook.sh b/base-notebook/start-notebook.sh index 08f32e4b20..0229bad2b1 100755 --- a/base-notebook/start-notebook.sh +++ b/base-notebook/start-notebook.sh @@ -5,7 +5,7 @@ set -e if [[ -n "${JUPYTERHUB_API_TOKEN}" ]]; then - echo "WARNING: use start-singleuser.sh instead of start-notebook.sh to start a server associated with JupyterHub." + echo "WARNING: using start-singleuser.sh instead of start-notebook.sh to start a server associated with JupyterHub." exec /usr/local/bin/start-singleuser.sh "$@" exit fi From d6fd535c5f5178e463e5c11148f72cbd3fcb8c55 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 12 Nov 2021 19:51:06 +0300 Subject: [PATCH 3/5] Update base-notebook/start-notebook.sh --- base-notebook/start-notebook.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/base-notebook/start-notebook.sh b/base-notebook/start-notebook.sh index 0229bad2b1..d1b3d8a2ba 100755 --- a/base-notebook/start-notebook.sh +++ b/base-notebook/start-notebook.sh @@ -7,7 +7,6 @@ set -e if [[ -n "${JUPYTERHUB_API_TOKEN}" ]]; then echo "WARNING: using start-singleuser.sh instead of start-notebook.sh to start a server associated with JupyterHub." exec /usr/local/bin/start-singleuser.sh "$@" - exit fi wrapper="" From dd0fcc010240085f6ffbdaeee0979c0490a96f4c Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Fri, 12 Nov 2021 19:52:23 +0300 Subject: [PATCH 4/5] Update base-notebook/start-notebook.sh --- base-notebook/start-notebook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-notebook/start-notebook.sh b/base-notebook/start-notebook.sh index d1b3d8a2ba..9ceee9203d 100755 --- a/base-notebook/start-notebook.sh +++ b/base-notebook/start-notebook.sh @@ -18,7 +18,7 @@ if [[ -n "${JUPYTER_ENABLE_LAB}" ]]; then # shellcheck disable=SC1091,SC2086 exec /usr/local/bin/start.sh ${wrapper} ${NOTEBOOK_ARGS} jupyter lab "$@" else - echo "WARN: Jupyter Notebook deprecation notice https://github.com/jupyter/docker-stacks#jupyter-notebook-deprecation-notice." + echo "WARNING: Jupyter Notebook deprecation notice https://github.com/jupyter/docker-stacks#jupyter-notebook-deprecation-notice." # shellcheck disable=SC1091,SC2086 exec /usr/local/bin/start.sh ${wrapper} ${NOTEBOOK_ARGS} jupyter notebook "$@" fi From f5753abc5ca53b71930e9a1fe0344a31971f9261 Mon Sep 17 00:00:00 2001 From: Ben Mares Date: Sun, 14 Nov 2021 11:24:52 +0100 Subject: [PATCH 5/5] Update test for altered Notebook deprecation warning --- base-notebook/test/test_start_container.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-notebook/test/test_start_container.py b/base-notebook/test/test_start_container.py index 9d3a858075..d3eec46dd4 100644 --- a/base-notebook/test/test_start_container.py +++ b/base-notebook/test/test_start_container.py @@ -33,7 +33,7 @@ def test_start_notebook(container, http_client, env, expected_server): ), f"Not the expected command (jupyter {expected_server}) was launched" # Checking warning messages if not env: - msg = "WARN: Jupyter Notebook deprecation notice" + msg = "WARNING: Jupyter Notebook deprecation notice" assert msg in logs, f"Expected warning message {msg} not printed"