* implement component support
This updates Spin to use [the Component
Model](https://github.com/WebAssembly/component-model/tree/main/design/high-level)
natively instead of core Wasm modules (except for WAGI -- see below).
Core modules are still supported transparently via
[`spin-componentize`](https://github.com/fermyon/spin-componentize).
For now, the SDKs will continue to produce core modules (which the
developer can convert to components ahead of time via
`spin-componentize` if desired). Eventually, we'll want the SDKs to
target the Component Model directly as language toolchain support
matures. For the time being, though, we'll consider Component support
experimental.
WAGI is stuck on Preview 1 and modules because there's no reliable way
to wrap an arbitrary Preview 1 command in a component -- the Preview 1
-> 2 adapter only works with modules that either export
`canonical_abi_realloc` (e.g. native Spin apps) or use a recent
version of `wasi-sdk`, which contains patches to allow the adapter to
safely allocate memory via `memory.grow`.
In theory, someone could build a WAGI app using a new-enough version
of `wasi-sdk` and wrap it in a component using the adapter, but that
wouldn't add any value beyond leaving it as a module, and any
toolchain capable of natively producing components will be capable
enough to produce native Spin apps, so we probably won't ever support
WAGI components.
Note that I've moved the `spin-abi-conformance` project from this repo
to `spin-componentize` since it seems more relevant (and more likely
to be kept up-to-date) there. We can move it back later if that
changes.
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
add `rustup target add wasm32-unknown-unknown` to CI
This is needed to build `spin-componentize`.
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
update `spin-componentize` dep
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
install `rust-wasm` deps for lint job
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
update to Rust 1.68 to help CI build component adapter
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
update `spin-componentize` dep (again)
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
update Dockerfiles so they can build `spin-componentize`
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
switch back to fermyon/wit-bindgen-backport repo
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
* change `spin_core::Wasi` from a struct to an enum
This helps us detect and raise errors earlier if code tries to
initialize a Preview 1 store in a way only supported by Preview 2, or
vice versa. The duplication is still pretty ugly, but will go away
once the upstream WASI implementations are merged together.
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
* use newfangled refutable-let-or-diverge syntax
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
---------
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
* Add key-value end to end test
Signed-off-by: Kate Goldenring <kate.goldenring@fermyon.com>
* Share key-value test across integration and e2e tests
Signed-off-by: Kate Goldenring <kate.goldenring@fermyon.com>
---------
Signed-off-by: Kate Goldenring <kate.goldenring@fermyon.com>
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
add logs_stream to app instance
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
use hyper http client in assertions and provide logs stream to assert functions
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
add support for diff trigger type
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
add redis trigger tests
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>