generated from kbase/kbase-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from kbase/dev_jupyterhub
add JUPYTER_MODE for JupyterHub
- Loading branch information
Showing
3 changed files
with
105 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
#!/bin/bash | ||
|
||
echo "starting jupyter notebook" | ||
|
||
# Ensure NOTEBOOK_DIR is set | ||
if [ -z "$NOTEBOOK_DIR" ]; then | ||
echo "ERROR: NOTEBOOK_DIR is not set. Please run setup.sh first." | ||
|
@@ -10,17 +8,28 @@ fi | |
|
||
mkdir -p "$NOTEBOOK_DIR" && cd "$NOTEBOOK_DIR" | ||
|
||
# install Plotly extension | ||
jupyter labextension install [email protected] | ||
|
||
# install ipywidgets extension | ||
jupyter labextension install @jupyter-widgets/[email protected] | ||
if [ "$JUPYTER_MODE" = "jupyterlab" ]; then | ||
echo "starting jupyterlab" | ||
# install Plotly extension | ||
jupyter labextension install [email protected] | ||
|
||
# install ipywidgets extension | ||
jupyter labextension install @jupyter-widgets/[email protected] | ||
|
||
# Start Jupyter Lab | ||
jupyter lab --ip=0.0.0.0 \ | ||
--port="$NOTEBOOK_PORT" \ | ||
--no-browser \ | ||
--allow-root \ | ||
--notebook-dir="$NOTEBOOK_DIR" \ | ||
--ServerApp.token='' \ | ||
--ServerApp.password='' | ||
elif [ "$JUPYTER_MODE" = "jupyterhub" ]; then | ||
echo "starting jupyterhub" | ||
|
||
# Start Jupyter Lab | ||
jupyter lab --ip=0.0.0.0 \ | ||
--port="$NOTEBOOK_PORT" \ | ||
--no-browser \ | ||
--allow-root \ | ||
--notebook-dir="$NOTEBOOK_DIR" \ | ||
--ServerApp.token='' \ | ||
--ServerApp.password='' | ||
echo "TO BE IMPLEMENTED" | ||
else | ||
echo "ERROR: JUPYTER_MODE is not set to jupyterlab or jupyterhub. Please set JUPYTER_MODE to either jupyterlab or jupyterhub." | ||
exit 1 | ||
fi |