ideonate / cdsdashboards

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

dashboard images Follow the custom jupyterhub images transformation #80

Closed faye1225 closed 3 years ago

faye1225 commented 3 years ago

Describe the bug I customized the documentation with multiple images. Includes cpu, gpu nodes。 But different environments, created via the dashboard will always be jupyter/containds-allr-datascience:0.5.6

Whether the dashboard can be modified based on the user's current images?

Configuration Zero to JupyterHub -> jupyterhub_config.yaml

  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.Spawner.args = ["--allow-root"]
.......
  image:
    name: registry.baidubce.com/jupyter/containds-allr-datascience
    tag: 0.5.6
  profileList:
    - display_name: "1 CPU | 64G RAM | 16"
      description: "Python3.8"
      default: true

    - display_name: "NODE1: GPU | V100-32G * 4 | 224GB RAM | 48"
      description: "TF 2.4 | Pytorch 1.8 | CUDA 11.0 | Python 3.8"
      kubespawner_override:
        image: registry.baidubce.com/jupyter/containds-allr-datascience:cuda11.0.03-tf2.4-pytorch1.8
        node_selector:
          kubernetes.io/hostname: tai-gpu-1

    - display_name: "NODE4: GPU | V100-32G * 4 | 224GB RAM | 48"
      description: "TF 1.14 | CUDA 10.0 | Python 3.7"
      kubespawner_override:
        image: registry.baidubce.com/jupyter/containds-allr-datascience:cuda10.0.130-tf1.14
        node_selector:
          kubernetes.io/hostname: tai-gpu-1
danlester commented 3 years ago

I'm not sure I've fully understood your question, but maybe you need to look at this option so the dashboard creator can select a profile when they first launch the dashboard:

https://cdsdashboards.readthedocs.io/en/latest/chapters/customization/huboptions.html#spawner-user-options-form

faye1225 commented 3 years ago

Thank you very much, this document has solved my problem :)