Commit Graph

9 Commits

Author SHA1 Message Date
Joel Dice 2a250ae751
implement component support (#1321)
* 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>
2023-03-27 12:11:30 -06:00
Rajat Jindal a15fcfac24
add e2e tests for php, swift, oci, longevity
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
2023-03-03 13:00:40 +05:30
Kate Goldenring b0f6d64f0e
Add key/value end to end test (#1219)
* 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>
2023-03-03 09:49:13 +05:30
Rajat Jindal fd8404a804
support redis trigger tests
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>
2023-02-23 12:39:34 +05:30
Vaughn Dice 7330584d27
ref(*): further go/tinygo updates
Signed-off-by: Vaughn Dice <vaughn.dice@fermyon.com>
2023-02-17 10:57:16 -07:00
Rajat Jindal f3ab03d2e4
add dockerfile for aarch64
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
2023-02-03 18:54:31 +05:30
Rajat Jindal cf108c52ef
use v1.66.x of rust
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
2023-02-03 18:54:29 +05:30
Rajat Jindal 61bcd4d79f
put new e2e tests behind feature new-e2e-tests
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
2023-02-03 18:54:28 +05:30
Rajat Jindal d2b2ab4ad5
add dockerfile/docker-compose file for better UX
Signed-off-by: Rajat Jindal <rajatjindal83@gmail.com>
2023-02-03 18:54:12 +05:30