Skip to content

fix: update buildkit client image and add oci-mediatypes to cache export#124

Merged
vigneshrajsb merged 1 commit intomainfrom
fix/buildkit-perf-and-stability
Mar 10, 2026
Merged

fix: update buildkit client image and add oci-mediatypes to cache export#124
vigneshrajsb merged 1 commit intomainfrom
fix/buildkit-perf-and-stability

Conversation

@vigneshrajsb
Copy link
Contributor

Problem

Three root causes were identified in the BuildKit-based native build pipeline:

  1. gRPC GOAWAY errors (client/server version mismatch) — The buildctl client image was pinned to moby/buildkit:v0.12.0 while the BuildKit daemon running in the cluster is on a significantly newer version. gRPC GOAWAY frames are sent by the server when the client is too old to communicate correctly, causing builds to fail mid-stream.

  2. 30s cache manifest import delays — Without oci-mediatypes=true on --export-cache, the cache manifest is written in Docker schema v2 format. On import, the registry returns a non-OCI manifest, which triggers a slow fallback path in BuildKit before it can locate and use the cached layers. This adds a consistent ~30s penalty to every build.

  3. Stale client preventing future BuildKit upgrades — Keeping the client image at v0.12.0 makes it increasingly difficult to adopt new BuildKit daemon features or upgrade the daemon without breaking the client.

Changes

  • src/server/lib/nativeBuild/engines.ts
    • Upgraded buildctl client image from moby/buildkit:v0.12.0 to moby/buildkit:v0.21.0 to align client and server versions and eliminate gRPC GOAWAY errors.
    • Added oci-mediatypes=true to the --export-cache flag so cache manifests are written in OCI format, removing the 30s fallback delay on cache import.

Test plan

  • Trigger a native build and confirm no gRPC GOAWAY errors in build logs
  • Confirm cache import completes in under 5s (previously ~30s) on a warm cache build
  • Confirm cache export completes successfully and produces an OCI-format manifest in the registry

… to cache export

Upgrade buildctl client image from moby/buildkit:v0.12.0 to v0.21.0 to
resolve gRPC GOAWAY errors caused by client/server version mismatch when
the BuildKit daemon running in the cluster is on a newer version.

Add oci-mediatypes=true to the --export-cache flag to fix 30s fallback
delays during cache manifest import. Without this flag, the registry
returns a non-OCI manifest on import, triggering a slow fallback path in
BuildKit before it can use the cached layers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vigneshrajsb vigneshrajsb requested a review from a team as a code owner March 9, 2026 18:36
@vigneshrajsb vigneshrajsb merged commit 17d7ad7 into main Mar 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants