feat: OCI registry support via cocoon-common (select with OCI_REGISTRY)#26
Merged
Conversation
…nterface Decouple vk from epoch's concrete *registryclient.Client so a standard-OCI backend can drop in (issue #25). The new snapshots.Registry composes epoch's snapshot Uploader/Downloader plus BaseURL and DeleteManifest; Pusher, Puller, blobReader and Provider hold the interface. No behavior change — main.go still wires the concrete client, which satisfies it.
…istry) OCIRegistry implements snapshots.Registry against any OCI Distribution registry (e.g. Artifact Registry) using standard upload sessions + keychain auth, so vk can drop epoch's bespoke server (issue #25). streamLayer pushes a multi-GB blob without buffering; rawManifest carries the custom artifactType bytes. Round-trip tested against an in-memory registry.
…rom local import
ensureRunImage now imports a cloud-image artifact and returns a local ref
(repo:tag) instead of rewriting to <base>/dl/{repo}/{tag}, so booting works
against any standard OCI registry, not just epoch's server (issue #25).
Removes canonicalCloudImgURL and BaseURL (its only user) from the Registry
interface and OCIRegistry.
buildRegistry returns a standard-OCI client (OCI_REGISTRY set) or epoch's client, so vk can run against Artifact Registry without epoch (issue #25). The OCI keychain resolves GCP ADC (google.Keychain) then docker config, so GCE nodes authenticate to AR with no bundled credential helper.
PullCloudImage, EnsureCloudImage and their fetchCloudImageManifest helper had no callers once the boot path settled on EnsureCloudImageFromRaw; drop them plus the now-unused io/manifest imports, and repoint two stale comments.
Drop vk's local OCIRegistry + Registry interface and the epoch/{snapshot,
cloudimg,manifest,utils} imports in favor of cocoon-common (oci.Registry
backend + the shared snapshot/cloudimg/manifest packages). epoch is now
imported only for registryclient, the transitional backend kept until the
data migration completes. Neutralizes stale epoch references in comments,
metrics, events, and the README.
vk now imports zero epoch: buildRegistry requires OCI_REGISTRY and always builds a cocoon-common oci client (GCP ADC then docker config). Removes the registryclient fallback, EPOCH_URL/TOKEN, and the dual-backend log. Tests use a fakeRegistry stub; the epoch dependency is gone from go.mod. Bumps cocoon-common to the HasBlob/ImportImage rename.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves vk's snapshot/cloud-image registry code to cocoon-common and makes vk
OCI-only — it now imports zero epoch. Advances #25.
Depends on cocoon-common#4 (shared
oci+ snapshot/cloudimg/manifest packages). Pinned viago get cocoon-common@<sha>; moves to a tag once #4 merges.What changed
/dl/(cloud images boot from a local import).oci.Registry+ the shared bridge packages); remove vk's local OCI client + allepoch/*imports.buildRegistrynow requiresOCI_REGISTRY. epoch is gone fromgo.mod.Deploy note
OCI_REGISTRYis now required — deploy after the epoch→AR migration completes and the env is set.Quality
Each commit:
build(go.work+GOWORK=off) /vet/test/lint(both GOOS, 0) green,/code+/simplify,go test -raceclean. No trailers.