You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/09/25 08:16:30 UTC

[GitHub] [apisix-website] nfrankel opened a new pull request, #1340: docs: Add Apache APISIX loves Rust

nfrankel opened a new pull request, #1340:
URL: https://github.com/apache/apisix-website/pull/1340

   <img width="1728" alt="Screenshot 2022-09-25 at 10 15 30" src="https://user-images.githubusercontent.com/752258/192134436-e62bad9c-be42-439c-8356-3a9e376b7efb.png">
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-website] yzeng25 commented on a diff in pull request #1340: docs: Add Apache APISIX loves Rust

Posted by GitBox <gi...@apache.org>.
yzeng25 commented on code in PR #1340:
URL: https://github.com/apache/apisix-website/pull/1340#discussion_r979605035


##########
blog/en/blog/2022/09/28/rust-loves-apisix.md:
##########
@@ -0,0 +1,198 @@
+---
+title: "Apache APISIX loves Rust!"
+authors:
+  - name: Nicolas Fränkel
+    title: Author
+    url: https://github.com/nfrankel
+    image_url: https://avatars.githubusercontent.com/u/752258
+keywords: 
+- API gateway
+- Apache APISIX
+- Rust
+- WebAssembly
+description: This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+tags: [Case Studies]
+---
+
+> This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+
+<!--truncate-->
+
+<head>
+    <link rel="canonical" href="https://blog.frankel.ch/rust-apisix/1/" />
+</head>
+
+Apache APISIX is built upon the shoulders of two giants:
+
+* [NGINX](https://www.nginx.com/), a widespread Open Source reverse-proxy
+* [OpenResty](https://openresty.org/en/), a platform that allows scripting NGINX with the [Lua](https://www.lua.org/) programming language via [LuaJIT](https://luajit.org/)
+
+This approach allows APISIX to provide out-of-the-box Lua plugins that should fit most business requirements. But it always comes a time when generic plugins don't fit your requirements. In this case, you can write your own Lua plugin.
+
+However, if Lua is not part of your tech stack, [diving into a new ecosystem is a considerable investment](https://blog.frankel.ch/on-learning-new-programming-language/). Therefore, Apache APISIX offers developers to write plugins in several other languages. In this post, I'd like to highlight how to write such a plugin with Rust.
+
+## A bit of context
+
+Before I dive into the "how", let me first describe a bit of context surrounding the Rust integration in Apache APISIX. I believe it's a good story because it highlights the power of Open Source.
+
+It starts with the Envoy proxy.
+
+>Envoy is an open source edge and service proxy, designed for cloud-native applications
+>
+> -- https://www.envoyproxy.io/
+
+Around 2019, Envoy's developers realized a simple truth. Since Envoy is a statically compiled binary, integrators who need to extend it must compile it from the modified source instead of using the official binary version. Issues range from supply chains more vulnerable to attacks to a longer drift when a new version is released. For end-users, whose core business is much further, it means having to hire specialized skills for this reason only.
+
+The team considered to solve the issue with C++ extensions, but discarded this approach as neither <abbr title="Application Programmer Interface">API</abbr>s nor <abbr title="Application Binary Interface">ABI</abbr>s were stable. Instead, they chose to provide a stable WebAssembly-based ABI. If you're interested in a more detailed background, you can read the whole piece [on GitHub](https://github.com/proxy-wasm/spec/blob/master/docs/WebAssembly-in-Envoy.md).
+
+The specification is available on [GitHub](https://github.com/proxy-wasm/spec).
+
+* Developers can create SDK for their tech stack
+* Proxy and API Gateway providers can integrate `proxy-wasm` in their product
+
+## Apache APISIX and proxy-wasm
+
+The Apache APISIX project decided to integrate `proxy-wasm` into the product to benefit from the standardization effort. It also allows end-users to start with Envoy, or any other `proxy-wasm`-compatible reverse proxy, to migrate to Apache APISIX when necessary.
+
+APISIX doesn't implement `proxy-wasm` but integrates [wasm-nginx-module](https://github.com/api7/wasm-nginx-module). It's an Apache v2-licensed project provided by [api7.ai](https://api7.ai/), one of the main contributors to Apache APISIX. As its name implies, integration is done at the NGINX level.
+
+![Apache APISIX and WebAssemby architecture overview](https://api7.ai/wp-content/uploads/2022/09/architecture-diagram.png)
+
+## Let's code!
+
+Now that we have explained how everything fits together, it's time to code.
+
+### Preparing Rust for WebAssembly
+
+Before developing the first line of code, we need to give Rust <abbr title="WebAssembly">WASM</abbr> compilation capabilities.
+
+```bash
+rustup target add wasm32-wasi
+```
+
+It allows the Rust compiler to output WASM code:
+
+```bash
+cargo build --target wasm32-wasi
+```
+
+The WASM code is found in:
+
+* `target/wasm32-wasi/debug/sample.wasm`
+* `target/wasm32-wasi/release/sample.wasm` (when compiled with the `--release` flag)
+
+### Setting up the project
+
+The setup of the project is pretty straightforward:
+
+```bash
+cargo new sample --lib
+```
+
+The command creates a `lib` project with the expected structure.
+
+### The code itself
+
+Let me first say that the available documentation is pretty sparse. For example, `proxy-wasm`'s is limited to the [methods' signature](https://github.com/proxy-wasm/spec/tree/master/abi-versions/vNEXT) (think JavaDocs). Rust SDK is sample-based. However, one can get some information from the [C++ SDK](https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/blob/master/docs/wasm_filter.md).
+
+>WASM module is running in a stack-based virtual machine and its memory is isolated from the host environment. All interactions between host and WASM module are through functions and callbacks wrapped by context object.
+>
+>At bootstrap time, a root context is created. The root context has the same lifetime as the VM/runtime instance and acts as a target for any interactions which happen at initial setup. It is also used for interactions that outlive a request.
+>
+>At request time, a context with incremental is created for each stream. Stream context has the same lifetime as the stream itself and acts as a target for interactions that are local to that stream.
+
+The Rust code maps to the same abstractions.
+
+![Rust's 'structure diagram'](https://api7.ai/wp-content/uploads/2022/09/struct-diagram.png)

Review Comment:
   OK cool.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-website] juzhiyuan merged pull request #1340: docs: Add Apache APISIX loves Rust

Posted by GitBox <gi...@apache.org>.
juzhiyuan merged PR #1340:
URL: https://github.com/apache/apisix-website/pull/1340


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-website] netlify[bot] commented on pull request #1340: docs: Add Apache APISIX loves Rust

Posted by GitBox <gi...@apache.org>.
netlify[bot] commented on PR #1340:
URL: https://github.com/apache/apisix-website/pull/1340#issuecomment-1257144985

   ### <span aria-hidden="true">👷</span> Deploy Preview for *apache-apisix* processing.
   
   
   |  Name | Link |
   |---------------------------------|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | 621d3fca518fc319cfb5d3daa684efd711cce013 |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/sites/apache-apisix/deploys/63300e5e826b5900091eea0c |


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-website] juzhiyuan commented on a diff in pull request #1340: docs: Add Apache APISIX loves Rust

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on code in PR #1340:
URL: https://github.com/apache/apisix-website/pull/1340#discussion_r980789402


##########
blog/en/blog/2022/09/28/rust-loves-apisix.md:
##########
@@ -0,0 +1,198 @@
+---
+title: "Apache APISIX loves Rust!"
+authors:
+  - name: Nicolas Fränkel
+    title: Author
+    url: https://github.com/nfrankel
+    image_url: https://avatars.githubusercontent.com/u/752258
+keywords: 
+- API gateway
+- Apache APISIX
+- Rust
+- WebAssembly
+description: This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+tags: [Case Studies]
+---
+
+> This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+
+<!--truncate-->
+
+<head>
+    <link rel="canonical" href="https://blog.frankel.ch/rust-apisix/1/" />
+</head>
+
+Apache APISIX is built upon the shoulders of two giants:
+
+* [NGINX](https://www.nginx.com/), a widespread Open Source reverse-proxy
+* [OpenResty](https://openresty.org/en/), a platform that allows scripting NGINX with the [Lua](https://www.lua.org/) programming language via [LuaJIT](https://luajit.org/)
+
+This approach allows APISIX to provide out-of-the-box Lua plugins that should fit most business requirements. But it always comes a time when generic plugins don't fit your requirements. In this case, you can write your own Lua plugin.
+
+However, if Lua is not part of your tech stack, [diving into a new ecosystem is a considerable investment](https://blog.frankel.ch/on-learning-new-programming-language/). Therefore, Apache APISIX offers developers to write plugins in several other languages. In this post, I'd like to highlight how to write such a plugin with Rust.
+
+## A bit of context
+
+Before I dive into the "how", let me first describe a bit of context surrounding the Rust integration in Apache APISIX. I believe it's a good story because it highlights the power of Open Source.
+
+It starts with the Envoy proxy.
+
+>Envoy is an open source edge and service proxy, designed for cloud-native applications
+>
+> -- https://www.envoyproxy.io/
+
+Around 2019, Envoy's developers realized a simple truth. Since Envoy is a statically compiled binary, integrators who need to extend it must compile it from the modified source instead of using the official binary version. Issues range from supply chains more vulnerable to attacks to a longer drift when a new version is released. For end-users, whose core business is much further, it means having to hire specialized skills for this reason only.
+
+The team considered to solve the issue with C++ extensions, but discarded this approach as neither <abbr title="Application Programmer Interface">API</abbr>s nor <abbr title="Application Binary Interface">ABI</abbr>s were stable. Instead, they chose to provide a stable WebAssembly-based ABI. If you're interested in a more detailed background, you can read the whole piece [on GitHub](https://github.com/proxy-wasm/spec/blob/master/docs/WebAssembly-in-Envoy.md).
+
+The specification is available on [GitHub](https://github.com/proxy-wasm/spec).
+
+* Developers can create SDK for their tech stack
+* Proxy and API Gateway providers can integrate `proxy-wasm` in their product
+
+## Apache APISIX and proxy-wasm
+
+The Apache APISIX project decided to integrate `proxy-wasm` into the product to benefit from the standardization effort. It also allows end-users to start with Envoy, or any other `proxy-wasm`-compatible reverse proxy, to migrate to Apache APISIX when necessary.
+
+APISIX doesn't implement `proxy-wasm` but integrates [wasm-nginx-module](https://github.com/api7/wasm-nginx-module). It's an Apache v2-licensed project provided by [api7.ai](https://api7.ai/), one of the main contributors to Apache APISIX. As its name implies, integration is done at the NGINX level.
+
+![Apache APISIX and WebAssemby architecture overview](https://api7.ai/wp-content/uploads/2022/09/architecture-diagram.png)

Review Comment:
   No worry :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-website] SylviaBABY commented on a diff in pull request #1340: docs: Add Apache APISIX loves Rust

Posted by GitBox <gi...@apache.org>.
SylviaBABY commented on code in PR #1340:
URL: https://github.com/apache/apisix-website/pull/1340#discussion_r979502794


##########
blog/en/blog/2022/09/28/rust-loves-apisix.md:
##########
@@ -0,0 +1,198 @@
+---
+title: "Apache APISIX loves Rust!"
+authors:
+  - name: Nicolas Fränkel
+    title: Author
+    url: https://github.com/nfrankel
+    image_url: https://avatars.githubusercontent.com/u/752258
+keywords: 
+- API gateway
+- Apache APISIX
+- Rust
+- WebAssembly
+description: This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+tags: [Case Studies]
+---
+
+> This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+
+<!--truncate-->
+
+<head>
+    <link rel="canonical" href="https://blog.frankel.ch/rust-apisix/1/" />
+</head>
+
+Apache APISIX is built upon the shoulders of two giants:
+
+* [NGINX](https://www.nginx.com/), a widespread Open Source reverse-proxy
+* [OpenResty](https://openresty.org/en/), a platform that allows scripting NGINX with the [Lua](https://www.lua.org/) programming language via [LuaJIT](https://luajit.org/)
+
+This approach allows APISIX to provide out-of-the-box Lua plugins that should fit most business requirements. But it always comes a time when generic plugins don't fit your requirements. In this case, you can write your own Lua plugin.
+
+However, if Lua is not part of your tech stack, [diving into a new ecosystem is a considerable investment](https://blog.frankel.ch/on-learning-new-programming-language/). Therefore, Apache APISIX offers developers to write plugins in several other languages. In this post, I'd like to highlight how to write such a plugin with Rust.
+
+## A bit of context
+
+Before I dive into the "how", let me first describe a bit of context surrounding the Rust integration in Apache APISIX. I believe it's a good story because it highlights the power of Open Source.
+
+It starts with the Envoy proxy.
+
+> Envoy is an open source edge and service proxy, designed for cloud-native applications
+>
+> -- https://www.envoyproxy.io/
+
+Around 2019, Envoy's developers realized a simple truth. Since Envoy is a statically compiled binary, integrators who need to extend it must compile it from the modified source instead of using the official binary version. Issues range from supply chains more vulnerable to attacks to a longer drift when a new version is released. For end-users, whose core business is much further, it means having to hire specialized skills for this reason only.
+
+The team considered to solve the issue with C++ extensions, but discarded this approach as neither <abbr title="Application Programmer Interface">API</abbr>s nor <abbr title="Application Binary Interface">ABI</abbr>s were stable. Instead, they chose to provide a stable WebAssembly-based ABI. If you're interested in a more detailed background, you can read the whole piece [on GitHub](https://github.com/proxy-wasm/spec/blob/master/docs/WebAssembly-in-Envoy.md).
+
+The specification is available on [GitHub](https://github.com/proxy-wasm/spec).
+
+* Developers can create SDK for their tech stack
+* Proxy and API Gateway providers can integrate `proxy-wasm` in their product
+
+## Apache APISIX and proxy-wasm
+
+The Apache APISIX project decided to integrate `proxy-wasm` into the product to benefit from the standardization effort. It also allows end-users to start with Envoy, or any other `proxy-wasm`-compatible reverse proxy, to migrate to Apache APISIX when necessary.
+
+APISIX doesn't implement `proxy-wasm` but integrates [wasm-nginx-module](https://github.com/api7/wasm-nginx-module). It's an Apache v2-licensed project provided by [api7.ai](https://api7.ai/), one of the main contributors to Apache APISIX. As its name implies, integration is done at the NGINX level.
+
+![Apache APISIX and WebAssemby architecture overview](https://api7.ai/wp-content/uploads/2022/09/architecture-diagram.png)
+
+## Let's code!
+
+Now that we have explained how everything fits together, it's time to code.
+
+### Preparing Rust for WebAssembly
+
+Before developing the first line of code, we need to give Rust <abbr title="WebAssembly">WASM</abbr> compilation capabilities.
+
+```bash

Review Comment:
   need to change the `bash` code type to `shell` in the rest of the content. Others LGTM



##########
blog/en/blog/2022/09/28/rust-loves-apisix.md:
##########
@@ -0,0 +1,198 @@
+---
+title: "Apache APISIX loves Rust!"
+authors:
+  - name: Nicolas Fränkel
+    title: Author
+    url: https://github.com/nfrankel
+    image_url: https://avatars.githubusercontent.com/u/752258
+keywords: 
+- API gateway
+- Apache APISIX
+- Rust
+- WebAssembly
+description: This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+tags: [Case Studies]
+---
+
+> This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+
+<!--truncate-->
+
+<head>
+    <link rel="canonical" href="https://blog.frankel.ch/rust-apisix/1/" />
+</head>
+
+Apache APISIX is built upon the shoulders of two giants:
+
+* [NGINX](https://www.nginx.com/), a widespread Open Source reverse-proxy
+* [OpenResty](https://openresty.org/en/), a platform that allows scripting NGINX with the [Lua](https://www.lua.org/) programming language via [LuaJIT](https://luajit.org/)
+
+This approach allows APISIX to provide out-of-the-box Lua plugins that should fit most business requirements. But it always comes a time when generic plugins don't fit your requirements. In this case, you can write your own Lua plugin.
+
+However, if Lua is not part of your tech stack, [diving into a new ecosystem is a considerable investment](https://blog.frankel.ch/on-learning-new-programming-language/). Therefore, Apache APISIX offers developers to write plugins in several other languages. In this post, I'd like to highlight how to write such a plugin with Rust.
+
+## A bit of context
+
+Before I dive into the "how", let me first describe a bit of context surrounding the Rust integration in Apache APISIX. I believe it's a good story because it highlights the power of Open Source.
+
+It starts with the Envoy proxy.
+
+> Envoy is an open source edge and service proxy, designed for cloud-native applications
+>
+> -- https://www.envoyproxy.io/
+
+Around 2019, Envoy's developers realized a simple truth. Since Envoy is a statically compiled binary, integrators who need to extend it must compile it from the modified source instead of using the official binary version. Issues range from supply chains more vulnerable to attacks to a longer drift when a new version is released. For end-users, whose core business is much further, it means having to hire specialized skills for this reason only.
+
+The team considered to solve the issue with C++ extensions, but discarded this approach as neither <abbr title="Application Programmer Interface">API</abbr>s nor <abbr title="Application Binary Interface">ABI</abbr>s were stable. Instead, they chose to provide a stable WebAssembly-based ABI. If you're interested in a more detailed background, you can read the whole piece [on GitHub](https://github.com/proxy-wasm/spec/blob/master/docs/WebAssembly-in-Envoy.md).
+
+The specification is available on [GitHub](https://github.com/proxy-wasm/spec).
+
+* Developers can create SDK for their tech stack
+* Proxy and API Gateway providers can integrate `proxy-wasm` in their product
+
+## Apache APISIX and proxy-wasm
+
+The Apache APISIX project decided to integrate `proxy-wasm` into the product to benefit from the standardization effort. It also allows end-users to start with Envoy, or any other `proxy-wasm`-compatible reverse proxy, to migrate to Apache APISIX when necessary.
+
+APISIX doesn't implement `proxy-wasm` but integrates [wasm-nginx-module](https://github.com/api7/wasm-nginx-module). It's an Apache v2-licensed project provided by [api7.ai](https://api7.ai/), one of the main contributors to Apache APISIX. As its name implies, integration is done at the NGINX level.
+
+![Apache APISIX and WebAssemby architecture overview](https://api7.ai/wp-content/uploads/2022/09/architecture-diagram.png)
+
+## Let's code!
+
+Now that we have explained how everything fits together, it's time to code.
+
+### Preparing Rust for WebAssembly
+
+Before developing the first line of code, we need to give Rust <abbr title="WebAssembly">WASM</abbr> compilation capabilities.
+
+```bash

Review Comment:
   ```suggestion
   ```shell
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-website] nfrankel commented on a diff in pull request #1340: docs: Add Apache APISIX loves Rust

Posted by GitBox <gi...@apache.org>.
nfrankel commented on code in PR #1340:
URL: https://github.com/apache/apisix-website/pull/1340#discussion_r979451062


##########
blog/en/blog/2022/09/28/rust-loves-apisix.md:
##########
@@ -0,0 +1,198 @@
+---
+title: "Apache APISIX loves Rust!"
+authors:
+  - name: Nicolas Fränkel
+    title: Author
+    url: https://github.com/nfrankel
+    image_url: https://avatars.githubusercontent.com/u/752258
+keywords: 
+- API gateway
+- Apache APISIX
+- Rust
+- WebAssembly
+description: This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+tags: [Case Studies]
+---
+
+> This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+
+<!--truncate-->
+
+<head>
+    <link rel="canonical" href="https://blog.frankel.ch/rust-apisix/1/" />
+</head>
+
+Apache APISIX is built upon the shoulders of two giants:
+
+* [NGINX](https://www.nginx.com/), a widespread Open Source reverse-proxy
+* [OpenResty](https://openresty.org/en/), a platform that allows scripting NGINX with the [Lua](https://www.lua.org/) programming language via [LuaJIT](https://luajit.org/)
+
+This approach allows APISIX to provide out-of-the-box Lua plugins that should fit most business requirements. But it always comes a time when generic plugins don't fit your requirements. In this case, you can write your own Lua plugin.
+
+However, if Lua is not part of your tech stack, [diving into a new ecosystem is a considerable investment](https://blog.frankel.ch/on-learning-new-programming-language/). Therefore, Apache APISIX offers developers to write plugins in several other languages. In this post, I'd like to highlight how to write such a plugin with Rust.
+
+## A bit of context
+
+Before I dive into the "how", let me first describe a bit of context surrounding the Rust integration in Apache APISIX. I believe it's a good story because it highlights the power of Open Source.
+
+It starts with the Envoy proxy.
+
+>Envoy is an open source edge and service proxy, designed for cloud-native applications
+>
+> -- https://www.envoyproxy.io/
+
+Around 2019, Envoy's developers realized a simple truth. Since Envoy is a statically compiled binary, integrators who need to extend it must compile it from the modified source instead of using the official binary version. Issues range from supply chains more vulnerable to attacks to a longer drift when a new version is released. For end-users, whose core business is much further, it means having to hire specialized skills for this reason only.
+
+The team considered to solve the issue with C++ extensions, but discarded this approach as neither <abbr title="Application Programmer Interface">API</abbr>s nor <abbr title="Application Binary Interface">ABI</abbr>s were stable. Instead, they chose to provide a stable WebAssembly-based ABI. If you're interested in a more detailed background, you can read the whole piece [on GitHub](https://github.com/proxy-wasm/spec/blob/master/docs/WebAssembly-in-Envoy.md).
+
+The specification is available on [GitHub](https://github.com/proxy-wasm/spec).
+
+* Developers can create SDK for their tech stack
+* Proxy and API Gateway providers can integrate `proxy-wasm` in their product
+
+## Apache APISIX and proxy-wasm
+
+The Apache APISIX project decided to integrate `proxy-wasm` into the product to benefit from the standardization effort. It also allows end-users to start with Envoy, or any other `proxy-wasm`-compatible reverse proxy, to migrate to Apache APISIX when necessary.
+
+APISIX doesn't implement `proxy-wasm` but integrates [wasm-nginx-module](https://github.com/api7/wasm-nginx-module). It's an Apache v2-licensed project provided by [api7.ai](https://api7.ai/), one of the main contributors to Apache APISIX. As its name implies, integration is done at the NGINX level.
+
+![Apache APISIX and WebAssemby architecture overview](https://api7.ai/wp-content/uploads/2022/09/architecture-diagram.png)
+
+## Let's code!
+
+Now that we have explained how everything fits together, it's time to code.
+
+### Preparing Rust for WebAssembly
+
+Before developing the first line of code, we need to give Rust <abbr title="WebAssembly">WASM</abbr> compilation capabilities.
+
+```bash
+rustup target add wasm32-wasi
+```
+
+It allows the Rust compiler to output WASM code:
+
+```bash
+cargo build --target wasm32-wasi
+```
+
+The WASM code is found in:
+
+* `target/wasm32-wasi/debug/sample.wasm`
+* `target/wasm32-wasi/release/sample.wasm` (when compiled with the `--release` flag)
+
+### Setting up the project
+
+The setup of the project is pretty straightforward:
+
+```bash
+cargo new sample --lib
+```
+
+The command creates a `lib` project with the expected structure.
+
+### The code itself
+
+Let me first say that the available documentation is pretty sparse. For example, `proxy-wasm`'s is limited to the [methods' signature](https://github.com/proxy-wasm/spec/tree/master/abi-versions/vNEXT) (think JavaDocs). Rust SDK is sample-based. However, one can get some information from the [C++ SDK](https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/blob/master/docs/wasm_filter.md).
+
+>WASM module is running in a stack-based virtual machine and its memory is isolated from the host environment. All interactions between host and WASM module are through functions and callbacks wrapped by context object.
+>
+>At bootstrap time, a root context is created. The root context has the same lifetime as the VM/runtime instance and acts as a target for any interactions which happen at initial setup. It is also used for interactions that outlive a request.
+>
+>At request time, a context with incremental is created for each stream. Stream context has the same lifetime as the stream itself and acts as a target for interactions that are local to that stream.
+
+The Rust code maps to the same abstractions.
+
+![Rust's 'structure diagram'](https://api7.ai/wp-content/uploads/2022/09/struct-diagram.png)

Review Comment:
   There's no such thing as a structure diagram in UML, hence the quotes. I can remove them, I don't understand why.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-website] yzeng25 commented on a diff in pull request #1340: docs: Add Apache APISIX loves Rust

Posted by GitBox <gi...@apache.org>.
yzeng25 commented on code in PR #1340:
URL: https://github.com/apache/apisix-website/pull/1340#discussion_r979413034


##########
blog/en/blog/2022/09/28/rust-loves-apisix.md:
##########
@@ -0,0 +1,198 @@
+---
+title: "Apache APISIX loves Rust!"
+authors:
+  - name: Nicolas Fränkel
+    title: Author
+    url: https://github.com/nfrankel
+    image_url: https://avatars.githubusercontent.com/u/752258
+keywords: 
+- API gateway
+- Apache APISIX
+- Rust
+- WebAssembly
+description: This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+tags: [Case Studies]
+---
+
+> This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+
+<!--truncate-->
+
+<head>
+    <link rel="canonical" href="https://blog.frankel.ch/rust-apisix/1/" />
+</head>
+
+Apache APISIX is built upon the shoulders of two giants:
+
+* [NGINX](https://www.nginx.com/), a widespread Open Source reverse-proxy
+* [OpenResty](https://openresty.org/en/), a platform that allows scripting NGINX with the [Lua](https://www.lua.org/) programming language via [LuaJIT](https://luajit.org/)
+
+This approach allows APISIX to provide out-of-the-box Lua plugins that should fit most business requirements. But it always comes a time when generic plugins don't fit your requirements. In this case, you can write your own Lua plugin.
+
+However, if Lua is not part of your tech stack, [diving into a new ecosystem is a considerable investment](https://blog.frankel.ch/on-learning-new-programming-language/). Therefore, Apache APISIX offers developers to write plugins in several other languages. In this post, I'd like to highlight how to write such a plugin with Rust.
+
+## A bit of context
+
+Before I dive into the "how", let me first describe a bit of context surrounding the Rust integration in Apache APISIX. I believe it's a good story because it highlights the power of Open Source.
+
+It starts with the Envoy proxy.
+
+>Envoy is an open source edge and service proxy, designed for cloud-native applications
+>
+> -- https://www.envoyproxy.io/
+
+Around 2019, Envoy's developers realized a simple truth. Since Envoy is a statically compiled binary, integrators who need to extend it must compile it from the modified source instead of using the official binary version. Issues range from supply chains more vulnerable to attacks to a longer drift when a new version is released. For end-users, whose core business is much further, it means having to hire specialized skills for this reason only.
+
+The team considered to solve the issue with C++ extensions, but discarded this approach as neither <abbr title="Application Programmer Interface">API</abbr>s nor <abbr title="Application Binary Interface">ABI</abbr>s were stable. Instead, they chose to provide a stable WebAssembly-based ABI. If you're interested in a more detailed background, you can read the whole piece [on GitHub](https://github.com/proxy-wasm/spec/blob/master/docs/WebAssembly-in-Envoy.md).
+
+The specification is available on [GitHub](https://github.com/proxy-wasm/spec).
+
+* Developers can create SDK for their tech stack
+* Proxy and API Gateway providers can integrate `proxy-wasm` in their product
+
+## Apache APISIX and proxy-wasm
+
+The Apache APISIX project decided to integrate `proxy-wasm` into the product to benefit from the standardization effort. It also allows end-users to start with Envoy, or any other `proxy-wasm`-compatible reverse proxy, to migrate to Apache APISIX when necessary.
+
+APISIX doesn't implement `proxy-wasm` but integrates [wasm-nginx-module](https://github.com/api7/wasm-nginx-module). It's an Apache v2-licensed project provided by [api7.ai](https://api7.ai/), one of the main contributors to Apache APISIX. As its name implies, integration is done at the NGINX level.
+
+![Apache APISIX and WebAssemby architecture overview](https://api7.ai/wp-content/uploads/2022/09/architecture-diagram.png)
+
+## Let's code!
+
+Now that we have explained how everything fits together, it's time to code.
+
+### Preparing Rust for WebAssembly
+
+Before developing the first line of code, we need to give Rust <abbr title="WebAssembly">WASM</abbr> compilation capabilities.
+
+```bash
+rustup target add wasm32-wasi
+```
+
+It allows the Rust compiler to output WASM code:
+
+```bash
+cargo build --target wasm32-wasi
+```
+
+The WASM code is found in:
+
+* `target/wasm32-wasi/debug/sample.wasm`
+* `target/wasm32-wasi/release/sample.wasm` (when compiled with the `--release` flag)
+
+### Setting up the project
+
+The setup of the project is pretty straightforward:
+
+```bash
+cargo new sample --lib
+```
+
+The command creates a `lib` project with the expected structure.
+
+### The code itself
+
+Let me first say that the available documentation is pretty sparse. For example, `proxy-wasm`'s is limited to the [methods' signature](https://github.com/proxy-wasm/spec/tree/master/abi-versions/vNEXT) (think JavaDocs). Rust SDK is sample-based. However, one can get some information from the [C++ SDK](https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/blob/master/docs/wasm_filter.md).
+
+>WASM module is running in a stack-based virtual machine and its memory is isolated from the host environment. All interactions between host and WASM module are through functions and callbacks wrapped by context object.
+>
+>At bootstrap time, a root context is created. The root context has the same lifetime as the VM/runtime instance and acts as a target for any interactions which happen at initial setup. It is also used for interactions that outlive a request.
+>
+>At request time, a context with incremental is created for each stream. Stream context has the same lifetime as the stream itself and acts as a target for interactions that are local to that stream.
+
+The Rust code maps to the same abstractions.
+
+![Rust's 'structure diagram'](https://api7.ai/wp-content/uploads/2022/09/struct-diagram.png)

Review Comment:
   ditto, Tencent CDN? cc @juzhiyuan 
   ```suggestion
   ![Rust's structure diagram](https://api7.ai/wp-content/uploads/2022/09/struct-diagram.png)
   ```



##########
blog/en/blog/2022/09/28/rust-loves-apisix.md:
##########
@@ -0,0 +1,198 @@
+---
+title: "Apache APISIX loves Rust!"
+authors:
+  - name: Nicolas Fränkel
+    title: Author
+    url: https://github.com/nfrankel
+    image_url: https://avatars.githubusercontent.com/u/752258
+keywords: 
+- API gateway
+- Apache APISIX
+- Rust
+- WebAssembly
+description: This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+tags: [Case Studies]
+---
+
+> This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+
+<!--truncate-->
+
+<head>
+    <link rel="canonical" href="https://blog.frankel.ch/rust-apisix/1/" />
+</head>
+
+Apache APISIX is built upon the shoulders of two giants:
+
+* [NGINX](https://www.nginx.com/), a widespread Open Source reverse-proxy
+* [OpenResty](https://openresty.org/en/), a platform that allows scripting NGINX with the [Lua](https://www.lua.org/) programming language via [LuaJIT](https://luajit.org/)
+
+This approach allows APISIX to provide out-of-the-box Lua plugins that should fit most business requirements. But it always comes a time when generic plugins don't fit your requirements. In this case, you can write your own Lua plugin.
+
+However, if Lua is not part of your tech stack, [diving into a new ecosystem is a considerable investment](https://blog.frankel.ch/on-learning-new-programming-language/). Therefore, Apache APISIX offers developers to write plugins in several other languages. In this post, I'd like to highlight how to write such a plugin with Rust.
+
+## A bit of context
+
+Before I dive into the "how", let me first describe a bit of context surrounding the Rust integration in Apache APISIX. I believe it's a good story because it highlights the power of Open Source.
+
+It starts with the Envoy proxy.
+
+>Envoy is an open source edge and service proxy, designed for cloud-native applications

Review Comment:
    I think we need a space here to show properly.
   ```suggestion
   > Envoy is an open source edge and service proxy, designed for cloud-native applications
   ```



##########
blog/en/blog/2022/09/28/rust-loves-apisix.md:
##########
@@ -0,0 +1,198 @@
+---
+title: "Apache APISIX loves Rust!"
+authors:
+  - name: Nicolas Fränkel
+    title: Author
+    url: https://github.com/nfrankel
+    image_url: https://avatars.githubusercontent.com/u/752258
+keywords: 
+- API gateway
+- Apache APISIX
+- Rust
+- WebAssembly
+description: This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+tags: [Case Studies]
+---
+
+> This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+
+<!--truncate-->
+
+<head>
+    <link rel="canonical" href="https://blog.frankel.ch/rust-apisix/1/" />
+</head>
+
+Apache APISIX is built upon the shoulders of two giants:
+
+* [NGINX](https://www.nginx.com/), a widespread Open Source reverse-proxy
+* [OpenResty](https://openresty.org/en/), a platform that allows scripting NGINX with the [Lua](https://www.lua.org/) programming language via [LuaJIT](https://luajit.org/)
+
+This approach allows APISIX to provide out-of-the-box Lua plugins that should fit most business requirements. But it always comes a time when generic plugins don't fit your requirements. In this case, you can write your own Lua plugin.
+
+However, if Lua is not part of your tech stack, [diving into a new ecosystem is a considerable investment](https://blog.frankel.ch/on-learning-new-programming-language/). Therefore, Apache APISIX offers developers to write plugins in several other languages. In this post, I'd like to highlight how to write such a plugin with Rust.
+
+## A bit of context
+
+Before I dive into the "how", let me first describe a bit of context surrounding the Rust integration in Apache APISIX. I believe it's a good story because it highlights the power of Open Source.
+
+It starts with the Envoy proxy.
+
+>Envoy is an open source edge and service proxy, designed for cloud-native applications
+>
+> -- https://www.envoyproxy.io/
+
+Around 2019, Envoy's developers realized a simple truth. Since Envoy is a statically compiled binary, integrators who need to extend it must compile it from the modified source instead of using the official binary version. Issues range from supply chains more vulnerable to attacks to a longer drift when a new version is released. For end-users, whose core business is much further, it means having to hire specialized skills for this reason only.
+
+The team considered to solve the issue with C++ extensions, but discarded this approach as neither <abbr title="Application Programmer Interface">API</abbr>s nor <abbr title="Application Binary Interface">ABI</abbr>s were stable. Instead, they chose to provide a stable WebAssembly-based ABI. If you're interested in a more detailed background, you can read the whole piece [on GitHub](https://github.com/proxy-wasm/spec/blob/master/docs/WebAssembly-in-Envoy.md).
+
+The specification is available on [GitHub](https://github.com/proxy-wasm/spec).
+
+* Developers can create SDK for their tech stack
+* Proxy and API Gateway providers can integrate `proxy-wasm` in their product
+
+## Apache APISIX and proxy-wasm
+
+The Apache APISIX project decided to integrate `proxy-wasm` into the product to benefit from the standardization effort. It also allows end-users to start with Envoy, or any other `proxy-wasm`-compatible reverse proxy, to migrate to Apache APISIX when necessary.
+
+APISIX doesn't implement `proxy-wasm` but integrates [wasm-nginx-module](https://github.com/api7/wasm-nginx-module). It's an Apache v2-licensed project provided by [api7.ai](https://api7.ai/), one of the main contributors to Apache APISIX. As its name implies, integration is done at the NGINX level.
+
+![Apache APISIX and WebAssemby architecture overview](https://api7.ai/wp-content/uploads/2022/09/architecture-diagram.png)

Review Comment:
   Probably need to covert to Tencent CDN, cc @juzhiyuan 



##########
blog/en/blog/2022/09/28/rust-loves-apisix.md:
##########
@@ -0,0 +1,198 @@
+---
+title: "Apache APISIX loves Rust!"
+authors:
+  - name: Nicolas Fränkel
+    title: Author
+    url: https://github.com/nfrankel
+    image_url: https://avatars.githubusercontent.com/u/752258
+keywords: 
+- API gateway
+- Apache APISIX
+- Rust
+- WebAssembly
+description: This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+tags: [Case Studies]
+---
+
+> This article shows the steps to perform to develop and deploy WebAssembly plugins from Rust.
+
+<!--truncate-->
+
+<head>
+    <link rel="canonical" href="https://blog.frankel.ch/rust-apisix/1/" />
+</head>
+
+Apache APISIX is built upon the shoulders of two giants:
+
+* [NGINX](https://www.nginx.com/), a widespread Open Source reverse-proxy
+* [OpenResty](https://openresty.org/en/), a platform that allows scripting NGINX with the [Lua](https://www.lua.org/) programming language via [LuaJIT](https://luajit.org/)
+
+This approach allows APISIX to provide out-of-the-box Lua plugins that should fit most business requirements. But it always comes a time when generic plugins don't fit your requirements. In this case, you can write your own Lua plugin.
+
+However, if Lua is not part of your tech stack, [diving into a new ecosystem is a considerable investment](https://blog.frankel.ch/on-learning-new-programming-language/). Therefore, Apache APISIX offers developers to write plugins in several other languages. In this post, I'd like to highlight how to write such a plugin with Rust.
+
+## A bit of context
+
+Before I dive into the "how", let me first describe a bit of context surrounding the Rust integration in Apache APISIX. I believe it's a good story because it highlights the power of Open Source.
+
+It starts with the Envoy proxy.
+
+>Envoy is an open source edge and service proxy, designed for cloud-native applications
+>
+> -- https://www.envoyproxy.io/
+
+Around 2019, Envoy's developers realized a simple truth. Since Envoy is a statically compiled binary, integrators who need to extend it must compile it from the modified source instead of using the official binary version. Issues range from supply chains more vulnerable to attacks to a longer drift when a new version is released. For end-users, whose core business is much further, it means having to hire specialized skills for this reason only.
+
+The team considered to solve the issue with C++ extensions, but discarded this approach as neither <abbr title="Application Programmer Interface">API</abbr>s nor <abbr title="Application Binary Interface">ABI</abbr>s were stable. Instead, they chose to provide a stable WebAssembly-based ABI. If you're interested in a more detailed background, you can read the whole piece [on GitHub](https://github.com/proxy-wasm/spec/blob/master/docs/WebAssembly-in-Envoy.md).
+
+The specification is available on [GitHub](https://github.com/proxy-wasm/spec).
+
+* Developers can create SDK for their tech stack
+* Proxy and API Gateway providers can integrate `proxy-wasm` in their product
+
+## Apache APISIX and proxy-wasm
+
+The Apache APISIX project decided to integrate `proxy-wasm` into the product to benefit from the standardization effort. It also allows end-users to start with Envoy, or any other `proxy-wasm`-compatible reverse proxy, to migrate to Apache APISIX when necessary.
+
+APISIX doesn't implement `proxy-wasm` but integrates [wasm-nginx-module](https://github.com/api7/wasm-nginx-module). It's an Apache v2-licensed project provided by [api7.ai](https://api7.ai/), one of the main contributors to Apache APISIX. As its name implies, integration is done at the NGINX level.
+
+![Apache APISIX and WebAssemby architecture overview](https://api7.ai/wp-content/uploads/2022/09/architecture-diagram.png)
+
+## Let's code!
+
+Now that we have explained how everything fits together, it's time to code.
+
+### Preparing Rust for WebAssembly
+
+Before developing the first line of code, we need to give Rust <abbr title="WebAssembly">WASM</abbr> compilation capabilities.
+
+```bash
+rustup target add wasm32-wasi
+```
+
+It allows the Rust compiler to output WASM code:
+
+```bash
+cargo build --target wasm32-wasi
+```
+
+The WASM code is found in:
+
+* `target/wasm32-wasi/debug/sample.wasm`
+* `target/wasm32-wasi/release/sample.wasm` (when compiled with the `--release` flag)
+
+### Setting up the project
+
+The setup of the project is pretty straightforward:
+
+```bash
+cargo new sample --lib
+```
+
+The command creates a `lib` project with the expected structure.
+
+### The code itself
+
+Let me first say that the available documentation is pretty sparse. For example, `proxy-wasm`'s is limited to the [methods' signature](https://github.com/proxy-wasm/spec/tree/master/abi-versions/vNEXT) (think JavaDocs). Rust SDK is sample-based. However, one can get some information from the [C++ SDK](https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/blob/master/docs/wasm_filter.md).
+
+>WASM module is running in a stack-based virtual machine and its memory is isolated from the host environment. All interactions between host and WASM module are through functions and callbacks wrapped by context object.
+>
+>At bootstrap time, a root context is created. The root context has the same lifetime as the VM/runtime instance and acts as a target for any interactions which happen at initial setup. It is also used for interactions that outlive a request.
+>
+>At request time, a context with incremental is created for each stream. Stream context has the same lifetime as the stream itself and acts as a target for interactions that are local to that stream.

Review Comment:
   ditto
   ```suggestion
   > WASM module is running in a stack-based virtual machine and its memory is isolated from the host environment. All interactions between host and WASM module are through functions and callbacks wrapped by context object.
   >
   > At bootstrap time, a root context is created. The root context has the same lifetime as the VM/runtime instance and acts as a target for any interactions which happen at initial setup. It is also used for interactions that outlive a request.
   >
   > At request time, a context with incremental is created for each stream. Stream context has the same lifetime as the stream itself and acts as a target for interactions that are local to that stream.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-website] yzeng25 commented on pull request #1340: docs: Add Apache APISIX loves Rust

Posted by GitBox <gi...@apache.org>.
yzeng25 commented on PR #1340:
URL: https://github.com/apache/apisix-website/pull/1340#issuecomment-1257553049

   > @yzeng25 It will be good if you do it because I've no clue what you mean 😅
   
   I'd love to but currently I don't have access to it. I meant converting the images' link to something like `https://static.apiseven.com/2022/09/26/example.png`, which means storing it in another place, just like the other images in the blog.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-website] nfrankel commented on pull request #1340: docs: Add Apache APISIX loves Rust

Posted by GitBox <gi...@apache.org>.
nfrankel commented on PR #1340:
URL: https://github.com/apache/apisix-website/pull/1340#issuecomment-1257549547

   @yzeng25 It will be good if you do it because I've no clue what you mean 😅


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org