Skip to content

Commit 9701743

Browse files
authored
Merge pull request #1527 from maresb/notebook_args
start-notebook.sh: pass NOTEBOOK_ARGS as docs say
2 parents cd860b9 + f5753ab commit 9701743

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

base-notebook/start-notebook.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@
44

55
set -e
66

7+
if [[ -n "${JUPYTERHUB_API_TOKEN}" ]]; then
8+
echo "WARNING: using start-singleuser.sh instead of start-notebook.sh to start a server associated with JupyterHub."
9+
exec /usr/local/bin/start-singleuser.sh "$@"
10+
fi
11+
712
wrapper=""
813
if [[ "${RESTARTABLE}" == "yes" ]]; then
914
wrapper="run-one-constantly"
1015
fi
1116

12-
if [[ -n "${JUPYTERHUB_API_TOKEN}" ]]; then
13-
# launched by JupyterHub, use single-user entrypoint
14-
exec /usr/local/bin/start-singleuser.sh "$@"
15-
elif [[ -n "${JUPYTER_ENABLE_LAB}" ]]; then
16-
# shellcheck disable=SC1091
17-
. /usr/local/bin/start.sh ${wrapper} jupyter lab "$@"
17+
if [[ -n "${JUPYTER_ENABLE_LAB}" ]]; then
18+
# shellcheck disable=SC1091,SC2086
19+
exec /usr/local/bin/start.sh ${wrapper} ${NOTEBOOK_ARGS} jupyter lab "$@"
1820
else
19-
echo "WARN: Jupyter Notebook deprecation notice https://github.com/jupyter/docker-stacks#jupyter-notebook-deprecation-notice."
20-
# shellcheck disable=SC1091
21-
. /usr/local/bin/start.sh ${wrapper} jupyter notebook "$@"
21+
echo "WARNING: Jupyter Notebook deprecation notice https://github.com/jupyter/docker-stacks#jupyter-notebook-deprecation-notice."
22+
# shellcheck disable=SC1091,SC2086
23+
exec /usr/local/bin/start.sh ${wrapper} ${NOTEBOOK_ARGS} jupyter notebook "$@"
2224
fi

base-notebook/test/test_start_container.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_start_notebook(container, http_client, env, expected_server):
3333
), f"Not the expected command (jupyter {expected_server}) was launched"
3434
# Checking warning messages
3535
if not env:
36-
msg = "WARN: Jupyter Notebook deprecation notice"
36+
msg = "WARNING: Jupyter Notebook deprecation notice"
3737
assert msg in logs, f"Expected warning message {msg} not printed"
3838

3939

0 commit comments

Comments
 (0)