Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions code-interpreter/app/app_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
os.environ.get("PYTHON_EXECUTOR_DOCKER_IMAGE") or "onyxdotapp/python-executor-sci"
)
PYTHON_EXECUTOR_DOCKER_RUN_ARGS = os.environ.get("PYTHON_EXECUTOR_DOCKER_RUN_ARGS") or ""
# Docker network for spawned executor containers. Defaults to "none" (no network access)
# for maximum isolation. Set to a Docker network name (e.g. "onyx_default", "traefik")
# to allow executor containers to reach services on that network.
PYTHON_EXECUTOR_DOCKER_NETWORK = os.environ.get("PYTHON_EXECUTOR_DOCKER_NETWORK") or "none"

# Kubernetes executor configuration
KUBERNETES_EXECUTOR_NAMESPACE = os.environ.get("KUBERNETES_EXECUTOR_NAMESPACE") or "default"
Expand Down
3 changes: 2 additions & 1 deletion code-interpreter/app/services/executor_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from app.app_configs import (
PYTHON_EXECUTOR_DOCKER_BIN,
PYTHON_EXECUTOR_DOCKER_IMAGE,
PYTHON_EXECUTOR_DOCKER_NETWORK,
PYTHON_EXECUTOR_DOCKER_RUN_ARGS,
)
from app.image_ref import normalize_image_ref
Expand Down Expand Up @@ -269,7 +270,7 @@ def _build_run_command(
"--pull",
"never",
"--network",
"none",
PYTHON_EXECUTOR_DOCKER_NETWORK,
"--name",
container_name,
"--cgroupns",
Expand Down
Loading