mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-08-09 06:18:57 +00:00
fix(docker): set DEER_FLOW_ROOT for log commands (#4658)
* fix(docker): set DEER_FLOW_ROOT for log commands * fix(docker): set root before restart * docs(docker): clarify log command
This commit is contained in:
parent
1f792d0f4b
commit
276481371e
@ -112,6 +112,9 @@ make up / down # Build/stop the production Docker stack (browser at localhost:
|
||||
make docker-start / docker-stop / docker-logs # Docker development environment
|
||||
```
|
||||
|
||||
Docker log and restart commands resolve `DEER_FLOW_ROOT` from the current
|
||||
checkout before invoking Compose, matching the start and stop commands.
|
||||
|
||||
Run `make help` for the full list.
|
||||
|
||||
**Per-module commands drive a single module** (run inside that module):
|
||||
|
||||
@ -247,6 +247,7 @@ Use the table below as a practical starting point when choosing how to run DeerF
|
||||
```bash
|
||||
make docker-init # Pull sandbox image (only once or when image updates)
|
||||
make docker-start # Start services (auto-detects sandbox mode from config.yaml)
|
||||
make docker-logs # View logs
|
||||
```
|
||||
|
||||
`make docker-start` starts `provisioner` only when `config.yaml` uses provisioner mode (`sandbox.use: deerflow.community.aio_sandbox:AioSandboxProvider` with `provisioner_url`).
|
||||
|
||||
@ -104,3 +104,19 @@ sandbox:
|
||||
""".strip()
|
||||
|
||||
assert _detect_mode_with_config(config) == "local"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("docker_command", ["logs --gateway", "restart"])
|
||||
def test_compose_commands_set_deer_flow_root_before_compose(docker_command):
|
||||
"""Log and restart commands should resolve mounts from the repository root."""
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
command = f"""
|
||||
source '{SCRIPT_PATH}'
|
||||
PROJECT_ROOT='{tmpdir}'
|
||||
DOCKER_DIR='{tmpdir}'
|
||||
COMPOSE_CMD=capture_compose
|
||||
capture_compose() {{ test "${{DEER_FLOW_ROOT:-}}" = "$PROJECT_ROOT"; }}
|
||||
unset DEER_FLOW_ROOT
|
||||
{docker_command}
|
||||
"""
|
||||
subprocess.check_call([BASH_EXECUTABLE, "-lc", command])
|
||||
|
||||
@ -282,6 +282,12 @@ start() {
|
||||
# View Docker development logs
|
||||
logs() {
|
||||
local service=""
|
||||
|
||||
# DEER_FLOW_ROOT is referenced in docker-compose-dev.yaml; set it before
|
||||
# reading logs so Compose does not resolve mounted paths from an empty root.
|
||||
if [ -z "$DEER_FLOW_ROOT" ]; then
|
||||
export DEER_FLOW_ROOT="$PROJECT_ROOT"
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
--frontend)
|
||||
@ -333,6 +339,11 @@ stop() {
|
||||
|
||||
# Restart Docker development environment
|
||||
restart() {
|
||||
# DEER_FLOW_ROOT is referenced in docker-compose-dev.yaml; set it before
|
||||
# restarting services so Compose resolves mounted paths from this checkout.
|
||||
if [ -z "$DEER_FLOW_ROOT" ]; then
|
||||
export DEER_FLOW_ROOT="$PROJECT_ROOT"
|
||||
fi
|
||||
echo "========================================"
|
||||
echo " Restarting DeerFlow Docker Services"
|
||||
echo "========================================"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user