bytecodealliance / wasm-pkg-tools

Apache License 2.0
21 stars 9 forks source link

Can't make fetch happen #32

Open itowlson opened 2 months ago

itowlson commented 2 months ago

I have a registry domain with the following configuration (I don't know if this matters but so you know):

{
    "ociRegistry": "ghcr.io",
    "ociNamespacePrefix": "itowlson/wasm-pkg/"
}

I pushed a Wasm component file under this prefix using the recommended ORAS incantation:

oras push "ghcr.io/itowlson/wasm-pkg/component/ccspintest:0.0.1" ../ccspintest/target/wasm32-wasi/release/ccspintest.wasm:application/wasm

I was able to list versions via wasm-pkg-loader:

$ cargo run --bin wasm-pkg-loader -- component:ccspintest show
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.13s
     Running `target/debug/wasm-pkg-loader 'component:ccspintest' show`
Package: component:ccspintest
Versions:
  0.0.1

But I got an error when I tried to fetch:

$ cargo run --bin wasm-pkg-loader -- component:ccspintest fetch
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.09s
     Running `target/debug/wasm-pkg-loader 'component:ccspintest' fetch`
No version specified; looking up latest release...
Fetching release details for component:ccspintest@0.0.1...
Error: error getting release details

Caused by:
    0: Warg error: Wasm components must have a config of type application/vnd.wasm.config.v0+json
    1: Wasm components must have a config of type application/vnd.wasm.config.v0+json

Is my scenario supported? I realise things are in flux at the moment - do I need to wait for #31 which will set things up correctly? Thanks!

thomastaylor312 commented 1 month ago

@itowlson Yeah, right now the loader uses the new OCI spec. I am working on the pusher part right now (have to rebase on some things and finish a refactor). You can use the oci-wasm crate if you want to push manually in the meantime.

I think you can also use ORAS to manually set the proper config type and media type for your component (application/wasm) if you'd like to do that. The config would be empty, but that is fine