By default, all connected JupyterHubs may use all available resources. It's possible to configure "flavors" for each connected JupyterHub, offering only a part of the available resources.
By default, all connected JupyterHubs may use all available resources. It's possible to configure "flavors" for each connected JupyterHub, offering only a part of the available resources.
For this configuration three attributes are crucial:
For this configuration three attributes are crucial:
Configure different flavors, which can be used in Spawner configuration.
Configure different flavors, which can be used in Spawner configuration.
...
@@ -224,7 +224,126 @@ The according RAM / VCPUs restrictions are configured later on in the config fil
...
@@ -224,7 +224,126 @@ The according RAM / VCPUs restrictions are configured later on in the config fil
JupyterHub OutpostSpawner has to send the chosen flavor in `user_options.flavor` when starting a notebook server.
JupyterHub OutpostSpawner has to send the chosen flavor in `user_options.flavor` when starting a notebook server.
### User specific flavors
### User specific flavors
coming soon
JupyterHub Outpost supports user-specific flavors, which allows administrators to assign different resource configurations to individual users. This feature is especially useful in environments where users have varying levels of resource needs or access rights. With user-specific flavors, you can:
- Block access for specific users
- Prioritize certain users with more resources
- Allocate minimal resources for external or guest users
- Tailor resource allocation for different user groups
#### How It Works
The concept of "flavors" allows for the customization of resources based on user identity. By configuring these flavors, administrators can control the resource allocation and user access in a flexible manner.
Flavors are typically defined by setting parameters such as CPU, memory, disk space, and other configurations needed for running the user's server. The configuration is linked to each user, and the appropriate settings are applied when they spawn a jupyter server.
#### Use Cases
-**Blocked Users**: Administrators can configure flavors for specific users that deny access, effectively blocking them from launching any jupyter servers.
-**Prioritized Users**: For power users, administrators can assign more resources (e.g., higher CPU, additional memory) to ensure they have the performance needed for demanding tasks.
-**External Users**: For guest or external users, administrators may provide a default, minimal resource allocation to prevent overuse of the system’s resources.
#### Configuration
To assign a flavor to a user, you will need to update the JupyterHub Outpost configuration to define and link flavors to specific user identities.
Example configuration snippet:
```python
resources={
"s1":{
"node_selector":{"smallnode":"true"},
"cpu_guarantee":0.1,
"cpu_limit":1,
"mem_guarantee":"256M",
"mem_limit":"2048M"
},
"l1":{
"node_selector":{"bignode":"true"},
"cpu_guarantee":1,
"cpu_limit":4,
"mem_guarantee":"2048M",
"mem_limit":"65536M"
}
}
awesome_users={
"l1":{
"max":50,
"weight":10,
"display_name":"64GB RAM, 4VCPUs, 12 hours",
"description":"JupyterLab will run for max 12 hours with 64GB RAM and 4VCPUs.",
"runtime":{"hours":12},
},
"s1":{
"max":20,
"weight":11,
"display_name":"2GB RAM, 1VCPU, 4 hours",
"description":"JupyterLab will run for max 4 hours with 2GB RAM and 1VCPU.",
"runtime":{"hours":4},
}
}
default_users={
"s1":{
"max":10,
"weight":11,
"display_name":"2GB RAM, 1VCPU, 4 hours",
"description":"JupyterLab will run for max 4 hours with 2GB RAM and 1VCPU.",
In this example you will give users of your company the full extend of your resources, while other users get less resources.
-**Pro-Tipp** If you manage the flavors and resources in a ConfigMap and mount it in your Outpost, you can update flavors and resources without restarting the Outpost.
> All users will have a shared counter for servers with the s1 flavor. If 10 Jupyter servers of flavor s1 are running, default users won't be able to start a Jupyter server. This allows you to reserve 10 Jupyter servers of flavor s1 to your employees, workshops, or other use cases.
#### Benefits
- Resource Management: Fine-grained control over resource allocation ensures efficient use of system resources.
- User Control: Administrators can easily adjust resource access based on user needs or status (e.g., external user vs internal user).
- Scalability: As your user base grows, you can easily apply different flavors to new users without major changes to the overall configuration.
### Undefined Max
### Undefined Max
If JupyterHub OutpostSpawner does not send a flavor in user_options `c.JupyterHubOutpost.flavors_undefined_max` will be used to limit the available resources. This value is also used, if the given flavor is not part of the previously defined `flavors` dict. Default is `-1`, which allows infinite notebook servers for all unknown or unconfigured flavored notebook servers.
If JupyterHub OutpostSpawner does not send a flavor in user_options `c.JupyterHubOutpost.flavors_undefined_max` will be used to limit the available resources. This value is also used, if the given flavor is not part of the previously defined `flavors` dict. Default is `-1`, which allows infinite notebook servers for all unknown or unconfigured flavored notebook servers.