Compare commits
7 Commits
7244d265fa
...
main
Author | SHA1 | Date | |
---|---|---|---|
d41a25b366 | |||
3c382e96cb | |||
cb5ba1e0c1 | |||
db8d3ef52b | |||
606b6c8ff9 | |||
d890e88f16 | |||
4286fc8a20 |
17
helper.sh
17
helper.sh
@ -13,7 +13,7 @@ Available flags:
|
||||
t, -t, tensorboard, --tensorboard Launch Tensorboard locally to the script (Require installation beforehand).
|
||||
h, -h, help, --help Which display this help message."
|
||||
|
||||
VENV_PATH=./venv
|
||||
VENV_PATH=./.venv
|
||||
JUPYTER_ROOT_PATH=./jupyter
|
||||
TENSORBOARD_LOG_DIR=./logs
|
||||
export R_LIBS_SITE=./libs
|
||||
@ -39,23 +39,22 @@ enable_venv(){
|
||||
|
||||
case "$1" in
|
||||
i|-i|install|--install)
|
||||
python -m venv "$VENV_PATH"
|
||||
mkdir -p "$JUPYTER_ROOT_PATH"/{settings,workspace,config,runtime,data} "$JUPYTERLAB_SETTINGS_DIR"/@jupyterlab/{notebook-extension,extensionmanager-extension,apputils-extension}
|
||||
python -m venv --upgrade-deps "$VENV_PATH"
|
||||
mkdir -p "$JUPYTERLAB_SETTINGS_DIR"/@jupyterlab/{notebook-extension,extensionmanager-extension,apputils-extension}
|
||||
# Setting it to zero doesn't have the expected result, therefore, let's set it to an abnormally large number.
|
||||
echo '{ "maxNumberOutputs": 10000000000 }' > "$JUPYTERLAB_SETTINGS_DIR"/@jupyterlab/notebook-extension/tracker.jupyterlab-settings
|
||||
echo '{ "disclaimed": true }' > "$JUPYTERLAB_SETTINGS_DIR"/@jupyterlab/extensionmanager-extension/plugin.jupyterlab-settings
|
||||
echo '{ "theme": "JupyterLab Dark" }' > "$JUPYTERLAB_SETTINGS_DIR"/@jupyterlab/apputils-extension/themes.jupyterlab-settings
|
||||
echo '{ "fetchNews": "false" }' > "$JUPYTERLAB_SETTINGS_DIR"/@jupyterlab/apputils-extension/notification.jupyterlab-settings
|
||||
enable_venv "$2"
|
||||
python -m pip install --timeout 120 --retries 10000000000 -U pip setuptools
|
||||
pip install --timeout 120 --retries 10000000000 -r requirements.txt
|
||||
pip install --timeout 120 --retries 1000000000000 -r requirements.txt
|
||||
;;
|
||||
|
||||
k|-k|kernel|--kernel)
|
||||
enable_venv "$2"
|
||||
mkdir -p "$R_LIBS_SITE"
|
||||
mkdir -pv "$R_LIBS_SITE"
|
||||
if command -v Rscript >> /dev/null; then
|
||||
Rscript -e 'install.packages("IRkernel",repos="http://cran.r-project.org");library(IRkernel);IRkernel::installspec()'
|
||||
Rscript -e "install.packages('IRkernel','$R_LIBS_SITE','http://cran.r-project.org');library(IRkernel);IRkernel::installspec()"
|
||||
else
|
||||
echo "R isn't installed"
|
||||
exit 1
|
||||
@ -74,13 +73,13 @@ case "$1" in
|
||||
;;
|
||||
|
||||
U|-U|uninstall|--uninstall)
|
||||
rm -rf "$VENV_PATH" "$JUPYTER_ROOT_PATH" "$R_LIBS_SITE"
|
||||
rm -rf "$VENV_PATH" "$JUPYTER_ROOT_PATH" "$R_LIBS_SITE" .ipynb_checkpoints __pycache__
|
||||
;;
|
||||
|
||||
l|-l|launch|--launch)
|
||||
enable_venv "$2"
|
||||
if command -v jupyter >> /dev/null; then
|
||||
exec jupyter lab --ip 0.0.0.0 --ServerApp.iopub_data_rate_limit 1e16
|
||||
exec jupyter lab --ip 0.0.0.0
|
||||
else
|
||||
echo "Jupyter lab isn't installed"
|
||||
exit 1
|
||||
|
Reference in New Issue
Block a user