Skip to content

OCI configuration updates to support containerd #1857

@jsturtevant

Description

@jsturtevant

Based on the issue created in runwasi containerd/runwasi#108 and the proposal to support WASI OCI artifacts in Containerd spins current OCI format won't work with out some minor modifications.

The approach outlined in the doc is to add "artifactType": "application/vnd.bytecodealliance.component.v1+wasm" and use config.mediaType as application/vnd.oci.image.config.v1+json. This allows for runtimes to still properly configure and launch the wasm applications (see containerd/runwasi#147 as an example).

This means the current spin configuration of application/vnd.fermyon.spin.application.v1+config would need to move to be a layer in the OCI artifact and artifact type would be specified.

An example of the image manifest might look like:

regctl manifest get localhost:5000/spin:oci
Name:                                localhost:5000/spin:oci
MediaType:                           application/vnd.oci.image.manifest.v1+json
ArtifactType:                        application/vnd.bytecodealliance.module.v1+wasm
Digest:                              sha256:c74cb8cb19ee2632b4ae825c71780f48e3424cae6fc1e865cb34b1f03da35c58
Total Size:                          839.916kB

Config:
  Digest:                            sha256:30beeddd35f0d22d3c068f29fc6fb41bb9461807e427d3ebdf34d3b922704a4b
  MediaType:                         application/vnd.oci.image.config.v1+json
  Size:                              136B

Layers:

  Digest:                            sha256:499237ead273693b70fb4110b179226fe857efb6da0865fd8f8c98437f8c4467
  MediaType:                         application/vnd.bytecodealliance.wasm.component.layer.v0+wasm
  Size:                              146.992kB

  Digest:                            sha256:270f42cf04ef6dd5b5d223d14bf9a6c703f1f0df7dded6db897997006fa2ca26
  MediaType:                         application/vnd.bytecodealliance.wasm.component.layer.v0+wasm
  Size:                              692.031kB

  Digest:                            sha256:96485f14df303540d3f687be5b663a629a150c96e27697e27b4d3d75f31910b7
  MediaType:                         application/vnd.fermyon.spin.application.v1+config
  Size:                              893B

I have a prototype using this approach at deislabs/containerd-wasm-shims#164. Happy to answer any questions and feedback is appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions