docker / docker/buildx

Optimize internal ListWorkers calls

Open
#2,474 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/buildkit help wanted kind/enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.