spin icon indicating copy to clipboard operation
spin copied to clipboard

Proposal: "Manifest-less" Single Component Apps

Open lann opened this issue 2 months ago • 2 comments

Some simple apps don't require any meaningful configuration in their manifests beyond a single input component, e.g.:

  • No (non-trivial) trigger config (route = "/...")
  • No WASI config: files, environment (could be WASI-Virted)
  • No Spin-specific component config: allowed_outbound_hosts, key_value_stores, etc.

spin up could synthesize a manifest (or locked app, directly) for this sort of "manifest-less app", giving a similar/somewhat-compatible experience to wasmtime serve.

In addition to providing a nice lightweight path to running this sort of simple app, this could serve as a base for future features:

  • Generate a spin.toml, either interactively or with TODO fill-in-the-blanks for required config
  • Interactively virtualize dependencies

This would also allow us to support the proposed "WASI OCI Design"

lann avatar Apr 29 '24 14:04 lann

I really like this idea of starting with the simple use case, so I'm in favor of targeting distributing this using the new OCI design.

From talking about this with a few people in the context of the OCI design, it looks like the design for distributing a multi-Spin-component application leans in the direction of a root Wasm component that embeds the referenced components. Now, this design is a bit out as far as I can tell (referencing an embedded core module or component by content digest and reassembling the composed component is not possible right now), and we don't have a prototype for distributing files using WASI-Virt.

That being said, I'm wondering if we can take this prototype one step further, and embed the application metadata for this one-component approach in a custom section? This would set the precedent for how to distribute Spin application metadata as part of a component in the future as well; Then, we can ideally update this with a solution for files.

radu-matei avatar Apr 30 '24 09:04 radu-matei

I'm wondering if we can take this prototype one step further, and embed the application metadata for this one-component approach in a custom section?

We probably can, but that would expand the scope from "@itowlson already did it" to "needs more thought". :slightly_smiling_face:

lann avatar Apr 30 '24 13:04 lann