-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add docs for Wasm Sandbox #13605
Comments
@phlax should I assign this to you? |
yep, im happy to do this |
@htuch the immediate problem i hit with this is that the im thinking the sandbox should ideally not depend on this - and if it does it would want to do the build inside a container (like for building grpc protos eg) im wondering if there is an easy way to compile the |
this seems an option https://docs.bazel.build/versions/master/bazel-container.html - but its not a small image |
i tried compiling the https://travis-ci.org/github/phlax/bazeldev/builds/736657571#L244 and then using https://travis-ci.org/github/phlax/bazeldev/builds/736662127#L1007 |
@PiotrSikora can you potentially advise on ^? Perhaps we can come up with some type of self contained example that doesn't use Bazel and just a very basic make/cmake setup? |
@phlax are you talking about building Wasm extensions? For C++ examples using standard tools (i.e. not Bazel), you can take a look at: For C++ examples using Bazel, you can take a look at extensions in Istio Proxy: For Rust examples using standard tools, you can take a look at examples in Proxy-Wasm Rust SDK: |
yep, compiling this file (https://github.com/envoyproxy/envoy/blob/master/examples/wasm/envoy_filter_http_wasm_example.cc) before running the sandbox with the compiled file i guess we need to build it in a container as we want something that will take at most 1 or 2 commands to build, and doesnt expect much from users env after thinking about it, i reckon using bazel is fine - probs better as that is how Envoy builds everything else i didnt try too hard to get the container builds above working - but probs we need to use the (huge) envoy build image, or at least a bazel build container |
For that example, you can simply build it with:
but that's a specific example within Envoy repository, and it's not how people should be developing extensions, so that's not a great base for developer documentation, IMHO. For that, see my previous comment. |
the thing is that it is just for a sandbox - ie a single page of docs with a really simple setup to get started we definitely dont want to expect that users have bazel/llvm/etc available natively (if we did, we would need to document exactly how they can do that in a multi-platform way)
yep - its a simple example to get people started running with a wasm extension - compiliing it is kinda more than we might hope to be strictly necessary |
in terms of comparisons with existing sandboxes - i think compiling the grpc protocol stubs is the closest to what we need here: |
providing a pre-compiled binary is also an option i guess |
...once #13619 is merged. |
brilliant, thankyou! |
If it's not about building Wasm extensions, but only about running them, then I think that using the existing |
i couldnt find any compiled module (with |
if i can get the build to work - this should be good - ill PR som wip sandbox docs in the next day or two |
Ah, right. I must have generated it previously and it just stuck around. Once #13619 is merged, it's one-line to build it, though. |
i tested building with the bazel and envoy-build images the envoy-build image works - so i can use that i reckon i tried again with the bazel image and got the (same) following error:
test is here - https://travis-ci.org/github/phlax/bazeldev/builds/736783158#L246 it might well be to do with how i am trying to call it - the commands are:
for the docs im thinking we can provide a download and some instructions to rebuild the module i can create something now i have it working |
I don't think you can build Envoy or Wasm extensions using Bazel's official container, since it's missing a bunch of build tools. How about using what's already provided in Envoy?
|
yep that works, it just involves a ~4GB image, which i was trying to avoid |
i think the other reason im averse to running the i think its ok for CI - but better avoided for local use, unless you understand what it is doing for the example i have created a docker-compose with the |
description
We have a sandbox to demonstrate creating a Wasm filter, but it doesnt currently have any documentation
The text was updated successfully, but these errors were encountered: