Compare commits

...

4 Commits

Author SHA1 Message Date
saundersp
d41a25b366 Removed deprecated ServerApp.iopub_data_rate_limit option 2025-01-23 16:07:49 +01:00
saundersp
3c382e96cb Using R_LIBS_SITE in install.packages for distros who doesn't respect environnement variable 2025-01-23 16:07:26 +01:00
saundersp
cb5ba1e0c1 Removed mkdir and rm verbose flags 2024-12-18 17:31:17 +01:00
saundersp
db8d3ef52b Changed VENV_PATH to .venv 2024-10-27 20:40:52 +01:00

View File

@@ -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
@@ -40,7 +40,7 @@ enable_venv(){
case "$1" in
i|-i|install|--install)
python -m venv --upgrade-deps "$VENV_PATH"
mkdir -pv "$JUPYTERLAB_SETTINGS_DIR"/@jupyterlab/{notebook-extension,extensionmanager-extension,apputils-extension}
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
@@ -54,7 +54,7 @@ case "$1" in
enable_venv "$2"
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
@@ -73,13 +73,13 @@ case "$1" in
;;
U|-U|uninstall|--uninstall)
rm -rfv "$VENV_PATH" "$JUPYTER_ROOT_PATH" "$R_LIBS_SITE" .ipynb_checkpoints __pycache__
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