INNER CODE UNIT · Python
executor_base_url
pgalko/BambooAI · web_app/app.py:140
def executor_base_url(user_id: str):
"""The executor this user's instance talks to: None in local mode (the kernel runs here)."""
urls = get_dynamic_executor_urls(user_id)
return urls['EXECUTOR_API_BASE_URL'] if urls else None
def get_dynamic_executor_urls(user_id: str) -> dict:
"""Get dynamic executor URLs for a specific user"""
if GLOBAL_EXECUTION_MODE == 'local':
return None # no executor: the kernel runs in a subprocess here
if DIRECT_EXECUTOR_URL:
return _executor_urls(DIRECT_EXECUTOR_URL) # one executor, named in .env, no orchestrator
if container_orchestrator is None:
logger.error("EXECUTION_MODE=api needs EXECUTOR_API_BASE_URL in this edition (no orchestrator is installed)")
return None
try:
user_compute_tier = get_user_compute_tier(user_id)