proxy-wasm-rust-sdk icon indicating copy to clipboard operation
proxy-wasm-rust-sdk copied to clipboard

Is this ready for use with Envoy?

Open antweiss opened this issue 5 years ago • 10 comments

I tried to use the WASM filters built from project examples in WASM-enabled Envoy but got: "WASM missing malloc/free" Is this ready to play with? Should the examples work? Do they require a special Envoy build?

antweiss avatar Apr 11 '20 17:04 antweiss

@PiotrSikora I'd love to get an answer to this. Thanks a bunch in advance!

antweiss avatar Apr 12 '20 17:04 antweiss

@antweiss I hit the same issue with missing malloc/free. Are you using wasme deploy envoy to test locally by any chance?

If so, I think the default envoy docker image it uses (quay.io/solo-io/gloo-envoy-wasm-wrapper:1.3.5) uses an outdated ABI not supported by this SDK (at least I think that's what's happening).

It works fine with Istio's version of Envoy, like so:

wasme deploy envoy <image-name> --envoy-image=istio/proxyv2:1.5.1

I initially got around the malloc/free problem by exporting a stub free function, but then it failed calling proxy_on_configure anyway, saying it's unreachable.

charypar avatar Apr 13 '20 13:04 charypar

@charypar Thanks a lot for this! Yes - the malloc/free issue comes from Gloo version of Envoy. I also tried with a self-built Wasm-enabled Envoy binary - and got Failed to load WASM module due to a missing import: env.proxy_get_configuration So I suppose this does require Istio-provided Envoy. Will try this now.

antweiss avatar Apr 13 '20 13:04 antweiss

@charypar you were right - works like charm :) thanks again!

antweiss avatar Apr 13 '20 14:04 antweiss

Described my experience writing a filter using Rust sdk here: https://antweiss.com/blog/extending-envoy-with-wasm-and-rust/ Thanks @PiotrSikora and @charypar

antweiss avatar Apr 17 '20 22:04 antweiss

Fun, I did the same thing here @antweiss: https://blog.red-badger.com/extending-istio-with-rust-and-webassembly, just took me longer to get it published 😄

charypar avatar Apr 20 '20 16:04 charypar

same problem here, I solved by using proxyv2:1.5.1 I could not make it running on Mac OS btw. With Ubuntu it works.

Gsantomaggio avatar Jan 11 '21 12:01 Gsantomaggio

Envoy 1.7 is out!!! and it supports wasm. I don't have this problem anymore I think we can close the issue @PiotrSikora

Gsantomaggio avatar Jan 28 '21 08:01 Gsantomaggio

Thanks, I'm glad that everything works for you!

I'll keep the bug open as a reminder to put a list of compatible host environments in the documentation that I'm working on.

PiotrSikora avatar Jan 28 '21 13:01 PiotrSikora

Is there any typescript examples?

playground avatar Nov 20 '21 13:11 playground