Environment Variables Reference

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

VariableDescriptionExample
JUPYTERHUB_SERVICE_PREFIXURL prefix for the service/user/lmata/lmata-waiide-abc123/
JUPYTERHUB_SERVICE_URLFull URL to the servicehttps://hub.example.com/user/lmata/lmata-waiide-abc123/
JUPYTERHUB_USERUsername of the JupyterHub userlmata
JUPYTERHUB_API_TOKENOAuth token for API authenticationabc123... (long token)
JUPYTERHUB_API_URLURL to JupyterHub APIhttp://hub:8081/hub/api
JUPYTERHUB_BASE_URLBase URL of JupyterHub/
JUPYTERHUB_CLIENT_IDOAuth client IDjupyterhub-user-lmata

Named Server Variables (Multi-Instance)

VariableDescriptionExample
JUPYTERHUB_SERVER_NAMEFull instance name from spawnerlmata-waiide-abc123
JUPYTERHUB_OAUTH_CALLBACK_URLOAuth callback URL/user/lmata/lmata-waiide-abc123/oauth_callback
JUPYTERHUB_OAUTH_ACCESS_SCOPESJSON array of OAuth scopes["access:servers!server=lmata/", ...]
JUPYTERHUB_OAUTH_CLIENT_ALLOWED_SCOPESAllowed 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:

VariableDescriptionModern Example
JUPYTERHUB_SERVER_NAMEUnique instance identifierlmata-waiide-abc123
JUPYTERHUB_SERVICE_PREFIXFull instance path/user/lmata/lmata-waiide-abc123/
JUPYTERHUB_SERVICE_URLComplete instance URLhttps://hub.example.com/user/lmata/lmata-waiide-abc123/

Multiple Instance Examples

User lmata can have multiple instances simultaneously:

InstanceJUPYTERHUB_SERVER_NAMEService URL
WAIIDE #1lmata-waiide-abc123/user/lmata/lmata-waiide-abc123/
WAIIDE #2lmata-waiide-def456/user/lmata/lmata-waiide-def456/
Lab Instancelmata-lab-ghi789/user/lmata/lmata-lab-ghi789/

ECS Spawner Integration

When using ECS spawners, ensure they set:

VariableECS Spawner RequirementExample
JUPYTERHUB_SERVER_NAMEMust match ECS task/container namelmata-waiide-abc123
JUPYTERHUB_SERVICE_PREFIXMust include full hashed path/user/lmata/lmata-waiide-abc123/
JUPYTERHUB_SERVICE_URLMust include full external URLhttps://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

VariableDefaultDescription
PORT8080Main service port (JupyterHub/API)
HOST0.0.0.0Bind address for main service
USE_ALL_COMPONENTStrueEnable all components (JupyterHub mode)
VSCODE_PORT8071Internal WAIIDE Server port (default)
JUPYTERHUB_PORT8070Main service port (default)
PORT8070Override main service port (uses JUPYTERHUB_PORT if not set)

Logging

VariableDefaultDescription
LOG_LEVELINFOLogging level: DEBUG, INFO, WARNING, ERROR

User Environment

VariableDefaultDescription
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-empty
  • JUPYTERHUB_API_TOKEN - Must be a valid OAuth token
  • JUPYTERHUB_SERVICE_PREFIX - Must end with /
  • JUPYTERHUB_SERVICE_URL - Must be a valid URL

Optional but Recommended

  • JUPYTERHUB_SERVER_NAME - Used for instance identification and logging
  • LOG_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-abc123

OAuth Callback Errors

# Verify callback URL matches service prefix
echo $JUPYTERHUB_OAUTH_CALLBACK_URL  
# Should show: /user/lmata/lmata-waiide-abc123/oauth_callback

WAIIDE 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.