-
Notifications
You must be signed in to change notification settings - Fork 70
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 support for WebAssembly Micro Runtime (WAMR). #142
Conversation
@googlebot I signed it! |
@googlebot I signed it! |
@googlebot I fixed it. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@leyao-daily one of your commits has a line saying |
Okay, I will remind him. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@googlebot I fixed it. |
@googlebot I consent. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
Build and testing runtime Signed-off-by: Le Yao <[email protected]>
Signed-off-by: Le Yao <[email protected]>
Add wamr runtime to testing, passed Signed-off-by: Le Yao <[email protected]>
using a pre-release archive until passing integration Signed-off-by: liam <[email protected]>
WAMR is commom WASM c/c++ API based, implenment same as wasitime Co-authored-by: Liang He <[email protected]> Signed-off-by: Le Yao <[email protected]>
Build and testing runtime Signed-off-by: Le Yao <[email protected]>
Signed-off-by: Le Yao <[email protected]>
Co-authored-by: Liang He <[email protected]> Signed-off-by: Le Yao <[email protected]>
INFO: Analyzed 9 targets (0 packages loaded, 0 targets configured). INFO: Found 1 target and 8 test targets... INFO: Elapsed time: 4.954s, Critical Path: 3.83s INFO: 25 processes: 2 internal, 23 linux-sandbox. INFO: Build completed successfully, 25 total actions //test:context_test PASSED in 0.1s //test:exports_test PASSED in 0.1s //test:null_vm_test PASSED in 0.2s //test:runtime_test PASSED in 0.1s //test:shared_data PASSED in 0.1s //test:shared_queue PASSED in 0.1s //test:vm_id_handle PASSED in 0.1s //test/common:bytecode_util_test PASSED in 0.2s Executed 8 out of 8 tests: 8 tests pass. INFO: Build completed successfully, 25 total actions Signed-off-by: Le Yao <[email protected]>
INFO: Analyzed 9 targets (0 packages loaded, 0 targets configured). INFO: Found 1 target and 8 test targets... INFO: Elapsed time: 4.541s, Critical Path: 3.48s INFO: 20 processes: 2 internal, 18 linux-sandbox. INFO: Build completed successfully, 20 total actions //test:context_test PASSED in 0.1s //test:exports_test PASSED in 0.1s //test:null_vm_test PASSED in 0.1s //test:runtime_test PASSED in 0.1s //test:shared_data PASSED in 0.1s //test:shared_queue PASSED in 0.1s //test:vm_id_handle PASSED in 0.1s //test/common:bytecode_util_test PASSED in 0.1s Executed 8 out of 8 tests: 8 tests pass. INFO: Build completed successfully, 20 total actions Signed-off-by: Le Yao <[email protected]>
Starting local Bazel server and connecting to it... DEBUG: Rule 'proxy_wasm_cpp_host__wasmtime_c_api_macros__0_19_0' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1617649269 -0700" DEBUG: Repository proxy_wasm_cpp_host__wasmtime_c_api_macros__0_19_0 instantiated at: /root/proxy-wasm-cpp-host/WORKSPACE:9:33: in <toplevel> /root/.cache/bazel/_bazel_root/5d3cda4fc30ff6fff6d96ed8522a1d40/external/proxy_wasm_cpp_host/bazel/dependencies.bzl:20:44: in proxy_wasm_cpp_host_dependencies /root/.cache/bazel/_bazel_root/5d3cda4fc30ff6fff6d96ed8522a1d40/external/proxy_wasm_cpp_host/bazel/cargo/crates.bzl:724:10: in proxy_wasm_cpp_host_fetch_remote_crates /root/.cache/bazel/_bazel_root/5d3cda4fc30ff6fff6d96ed8522a1d40/external/bazel_tools/tools/build_defs/repo/utils.bzl:201:18: in maybe Repository rule new_git_repository defined at: /root/.cache/bazel/_bazel_root/5d3cda4fc30ff6fff6d96ed8522a1d40/external/bazel_tools/tools/build_defs/repo/git.bzl:186:37: in <toplevel> INFO: Analyzed 9 targets (131 packages loaded, 34267 targets configured). INFO: Found 1 target and 8 test targets... INFO: Elapsed time: 117.312s, Critical Path: 101.49s INFO: 334 processes: 165 internal, 169 linux-sandbox. INFO: Build completed successfully, 334 total actions //test:context_test PASSED in 0.1s //test:exports_test PASSED in 5.7s //test:null_vm_test PASSED in 0.1s //test:runtime_test PASSED in 2.0s //test:shared_data PASSED in 0.1s //test:shared_queue PASSED in 0.1s //test:vm_id_handle PASSED in 0.1s //test/common:bytecode_util_test PASSED in 0.1s Executed 8 out of 8 tests: 8 tests pass. INFO: Build completed successfully, 334 total actions Signed-off-by: Le Yao <[email protected]>
INFO: Analyzed 9 targets (5 packages loaded, 930 targets configured). INFO: Found 1 target and 8 test targets... INFO: Elapsed time: 5.281s, Critical Path: 0.02s INFO: 1 process: 1 internal. INFO: Build completed successfully, 1 total action //test:context_test (cached) PASSED in 0.1s //test:exports_test (cached) PASSED in 5.7s //test:null_vm_test (cached) PASSED in 0.1s //test:runtime_test (cached) PASSED in 2.0s //test:shared_data (cached) PASSED in 0.1s //test:shared_queue (cached) PASSED in 0.1s //test:vm_id_handle (cached) PASSED in 0.1s //test/common:bytecode_util_test (cached) PASSED in 0.1s Executed 0 out of 8 tests: 8 tests pass. INFO: Build completed successfully, 1 total action Signed-off-by: Le Yao <[email protected]>
since `wasm_functype_new` will transfer data ownerships of both `params` and `resutls` to the new `wasm_functype_t`, we should not - delete `wasm_valtype_t` of `wasm_valtype_vec_t` - use `wasm_functype_delete` to release members of `wasm_functype_t` a good example will be found here: [multi.c](https://github.com/WebAssembly/wasm-c-api/blob/master/example/multi.c) another thing is the runtime() should return a string as same as the one in envoy.yaml update wamr code release to 0.1-beta Signed-off-by: liam <[email protected]>
Signed-off-by: Le Yao <[email protected]>
To the latest official commit Signed-off-by: Le Yao <[email protected]>
}, | ||
lib_source = ":srcs", | ||
out_shared_libs = ["libiwasm.so"], | ||
) |
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.
Don't we need LLVM dependency like in Envoy?
cmake( | ||
name = "libiwasm", | ||
cache_entries = { | ||
"WAMR_BUILD_AOT": "0", |
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.
Please match it to options used in Envoy. At the very least, please add:
"WAMR_BUILD_INTERP": "1",
"WAMR_BUILD_JIT": "0",
or does JIT work already?
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.
✋ just curious, I didn't find any WAVM related BUILD file. Does it mean WAVM can not be linked in this repo yet?
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.
Correct, currently you cannot build WAVM in this repo. We're slowly fixing this (see: #160), which is why it would be helpful if WAMR worked.
Get it. And I am on holiday now, so I will update PR after May 6th. Thanks!
________________________________
发件人: Piotr Sikora ***@***.***>
发送时间: Sunday, May 2, 2021 6:29:10 AM
收件人: proxy-wasm/proxy-wasm-cpp-host ***@***.***>
抄送: Yao, Le ***@***.***>; Mention ***@***.***>
主题: Re: [proxy-wasm/proxy-wasm-cpp-host] Add Webassembly micro runtime support (#142)
@PiotrSikora commented on this pull request.
________________________________
In src/wamr/wamr.cc<#142 (comment)>:
+ void *raw_func_;
+ WasmVm *vm_;
+};
+
+using HostFuncDataPtr = std::unique_ptr<HostFuncData>;
+
+wasm_engine_t *engine() {
+ static const auto engine = WasmEnginePtr(wasm_engine_new());
+ return engine.get();
+}
+
+class Wamr : public WasmVm {
+public:
+ Wamr() {}
+
+ std::string_view runtime() override { return "envoy.wasm.runtime.wamr"; }
This should return "wamr", since Proxy-Wasm C++ Host is (in theory) proxy-agnostic.
The issue you've hit should be fixed in envoyproxy/envoy#16263<envoyproxy/envoy#16263>.
―
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#142 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AM66EL6HW54UQUMTEWBUBQTTLR6DNANCNFSM4ZLWT42Q>.
|
Signed-off-by: Le Yao <[email protected]>
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.
@mathetake could you take a pass on this PR? I think it looks good, and tests in Envoy passed already (envoyproxy/envoy#16057).
I think the only thing missing right now is the LLVM dependency, but perhaps we could merge it as-is to unblock merge in Envoy, and we could fix any build issues as part of #160.
What do you think?
this looks good to me now and we could merge as-is since Envoy tests pass. And I will handle build/test issues here in #160 and subsequent PRs. |
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.
LGTM, thanks a lot! @leyao-daily @lum1n0us please let me know if this is ready to be merged or if you still want to make some changes, thanks!
Cool! We think it is ready to be merged now. Thanks a lot. |
Thanks! |
Add WAMR support