Hi all! We really like the ContainDS dashboard extensions to JupyterHub. Works very well in our Azure Kubernetes deployment. Big thank you to the authors!
At the moment we have just one more requirement left, which is "Sharing JupyterLab servers" between teams. Dashboards are already designed to be accessible to a JupyterHub group of users. One approach to share JupyterLab servers could be to simply spawn the JupyterLab in the same way as you would spawn a dashboard server.
I tried to do that with a a custom launcher, like this:
c.VariableMixin.extra_presentation_launchers = {
'shared_jupyter': {
'env': {
'JUPYTERHUB_SERVICE_PREFIX': '/user/<username>/dash-shared-jupyter',
},
'args': ['jupyter', 'lab', '{--}no-browser','{--}ServerApp.token=\'\'','{--}ServerApp.base_url=\'\'', '{--}ip=0.0.0.0', '{--}port={port}'],
'debug_args': [],
}
}
It did not really work, probably because I did not quite hit the right configuration for "ServerApp.base_url" and "JUPYTERHUB_SERVICE_PREFIX". Maybe one of you has an idea, how to configure such a "shared_jupyter_server" launcher.
c.CDSDashboardsConfig.builder_class = 'cdsdashboards.builder.processbuilder.ProcessBuilder'
c.CDSDashboardsConfig.spawn_allow_group = '(blanked)'
c.CDSDashboardsConfig.presentation_types = ['plotlydash', 'voila']
from cdsdashboards.app import CDS_TEMPLATE_PATHS_RESTRICTED
from cdsdashboards.hubextension import cds_extra_handlers
c.JupyterHub.template_paths = CDS_TEMPLATE_PATHS_RESTRICTED
c.JupyterHub.extra_handlers = cds_extra_handlers
c.JupyterHub.admin_users = set(["(blanked)", "(blanked)"])
c.JupyterHub.spawner_class = 'cdsdashboards.hubextension.spawners.VariableLocalProcessSpawner'
c.JupyterHub.redirect_to_server = False
c.JupyterHub.default_url = '/hub/dashboards'
c.JupyterHub.load_roles = [{
"name": "cdsdashboards",
"description": "access servers",
"scopes": ["access:servers"],
"groups": ["default"]
}]
c.JupyterHub.data_files_path = '/etc/jupyterhub/templates/jupyterhub'
Hi, i am trying to install cds dashboards via my custom docker file, i am using ideonate/cdsdashboards-jupyter-k8s-hub for hub and for single user i am building on top of docker stacks .
So when i create new dashboard i get the following error message - i have tried creating for voila and plotly dash so far.
My docker file - using this for reference- https://github.com/ideonate/cdsdashboards/blob/master/docker-images/singleuser-example/containds-all-example/Dockerfile
FROM jupyter/minimal-notebook
USER root
ENV JUPYTER_CONFIG_DIR /jupyter/.jupyter
ENV JUPYTER_DATA_DIR /jupyter/.local/share/jupyter
ENV JUPYTER_RUNTIME_DIR /jupyter/.local/share/jupyter/runtime
RUN conda config --set ssl_verify no
RUN conda install --quiet --yes -c conda-forge git
RUN rm -rf /home/jovyan/work
ARG JHSINGLENATIVEPROXY_LINE=jhsingle-native-proxy>=0.6.1
RUN pip install $JHSINGLENATIVEPROXY_LINE plotlydash-tornado-cmd>=0.0.4 bokeh-root-cmd>=0.1.2 rshiny-server-cmd>=0.0.2 voila-materialstream>=0.2.6
ARG FRAMEWORKS_LINE="voila streamlit dash bokeh panel holoviews"
RUN pip install $FRAMEWORKS_LINE
USER $NB_UID
COPY jupyter_notebook_config_extra.py /etc/jupyter/
RUN cat /etc/jupyter/jupyter_notebook_config_extra.py >> /etc/jupyter/jupyter_notebook_config.py
RUN rm /etc/jupyter/jupyter_notebook_config_extra.py
COPY voila.json /etc/jupyter
RUN conda init bash
USER root
RUN fix-permissions /etc/jupyter/
USER root
RUN mkdir -p $JUPYTER_CONFIG_DIR
RUN mkdir -p $JUPYTER_DATA_DIR
RUN mkdir -p $JUPYTER_RUNTIME_DIR
RUN pip install jupyter_contrib_nbextensions \
&& pip install jupyterhub==1.5 \
&& pip install --upgrade cdsdashboards==0.6.0 \
&& jupyter contrib nbextension install --system \
&& pip install jupyter_nbextensions_configurator \
&& jupyter nbextensions_configurator enable --system \
&& pip install yapf # for code pretty
RUN chmod -R 777 /jupyter
USER $NB_UID
I am running jupyterhub on EKS cluster. Hub configurations-
hub:
allowNamedServers: true
image:
name: ideonate/cdsdashboards-jupyter-k8s-hub
tag: 1.1.3-0.6.0
extraConfig:
cds-handlers: |
from cdsdashboards.hubextension import cds_extra_handlers
c.JupyterHub.extra_handlers = cds_extra_handlers
cds-templates: |
from cdsdashboards.app import CDS_TEMPLATE_PATHS
c.JupyterHub.template_paths = CDS_TEMPLATE_PATHS
cds-kube: |
c.JupyterHub.spawner_class = 'cdsdashboards.hubextension.spawners.variablekube.VariableKubeSpawner'
c.CDSDashboardsConfig.builder_class = 'cdsdashboards.builder.kubebuilder.KubeBuilder'
@danlester Hi, thanks for creating ContainDS Dashboards! It caters to a loooot of our use cases. However I am unable to get it running on our current setup :/ We are on Kubernetes (Z2JH). So on our custom jhub_k8s image I installed cdsdashboards>=0.4.0. Further, on our custom singleuser image, we need all kinds of dashboards. So I have added
RUN pip install streamlit
RUN conda install dash=1.16.0 && pip install 'plotlydash-tornado-cmd>=0.0.6'
RUN pip install bokeh panel 'bokeh-root-cmd>=0.0.5'
(dash=1.16.0 because it conflicted with a few already installed pkgs)
Since we use custom single user image:-
Added : "c.VoilaConfiguration.enable_nbextensions=True" to the already existing /etc/jupyter/jupyter_notebook_config.py file in the singleuser image. Added /etc/jupyter/voila.json (containing {}) to this image. Also, added this to the single user imagepip install 'jhsingle-native-proxy>=0.7.6' 'voila-materialstream>=0.4.0' jupyter-containds
Added extra configs to the helm values.yml : https://cdsdashboards.readthedocs.io/en/stable/chapters/setup/z2jh.html#config-yaml
Rest all lines in the Dockerfile was already present in our single-user custom image since we build our image based on the docker-stacks image as well.
Is there nothing else to be done on hub apart from installing cdsdashboards>=0.4.0?
I see a CDSDashboard Menu item after logging into my named server notebook on jhub. But the extension itself doesnt show the buttons ib the launcher. Neither doest the 'Dashboards' tab appear on hub.
What did I miss?