Skip to content

Commit

Permalink
add example config
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed May 24, 2024
1 parent bec737b commit 5100c60
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions jupyterhub/spawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,29 @@ def _default_access_scopes(self):
If the traitlet being overriden is a *dictionary*, the dictionary
will be *recursively updated*, rather than overriden. If you want to
remove a key, set its value to `None`
The following example config will:
1. Add the environment variable "AM_I_USER" to everyone in the "user" group
2. Add the environment variable "AM_I_ADMIN" to everyone in the "admin" group.
If a user is part of both "user" and "admin", they will get *both* these env
vars, due to the dictionary merging functionality.
3. Add a higher memory limit for everyone in the "admin" group.
c.Spawner.group_overrides = {
"01-admin-env-add": {
"groups": ["admin"],
"spawner_override": {"environment": {"AM_I_ADMIN": "yes"}},
},
"02-user-env-add": {
"groups": ["user"],
"spawner_override": {"environment": {"AM_I_USER": "yes"}},
},
"03-admin-mem-limit": {
"groups": ["admin"],
"spawner_override": {"mem_limit": "2G"}
}
}
""",
config=True,
)
Expand Down

0 comments on commit 5100c60

Please sign in to comment.