Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Victor Behar
    Greetings all! With the latest jupyterhub-lab I am trying to create a Voila dashboard and share it. I get a forbidden 403 error when the involved users are normal users and everything works as expected when the users sharing the dashboard are admins. I suspect this is related to the newly introduced roles and scopes. Please advise on how to overcome this, what are the required permissions that should be granted? Thank you.
    Geri Wolters
    I'm running in the same problem that @victor_wayward_twitter has. It also applies to Dash dashboards. My configuration involves a modified Generic OAuthenticator that creates local accounts. Only admins seem to be able to access shared dashboards. The log shows: User ... not allowed to access Server at ...
    A trace with some information blanked:
    HTTPServerRequest(protocol='https', host='(blanked)', method='GET', uri='/user/(blanked)/dash-sincos/', version='HTTP/1.1', remote_ip='(blanked')
    Traceback (most recent call last):
    File "/usr/local/lib/python3.9/dist-packages/tornado/web.py", line 1704, in _execute
    result = await result
    File "/usr/local/lib/python3.9/dist-packages/jhsingle_native_proxy/websocket.py", line 102, in get
    return await self.http_get(args, *kwargs)
    File "/usr/local/lib/python3.9/dist-packages/jhsingle_native_proxy/proxyhandlers.py", line 849, in http_get
    return await self.proxy(self.port, path)
    File "/usr/local/lib/python3.9/dist-packages/jhsingle_native_proxy/proxyhandlers.py", line 843, in proxy
    return await self.oauth_proxy(port, path)
    TypeError: object NoneType can't be used in 'await' expression
    Just prior to that trace, tornado has some warnings:
    WARNING:tornado.application:No Hub user identified for request
    WARNING:tornado.application:Token stored in cookie may have expired
    WARNING:tornado.application:Detected unused OAuth state cookies
    Victor Behar
    Here is what you need:
    # cdsdashboards role
    c.JupyterHub.load_roles = [{
    "name": "cdsdashboards",
    "description": "access servers",
    "scopes": ["access:servers"],
    'users': ['victor']
    Geri Wolters
    Nice. That works! Thanks! Now my problem is how to add users to the 'users' automatically... Is there a way to specify a group instead of individual users?
    Basically, I want all registered users to be able to use those dashboards. Currently, I add all users to a specific Linux group.
    Geri Wolters
    I think I found how: by adding a user to the user_role_map table in the back-end database for the role cdsdashboards.
    Victor Behar
    I think groups are supported, I would expect you can assign roles to groups
    Geri Wolters
    Yes, I did so. I used PostAuthHook to add the user to the default group that is allowed for the csdsdashboards role. Works nicely. Thanks for the advice!
    1 reply
    I am installing ContainDS on an ubuntu 18.04 server with my JupyterHub in basic installation. I am using the default PAM authenticator. I followed the ContainDS installation documentation (https://cdsdashboards.readthedocs.io/en/stable/index.html) but I have a problem as soon as I connect to my Jupyterhub I have a 404 error : Not Found
    You are requesting a page that does not exist!
    Dashboards ultimately lead to a 404 not found error, as do any named servers that you create directly using the standard JupyterHub home page table.
    I'm not sure if the fix for TLJH is also applicable to a JupyterHub server installed from scratch. Could you help me solve this problem.
    Thank you in advance for your help.
    Geri Wolters
    Here is my configuration, at least the relevant parts, I believe. This is also a clean setup, no TLJH fixes. I left the authentication part out, as mine is OAuth. I hope it helps.

    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'

    cdsdashboards role

    c.JupyterHub.load_roles = [{
    "name": "cdsdashboards",
    "description": "access servers",
    "scopes": ["access:servers"],
    "groups": ["default"]

    c.JupyterHub.data_files_path = '/etc/jupyterhub/templates/jupyterhub'

    Ray Bell
    Hi all. Trying this for the first time on tljh. Current following the config in the docs but once I reload the config I get a "bad gateway". I created an issue on this ideonate/cdsdashboards#91
    1 reply
    Robert Seidl
    Hi, whats the best way to serve a static website as dashboard with python. A custom launcher that uses http.server module or is there something more obvious that I am missing?
    rey abe
    I tried the above suggestion to add the "access:servers" scope to the user's or group's role, but I found that any user who has a role with that scope can access all other users' notebook servers as well, which basically voids all access control. Am I missing something?
    shubham kanwal

    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

    Effectively we just want to run

    RUN pip install cdsdashboards[user]

    But we often build the docker image before the cdsdashboards release to pypi

    so just pick the bits we need:

    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

    Install the frameworks

    ARG FRAMEWORKS_LINE="voila streamlit dash bokeh panel holoviews"

    RUN pip install $FRAMEWORKS_LINE

    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

    Enable local conda envs

    RUN conda init bash

    Fix permissions on /etc/jupyter as root

    USER root
    RUN fix-permissions /etc/jupyter/


    make sure the directories exist

    USER root

    RUN mkdir -p $JUPYTER_DATA_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


    I am running jupyterhub on EKS cluster. Hub configurations-

    allowNamedServers: true
    name: ideonate/cdsdashboards-jupyter-k8s-hub
    tag: 1.1.3-0.6.0
    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'

    Yann Sartori
    I am having the same issue as @reyabe_twitter. Ideally, I would like users to be able to start any containds dashboard server, but not be able to start, nor access normal notebook servers. With the current configuration, users cannot start others' notebook servers, but can access them if they are already running, albeit by going directly to the URL.
    2 replies
    Yashali Bansod

    @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 image
    pip 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?

    4 replies
    Yashali Bansod
    Hi @danlester , I was wondering if there is way to automatically refresh a dashboard server , if it's corresponding streamlit_app.py file changes. If not, it would be great if you could point me in the direction where I will be able to implement something like this

    Hi @danlester I am trying to create a new custom conda env while creating Dashboard. But dashboard gives me following error .

    I am running jupyterhub via helm and have included c.CDSDashboardsConfig.allow_custom_conda_env = True config too


    :point_up: Edit: Hi @danlester I am trying to create a new custom conda env while creating Dashboard. But dashboard gives me following error .

    I am running jupyterhub via helm and have included c.CDSDashboardsConfig.allow_custom_conda_env = True config.