Skip to content

Instantly share code, notes, and snippets.

@bcoryat
Last active September 13, 2018 18:19
Show Gist options
  • Save bcoryat/fb45915015cb06b8d39a81940d6dd6a9 to your computer and use it in GitHub Desktop.
Save bcoryat/fb45915015cb06b8d39a81940d6dd6a9 to your computer and use it in GitHub Desktop.
set -o nounset -o errexit
CONF_DIR="$HOME/.jupyter"
CONF_FILE="${CONF_DIR}/jupyter_notebook_config.py"
mkdir -p "${CONF_DIR}"
PREFIX=/${DOMINO_PROJECT_OWNER}/${DOMINO_PROJECT_NAME}/notebookSession/${DOMINO_RUN_ID}/
cat >> $CONF_FILE << EOF
c = get_config()
c.NotebookApp.notebook_dir = '/'
c.NotebookApp.base_url = '${PREFIX}'
c.NotebookApp.tornado_settings = {'headers': {'Content-Security-Policy': 'frame-ancestors *'}, 'static_url_prefix': '${PREFIX}static/'}
c.NotebookApp.default_url = '/lab/tree${DOMINO_WORKING_DIR}'
c.NotebookApp.token = ''
c.JupyterLabTemplates.template_dirs = ['']
EOF
COMMAND='jupyter-lab --config="$CONF_FILE" --no-browser --ip="0.0.0.0" 2>&1'
eval ${COMMAND}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment