fermyon / spin

Spin is the open source developer tool for building and running serverless applications powered by WebAssembly.
https://developer.fermyon.com/spin
Apache License 2.0
5.47k stars 255 forks source link

Support wasi-config #2868

Closed kate-goldenring closed 3 weeks ago

kate-goldenring commented 1 month ago

WASI is moving wasi-config to phase 3 soon. We should consider moving from the spin variables interface to WASI config.

The main diff is the need to add support for get-all

Spin 3.0 may be a good opportunity to make this switch

kate-goldenring commented 1 month ago

I did a quick check on implementation feasibility of get-all for our current providers:

lann commented 1 month ago

get-all isn't a huge problem for Spin because all variables must be declared in the manifest, so its really just a get-many, which can itself be implemented in terms of plain get if needed.

kate-goldenring commented 1 month ago

@lann your point makes me think that the WASI config interface may want to rename that function. It defines get-all as getting the set of KV pairs:

    /// Gets a list of configuration key-value pairs of type `string`.
    /// 
    /// If an error occurs, an `Err(error)` is returned.
    get-all: func() -> result<list<tuple<string, string>>, error>;