Closed ticoneva closed 10 months ago
Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:
This PR includes two kinds of features (user/group config and cpu weight), and I think both are relevant.
If you want to work this still @ticoneva, I'd be happy to invest time reviewing it!
@consideRatio I have been thinking about the issue of maintainable too. This is what I have come up with at this moment:
from traitlets.traitlets import is_trait
...
def overwrite_config(self,source):
for config_name in source:
config = getattr(self,config_name)
assert is_trait(config), f"{config_name} is not configurable."
setattr(self,config_name,source[config_name])
This should cover all configurable options, since as far as I I tell all spawner configurations are handled through traitlets.
Regarding overwrite vs merge, from what I can see in kubespawner, the current implement appears to be a overwrite rather than a merge?
Splitting the two features into separate PRs is not a problem, I can do that.
This PR introduces two changes:
cpu_weight
. This sets the systemd propertyCPUWeight
, which causes available CPU time to be sliced in proportion to each process' weight.group_config
anduser_config
. These two options accept dict of configuration options specific to individual groups and individual users. For example, forgroup_config
:Only configurations implemented within systemdspawnwer are supported.
The combination of change 1. and 2. allow group- or user-specific resource allocation. For example, on our academic computing cluster, faculty members have much higher
cpu_weight
andmem_limit
than students.