Repository navigation
ORAS Client for Pony and Ponyup Integration #401
SeanTAllen
started this conversation in
Research
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This is a pretty significant undertaking with two distinct pieces: the ORAS client library itself, and the ponyup integration. Here's what each involves.
ORAS Client Library
ORAS is built on the OCI Distribution Spec, which is an HTTP API. The core operations ponyup would need are pull-side only — push would be handled by CI.
HTTP API surface to implement
WWW-Authenticateheader pointing to a token endpoint. You request a token (anonymous for public repos), then retry withAuthorization: Bearer <token>. This is the fiddliest part — every registry has slightly different behavior around token scopes and expiry.GET /v2/<name>/tags/list— needed for version/channel resolution (replaces Cloudsmith queries)GET /v2/<name>/manifests/<reference>— returns either an Image Index (multi-platform) or an Image Manifest. Need to send the rightAcceptheaders.GET /v2/<name>/blobs/<digest>— the actual artifact bytes. Registries often return 307 redirects to CDN URLs.Types to model
(mediaType, digest, size, annotations)— the universal building block(os, architecture). This is how multi-platform works — you resolve the current platform to the right child manifest.application/vnd.unknown.layer.v1+tar+gzipor something project-specific)Crypto dependency
OCI digests are
sha256:<hex>. Every blob and manifest must be verified against its digest after download. Pony stdlib doesn't have SHA256, but since ponyup already links OpenSSL, you could FFI toEVP_Digestor theSHA256()convenience function. Alternatively, this could be a standaloneponylang/cryptoor similar lib.Existing building blocks in Pony ecosystem
courier— HTTP client (already a ponyup dep)json— manifest/response parsingWhat doesn't exist and would need to be built from scratch
Ponyup Integration
What changes
Cloudsmithprimitive gets replaced (or supplemented) by an OCI registry backend(CPU, OS, Distro)to OCI's(os, architecture)is straightforward for os/arch but distro variants would need to go in annotations or tag conventionsWhat stays the same
Ponyupactor orchestration shape (query → download → verify → extract → update lockfile)CI/infrastructure side (not Pony code, but required)
orasCLI ordocker pushequivalent.Sizing
The ORAS client library is the bulk of the work. The OCI Distribution Spec is well-documented but has enough registry-specific quirks (especially around auth) that testing against real registries matters. The manifest/type model is straightforward. The digest verification needs the SHA256 FFI work.
The library is a medium-sized project and the ponyup integration is smaller — mostly swapping out the Cloudsmith backend while keeping the same overall flow.
The biggest open question is probably where the SHA256 implementation lives — inline FFI in the ORAS lib, or a separate reusable crypto package.
All reactions