WAIIDE JupyterHub Integration
Calliope Integration: This component is integrated into the Calliope AI platform. Some features and configurations may differ from the upstream project.
This document explains how WAIIDE (Web AI IDE) integrates with JupyterHub using multiple components for maximum compatibility and functionality.
Architecture Overview
WAIIDE runs four components simultaneously when USE_ALL_COMPONENTS=true (default):
WAIIDE Server (port 8080, internal)
- Core IDE functionality
- Runs on localhost only for security
JupyterHub SingleUser (port 8090, main)
- Primary JupyterHub integration
- Provides standard JupyterHub API endpoints
- Handles user authentication and session management
Jupyter Server Proxy (within JupyterHub)
- Proxies WAIIDE Server through JupyterHub
- Accessible at
/WAIIDE/path - Provides seamless integration with JupyterHub interface
Custom API Server (port 8091)
- Additional API endpoints
- Direct WAIIDE Server proxy
- Enhanced service discovery and health checking
Port Configuration
| Component | Port | Access | Purpose |
|---|---|---|---|
| WAIIDE Server | 8080 | Internal | Core IDE functionality |
| JupyterHub SingleUser | 8090 | External | Main JupyterHub endpoint |
| Custom API Server | 8091 | External | Additional API endpoints |
API Endpoints
JupyterHub Standard Endpoints (port 8090)
These are provided by jupyterhub-singleuser:
GET /api/status- JupyterHub server statusGET /api/user- Current user informationGET /hub/api/...- Full JupyterHub APIGET /WAIIDE/- WAIIDE Server via proxy
Custom API Endpoints (port 8091)
These are provided by our custom API server:
GET /api- Main API endpoint with service overviewGET /api/status- Enhanced status with WAIIDE health checkGET /api/user- User informationGET /api/services- Detailed service discoveryGET /*- Proxy to WAIIDE Server for direct access
Environment Variables
Required for JupyterHub Integration
JUPYTERHUB_SERVICE_PREFIX- Set by JupyterHubJUPYTERHUB_USER- Username from JupyterHubJUPYTERHUB_API_TOKEN- API token from JupyterHub
Configuration Options
USE_ALL_COMPONENTS=true- Run all components (default)USE_ALL_COMPONENTS=false- Run only WAIIDE + Custom APIPORT=8090- Main port for JupyterHub integrationAPI_SERVER_PORT=8091- Port for custom API serverHOST=0.0.0.0- Listen address
JupyterHub Spawner Configuration
For Full Integration (Recommended)
# In jupyterhub_config.py
c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'
# WAIIDE spawner configuration
c.DockerSpawner.image_whitelist = {
'waiide': 'calliopeai/waiide:latest'
}
# Service configuration
c.DockerSpawner.services = {
'waiide': {
'name': 'waiide',
'image': 'calliopeai/waiide:latest',
'port': 8090,
'uses_jupyterhub_singleuser': True, # Use JupyterHub integration
'health_check': {
'endpoint': '/api/status',
'timeout': 60,
'disable_health_check': False
},
'environment': {
'USE_ALL_COMPONENTS': 'true'
}
}
}For Lightweight Integration
# For environments where you want minimal JupyterHub integration
c.DockerSpawner.services = {
'waiide': {
'name': 'waiide',
'image': 'calliopeai/waiide:latest',
'port': 8090,
'uses_jupyterhub_singleuser': False, # Use custom API only
'health_check': {
'endpoint': '/api/status',
'timeout': 30,
'disable_health_check': False
},
'environment': {
'USE_ALL_COMPONENTS': 'false'
}
}
}Health Checking
JupyterHub Health Check
JupyterHub will health check at the configured endpoint:
- Full integration:
http://container:8090/api/status - Lightweight:
http://container:8090/api/status
Manual Health Check
You can manually check service health:
# Check main API
curl http://localhost:8091/api
# Check specific services
curl http://localhost:8091/api/services
# Check JupyterHub integration
curl http://localhost:8090/api/statusAccess Methods
Through JupyterHub (Recommended)
- Standard JupyterHub Interface:
/hub/spawn - Direct WAIIDE Access:
/user/{username}/waiide/WAIIDE/ - API Access:
/user/{username}/waiide/api/
Direct Access (Development)
- WAIIDE Server:
http://localhost:8080(if exposed) - Custom API:
http://localhost:8091/api - JupyterHub:
http://localhost:8090
Testing
Quick Test
# Run the test script
python3 scripts/test_api.py
# Or test specific endpoint
curl http://localhost:8091/api/servicesFull Integration Test
# Set environment variables
export JUPYTERHUB_USER=testuser
export JUPYTERHUB_SERVICE_PREFIX=/user/testuser/waiide/
export USE_ALL_COMPONENTS=true
# Start WAIIDE
./scripts/entrypoint-jupyterhub.shTroubleshooting
Common Issues
JupyterHub Health Check Fails
- Check if port 8090 is accessible
- Verify
/api/statusendpoint responds - Check container logs for startup errors
WAIIDE Not Accessible
- Ensure WAIIDE Server started (check port 8080)
- Verify proxy configuration
- Check
/WAIIDE/path accessibility
API Endpoints Not Working
- Ensure API server started on port 8091
- Check firewall/network configuration
- Verify JSON responses are valid
Debug Mode
Add debug logging:
export DEBUG=true
./scripts/entrypoint-jupyterhub.shArchitecture Benefits
This multi-component architecture provides:
- Maximum Compatibility: Works with all JupyterHub configurations
- Flexibility: Can run in full or lightweight mode
- Robustness: Multiple access methods prevent single points of failure
- Extensibility: Easy to add new API endpoints or services
- Standard Compliance: Follows JupyterHub API conventions
Migration Notes
If upgrading from a previous version:
- The default behavior now runs all components
- Set
USE_ALL_COMPONENTS=falsefor old behavior - Update health check endpoints if needed
- Review port configurations in your spawner
© 2025 CalliopeAI - Web AI IDE (WAIIDE) with comprehensive JupyterHub integration