Skip to content

Commit

Permalink
Merge pull request #1527 from maresb/notebook_args
Browse files Browse the repository at this point in the history
start-notebook.sh: pass NOTEBOOK_ARGS as docs say
  • Loading branch information
mathbunnyru authored Nov 15, 2021
2 parents cd860b9 + f5753ab commit 9701743
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions base-notebook/start-notebook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@

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 "$@"
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 "$@"
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
2 changes: 1 addition & 1 deletion base-notebook/test/test_start_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down

0 comments on commit 9701743

Please sign in to comment.