20 lines
670 B
Python
20 lines
670 B
Python
"""Sandbox 容器管理(DESIGN §7.5)。
|
|
|
|
模块边界:
|
|
- `network.py`:Docker network ensure(`zcbot-sandbox-net`,`--internal` 隔离 outbound + cross-container)
|
|
- `pool.py`:per-user 容器生命周期(ensure / mark_active / reap_idle / shutdown_all)
|
|
|
|
不在本目录:`shell` / `run_python` 工具的 docker exec 调用 ── 那是 Step 3 的
|
|
`core/executor_docker.py`,调用本模块的 `pool.ensure(user_id)` 拿到容器名后再 exec。
|
|
"""
|
|
from .pool import SandboxPool, container_name, setup_pool
|
|
from .network import NETWORK_NAME, ensure_network
|
|
|
|
__all__ = [
|
|
"SandboxPool",
|
|
"container_name",
|
|
"setup_pool",
|
|
"NETWORK_NAME",
|
|
"ensure_network",
|
|
]
|