Skip to content

feat: relocate epoch's registry packages + add shared OCI client#4

Merged
CMGS merged 4 commits into
mainfrom
feat/registry-packages
Jul 1, 2026
Merged

feat: relocate epoch's registry packages + add shared OCI client#4
CMGS merged 4 commits into
mainfrom
feat/registry-packages

Conversation

@CMGS

@CMGS CMGS commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Makes cocoon-common the shared home for the OCI snapshot/cloud-image code so
vk and the operator can drop their dependency on the epoch module. Part of
the epoch-removal effort.

Packages

  • manifest, ociutil — leaf helpers relocated from epoch: OCI media types + artifact classification; SHA-256, blob copy/verify, ref parsing.
  • cloudimg, snapshot — the bridge packages relocated from epoch: the snapshot OCI↔tar Pusher/Stream/Uploader/Downloader and the cloud-image stream. Internal imports repointed to the common manifest/ociutil.
  • oci — NEW: a go-containerregistry-backed Registry (Uploader+Downloader+HasManifest+DeleteManifest) with keychain auth, so snapshots/cloud images live in any standard OCI registry (e.g. Artifact Registry). streamLayer pushes multi-GB blobs without buffering. HasManifest (a cheap HEAD) serves the operator's hibernate/wake existence probe.

Notes

  • The relocated packages are copied, not moved — epoch keeps its own copies until it is retired, so this PR does not touch or break epoch.
  • Both *oci.OCIRegistry and epoch's registryclient.Client satisfy oci.Registry structurally, so the epoch backend stays a drop-in during the transition.
  • Consumers switch over in follow-up PRs (vk, operator) via go get cocoon-common@<sha>.

Quality

Each commit: build / vet / test / lint (darwin + linux, 0 issues) green, plus a /code + /simplify pass with tightened comments. No trailers.

CMGS added 3 commits July 1, 2026 12:55
Relocate epoch's leaf packages into cocoon-common so vk + operator can share
them without depending on epoch: manifest (OCI media types + artifact
classification) and ociutil (SHA-256, blob copy/verify, ref parsing). epoch
keeps its own copies until it retires.
Relocate epoch's snapshot OCI<->tar bridge (Pusher/Stream/Uploader/Downloader)
and cloud-image stream into cocoon-common, imports repointed to the common
manifest/ociutil packages, so vk + operator convert artifacts without
depending on epoch.
A go-containerregistry-backed Registry (Uploader/Downloader + HasManifest +
DeleteManifest) that vk and the operator share to push/pull snapshots and
cloud images and probe/roll back manifests against any OCI registry (e.g.
Artifact Registry) with keychain auth. streamLayer pushes multi-GB blobs
without buffering.
Rename to the cocoon idiom: Uploader.BlobExists -> HasBlob (pairs with
HasManifest) and CocoonRunner.ImageImport -> ImportImage (verb-noun), across
interfaces, impls, callers, and fakes. Plus test fixes: t.Context() over
context.Background(), hoist the cloudimg-test const/var above the type, and
compare io.EOF with errors.Is.
@CMGS CMGS merged commit 3dcdfdd into main Jul 1, 2026
2 checks passed
@CMGS CMGS deleted the feat/registry-packages branch July 1, 2026 06:50
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