Add user quota management system#11
Merged
KerwinTsaiii merged 11 commits intodevelopfrom Jan 30, 2026
Merged
Conversation
Features: - Quota tracking with per-accelerator rates (GPU/NPU) - Admin UI quota column with inline editing - Batch quota operations API - Auto-refresh with CronJob support (configurable rules) - Pydantic validation for all quota API endpoints Security & Stability: - Input validation with Pydantic models - Proper API authentication - SQL injection prevention - Rate limiting support Documentation: - quota-system.md with full API reference - Updated user-management.md
KerwinTsaiii
approved these changes
Jan 29, 2026
Features: - Add defaultQuota setting to grant initial quota to new users - Add defaultUnlimited setting to grant unlimited quota to new users - Auto-allocate quota when new users first attempt to start container - Record initial grants in transaction log as 'initial_grant' type Documentation: - Update quota system docs with new configuration options - Fix outdated configuration examples (enabled: null) - Fix transaction field structure in API examples - Add /api/quota/me response fields (accelerators, enabled) - Add screenshots for admin quota management UI - Remove outdated quota status indicator documentation Implementation: - Add ensure_user_quota() method in QuotaManager - Update can_start_container() to support default quota allocation - Add DEFAULT_QUOTA and DEFAULT_UNLIMITED config loading - Add logging for new user quota grants
Features: - Add expandable user details panel showing User and Server info - Display auth_state, state, user_options as formatted JSON - Add delete user button with confirmation modal - Move "Back to Users" button to right side in GroupList UI improvements: - JSON fields displayed in formatted <pre> with syntax highlighting - Expand/collapse toggle (▶/▼) for each user row - Delete button disabled for admin user
- Split /api/accelerators from /api/quota/me and /api/quota/rates - Add XSRF token to spawn page API calls (fixes 403 error) - Update documentation with new API structure
fd30c5c to
863f199
Compare
- Add missing doc links to main README (authentication, user-management, quota-system) - Remove outdated jupyterhub_config.py sections from docs/jupyterhub/README.md - Fix CustomNativeAuthenticator -> CustomFirstUseAuthenticator in authentication-guide.md
- Remove adminsUnlimited, unlimitedUsers, defaultUnlimited config options - Unlimited quota now managed exclusively via Admin UI - Auto-login mode still disables quota system entirely - Update documentation and values.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a complete user quota management system for tracking and controlling resource usage.
Changes
Core Features
New User Experience
defaultQuotasetting)defaultUnlimitedsetting)Admin UI Enhancements
Documentation
Files Changed
Core:
runtime/jupyterhub/files/hub/quota_manager.py- quota logicruntime/jupyterhub/files/hub/quota_models.py- Pydantic modelsruntime/jupyterhub/files/hub/jupyterhub_config.py- API handlersAdmin UI:
dockerfiles/Hub/admin-ui/src/pages/UserList.tsx- quota column, user detailsdockerfiles/Hub/admin-ui/src/api/client.ts- API clientTemplates:
runtime/jupyterhub/templates/hub/cronjob-quota-refresh.yaml- CronJobdockerfiles/Hub/templates/resource_options_form.html- spawn pageDocumentation:
docs/jupyterhub/quota-system.mddocs/jupyterhub/authentication-guide.mddocs/jupyterhub/README.mdREADME.mdTesting
Checklist