Skip to content

feat: variant-proxy — server-computed variant index (Phase B) - #6

Merged
achimnol merged 1 commit into
topic/pullfrom
topic/proxy
Aug 9, 2026
Merged

feat: variant-proxy — server-computed variant index (Phase B)#6
achimnol merged 1 commit into
topic/pullfrom
topic/proxy

Conversation

@achimnol

Copy link
Copy Markdown
Member

Summary

Stacked PR 6/7 (base: #5). Delivers the "registry provides the variant index from image labels" requirement as a deployable component:

  • cmd/variant-proxy: httputil.ReverseProxy in front of any V2 registry (--upstream, --listen, --upstream-https). Intercepts GET|HEAD /v2/<name>/_variants/<version> and serves an index computed on demand via the shared BuildIndex tag-scan (label/tag drift and unlabeled tags logged and skipped); 404 in the OCI error envelope when no variant tags exist; everything else — including docker push/pull traffic — passes through unchanged.
  • Client: FetchIndex now queries the _variants extension endpoint first, falling back to the -variants tag artifact, so the same docker variant pull works against Phase A registries and the proxy transparently. The endpoint contract is deliberately implementation-agnostic — a future native registry extension is a drop-in replacement.

Testing

e2e extended and passing: variants published only via plain docker push through the proxy (script asserts no -variants tag exists upstream), endpoint serves the computed index, unknown version → 404, and variant pull through the proxy selects cu128 (GPU profile) / null (CPU profile) with zero client-side index maintenance. Unit tests and prior e2e sections unchanged-green.

https://claude.ai/code/session_01D383U8kkQkJc1yzyC5H5Nk

cmd/variant-proxy is a stateless reverse proxy in front of any V2
registry that serves GET /v2/<name>/_variants/<version> by running the
same BuildIndex tag-scan used by `index update`, so plain `docker push`
of labeled images is sufficient — no client-side index maintenance.
Everything else passes through unchanged (docker push/pull work
through the proxy). Errors use the OCI distribution error envelope;
the served index advertises the proxy authority as its repository.

Client side: FetchIndex now tries the _variants extension endpoint
first and falls back to the "<version>-variants" tag artifact, with a
size cap on the accepted document.

e2e: new proxy section — variants pushed only via plain docker push
through the proxy (asserting no index artifact tag exists upstream),
endpoint content and 404 behavior, and variant pull via the proxy
selecting cu128/null per mocked hardware.

Claude-Session: https://claude.ai/code/session_01D383U8kkQkJc1yzyC5H5Nk
@achimnol
achimnol merged commit 5b051e7 into main Aug 9, 2026
2 checks 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.

1 participant