From 1ce8b7e4b3bd16dedb7c8b6bc821adf358a1c280 Mon Sep 17 00:00:00 2001 From: Ilija Vukotic Date: Wed, 15 Nov 2023 15:42:38 -0600 Subject: [PATCH] Add Dask configuration file and enable Dask Labextension --- Dockerfile | 2 ++ SetupPrivateJupyterLab.sh | 12 ++---------- dask_config.yaml | 12 ++++++++++++ 3 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 dask_config.yaml diff --git a/Dockerfile b/Dockerfile index 6202cff..aff800c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,8 @@ RUN mkdir /workspace # c.f. https://docs.jupyter.org/en/latest/use/jupyter-directories.html#configuration-files COPY private_jupyter_notebook_config.py /root/.jupyter/jupyter_notebook_config.py +COPY dask_config.yaml /etc/dask/dask_config.yaml + RUN . /release_setup.sh \ && /venv/bin/jupyter server extension enable --py jupyterlab --sys-prefix diff --git a/SetupPrivateJupyterLab.sh b/SetupPrivateJupyterLab.sh index d57f64a..6e16660 100644 --- a/SetupPrivateJupyterLab.sh +++ b/SetupPrivateJupyterLab.sh @@ -22,22 +22,14 @@ if [ "$OWNER" != "" ] && [ "$CONNECT_GROUP" != "" ]; then cd /home/$OWNER chown -R $OWNER: /venv - - # # get tutorial in. - # cp -r /ML_platform_tests/tutorial ~/. - - # # setup ROOT - # cd /opt/root/ - # source bin/thisroot.sh - # cp -r $ROOTSYS/etc/notebook/kernels/root /usr/local/share/jupyter/kernels/ - - # python3.8 -m pip --no-cache-dir install root-pandas unset JUPYTER_PATH which jupyter unset JUPYTER_CONFIG_DIR ls /root/.jupyter/jupyter_notebook_config.py cd /home/$OWNER + + jupyter serverextension enable --py --sys-prefix dask_labextension # Invoke Jupyter lab as the user su $OWNER -c "jupyter lab --ServerApp.root_dir=/home/${OWNER} --ServerApp.port=9999 --ServerApp.ip='0.0.0.0' --no-browser --config=/root/.jupyter/jupyter_notebook_config.py" diff --git a/dask_config.yaml b/dask_config.yaml new file mode 100644 index 0000000..33a27d8 --- /dev/null +++ b/dask_config.yaml @@ -0,0 +1,12 @@ +labextension: + factory: + module: dask_kubernetes + class: KubeCluster + args: [] + kwargs: {} + default: + workers: 3 + adapt: + minimum: 0 + maximum: 100 + initial: []