mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
feat: add docker_volumes config for custom volume mounts
This commit is contained in:
parent
e3cb957a10
commit
f7677ed275
4 changed files with 44 additions and 3 deletions
|
|
@ -445,6 +445,7 @@ def _get_env_config() -> Dict[str, Any]:
|
|||
"container_memory": int(os.getenv("TERMINAL_CONTAINER_MEMORY", "5120")), # MB (default 5GB)
|
||||
"container_disk": int(os.getenv("TERMINAL_CONTAINER_DISK", "51200")), # MB (default 50GB)
|
||||
"container_persistent": os.getenv("TERMINAL_CONTAINER_PERSISTENT", "true").lower() in ("true", "1", "yes"),
|
||||
"docker_volumes": json.loads(os.getenv("TERMINAL_DOCKER_VOLUMES", "[]")),
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -471,6 +472,7 @@ def _create_environment(env_type: str, image: str, cwd: str, timeout: int,
|
|||
memory = cc.get("container_memory", 5120)
|
||||
disk = cc.get("container_disk", 51200)
|
||||
persistent = cc.get("container_persistent", True)
|
||||
volumes = cc.get("docker_volumes", [])
|
||||
|
||||
if env_type == "local":
|
||||
return _LocalEnvironment(cwd=cwd, timeout=timeout)
|
||||
|
|
@ -480,6 +482,7 @@ def _create_environment(env_type: str, image: str, cwd: str, timeout: int,
|
|||
image=image, cwd=cwd, timeout=timeout,
|
||||
cpu=cpu, memory=memory, disk=disk,
|
||||
persistent_filesystem=persistent, task_id=task_id,
|
||||
volumes=volumes,
|
||||
)
|
||||
|
||||
elif env_type == "singularity":
|
||||
|
|
@ -848,6 +851,7 @@ def terminal_tool(
|
|||
"container_memory": config.get("container_memory", 5120),
|
||||
"container_disk": config.get("container_disk", 51200),
|
||||
"container_persistent": config.get("container_persistent", True),
|
||||
"docker_volumes": config.get("docker_volumes", []),
|
||||
}
|
||||
|
||||
new_env = _create_environment(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue