WAIIDE JupyterHub Integration - Hub Side Implementation
Calliope Integration: This component is integrated into the Calliope AI platform. Some features and configurations may differ from the upstream project.
Context
WAIIDE (Web AI IDE) is a WAIIDE Server container that we’ve successfully configured for JupyterHub integration. The container side is complete - now we need to implement the JupyterHub hub-side configuration.
What We’ve Built (Container Side)
Port Architecture
- Port 8080: Main service (JupyterHub integration endpoint)
- Port 8081: Direct WAIIDE Server access (optional)
- Dockerfile:
EXPOSE 8080 8081
Service Architecture
The container runs multiple services depending on environment detection:
JupyterHub Mode (when JUPYTERHUB_SERVICE_PREFIX is set):
- WAIIDE Server on port 8081 (internal)
- JupyterHub SingleUser + jupyter-server-proxy on port 8080 (main)
- Automatic proxy configuration:
/WAIIDE/→ WAIIDE Server
Standalone Mode (no JupyterHub environment):
- Custom API server on port 8080 that proxies to WAIIDE Server
- WAIIDE Server on port 8081
- API endpoints:
/api,/api/services,/api/*(JupyterHub compatibility)
API Endpoints (for health checking)
GET /api- Service overview and statusGET /api/services- Service discoveryGET /api/*- Basic JupyterHub compatibility responses- All other requests proxied to WAIIDE Server
Environment Variables
The container detects JupyterHub via:
JUPYTERHUB_SERVICE_PREFIX- Triggers JupyterHub modeJUPYTERHUB_USER- Username from hubPORT- Main port (defaults to 8080)USE_ALL_COMPONENTS- Enable all services (default: true)
Key Files Created
scripts/entrypoint-jupyterhub.sh- Main entrypointscripts/api_server.py- Custom API server for standalone mode- Docker image:
calliopeai/waiide:latest
What We Need (Hub Side Configuration)
JupyterHub Spawner Configuration
Help me configure the JupyterHub spawner to:
- Spawn WAIIDE containers with proper environment variables
- Configure health checking using our API endpoints
- Set up proper port mapping (8080 as primary, optionally 8081)
- Handle both integration modes (with/without jupyter-server-proxy)
Integration Options
We support two integration approaches:
- Native JupyterHub: Uses
jupyterhub-singleuser+jupyter-server-proxy - API Proxy: Uses our custom API server that provides JupyterHub-compatible endpoints
Specific Questions
- Which JupyterHub spawner should we use? (DockerSpawner, KubeSpawner, etc.)
- How to configure the spawner to use our container image?
- How to set up health checking with our
/apiendpoints? - How to handle the dual-port architecture in JupyterHub?
- Should we disable JupyterHub’s built-in health checking in favor of our API?
Expected Behavior
When complete, users should be able to:
- Click “Start” in JupyterHub
- Get redirected automatically to WAIIDE Server interface
- Have their workspace persist across sessions
- Access via JupyterHub’s URL structure:
/user/{username}/proxy/8081/
How jupyter-server-proxy Works
The jupyter-server-proxy package automatically handles URL rewriting:
- User accesses:
http://hub.example.com/user/lmata/proxy/8081/ - Proxy strips the prefix and forwards to:
http://localhost:8081/ - WAIIDE Server receives clean paths without JupyterHub prefixes
Current Status
✅ Container integration complete
✅ Dual port architecture working
✅ API endpoints functional
✅ Environment detection working
🔄 Need JupyterHub hub-side configuration
Please help me implement the JupyterHub hub configuration to spawn and manage WAIIDE containers effectively.