-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds sample for embedded wasm usage #122
Conversation
Note: as dapr v1.10 isn't out, you have to do this to get things working: $ cd dapr
$ make
$ cp -p dist/*/release/* $HOME/.dapr/bin/ |
@codefromthecrypt - Can you update the README here https://github.com/dapr/samples#readme which is an index of the samples in the repo |
@msfussell done. thanks! |
4c135ea
to
a87b224
Compare
@daixiang0 mind reviewing/testing for merge? it would be nice to promote this with 1.10 |
This introduces users to the idea that WebAssembly is embedded in the sidecar, by actually serving a request that way. This will be more interesting when we add file watch support to the wasm middleware, which would allow people to reload wasm without restarting the process. Signed-off-by: Adrian Cole <[email protected]>
a87b224
to
241b0f5
Compare
@yaron2 I addressed @daixiang0 feedback, and also tested this, fixing a small CLI arg drift (components-path -> resources-path). Can we get this in? |
In other words, it does not require a separate app to use. | ||
|
||
To add custom middleware, you need a wasm binary (file with a `.wasm` extension), | ||
compatible with [http-wasm](https://http-wasm.io/) middleware. You can re-use an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here, we say you can re-use or compile.. so that beginners don't feel they need to compile each time. good suggestion by @daixiang0
``` | ||
ℹ️ Starting Dapr with id embedded. HTTP Port: 3500. gRPC Port: 56067 | ||
... | ||
INFO[0000] enabled middleware.http.wasm/http middleware app_id=embedded instance=MacBook-Pro.local scope=dapr.runtime type=log ver=1.10.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as you can see by my updated logs, things work out-of-box 💯
|
||
go 1.19 | ||
|
||
require github.com/http-wasm/http-wasm-guest-tinygo v0.1.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rebuilt this today with latest tinygo. all good
@msfussell @yaron2 is there something that I can do to help on this front, so this gets merged? |
thanks for the help! |
This introduces users to the idea that WebAssembly is embedded in the sidecar, by actually serving a request that way.
This will be more interesting when we add file watch support to the wasm middleware, which would allow people to reload wasm without restarting the process. dapr/components-contrib#2267