Skip to content

packager: set OCI layout metadata for direct registry push#748

Draft
sozercan wants to merge 8 commits intomainfrom
oci-layout-passthrough
Draft

packager: set OCI layout metadata for direct registry push#748
sozercan wants to merge 8 commits intomainfrom
oci-layout-passthrough

Conversation

@sozercan
Copy link
Copy Markdown
Member

@sozercan sozercan commented Mar 10, 2026

Requires moby/buildkit#6574

Summary

  • Set containerimage.oci-layout metadata key on BuildKit results from BuildModelpack() and BuildGeneric() (excluding files mode)
  • This signals to a BuildKit image exporter with OCI layout passthrough support that the result contains a pre-built OCI layout and should be pushed as-is
  • Preserves custom media types, annotations, artifactType, and full OCI artifact structure through the push

Dependencies

How to test

# Create a buildx builder using the custom buildkit image
docker buildx create --name oci-test \
  --driver docker-container \
  --driver-opt image=sozercan/buildkit:oci-layout-passthrough

# Build and push a modelpack directly
docker buildx build \
  --builder oci-test \
  --build-arg BUILDKIT_SYNTAX=<aikit-frontend> \
  --target packager/modelpack \
  --build-arg source=huggingface://Qwen/Qwen3-0.6B \
  --build-arg name=qwen3 \
  --provenance=false --sbom=false \
  --output "type=image,name=docker.io/<user>/qwen3:0.6b,push=true" .

Verified

  • Pushed docker.io/sozercan/qwen3:0.6b-test — manifest matches docker.io/sozercan/qwen3:0.6b exactly (flat manifest, same media types, same annotations)

Set the "containerimage.oci-layout" metadata key on BuildKit results
from BuildModelpack() and BuildGeneric() (excluding files mode). This
signals to a BuildKit image exporter with OCI layout passthrough
support that the result contains a pre-built OCI layout and should be
pushed as-is, preserving custom media types, annotations, and artifact
structure.

This enables `--output type=image,push=true` to work directly without
external tools like oras or skopeo.

Requires: sozercan/buildkit@oci-layout-passthrough
Add output_mode=artifact build arg to the modelpack packager that
produces artifact metadata instead of an OCI layout. The metadata is
consumed by the BuildKit artifact postprocessor to enable direct
registry push via --output type=image,push=true.

Also bump LocalAI to v3.10.1 and update Go dependencies to align
with the buildkit postprocessor changes.
Take LocalAI v3.12.1 and vLLM backend support from main.
Update go.mod/go.sum to main's versions.
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.

1 participant