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
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ def generate_compose(
main_service: dict[str, Any] = {
"image": docker_image,
"working_dir": container_workdir,
# Run as root. Harbor's codex runtime pre-creates root-owned
# /logs/agent and $CODEX_HOME during setup, then runs the agent as the
# image's default USER. dab-agent:latest ships USER exedev (non-root),
# so the agent cannot write those dirs and codex aborts with
# "Permission denied (os error 13)". ade-bench's images run as root and
# never hit this; pin main to root to match.
"user": "0:0",
"networks": ["dab-net"] if networks_used else [],
}
if main_file_volumes:
Expand Down
16 changes: 16 additions & 0 deletions packages/razorback-plugin-dab/tests/unit/test_compose_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,22 @@ def test_sqlite_does_not_spawn_service(tmp_path: Path):
assert "dab-sqlite" not in compose["services"]


def test_main_service_runs_as_root(tmp_path: Path):
# The codex runtime's setup (run as root) pre-creates root-owned
# /logs/agent and $CODEX_HOME, then harbor runs the agent as the image's
# default USER. dab-agent:latest is USER exedev (non-root), so the agent
# cannot write those dirs -> codex aborts with "Permission denied
# (os error 13)". Pin the main service to root so it can write them,
# matching the root images ade-bench runs successfully.
Comment on lines +68 to +72
compose_text = generate_compose(
db_config=_BOOKREVIEW_LIKE,
dataset_name="bookreview",
data_root=tmp_path,
)
compose = yaml.safe_load(compose_text)
assert compose["services"]["main"]["user"] == "0:0"


def test_dab_net_declared(tmp_path: Path):
compose_text = generate_compose(
db_config=_BOOKREVIEW_LIKE,
Expand Down