Skip to content
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

feature: support WebAssembly in apisix. #157

Closed
membphis opened this issue Jun 25, 2019 · 12 comments · Fixed by #5288
Closed

feature: support WebAssembly in apisix. #157

membphis opened this issue Jun 25, 2019 · 12 comments · Fixed by #5288

Comments

@membphis
Copy link
Member

在 apisix 的生态圈中,目前主要是通过 Lua 来完成的,但由于 Lua 语言自身比较弱以及生态比较匮乏,是否可以通过其他语言来弥补短板,就非常有意义了。

貌似 WebAssembly 比较符合目前需求,它已经支持目前比较流行的语言主要有 C/C++、JavaScript 和 Golang 等,为这些语言提供了新的运行机制。

另外对于 serverless 以及边缘计算场景,更需要多语言的支持。

In the apisix ecosystem, it is mainly done by Lua, but because the Lua language itself is weak and the ecology is scarce, it is very meaningful to make up for the short board through other languages.

It seems that WebAssembly is more in line with current needs. It already supports the more popular languages, such as C/C++, JavaScript and Golang, providing a new operating mechanism for these languages.

In addition, for serverless and edge computing case, more need for multi-language support.

@Miss-you
Copy link
Member

I think the most important thing about serverless is the Devops or the NoOps and the variety of runtimes. This includes a series of processes about development, testing, operation and maintenance, and release. What't more, the serverless must solve problems such as accelerated cold start, automatic scale-in and scale-out, etc.This is not the responsibility of the gateway. The gateway currently plays more of a proxy, multiple different traffic diversion policies, and full-link tracking in serverless.
So the priority of this requirement is not high or even a pseudo-demand.

@Xunzhuo
Copy link
Contributor

Xunzhuo commented Aug 10, 2021

@membphis If we want to achieve this in 'APISIX' ,there are couple of things to do first:

  1. choose at least one wasm runtime (V8, WAVM, wasmer...)
  2. set rules and impl proxy-wasm-host in apisix followed by webassembly spec
  3. impl couple of languages proxy-wasm-sdk

@membphis
Copy link
Member Author

@spacewander what do you think about the message of @Xunzhuo?

@Xunzhuo if you would like to join this job, please let me know. my email: membphis@apache.org

@spacewander
Copy link
Member

Totally agree.

  1. Personally I prefer to wasmtime. It has an active development and is backed by big company.
  2. Yes, our proxy-wasm-host would be an Nginx module called wasm-nginx-module.

@juzhiyuan
Copy link
Member

@Baoyuantop maybe you could also have a try by implementing plugins by Rust?

@Baoyuantop
Copy link
Contributor

@Baoyuantop maybe you could also have a try by implementing plugins by Rust?

Yes I am trying the Rust plugin runner. Maybe I can combine wasmtime to try.

@Xunzhuo
Copy link
Contributor

Xunzhuo commented Aug 12, 2021

For point 3: impl couple of languages proxy-wasm-sdk, I think C++ and Rust are both ideal lang for Webassmebly impl.
If we want to interact with APISIX, I think we should impl abi spec in sdk with export , and impl sdk in wasm module. In VM context, VM will read implements of wasm module and interact with proxy-wasm-host(wasm-nginx-module).
@membphis I`m interested in this, but I want to know if apisix is starting to work on wasm supporting. If it is on , which steps do we reach?

@membphis
Copy link
Member Author

membphis commented Aug 13, 2021

@Xunzhuo You can have a more in-depth conversation with @spacewander
I am not familiar with WASM

@syrusakbary
Copy link

Personally I prefer to wasmtime. It has an active development and is backed by big company.

Although Wasmer as a company is not as big as Fastly, the community using us is probably the biggest!
As an example of community usage, Google just integrated us into Dart lang: https://medium.com/dartlang/experimenting-with-dart-and-wasm-ef7f1c065577

We would love to help on this if you end choosing Wasmer! 😊

@membphis
Copy link
Member Author

membphis commented Aug 14, 2021

@syrusakbary Thank you very much for your kindness.

Everyone is welcome to discuss, what one do you prefer? ^_^

@moonming
Copy link
Member

Wasmer is great, we can use it in APISIX

@moonming
Copy link
Member

I am not familiar with wasmer, how should we integrate it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants