Optimize internal ListWorkers calls
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 4.5k
- Forks
- 682
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 29
Description
Atm. every client.Build call calls ListWorkers internally https://github.com/moby/buildkit/blob/v0.13.2/client/build.go#L31 . Buildx makes one such call for build node to determine its capabilities, and another per build request. Docker driver makes additional call to detect Moby snapshotter capability. While the call is fast, it is still unnecessary and could be optimized to avoid that. It also shows up in opentelemetry trace and could be confusing.
Options could be to add some internal caching in buildkit client or allow passing the workers list into Build() with some option. Avoiding the request for Docker driver likely requires update to driver interface.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in client/build.go at the internal ListWorkers call and trace how Buildx uses it for build-node capabilities and how the Docker driver checks Moby snapshotter support. Review the driver interface and OpenTelemetry traces; done means redundant ListWorkers requests are avoided without losing those capability checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- build-system, cli, devtools
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100