Is there a way, or could there be a way, to submit custom resource limits to the notebook pod via the Helm chart? This is needed to specify a number of GPUs to attach; for example:
singleuser:
image:
name: dholt/jupyterhub-k8s-gpu
tag: v0.6
extraEnv:
- JUPYTER_ENABLE_LAB: 1
resources:
limits:
nvidia.com/gpu: 1
nodeSelector:
gpu: "true"
This can be done with c.KubeSpawner.extra_resource_limits, but there's no z2jh configmap wrapper for that. You'd need to extraConfig for now.
@willingc I'm going to keep this particular one open, since I think we should expose this through the chart.
Sure thing @yuvipanda. To make sure that I understand correctly, support KubeSpawner resource limits, such as GPU, directly in helm chart.
@clkao would you like to elaborate how to achieve this with c.KubeSpawner.extra_resource_limits
For example, you'd set:
hub:
extraConfig:
10-gpu: |
c.KubeSpawner.extra_resource_limits = { 'nvidia.com/gpu': 1 }
@yuvipanda do we have this behavior documented somewhere? Would be useful to show people this pattern until it's officially in the chart
@choldgraf https://zero-to-jupyterhub.readthedocs.io/en/latest/advanced.html#arbitrary-extra-code-and-configuration-in-jupyterhub-config-py maybe?
I think I've initialized the resource limits to {} if it wasn't already in a kubespawner PR associated with #758 - we could encourage the use of .update
hub:
extraConfig:
10-gpu: |
c.KubeSpawner.extra_resource_limits.update({ 'nvidia.com/gpu': 1 })
Most helpful comment
@willingc I'm going to keep this particular one open, since I think we should expose this through the chart.