Environment Variables Reference
Calliope Integration: This component is integrated into the Calliope AI platform. Some features and configurations may differ from the upstream project.
Overview
WAIIDE uses environment variables for configuration and JupyterHub integration. This document lists all recognized environment variables and their effects in the modern multi-instance architecture.
JupyterHub Variables (Set Automatically)
These variables are set by JupyterHub when spawning containers. Do not override these manually.
Core JupyterHub Variables
| Variable | Description | Example |
|---|---|---|
JUPYTERHUB_SERVICE_PREFIX | URL prefix for the service | /user/lmata/lmata-waiide-abc123/ |
JUPYTERHUB_SERVICE_URL | Full URL to the service | https://hub.example.com/user/lmata/lmata-waiide-abc123/ |
JUPYTERHUB_USER | Username of the JupyterHub user | lmata |
JUPYTERHUB_API_TOKEN | OAuth token for API authentication | abc123... (long token) |
JUPYTERHUB_API_URL | URL to JupyterHub API | http://hub:8081/hub/api |
JUPYTERHUB_BASE_URL | Base URL of JupyterHub | / |
JUPYTERHUB_CLIENT_ID | OAuth client ID | jupyterhub-user-lmata |
Named Server Variables (Multi-Instance)
| Variable | Description | Example |
|---|---|---|
JUPYTERHUB_SERVER_NAME | Full instance name from spawner | lmata-waiide-abc123 |
JUPYTERHUB_OAUTH_CALLBACK_URL | OAuth callback URL | /user/lmata/lmata-waiide-abc123/oauth_callback |
JUPYTERHUB_OAUTH_ACCESS_SCOPES | JSON array of OAuth scopes | ["access:servers!server=lmata/", ...] |
JUPYTERHUB_OAUTH_CLIENT_ALLOWED_SCOPES | Allowed OAuth scopes | ["access:servers!server=lmata/lmata-waiide-abc123", ...] |
Modern Multi-Instance Pattern
The new architecture supports multiple instances per user with unique hashed names:
| Variable | Description | Modern Example |
|---|---|---|
JUPYTERHUB_SERVER_NAME | Unique instance identifier | lmata-waiide-abc123 |
JUPYTERHUB_SERVICE_PREFIX | Full instance path | /user/lmata/lmata-waiide-abc123/ |
JUPYTERHUB_SERVICE_URL | Complete instance URL | https://hub.example.com/user/lmata/lmata-waiide-abc123/ |
Multiple Instance Examples
User lmata can have multiple instances simultaneously:
| Instance | JUPYTERHUB_SERVER_NAME | Service URL |
|---|---|---|
| WAIIDE #1 | lmata-waiide-abc123 | /user/lmata/lmata-waiide-abc123/ |
| WAIIDE #2 | lmata-waiide-def456 | /user/lmata/lmata-waiide-def456/ |
| Lab Instance | lmata-lab-ghi789 | /user/lmata/lmata-lab-ghi789/ |
ECS Spawner Integration
When using ECS spawners, ensure they set:
| Variable | ECS Spawner Requirement | Example |
|---|---|---|
JUPYTERHUB_SERVER_NAME | Must match ECS task/container name | lmata-waiide-abc123 |
JUPYTERHUB_SERVICE_PREFIX | Must include full hashed path | /user/lmata/lmata-waiide-abc123/ |
JUPYTERHUB_SERVICE_URL | Must include full external URL | https://hub.example.com/user/lmata/lmata-waiide-abc123/ |
This allows WAIIDE to:
- ✅ Serve WAIIDE at root URL (no
/WAIIDE/path needed) - ✅ Display instance name in logs: “Running as named server: lmata-waiide-abc123 for user: lmata”
- ✅ Handle OAuth correctly with the full instance name
- ✅ Support multiple instances per user without conflicts
See ECS Instance Names for detailed ECS spawner configuration.
WAIIDE Configuration Variables
These variables control WAIIDE behavior:
Service Configuration
| Variable | Default | Description |
|---|---|---|
PORT | 8080 | Main service port (JupyterHub/API) |
HOST | 0.0.0.0 | Bind address for main service |
USE_ALL_COMPONENTS | true | Enable all components (JupyterHub mode) |
VSCODE_PORT | 8071 | Internal WAIIDE Server port (default) |
JUPYTERHUB_PORT | 8070 | Main service port (default) |
PORT | 8070 | Override main service port (uses JUPYTERHUB_PORT if not set) |
Logging
| Variable | Default | Description |
|---|---|---|
LOG_LEVEL | INFO | Logging level: DEBUG, INFO, WARNING, ERROR |
User Environment
| Variable | Default | Description |
|---|---|---|
WORKSPACE_DIR | /home/{username} | Default workspace directory |
HOME | /home/{username} | User home directory |
Migration from Legacy Variables
❌ Legacy Patterns (Deprecated)
# Old single-instance patterns
JUPYTERHUB_SERVER_NAME=waiide
JUPYTERHUB_SERVICE_PREFIX=/user/lmata/waiide/✅ Modern Patterns (Current)
# New multi-instance patterns
JUPYTERHUB_SERVER_NAME=lmata-waiide-abc123
JUPYTERHUB_SERVICE_PREFIX=/user/lmata/lmata-waiide-abc123/
JUPYTERHUB_SERVICE_URL=https://hub.example.com/user/lmata/lmata-waiide-abc123/Environment Variable Validation
WAIIDE validates these environment variables on startup:
Required for JupyterHub Mode
JUPYTERHUB_USER- Must be set and non-emptyJUPYTERHUB_API_TOKEN- Must be a valid OAuth tokenJUPYTERHUB_SERVICE_PREFIX- Must end with/JUPYTERHUB_SERVICE_URL- Must be a valid URL
Optional but Recommended
JUPYTERHUB_SERVER_NAME- Used for instance identification and loggingLOG_LEVEL- Helps with debugging
Troubleshooting Environment Issues
Instance Name Not Detected
# Check if server name is set
echo $JUPYTERHUB_SERVER_NAME
# Should show: lmata-waiide-abc123OAuth Callback Errors
# Verify callback URL matches service prefix
echo $JUPYTERHUB_OAUTH_CALLBACK_URL
# Should show: /user/lmata/lmata-waiide-abc123/oauth_callbackWAIIDE Not at Root
# Check service prefix configuration
echo $JUPYTERHUB_SERVICE_PREFIX
# Should show: /user/lmata/lmata-waiide-abc123/For detailed troubleshooting, see the WAIIDE Configuration Guide.