Hello, I’m new in Z2JH. I want to use group to manage students, but I don’t find any explanation of this manage groups. Is there any documentation for this feature? For example, what does KeyValue mean in image .
Any help will be greatly appreciated!
The Key value section is so you can add additional metadata to the group
By default JupyterHub doesn’t do anything with it, but custom spawners could make use of it.
Thank you very much for your reply. I have read the link you provided, but my understanding of JupyterHub may not be deep enough, so I don’t fully grasp the examples in the link . I’m not sure if my following idea is correct. The specific problem I’m facing now is that I have two different GPU cards, such as a 4090 and a 3090, and I hope to allocate the 4090 to Group A and the 3090 to Group B. Does this mean I need to set corresponding Keys and Values in
manage_group
, and then rewrite the pre_spawn_hook
function in the profileList
of the jupyterhub.yaml
file (as shown in the figure below) to call the corresponding Keys and Values for allocation? Or is there a more recommended and simpler way? I’m looking forward to your reply with great expectation.
I think you can use KubeSpawner.group_overrides
for that:
Thank you very much for your response. I will try to resolve this issue.
Hello, I tried using the group_override
method in KubeSpawner (as you suggested) to solve the issue I mentioned earlier (where students of different levels should only be able to select GPU cards corresponding to their level). However, I encountered some problems:
- Issue with Syntax or Configuration:
In Image 1, I created a test example based on the documentation’s sample code
. I’m unsure if my syntax errors caused the “Spawn Failed” error shown in Image 2.
Could you please review and correct my approach? - Missing
jupyterhub_config.py
File:
I noticed that all the examples you provided reference thejupyterhub_config.py
file. However, while setting up JupyterHub on Kubernetes from scratch, I’ve never encountered this file. Could this absence be impacting my ability to resolve this issue?
If you can share similar specific examples with actual code snippets (rather than images) or error details, I can help diagnose the problem more effectively! Thank you.