Upload run_jupyter.sh with huggingface_hub
Browse files- run_jupyter.sh +34 -0
run_jupyter.sh
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
source /opt/google/c2d-utils
|
3 |
+
|
4 |
+
ANACONDA_PATH="/opt/conda/bin/jupyter"
|
5 |
+
if [[ "${ENABLE_MULTI_ENV,,}" == 'true' ]]; then
|
6 |
+
ANACONDA_PATH="/opt/conda/envs/jupyterlab/bin/jupyter"
|
7 |
+
fi
|
8 |
+
|
9 |
+
#Configure gcloud for Dataproc Extension
|
10 |
+
set_cloud_sdk_config
|
11 |
+
|
12 |
+
# Check Dataproc extension logic for containers is now done in entry point.
|
13 |
+
disable_mixer=$(get_attribute_value disable-mixer)
|
14 |
+
if [[ ${disable_mixer,,} == "true" ]]; then
|
15 |
+
"${ANACONDA_PATH}" server extension disable dataproc_jupyter_plugin
|
16 |
+
"${ANACONDA_PATH}" labextension disable dataproc_jupyter_plugin
|
17 |
+
else
|
18 |
+
"${ANACONDA_PATH}" server extension enable dataproc_jupyter_plugin
|
19 |
+
"${ANACONDA_PATH}" labextension enable dataproc_jupyter_plugin
|
20 |
+
fi
|
21 |
+
|
22 |
+
# Toggle terminal
|
23 |
+
terminal_disabled=$(get_attribute_value notebook-disable-terminal)
|
24 |
+
if [[ ${terminal_disabled,,} == "true" ]]; then
|
25 |
+
"${ANACONDA_PATH}" server extension disable jupyter_server_terminals
|
26 |
+
else
|
27 |
+
"${ANACONDA_PATH}" server extension enable jupyter_server_terminals
|
28 |
+
fi
|
29 |
+
|
30 |
+
if [[ -n "${NOTEBOOK_DISABLE_ROOT}" ]]; then
|
31 |
+
"${ANACONDA_PATH}" lab --ip 0.0.0.0 --config=/opt/jupyter/.jupyter/jupyter_notebook_config.py
|
32 |
+
else
|
33 |
+
"${ANACONDA_PATH}" lab --allow-root --ip 0.0.0.0 --config=/opt/jupyter/.jupyter/jupyter_notebook_config.py
|
34 |
+
fi
|