Skip to content

Hold many repositories in a project's registry - #1611

Open
epompeii wants to merge 1 commit into
develfrom
u/ep/fixtures/repos
Open

epompeii wants to merge 1 commit into
develfrom
u/ep/fixtures/repos

Conversation

@epompeii

@epompeii epompeii commented Dec 3, 2026

Copy link
Copy Markdown
Member

A project's registry now holds many repositories: registry.bencher.dev/<project>/<name>:<tag> and <project>/<name>@<digest>, beside the project's own repository, <project>:<tag>, which keeps its meaning.

bencher run --image my-project/client:pr-42 resolves the tag in repository client of my-project. The job config still names the project and the digest, so a runner pulls exactly as before.

How

  • Routes: every /v2/<name>/... path is served by 1 wildcard route per method, and the handler parses the repository and the endpoint itself. Dropshot cannot hold a literal and a variable segment at the same position. <name> is <project> or <project>/<name>, where the second part is 1 OCI path component. A deeper path is refused with NAME_INVALID. Every refusal keeps the OCI error body.
  • Storage: blobs, manifests, and referrers stay content addressed per project. Tags are per repository, and a manifest push writes a link that records the repository's hold on the digest. Every key that existed before is unchanged. A named repository's keys are all under {project}/repositories/<name>/, which no other key uses.
  • Delete:
    • A delete by tag removes that tag only.
    • A delete by digest removes the asking repository's link and its tags for that digest. The manifest itself is deleted only when no repository of the project still holds it by a link or a tag.
    • A failed tag delete fails the delete, so the image never answers 202 and still pulls by that tag.
  • Authorization:
    • A token's repository is checked by its project: a token for any repository of a project is valid for every repository of that project, and never for another project.
    • Every pull, push, and delete with a user token checks the user's permission on the project, on the same terms as the start of a push. A token lives until it expires, and in that time its user can lose a role.
    • Runner pull tokens and project keys keep their own checks.
  • OpenAPI: the registry's routes, /v2 and /v0/auth/oci/token, are unpublished. The OCI distribution spec is their contract, and a wildcard route cannot be published.

Tests

  • Through the in-process registry:
    • Push and pull in 2 named repositories, with the same tag in each pointing at different images.
    • A shared image held by 2 repositories survives a delete through 1 of them.
    • A manifest stored before this change (tags, no link) is deleted as before.
    • A token for another project is refused.
    • A token signed directly for another project's repository is refused on every endpoint.
    • A project leader, a viewer, and a user on an unclaimed project each get the access their role gives.
    • Repositories named like the reserved key segments work.
  • Elsewhere: a job with a named image stores the right digest. A storage test makes a tag delete fail. A test reads the served spec.
  • The OCI conformance suite passes against both <project> and <project>/<name>.

A project's registry holds its own repository and any number of named
repositories, as <project>/<name>. Blobs and manifests stay shared within
the project, tags are per repository, and a manifest is deleted only when
no repository of the project still holds it.
@bencher-cloud

bencher-cloud Bot commented Dec 3, 2026

Copy link
Copy Markdown

🐰 Bencher Report

ProjectBencher
Branchu/ep/fixtures/repos
Testbedintel-v1
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
Adapter::Json📈 view plot
🚷 view threshold
5.31 µs
(+1.44%)Baseline: 5.23 µs
5.52 µs
(96.04%)
Adapter::Magic (JSON)📈 view plot
🚷 view threshold
5.16 µs
(+1.73%)Baseline: 5.07 µs
5.39 µs
(95.76%)
Adapter::Magic (Rust)📈 view plot
🚷 view threshold
7.63 µs
(-69.91%)Baseline: 25.37 µs
43.94 µs
(17.37%)
Adapter::Rust📈 view plot
🚷 view threshold
4.58 µs
(+1.85%)Baseline: 4.49 µs
4.77 µs
(95.85%)
Adapter::RustBench📈 view plot
🚷 view threshold
4.53 µs
(+1.12%)Baseline: 4.48 µs
4.75 µs
(95.47%)
🐰 View full continuous benchmarking report in Bencher

@epompeii
epompeii marked this pull request as ready for review December 3, 2026 12:46

This branch has not been deployed

No deployments
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