-
Notifications
You must be signed in to change notification settings - Fork 174
Open
Labels
Description
Problem
The current docker build telemetry in openhands-agent-server/openhands/agent_server/docker/build.py is extracted by regex-parsing BuildKit plain-text progress output from docker buildx build. That works, but it is inherently tied to human-readable progress strings like exporting cache to, pushing layers, and exporting manifest, which is a fragile boundary for SDK telemetry.
Proposed change
Replace the regex-based plain-text parsing with Buildx/BuildKit’s structured outputs:
- pass
--progress=rawjsontodocker buildx build - pass
--metadata-file <tmpfile>to capture final build metadata - parse JSON-line progress events for timing/progress telemetry
- parse the metadata file for final build metadata
- remove the regex parser rather than keeping a plain-text fallback
Why
rawjsonis the machine-oriented progress mode exposed bydocker buildx build--metadata-filegives structured final result metadata- this is a cleaner and more reliable telemetry boundary than parsing terminal-oriented text output
Scope
- update
build_with_telemetry()to requestrawjsonprogress and a metadata file - replace
_parse_buildkit_telemetry()with JSON-based parsing - thread any useful metadata-file fields into the telemetry/result model where appropriate
- update tests to validate JSON progress parsing instead of regex matching plain-text stderr
Acceptance criteria
- no regex parsing of BuildKit plain-text progress remains in the telemetry path
- telemetry still includes the currently useful phase timings/counts where available
- final build metadata is captured from
--metadata-file - tests cover successful builds and failed builds under the new parsing path
References
- Docker
buildx buildprogress modes, includingrawjson: https://docs.docker.com/reference/cli/docker/buildx/build/ - Docker
buildx build --metadata-file: https://docs.docker.com/reference/cli/docker/buildx/build/
Reactions are currently unavailable