bytecodealliance / wasm-pkg-tools

Apache License 2.0
48 stars 11 forks source link

Add OCI namespace mappings to registry metadata (well-known URL) #35

Open lann opened 3 months ago

lann commented 3 months ago

Warg has a mechanism for registries to advertise their own preferred namespace->registry mappings for federation purposes. We'd like to introduce the same for OCI-based package registries.

The simplest way I see to do this immediately would be to add this mapping to the /.well-known/wasm-pkg/registry.json's "oci" config section. A future possibility - if desired - could be to publish this mapping as an OCI artifact under some reference that doesn't collide with packages.

thomastaylor312 commented 3 months ago

Like you suggested, the easiest short term thing might be to have an oci artifact at a well known name in the registry (something like registry.io/.well-known:latest).

thomastaylor312 commented 3 months ago

Did some more thinking on this and I had a follow up question: How is a registry like ghcr.io supposed to handle this? Should the well known file be at each org name that is being used as a registry or should it be done another way?

I was trying to think what would be best and didn't come to any good conclusion yet

calvinrp commented 3 months ago

The /.well-known/wasm-pkg/registry.json is intended to be hosted on different domain than the OCI registry.

For the ghcr.io case, you would have registry domain name (example.com) that hosts that .well-known JSON which specifies the OCI registry and namespace prefix and, optionally, these namespace federation mappings.

lann commented 3 months ago

We should write up instructions for serving the well-known config from a *.github.io domain.

calvinrp commented 3 months ago

We should write up instructions for serving the well-known config from a *.github.io domain

Are those paths possible on github.io?

calvinrp commented 3 months ago

Mashed the wrong button on my phone. Accidentally closed the issue. But reopened.

lann commented 3 months ago

Are those paths possible on github.io?

https://lann.github.io/.well-known/wasm-pkg/registry.json