mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 05:37:20 +08:00
feat: add SANDBOX_STARTUP_GRACE_SECONDS env var for configurable startup timeout (#12741)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -205,6 +205,13 @@ def config_from_env() -> AppServerConfig:
|
|||||||
docker_sandbox_kwargs['container_url_pattern'] = os.environ[
|
docker_sandbox_kwargs['container_url_pattern'] = os.environ[
|
||||||
'SANDBOX_CONTAINER_URL_PATTERN'
|
'SANDBOX_CONTAINER_URL_PATTERN'
|
||||||
]
|
]
|
||||||
|
# Allow configuring sandbox startup grace period
|
||||||
|
# This is useful for slower machines or cloud environments where
|
||||||
|
# the agent-server container takes longer to initialize
|
||||||
|
if os.getenv('SANDBOX_STARTUP_GRACE_SECONDS'):
|
||||||
|
docker_sandbox_kwargs['startup_grace_seconds'] = int(
|
||||||
|
os.environ['SANDBOX_STARTUP_GRACE_SECONDS']
|
||||||
|
)
|
||||||
# Parse SANDBOX_VOLUMES and convert to VolumeMount objects
|
# Parse SANDBOX_VOLUMES and convert to VolumeMount objects
|
||||||
# This is set by the CLI's --mount-cwd flag
|
# This is set by the CLI's --mount-cwd flag
|
||||||
sandbox_volumes = os.getenv('SANDBOX_VOLUMES')
|
sandbox_volumes = os.getenv('SANDBOX_VOLUMES')
|
||||||
|
|||||||
Reference in New Issue
Block a user