ideonate / cdsdashboards

JupyterHub extension for ContainDS Dashboards
https://cdsdashboards.readthedocs.io/
Other
201 stars 37 forks source link

ZTJH presentation path defaults to jovyan when using Voila #110

Open nmearl opened 2 years ago

nmearl commented 2 years ago

Describe the bug When setting up ContainDS with a Kubernetes cluster and a Voila presentation, the presentation_path variable uses /home/jovyan instead of the user-specific path. Related issue: ideonate/cdsdashboards#43.

To Reproduce Follow instructions to install ContainDS Kubernetes. Edit the configuration file to include

...
    cds-kube: |
      c.JupyterHub.spawner_class = 'cdsdashboards.hubextension.spawners.variablekube.VariableKubeSpawner'
      c.CDSDashboardsConfig.builder_class = 'cdsdashboards.builder.kubebuilder.KubeBuilder'
      c.VariableMixin.default_presentation_cmd = ['start.sh', 'python3', '-m', 'jhsingle_native_proxy.main']
      c.VariableMixin.extra_presentation_launchers = {
        'voila': {
          'args': [
            '--destport=0', 'python', '{-}m','voila', '{presentation_path}',
            '{--}port={port}',
            '{--}no-browser',
            '{--}Voila.base_url={base_url}/',
            '{--}Voila.server_url=/',
            '{--}Voila.ip=0.0.0.0',
            ....
          ]
        }
      }
...

Create a new dashboard using a defined notebook. Upon visiting the dashboard, note 400 Bad Request error message in browser and the following error in the log:

ERROR:tornado.application:b'WARNING:tornado.general:400 GET / (127.0.0.1): Unreadable Notebook: /home/jovyan/HubbleDS.ipynb TypeError("__init__() got an unexpected keyword argument \'capture_validation_error\'")\n'
WARNING:tornado.access:400 GET /user/admin/dash-hubbleds/ (::ffff:192.168.126.246) 1352.61ms

Screenshots

Configuration

hub:
  config:
    Authenticator:
      admin_users:
        - admin
  allowNamedServers: true
  image:
    name: ideonate/cdsdashboards-jupyter-k8s-hub
    tag: 1.2.0-0.6.3
  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'
      c.VariableMixin.extra_presentation_launchers = {
        'voila': {
          'args': [
            '--destport=0', 'python', '{-}m','voila', '{presentation_path}',
            '{--}port={port}',
            '{--}no-browser',
            '{--}Voila.base_url={base_url}/',
            '{--}Voila.server_url=/',
            '{--}Voila.ip=0.0.0.0',
            '--ready-check-path=/voila/static/',
          ]
        }
      }
singleuser:
  image:
    name: ideonate/containds-allr-datascience
    tag: 0.6.3
  storage:
    type: dynamic
    capacity: 10Gi
    dynamic:
      pvcNameTemplate: claim-{username}
      volumeNameTemplate: volume-{username}
      storageAccessModes: [ReadWriteMany]