Skip to content

Store the container registry through object_store - #1043

Open
epompeii wants to merge 1 commit into
u/ep/s3-r2/server-backupfrom
u/ep/s3-r2/registry-storage
Open

epompeii wants to merge 1 commit into
u/ep/s3-r2/server-backupfrom
u/ep/s3-r2/registry-storage

Conversation

@epompeii

Copy link
Copy Markdown
Member

The container registry storage crate carried two hand-written backends: one on the AWS SDK, addressed by an S3 access point ARN, and one on the local filesystem. This replaces both with one implementation over the object_store crate, so any S3-compatible endpoint works through a bucket, an endpoint, and a region, and the local backend is object_store's filesystem store.

Changes

  • One OciStorage over Arc<dyn ObjectStore> replaces OciS3Storage and OciLocalStorage. Uploads keep their session shape (chunks as objects under _uploads/, a small state.json); completion streams the chunks through a multipart upload opened directly on the final blob key and aborts on a digest mismatch, so no temporary object and no copy.
  • The config section moves from plus.registry.data_store to plus.registry.storage with scheme: file | s3, mirroring the disaster recovery replica field for field. file takes an optional path; s3 takes bucket, path, endpoint, region (default auto), credentials, and chunk_size.
  • Stored keys and the on-disk layout are pinned byte for byte by key layout tests, with and without a prefix, including non-ASCII and # prefixes. A multipart boundary test pins reassembly across several parts.
  • An ignored live test (tests/s3_live.rs) runs the full flow against a scratch bucket from environment variables; it never runs in CI.
  • aws-sdk-s3 and aws-credential-types leave the workspace; object_store (aws, fs) and sync_wrapper arrive. The lockfile change is additions plus the AWS tree's removal, no version bumps.
  • Docs in all 9 languages describe the new section, the prefix normalization (leading, trailing, and repeated slashes dropped; characters outside A-Za-z0-9._-/ percent-encoded), and recommend a lifecycle rule that aborts incomplete multipart uploads.

Breaking changes

  • plus.registry.data_store is replaced by plus.registry.storage. A config that still carries data_store is ignored and the registry falls back to local files.
  • A configured path that began or ended with a slash, or contained a percent-encoded character, stored objects under a different key prefix in the previous release; that data must be moved to the normalized prefix. Plain prefixes are unchanged.

Last of a stack of three, on top of the plus.disaster_recovery rename and the on demand backup removal.

Replace the hand-written S3 and local filesystem backends with one
implementation over `object_store`, so any S3-compatible endpoint works
through a bucket, endpoint, and region instead of an access point ARN.
The config section becomes `plus.registry.storage` with `scheme: file |
s3`, matching the disaster recovery section. Stored keys and the local
directory layout are unchanged for a plain prefix, pinned by key layout
tests; see the config reference for slash-terminated prefixes.
@epompeii
epompeii added this pull request to stack #1042 September 18, 2026 07:13
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​object_store@​0.14.28110090100100
Addedcargo/​base64@​0.23.110010093100100

View full report

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

ProjectBencher
Branchu/ep/s3-r2/registry-storage
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.24 µs
(+8.23%)Baseline: 4.84 µs
5.88 µs
(89.17%)
Adapter::Magic (JSON)📈 view plot
🚷 view threshold
5.06 µs
(+7.74%)Baseline: 4.69 µs
5.59 µs
(90.38%)
Adapter::Magic (Rust)📈 view plot
🚷 view threshold
28.31 µs
(+7.25%)Baseline: 26.40 µs
29.86 µs
(94.81%)
Adapter::Rust📈 view plot
🚷 view threshold
4.73 µs
(+22.10%)Baseline: 3.87 µs
6.00 µs
(78.78%)
Adapter::RustBench📈 view plot
🚷 view threshold
4.70 µs
(+21.64%)Baseline: 3.87 µs
5.98 µs
(78.64%)
🐰 View full continuous benchmarking report in Bencher

@epompeii
epompeii marked this pull request as ready for review September 18, 2026 07:47
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