create_docker_workspace never reuses locally-built images (tag mismatch with DockerDevWorkspace)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
Inizia da benchmarks/utils/image_utils.py, in create_docker_workspace(), quindi confronta il relativo fallback con DockerDevWorkspace._build_image_from_base() in openhands-workspace/openhands/workspace/docker/dev_workspace.py. Esamina benchmarks/utils/build_utils.py:ensure_local_image() e il chiamante di SWE-Bench per verificare il comportamento previsto dei tag. Il lavoro è completato quando un workspace Docker locale riutilizza il tag agent_server_image dopo la build di fallback invece di eseguire una nuova build nei sei benchmark interessati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What's wrong
benchmarks/utils/image_utils.py:create_docker_workspace() pre-checks local_image_exists(agent_server_image) before falling back to building via the SDK's DockerDevWorkspace(base_image=..., target=...). But DockerDevWorkspace._build_image_from_base() (in openhands-workspace/openhands/workspace/docker/dev_workspace.py) builds via openhands.agent_server.docker.build.build(opts=BuildOptions(base_image=..., target=...)) without ever passing the agent_server_image tag. BuildOptions.image defaults to ghcr.io/openhands/agent-server (not this repo's EVAL_AGENT_SERVER_IMAGE = ghcr.io/openhands/eval-agent-server), and its tag is computed from base_tag (f"{short_sha}-{base_image_slug}") — a completely different naming scheme than whatever custom tag the calling benchmark computed.
Net effect: for every benchmark using create_docker_workspace with workspace_type=docker, if no pre-built image matches the expected tag, the fallback build tags its output under a name the next local_image_exists() check will never match — so local Docker runs always rebuild from scratch, even when an equivalent image was already built moments earlier in the same session.
Affected benchmarks
All current users of create_docker_workspace:
benchmarks/commit0/run_infer.pybenchmarks/gaia/run_infer.pybenchmarks/hybridgym_depsearch/run_infer.pybenchmarks/hybridgym_funcgen/run_infer.pybenchmarks/hybridgym_funclocalize/run_infer.pybenchmarks/hybridgym_issuelocalize/run_infer.py
Contrast with SWE-Bench
benchmarks/swebench/run_infer.py avoids this by using benchmarks/utils/build_utils.py:ensure_local_image() instead, which calls the benchmarks-side build_image() helper — that one builds and tags explicitly as target_image/custom_tag, matching what it just checked with local_image_exists().
Suggested fix
Either:
- Make
create_docker_workspace's build fallback callensure_local_image()(orbuild_image()directly) instead ofDockerDevWorkspace, so the built tag matches the pre-checked one, or - Pass
image=/tag overrides intoDockerDevWorkspace/BuildOptionsso its output lands under the caller's expectedagent_server_imagetag.
Either way, this is local workspace_type=docker dev-loop ergonomics only — it doesn't affect CI-pushed remote images (workspace_type=remote), which use remote_image_exists() + pre-built GHCR tags directly.
Context
Found while reviewing #778 (dropping commit0's forked agent-layer Dockerfile) — commit0 was going to be brought in line with SWE-Bench's ensure_local_image pattern as part of that PR, but the fix was scoped out since it's a pre-existing, repo-wide gap shared by 6 benchmarks, not something specific to commit0's build pipeline.
- Lingua principale
- Python
- Stelle
- 134
- Fork
- 97
- Merge medio
- 8g 23h
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OpenHands/benchmarks
-
SWE-bench Pro and ProgramBench reports leave out instances that errored during inferenceForse di nuovo libera @jahanvipandey22 l’ha presa 8 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 3/5 Mezza giornata Idoneità per principianti 62/100
OpenHands/benchmarks#791 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
OpenHands/benchmarks#776 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 28/100
OpenHands/benchmarks#764 · 16 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
OpenHands/benchmarks#744 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
OpenHands/benchmarks#726 ·
Tutte le issue di OpenHands/benchmarks
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
trycua/hermes-cua-spaces#17 ·
-
area:codegen backend:hip bug direction:output good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
status:waiting-for-triage type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
microsoftgraph/msgraph-sdk-python#1628 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
nautechsystems/nautilus_trader#5718 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: reme CLI crashes when the running server used a relative config pathForse già presa @nurlanmnn l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
agentscope-ai/ReMe#770 ·
I maintainer di solito rispondono entro 1 giorno