Commit Graph

34 Commits

Author SHA1 Message Date
stellarshenson
12953ee4d6 feat: add optional volume descriptions for UI
Added VOLUME_DESCRIPTIONS config dict allowing optional user-friendly
descriptions for volumes shown in management UI.

Changes:
- Added VOLUME_DESCRIPTIONS dict in jupyterhub_config.py (optional, co-defined
  with DOCKER_SPAWNER_VOLUMES)
- Exposed volume_descriptions via c.JupyterHub.template_vars
- Updated home.html to conditionally display descriptions if defined
- If volume not in VOLUME_DESCRIPTIONS, no description shown (UI remains agnostic)

Configuration example:
VOLUME_DESCRIPTIONS = {
    'home': 'User home directory files, configurations',
    'workspace': 'Project files, notebooks, code',
    'cache': 'Temporary files, pip cache, conda cache'
}

Documentation:
- Updated .claude/CLAUDE.md with Manage Volumes implementation details
- Simplified Restart Server section for consistency
- Added template variables to doc/ui-template-customization.md

UI now shows volume name, Docker volume path, and optional description
(if configured). Fully backward compatible - descriptions are optional.
2025-11-09 22:50:13 +01:00
stellarshenson
96f3d546b0 fix: protect jupyterhub_config.py from import errors
Fixed NameError when custom_handlers.py imports from jupyterhub_config.py
by protecting all c.* assignments with 'if c is not None:' checks.

Changes:
- Wrapped c = get_config() in try-except to handle module import context
- Defined DOCKER_SPAWNER_VOLUMES as module-level constant
- Modified get_user_volume_suffixes() to accept volumes dict parameter
- USER_VOLUME_SUFFIXES calculated from constant (importable without c defined)
- Protected all c.* configuration assignments with 'if c is not None:' guards

This allows custom_handlers.py to import USER_VOLUME_SUFFIXES without
triggering "NameError: name 'get_config' is not defined" when the config
file is imported as a module rather than loaded by JupyterHub.

Volume management now works correctly - configuration can be safely imported
by handlers to validate volume names against USER_VOLUME_SUFFIXES.
2025-11-09 22:39:59 +01:00
stellarshenson
d03ad7be22 feat: make volume management UI configuration-agnostic
Updated volume management to dynamically read volume names from
DockerSpawner.volumes configuration instead of hardcoding them:

- Added get_user_volume_suffixes() function to extract volume suffixes from
  config matching jupyterlab-{username}_<suffix> pattern
- Exposed USER_VOLUME_SUFFIXES via c.JupyterHub.template_vars for templates
- Updated home.html to use Jinja2 loop generating checkboxes dynamically
  from user_volume_suffixes variable
- Modified ManageVolumesHandler to validate against configured volumes
  instead of hardcoded {'home', 'workspace', 'cache'}
- Removed volume descriptions (e.g., "Contains: User home directory...") to
  keep UI truly agnostic

Now works correctly if volumes are renamed, added, or removed in configuration
without requiring template or handler changes. Volume names displayed exactly
as defined in config (home, workspace, cache by default).
2025-11-09 22:36:22 +01:00
stellarshenson
0e39fac7ac feat: add admin notification broadcast system for active JupyterLab servers
Implemented comprehensive notification broadcast functionality allowing
administrators to send notifications to all active user JupyterLab servers
simultaneously through a dedicated admin panel.

Core Features:
- Admin-only notification panel accessible at /hub/notifications
- Concurrent delivery to all active servers using asyncio with 5s timeout
- Temporary API token generation (5-minute expiry) for authentication
- Support for 6 notification types: default, info, success, warning, error, in-progress
- 140-character message limit with live character counter
- Auto-close toggle and dismiss button in notifications
- Dynamic endpoint URL construction using spawner.server.base_url
- Comprehensive error handling with user-friendly messages
- One-line logging per server with message preview and outcome

Technical Implementation:
- Created BroadcastNotificationHandler in custom_handlers.py
- Created NotificationsPageHandler for admin UI rendering
- Added notifications.html template with Bootstrap 5 form
- Registered handlers in jupyterhub_config.py extra_handlers
- Sends to /jupyterlab-notifications-extension/ingest endpoint
- Payload includes type, message, autoClose, and actions array
- Navigation link added to home.html for admin access

Integration:
- Requires jupyterlab_notifications_extension installed on JupyterLab servers
- Uses correct payload format (type field, not variant)
- Includes Dismiss action button for manual notification closure

Documentation:
- Updated .claude/CLAUDE.md with complete feature documentation
- Updated README.md Features section with notification broadcast details
- Updated .claude/JOURNAL.md with implementation summary
- Removed obsolete FEATURE_PLAN.md

Version: 3.2.0 (bumped from 3.1.2)
2025-11-09 22:05:06 +01:00
stellarshenson
067b613397 feat: add group-based docker.sock access control for privileged users
Implemented built-in protected group system enabling admins to grant trusted users read-write Docker socket access within their JupyterLab containers. Groups are managed through admin panel and cannot be permanently deleted.
2025-11-05 20:15:30 +01:00
stellarshenson
e8bf0b7c54 updated 2025-11-04 23:20:46 +01:00
stellarshenson
e985786499 fix: add /srv/jupyterhub to Python path for custom_handlers import
- Add /srv/jupyterhub to sys.path before importing custom_handlers
- Separate shell scripts and Python files in Dockerfile COPY commands
- Resolves ModuleNotFoundError for custom_handlers module
- JupyterHub now starts successfully with custom API handlers
2025-11-04 11:06:25 +01:00
stellarshenson
cd74fc71db feat: evolve user self-service to multi-volume management v3.0.12
Major enhancements to self-service features:
- Transform single volume reset to multi-volume selection (home/workspace/cache)
- Add Font Awesome icons to buttons (fa-rotate, fa-database)
- Fix Bootstrap 5 modal compatibility (data-bs-*, btn-close)
- Fix template inheritance to properly extend default home.html
- Wrap JavaScript in RequireJS callback for proper module loading
- Implement page refresh after Stop/Manage/Restart actions
- Update API endpoint to /api/users/{username}/manage-volumes
- Backend processes multiple volumes with detailed response
- Add Makefile logs target for container log monitoring

Technical fixes:
- Add default JupyterHub templates to template_paths configuration
- Convert modal triggers from Bootstrap 4 to Bootstrap 5 syntax
- Update JavaScript to use Bootstrap 5 Modal getInstance API
- Add json import to custom_handlers.py for request body parsing

Version: 3.0.12_cuda-12.9.1_jh-5.4.2
2025-11-04 10:07:07 +01:00
stellarshenson
3e52a91924 feat: implement reset home volume and restart server features
- Add custom API handlers for volume reset and server restart
- Create custom home.html template with self-service buttons and modals
- Register handlers in jupyterhub_config.py with @admin_or_self permissions
- Update Dockerfile to copy templates and handlers
- Add custom templates path to JupyterHub configuration
- Update .claude/CLAUDE.md with feature documentation
- Reset Home Volume: DELETE /hub/api/users/{username}/reset-home-volume
- Restart Server: POST /hub/api/users/{username}/restart-server
- Both features use Docker API directly via /var/run/docker.sock
2025-11-03 20:24:20 +01:00
stellarshenson
42b23a547d returned back to CUDA 12.9.1 2025-08-10 21:55:59 +02:00
stellarshenson
254d5670d6 updated to support latest CUDA 13.0 2025-08-10 04:22:21 +02:00
stellarshenson
ba81dd63c2 updated with configurable nvidia autodetect image 2025-08-08 00:52:17 +02:00
stellarshenson
51106cb81b updated with enhanved autodetection routine for nvidia 2025-08-08 00:50:41 +02:00
stellarshenson
1f0def6823 small bugs 2025-08-07 22:43:33 +02:00
stellarshenson
dccd14d6cc updated env variables 2025-08-07 22:42:12 +02:00
stellarshenson
99713fc557 updated to fix the issue with test container 2025-08-07 22:37:05 +02:00
stellarshenson
f5fd86adbf another fix 2025-08-07 22:29:37 +02:00
stellarshenson
293e2af741 fixed the way nvidia autodetection works 2025-08-07 21:52:56 +02:00
stellarshenson
caeb47d0bd updated nvidia detection 2025-08-07 21:40:24 +02:00
stellarshenson
fd3e591aab updated with the fix to the shared volume 2025-08-07 21:05:44 +02:00
stellarshenson
800c259bee updated with the nvidia autodetection 2025-08-07 20:08:36 +02:00
stellarshenson
cb8e6e106f updated permissions 2025-08-07 17:22:30 +02:00
stellarshenson
8d8d874a1c updated names of the enable variables 2025-07-23 23:56:01 +02:00
stellarshenson
d856089b64 small fixes to the documentation of the config files 2025-07-22 09:45:39 +00:00
stellarshenson
c43b622caa reduced default number of mlfow workers 4 -> 1 2025-07-22 00:28:04 +02:00
stellarshenson
7c192782ad fixed GPU configuration 2025-07-18 19:16:06 +02:00
stellarshenson
8c2d2175fc reduced number of volumes used per environment
mlflow was moved to /home/lab/.cache/mlflow and the cache
directory is now a separate volume
2025-07-18 02:51:16 +02:00
stellarshenson
0dfe3bc882 updated 2025-07-18 02:50:24 +02:00
stellarshenson
444bb3fa6c updated permissions 2025-07-18 00:15:55 +00:00
stellarshenson
08bb604466 updated paths 2025-07-18 00:14:19 +00:00
stellarshenson
54db628fe6 moved cache mount from .cache to /home/lab/.cache 2025-07-18 00:48:40 +02:00
stellarshenson
591d3a44f7 updated with the changes to certificate handling 2025-07-17 15:52:55 +02:00
stellarshenson
87e4d0746e updated to allow running with GPU support 2025-07-17 14:49:51 +02:00
stellarshenson
0f7f6fd1a1 moved to conform cloud development structure 2025-07-16 06:58:29 +02:00