Mailing List Archive

mod_wasm: Contributing Upstream to Apache
Hi everyone,



I’m Jesús González, and I am part of VMware’s Wasm Labs: wasmlabs.dev<https://wasmlabs.dev/>, a group focused on creating open source tools for WebAssembly.

We have created mod_wasm, an Apache module for running WebAssembly binaries inside httpd, and we would like to contribute it upstream. Please see below for more details. We would love to get your feedback and understand what improvements would be needed (if any) before it could be considered for contribution to the project.





The details:



WebAssembly<https://webassembly.org/> (Wasm) is a new binary instruction format that is open, portable, efficient, secure, and polyglot. It originated in the browser but is increasingly used in server applications, in particular NGINX, Apache APISIX, Istio provide Wasm-based plugin support (i.e.: https://apisix.apache.org/docs/apisix/wasm/).



mod_wasm is a way to run WebAssembly modules inside Apache Server. This is similar to how mod_php embeds a PHP runtime to run PHP code. This enables any language that supports WebAssembly (including C++, Rust, Go but also Python, PHP, Ruby) to run with mod_wasm and take advantage of the extra level of security and sandboxing. To learn more about mod_wasm you can check out the following resources:

* An overview article<https://wasmlabs.dev/articles/apache-mod-wasm/> for the original release.
* We presented mod_wasm at ApacheCon this year and here are the slides<https://apachecon.com/acna2022/slides/01_Gonz%c3%a1lez_mod-wasm_Bringing_WebAssembly.pdf> and the source code: https://github.com/vmware-labs/mod_wasm.
* CNCF Talk on mod_wasm showcasing how to run WordPress: https://www.youtube.com/watch?v=jXe8kulUscQ



In terms of mod_wasm architecture, the module is split into two parts:

* mod_wasm.so is the extension module for Apache and it’s written in C.
* An external dependency: libwasm_runtime.so, which is written in Rust and needs to be installed into the system.



We modelled this after mod_tls, a module that is part of httpd and also has a Rust dependency.

You can take a look at the architecture diagram and instructions on how to build the module here: https://github.com/vmware-labs/mod_wasm#%EF%B8%8F-building-mod_wasm



In terms of the actual contribution, please find a patch attached. We tried to follow all existing conventions in terms of autoconf/automake, providing module documentation, etc. Please let us know anything that you see missing or could be improved. In particular, we do not know yet if it is better to keep the Rust code separate, as an external dependency (like mod_tls does) or in the Apache source code repository.



In summary, we believe mod_wasm is a worthy addition to httpd and it will allow us to catch up to some of the other web servers already supporting Wasm, like NGINX. We were encouraged by Rich Bowen, Jim Jagielski and Jean-Frederic Clere to submit it for contribution upstream and we are looking forward to your feedback.



Cheers!

Jesús
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Hi everyone,

Following up on our email about contributing mod_wasm, we have continued to make progress on our side and just released mod_wasm v0.10.0.

In this version, among other improvements, we introduce two major features:

* #1: Wasm multi-module support
* #2: Shared Wasm modules

In #1, you can now specify different Wasm modules to be used in different routes. For instance, now it’s possible with one-single Apache instance to load simultaneously the Wasm builds for the PHP<https://github.com/vmware-labs/webassembly-language-runtimes/releases> and Python<https://github.com/tiran/cpython-wasm-test/releases> interpreters (and any other languages that compile to Wasm now or in the future).

And in #2, you can now specify different per-route configurations to the same Wasm module. The Wasm binary is loaded in memory only once, and the different configurations are applied to the Wasm module per-HTTP request.

Combining all together, you can have a more flexible configuration such as:

<Location /wordpress>
SetHandler wasm-handler
WasmModule /var/www/modules/php7.4.32.wasm
WasmDir /tmp

</Location>

<Location /python-app>
SetHandler wasm-handler
WasmModule /var/www/modules/python3.11.wasm
WasmArg /var/www/python-app/app.py

</Location>

<Location /python-app2>
SetHandler wasm-handler
WasmModule /var/www/modules/python3.11.wasm
WasmArg /var/www/python-app2/app2.py

</Location>


We have run some simple, preliminary stress tests using ApacheBench and mod_wasm performs great in both MPM event and MPM worker modes.

Hope you can find some time to try mod_wasm and provide feedback. Let us know if you have questions or suggestions.
Jesús

PS: Updated patch attached.


De: Jesús González <jesusgm@vmware.com>
Responder a: "dev@httpd.apache.org" <dev@httpd.apache.org>
Fecha: lunes, 14 de noviembre de 2022, 7:38
Para: "dev@httpd.apache.org" <dev@httpd.apache.org>
CC: Daniel Lopez Ridruejo <daniellopez@vmware.com>
Asunto: mod_wasm: Contributing Upstream to Apache


Hi everyone,



I’m Jesús González, and I am part of VMware’s Wasm Labs: wasmlabs.dev<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwasmlabs.dev%2F&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hQnzxjyjL4RPU5GK%2FUz9N6AMlsTsJlxX%2BQSkn2E8XzI%3D&reserved=0>, a group focused on creating open source tools for WebAssembly.

We have created mod_wasm, an Apache module for running WebAssembly binaries inside httpd, and we would like to contribute it upstream. Please see below for more details. We would love to get your feedback and understand what improvements would be needed (if any) before it could be considered for contribution to the project.





The details:



WebAssembly<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwebassembly.org%2F&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MsBjIpsju0J9AHkCXLy2%2BY83MIaLzhywcjIIPOAcKkg%3D&reserved=0> (Wasm) is a new binary instruction format that is open, portable, efficient, secure, and polyglot. It originated in the browser but is increasingly used in server applications, in particular NGINX, Apache APISIX, Istio provide Wasm-based plugin support (i.e.: https://apisix.apache.org/docs/apisix/wasm/<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapisix.apache.org%2Fdocs%2Fapisix%2Fwasm%2F&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jXuPc0uRObYzq6O98T51ypWizrmus%2FdSGwGk6Gi40VQ%3D&reserved=0>).



mod_wasm is a way to run WebAssembly modules inside Apache Server. This is similar to how mod_php embeds a PHP runtime to run PHP code. This enables any language that supports WebAssembly (including C++, Rust, Go but also Python, PHP, Ruby) to run with mod_wasm and take advantage of the extra level of security and sandboxing. To learn more about mod_wasm you can check out the following resources:

* An overview article<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwasmlabs.dev%2Farticles%2Fapache-mod-wasm%2F&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=d2MpWnkiKJA4fDOUdNghYPg0p4fMsGTeGiFR6kfcwyg%3D&reserved=0> for the original release.
* We presented mod_wasm at ApacheCon this year and here are the slides<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapachecon.com%2Facna2022%2Fslides%2F01_Gonz%25C3%25A1lez_mod-wasm_Bringing_WebAssembly.pdf&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=c9U4xL6091Lei7hPlQ83PP6naUCI0SMIxmW0qvRJCq4%3D&reserved=0> and the source code: https://github.com/vmware-labs/mod_wasm<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvmware-labs%2Fmod_wasm&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5oF9oB7rTpJZfUyECkvOfSnEkdaRT1UhIgOIVBD%2F9fs%3D&reserved=0>.
* CNCF Talk on mod_wasm showcasing how to run WordPress: https://www.youtube.com/watch?v=jXe8kulUscQ<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjXe8kulUscQ&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=GTh0dro4fqACMKnluAvXITVQFNOUL1BEiijKuSgdVkA%3D&reserved=0>



In terms of mod_wasm architecture, the module is split into two parts:

* mod_wasm.so is the extension module for Apache and it’s written in C.
* An external dependency: libwasm_runtime.so, which is written in Rust and needs to be installed into the system.



We modelled this after mod_tls, a module that is part of httpd and also has a Rust dependency.

You can take a look at the architecture diagram and instructions on how to build the module here: https://github.com/vmware-labs/mod_wasm#%EF%B8%8F-building-mod_wasm<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvmware-labs%2Fmod_wasm%23%25EF%25B8%258F-building-mod_wasm&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=riwxB9vHMxT%2ByvYzGUXBXtgqMi%2B9%2BRVb1zUZSaTxTHE%3D&reserved=0>



In terms of the actual contribution, please find a patch attached. We tried to follow all existing conventions in terms of autoconf/automake, providing module documentation, etc. Please let us know anything that you see missing or could be improved. In particular, we do not know yet if it is better to keep the Rust code separate, as an external dependency (like mod_tls does) or in the Apache source code repository.



In summary, we believe mod_wasm is a worthy addition to httpd and it will allow us to catch up to some of the other web servers already supporting Wasm, like NGINX. We were encouraged by Rich Bowen, Jim Jagielski and Jean-Frederic Clere to submit it for contribution upstream and we are looking forward to your feedback.



Cheers!

Jesús
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Cool stuff!

On Mon, Nov 28, 2022 at 1:18 PM Jesús González <jesusgm@vmware.com> wrote:

> Hi everyone,
>
>
>
> Following up on our email about contributing mod_wasm, we have continued
> to make progress on our side and just released mod_wasm v0.10.0.
>
>
>
> In this version, among other improvements, we introduce two major features:
>
> - #1: Wasm multi-module support
> - #2: Shared Wasm modules
>
>
>
> In #1, you can now specify different Wasm modules to be used in different
> routes. For instance, now it’s possible with one-single Apache instance to
> load simultaneously the Wasm builds for the PHP
> <https://github.com/vmware-labs/webassembly-language-runtimes/releases>
> and Python <https://github.com/tiran/cpython-wasm-test/releases>
> interpreters (and any other languages that compile to Wasm now or in the
> future).
>
>
>
> And in #2, you can now specify different per-route configurations to the
> same Wasm module. The Wasm binary is loaded in memory only once, and the
> different configurations are applied to the Wasm module per-HTTP request.
>
>
>
> Combining all together, you can have a more flexible configuration such
> as:
>
>
>
> <Location /wordpress>
>
> SetHandler wasm-handler
>
> WasmModule /var/www/modules/php7.4.32.wasm
>
> WasmDir /tmp
>
> …
>
> </Location>
>
>
>
> <Location /python-app>
>
> SetHandler wasm-handler
>
> WasmModule /var/www/modules/python3.11.wasm
>
> WasmArg /var/www/python-app/app.py
>
> …
>
> </Location>
>
>
>
> <Location /python-app2>
>
> SetHandler wasm-handler
>
> WasmModule /var/www/modules/python3.11.wasm
>
> WasmArg /var/www/python-app2/app2.py
>
> …
>
> </Location>
>
>
>
>
>
> We have run some simple, preliminary stress tests using ApacheBench and
> mod_wasm performs great in both MPM event and MPM worker modes.
>
>
>
> Hope you can find some time to try mod_wasm and provide feedback. Let us
> know if you have questions or suggestions.
>
> Jesús
>
>
>
> PS: Updated patch attached.
>
>
>
>
>
> *De: *Jesús González <jesusgm@vmware.com>
> *Responder a: *"dev@httpd.apache.org" <dev@httpd.apache.org>
> *Fecha: *lunes, 14 de noviembre de 2022, 7:38
> *Para: *"dev@httpd.apache.org" <dev@httpd.apache.org>
> *CC: *Daniel Lopez Ridruejo <daniellopez@vmware.com>
> *Asunto: *mod_wasm: Contributing Upstream to Apache
>
>
>
> Hi everyone,
>
>
>
> I’m Jesús González, and I am part of VMware’s Wasm Labs: wasmlabs.dev
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwasmlabs.dev%2F&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hQnzxjyjL4RPU5GK%2FUz9N6AMlsTsJlxX%2BQSkn2E8XzI%3D&reserved=0>,
> a group focused on creating open source tools for WebAssembly.
>
> We have created mod_wasm, an Apache module for running WebAssembly
> binaries inside httpd, and we would like to contribute it upstream. Please
> see below for more details. We would love to get your feedback and
> understand what improvements would be needed (if any) before it could be
> considered for contribution to the project.
>
>
>
>
>
> The details:
>
>
>
> WebAssembly
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwebassembly.org%2F&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MsBjIpsju0J9AHkCXLy2%2BY83MIaLzhywcjIIPOAcKkg%3D&reserved=0>
> (Wasm) is a new binary instruction format that is open, portable,
> efficient, secure, and polyglot. It originated in the browser but is
> increasingly used in server applications, in particular NGINX, Apache
> APISIX, Istio provide Wasm-based plugin support (i.e.:
> https://apisix.apache.org/docs/apisix/wasm/
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapisix.apache.org%2Fdocs%2Fapisix%2Fwasm%2F&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jXuPc0uRObYzq6O98T51ypWizrmus%2FdSGwGk6Gi40VQ%3D&reserved=0>
> ).
>
>
>
> mod_wasm is a way to run WebAssembly modules inside Apache Server. This is
> similar to how mod_php embeds a PHP runtime to run PHP code. This enables
> any language that supports WebAssembly (including C++, Rust, Go but also
> Python, PHP, Ruby) to run with mod_wasm and take advantage of the extra
> level of security and sandboxing. To learn more about mod_wasm you can
> check out the following resources:
>
> - An overview article
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwasmlabs.dev%2Farticles%2Fapache-mod-wasm%2F&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=d2MpWnkiKJA4fDOUdNghYPg0p4fMsGTeGiFR6kfcwyg%3D&reserved=0>
> for the original release.
> - We presented mod_wasm at ApacheCon this year and here are the slides
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapachecon.com%2Facna2022%2Fslides%2F01_Gonz%25C3%25A1lez_mod-wasm_Bringing_WebAssembly.pdf&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=c9U4xL6091Lei7hPlQ83PP6naUCI0SMIxmW0qvRJCq4%3D&reserved=0>
> and the source code: https://github.com/vmware-labs/mod_wasm
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvmware-labs%2Fmod_wasm&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5oF9oB7rTpJZfUyECkvOfSnEkdaRT1UhIgOIVBD%2F9fs%3D&reserved=0>
> .
> - CNCF Talk on mod_wasm showcasing how to run WordPress:
> https://www.youtube.com/watch?v=jXe8kulUscQ
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjXe8kulUscQ&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=GTh0dro4fqACMKnluAvXITVQFNOUL1BEiijKuSgdVkA%3D&reserved=0>
>
>
>
> In terms of mod_wasm architecture, the module is split into two parts:
>
> - *mod_wasm.so* is the extension module for Apache and it’s written in
> C.
> - An external dependency: *libwasm_runtime.so*, which is written in
> Rust and needs to be installed into the system.
>
>
>
> We modelled this after mod_tls, a module that is part of httpd and also
> has a Rust dependency.
>
> You can take a look at the architecture diagram and instructions on how to
> build the module here:
> https://github.com/vmware-labs/mod_wasm#%EF%B8%8F-building-mod_wasm
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvmware-labs%2Fmod_wasm%23%25EF%25B8%258F-building-mod_wasm&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=riwxB9vHMxT%2ByvYzGUXBXtgqMi%2B9%2BRVb1zUZSaTxTHE%3D&reserved=0>
>
>
>
> In terms of the actual contribution, please find a patch attached. We
> tried to follow all existing conventions in terms of autoconf/automake,
> providing module documentation, etc. Please let us know anything that you
> see missing or could be improved. In particular, we do not know yet if it
> is better to keep the Rust code separate, as an external dependency (like
> mod_tls does) or in the Apache source code repository.
>
>
>
> In summary, we believe mod_wasm is a worthy addition to httpd and it will
> allow us to catch up to some of the other web servers already supporting
> Wasm, like NGINX. We were encouraged by Rich Bowen, Jim Jagielski and
> Jean-Frederic Clere to submit it for contribution upstream and we are
> looking forward to your feedback.
>
>
>
> Cheers!
>
> Jesús
>
>
>
>
>
--
Joe Schaefer, Ph.D.
We only build what you need built.
<joe@sunstarsys.com>
954.253.3732 <//954.253.3732>
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Hi everyone,



We have just posted a new article<https://wasmlabs.dev/articles/multi-module-support-in-mod-wasm-0-10-0/> about mod_wasm v0.10.0 and published a new container<https://github.com/vmware-labs/mod_wasm/pkgs/container/httpd-mod-wasm> to try different mod_wasm demos in two simple steps:



1. Run the container:

docker run -p 8080:8080 ghcr.io/vmware-labs/httpd-mod-wasm:latest



1. Open browser at:
* http://localhost:8080/wordpress for a WordPress demo with PHP 7.3.33.
* http://localhost:8080/http-request-viewer for a HTTP Request Viewer demo with Python 3.11.



Hope this helps to visualize the ability of supporting different language runtimes (present and future ones!) in a secure way with one single module.



Looking forward to your feedback.

Jesús
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Le 28/11/2022 à 19:17, Jesús González a écrit :
> Hi everyone,
>
> Following up on our email about contributing mod_wasm, we have continued
> to make progress on our side and just released mod_wasm v0.10.0.
>

Hi,

just a few nits to clean code and help reviews:

- No need to send html files, it will be generated by the framework
- I don't see the need for trace_nocontext(). Also have a look at
APLOG_MARK and its usages.
- APLOG_NOTICE looks too high for trace logging. APLOG_DEBUG?
- At the end of create_dir_config(), 'note' and the corresponding
apr_psprintf() are useless or a debugging logging call is missing
- Please use only C89 comments (/* */) - try to configure with
--enable-maintainer-mode
- some double new lines could be saved

CJ

> In this version, among other improvements, we introduce two major features:
>
> * #1: Wasm multi-module support
> * #2: Shared Wasm modules
>
> In #1, you can now specify different Wasm modules to be used in
> different routes. For instance, now it’s possible with one-single Apache
> instance to load simultaneously the Wasm builds for the PHP
> <https://github.com/vmware-labs/webassembly-language-runtimes/releases>and Python <https://github.com/tiran/cpython-wasm-test/releases>interpreters (and any other languages that compile to Wasm now or in the future).
>
> And in #2, you can now specify different per-route configurations to the
> same Wasm module. The Wasm binary is loaded in memory only once, and the
> different configurations are applied to the Wasm module per-HTTP request.
>
> Combining all together, you can have a more flexible configuration such as:
>
> <Location /wordpress>
>
>     SetHandler wasm-handler
>
>     WasmModule /var/www/modules/php7.4.32.wasm
>
>     WasmDir    /tmp
>
>     …
>
> </Location>
>
> <Location /python-app>
>
>     SetHandler wasm-handler
>
>     WasmModule /var/www/modules/python3.11.wasm
>
>     WasmArg    /var/www/python-app/app.py
>
>     …
>
> </Location>
>
> <Location /python-app2>
>
>     SetHandler wasm-handler
>
>     WasmModule /var/www/modules/python3.11.wasm
>
>     WasmArg    /var/www/python-app2/app2.py
>
>     …
>
> </Location>
>
> We have run some simple, preliminary stress tests using ApacheBench and
> mod_wasm performs great in both MPM event and MPM worker modes.
>
> Hope you can find some time to try mod_wasm and provide feedback. Let us
> know if you have questions or suggestions.
>
> Jesús
>
> PS: Updated patch attached.
>
> *De: *Jesús González <jesusgm@vmware.com>
> *Responder a: *"dev@httpd.apache.org" <dev@httpd.apache.org>
> *Fecha: *lunes, 14 de noviembre de 2022, 7:38
> *Para: *"dev@httpd.apache.org" <dev@httpd.apache.org>
> *CC: *Daniel Lopez Ridruejo <daniellopez@vmware.com>
> *Asunto: *mod_wasm: Contributing Upstream to Apache
>
> Hi everyone,
>
> I’m Jesús González, and I am part of VMware’s Wasm Labs: wasmlabs.dev
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwasmlabs.dev%2F&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hQnzxjyjL4RPU5GK%2FUz9N6AMlsTsJlxX%2BQSkn2E8XzI%3D&reserved=0>, a group focused on creating open source tools for WebAssembly.
>
> We have created mod_wasm, an Apachemodule for running WebAssembly
> binaries inside httpd, and we would like to contribute it upstream.
> Please see below for more details. We would love to get your feedback
> and understand what improvements would be needed (if any) before it
> could be considered for contribution to the project.
>
> The details:
>
> WebAssembly
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwebassembly.org%2F&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MsBjIpsju0J9AHkCXLy2%2BY83MIaLzhywcjIIPOAcKkg%3D&reserved=0>(Wasm) is a new binary instruction format that is open, portable, efficient, secure, and polyglot. It originated in the browser but is increasingly used in server applications, in particular NGINX, Apache APISIX, Istio provide Wasm-based plugin support (i.e.: https://apisix.apache.org/docs/apisix/wasm/ <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapisix.apache.org%2Fdocs%2Fapisix%2Fwasm%2F&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jXuPc0uRObYzq6O98T51ypWizrmus%2FdSGwGk6Gi40VQ%3D&reserved=0>).
>
> mod_wasm is a way to run WebAssembly modules inside Apache Server. This
> is similar to how mod_php embeds a PHP runtime to run PHP code. This
> enables any language that supports WebAssembly (including C++, Rust, Go
> but also Python, PHP, Ruby) to run with mod_wasm and take advantage of
> the extra level of security and sandboxing. To learn more about mod_wasm
> you can check out the following resources:
>
> * An overviewarticle
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwasmlabs.dev%2Farticles%2Fapache-mod-wasm%2F&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=d2MpWnkiKJA4fDOUdNghYPg0p4fMsGTeGiFR6kfcwyg%3D&reserved=0>for the original release.
> * We presented mod_wasm at ApacheCon this year and here are theslides
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapachecon.com%2Facna2022%2Fslides%2F01_Gonz%25C3%25A1lez_mod-wasm_Bringing_WebAssembly.pdf&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=c9U4xL6091Lei7hPlQ83PP6naUCI0SMIxmW0qvRJCq4%3D&reserved=0>and the source code:https://github.com/vmware-labs/mod_wasm <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvmware-labs%2Fmod_wasm&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5oF9oB7rTpJZfUyECkvOfSnEkdaRT1UhIgOIVBD%2F9fs%3D&reserved=0>.
> * CNCF Talk on mod_wasm showcasing how to run
> WordPress:https://www.youtube.com/watch?v=jXe8kulUscQ
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjXe8kulUscQ&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=GTh0dro4fqACMKnluAvXITVQFNOUL1BEiijKuSgdVkA%3D&reserved=0>
>
> In terms of mod_wasm architecture, the module is split into two parts:
>
> * /mod_wasm.so/is the extension module for Apache and it’s written in C.
> * An external dependency:/libwasm_runtime.so/, which is written in
> Rust and needs to be installed into the system.
>
> We modelled this after mod_tls, a module that is part of httpd and also
> has a Rust dependency.
>
> You can take a look at the architecture diagram and instructions on how
> to build the module
> here:https://github.com/vmware-labs/mod_wasm#%EF%B8%8F-building-mod_wasm
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvmware-labs%2Fmod_wasm%23%25EF%25B8%258F-building-mod_wasm&data=05%7C01%7Cjesusgm%40vmware.com%7C07586834510d4ffc0a5108dac60ac618%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638040046834229085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=riwxB9vHMxT%2ByvYzGUXBXtgqMi%2B9%2BRVb1zUZSaTxTHE%3D&reserved=0>
>
> In terms of the actual contribution, please find a patch attached. We
> tried to follow all existing conventions in terms of autoconf/automake,
> providing module documentation, etc. Please let us know anything that
> you see missing or could be improved. In particular, we do not know yet
> if it is better to keep the Rust code separate, as an external
> dependency (like mod_tls does) or in the Apache source code repository.
>
> In summary, we believe mod_wasm is a worthy addition to httpd and it
> will allow us to catch up to some of the other web servers already
> supporting Wasm, like NGINX. We were encouraged by Rich Bowen, Jim
> Jagielski and Jean-Frederic Clere to submit it for contribution upstream
> and we are looking forward to your feedback.
>
> Cheers!
>
> Jesús
>
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Thanks for your feedback, Christophe!

We have addressed all these different issues in our repo:
- All logging is now properly route to `ap_log_error()`, `ap_log_perror()` and `ap_log_rerror()`.
- Also now using APLOG_MARK, and all errors marked as APLOG_ERR.
- Removed unused code in create_dir_config().
- Apache-2.0 extended license headers.
- Only C89 comments (/* */), double new lines removed.
- Other minor tweaks.

An updated patch is attached.
It might also be interesting to submit a PR to the mirror repo at GitHub to ease the review, but I think I'd need proper permissions. Just let me know what you prefer.

Our goal is still to donate the code to the ASF and help to maintain it.

Cheers,
Jesús


?El 9/12/22, 19:39, "Christophe JAILLET" <christophe.jaillet@wanadoo.fr <mailto:christophe.jaillet@wanadoo.fr>> escribió:


!! External Email


Le 28/11/2022 à 19:17, Jesús González a écrit :
> Hi everyone,
>
> Following up on our email about contributing mod_wasm, we have continued
> to make progress on our side and just released mod_wasm v0.10.0.
>


Hi,


just a few nits to clean code and help reviews:


- No need to send html files, it will be generated by the framework
- I don't see the need for trace_nocontext(). Also have a look at
APLOG_MARK and its usages.
- APLOG_NOTICE looks too high for trace logging. APLOG_DEBUG?
- At the end of create_dir_config(), 'note' and the corresponding
apr_psprintf() are useless or a debugging logging call is missing
- Please use only C89 comments (/* */) - try to configure with
--enable-maintainer-mode
- some double new lines could be saved


CJ
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
On 11/14/22 07:37, Jesús González wrote:
> Hi everyone,
>
> I’m Jesús González, and I am part of VMware’s Wasm Labs: wasmlabs.dev
> <https://wasmlabs.dev/>, a group focused on creating open source tools
> for WebAssembly.
>
> We have created mod_wasm, an Apachemodule for running WebAssembly
> binaries inside httpd, and we would like to contribute it upstream.
> Please see below for more details. We would love to get your feedback
> and understand what improvements would be needed (if any) before it
> could be considered for contribution to the project.
>
> The details:
>
> WebAssembly <https://webassembly.org/>(Wasm) is a new binary instruction
> format that is open, portable, efficient, secure, and polyglot. It
> originated in the browser but is increasingly used in server
> applications, in particular NGINX, Apache APISIX, Istio provide
> Wasm-based plugin support (i.e.:
> https://apisix.apache.org/docs/apisix/wasm/
> <https://apisix.apache.org/docs/apisix/wasm/>).
>
> mod_wasm is a way to run WebAssembly modules inside Apache Server. This
> is similar to how mod_php embeds a PHP runtime to run PHP code. This
> enables any language that supports WebAssembly (including C++, Rust, Go
> but also Python, PHP, Ruby) to run with mod_wasm and take advantage of
> the extra level of security and sandboxing. To learn more about mod_wasm
> you can check out the following resources:
>
> * An overviewarticle
> <https://wasmlabs.dev/articles/apache-mod-wasm/>for the original
> release.
> * We presented mod_wasm at ApacheCon this year and here are theslides
> <https://apachecon.com/acna2022/slides/01_Gonz%c3%a1lez_mod-wasm_Bringing_WebAssembly.pdf>and the source code:https://github.com/vmware-labs/mod_wasm <https://github.com/vmware-labs/mod_wasm>.
> * CNCF Talk on mod_wasm showcasing how to run
> WordPress:https://www.youtube.com/watch?v=jXe8kulUscQ
> <https://www.youtube.com/watch?v=jXe8kulUscQ>
>
> In terms of mod_wasm architecture, the module is split into two parts:
>
> * /mod_wasm.so/is the extension module for Apache and it’s written in C.
> * An external dependency:/libwasm_runtime.so/, which is written in
> Rust and needs to be installed into the system.
>
> We modelled this after mod_tls, a module that is part of httpd and also
> has a Rust dependency.
>
> You can take a look at the architecture diagram and instructions on how
> to build the module
> here:https://github.com/vmware-labs/mod_wasm#%EF%B8%8F-building-mod_wasm
> <https://github.com/vmware-labs/mod_wasm#%EF%B8%8F-building-mod_wasm>
>
> In terms of the actual contribution, please find a patch attached. We
> tried to follow all existing conventions in terms of autoconf/automake,
> providing module documentation, etc. Please let us know anything that
> you see missing or could be improved. In particular, we do not know yet
> if it is better to keep the Rust code separate, as an external
> dependency (like mod_tls does) or in the Apache source code repository.
>
> In summary, we believe mod_wasm is a worthy addition to httpd and it
> will allow us to catch up to some of the other web servers already
> supporting Wasm, like NGINX. We were encouraged by Rich Bowen, Jim
> Jagielski and Jean-Frederic Clere to submit it for contribution upstream
> and we are looking forward to your feedback.

Today I have send some time of mod_wasm, basically I have build the
module and the runtime and run the hello demo. Using
https://github.com/vmware-labs/mod_wasm.git (main)

Reviewing that from a diff is hard, probably probably a PR again httpd
(https://github.com/apache/httpd/tree/trunk for example) would more easy
to review.

When trying to run the hello I noted that requires a big runtime
(basically I had unresolved wasm_return_const_char_ownership() which
comes from a rust file).

I also noted that the headers in the c and h file needs to updated.

And to clarify your goal is to donate the modules code and help to
maintain it, correct?


>
> Cheers!
>
> Jesús
>

--
Cheers

Jean-Frederic
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Thank Jean-Frederic for your feedback!

Regarding reviewing from the diff, I agree that a PR to GitHub will ease the review process.
I'm afraid I don't have enough permission to do it. Who/where can I ask for it?

On the issue with wasm_return_const_char_ownership(), that's probably because we renamed the function name in the latest v0.10.0 for consistency.
Rebuilding everything (including the Rust library) should make that work.

With respect to the headers, in the update from yesterday both mod_wasm.h and mod_wasm.c now include the extended the Apache-2.0 license text as the other modules.

Finally, yes our goal is to donate the module code and help to maintain it! __

Jesús

?El 13/12/22, 18:57, "jean-frederic clere" <jfclere@gmail.com <mailto:jfclere@gmail.com>> escribió:


!! External Email


On 11/14/22 07:37, Jesús González wrote:
> Hi everyone,
>
> I’m Jesús González, and I am part of VMware’s Wasm Labs: wasmlabs.dev
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwasmlabs.dev%2F&amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315550879%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=qCNY3UEqv31Cc%2B5eqb6FT5wcnio0qcOzgQYcO20Nqlk%3D&amp;reserved=0> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwasmlabs.dev%2F&amp;amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315550879%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=qCNY3UEqv31Cc%2B5eqb6FT5wcnio0qcOzgQYcO20Nqlk%3D&amp;amp;reserved=0&gt;>, a group focused on creating open source tools
> for WebAssembly.
>
> We have created mod_wasm, an Apachemodule for running WebAssembly
> binaries inside httpd, and we would like to contribute it upstream.
> Please see below for more details. We would love to get your feedback
> and understand what improvements would be needed (if any) before it
> could be considered for contribution to the project.
>
> The details:
>
> WebAssembly <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwebassembly.org%2F&amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315550879%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=WlP8Eduz5DibUj1HWwUo57hGHRn9uZ9RoFDl8E2dk5I%3D&amp;reserved=0> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwebassembly.org%2F&amp;amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315550879%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=WlP8Eduz5DibUj1HWwUo57hGHRn9uZ9RoFDl8E2dk5I%3D&amp;amp;reserved=0&gt;>(Wasm) is a new binary instruction
> format that is open, portable, efficient, secure, and polyglot. It
> originated in the browser but is increasingly used in server
> applications, in particular NGINX, Apache APISIX, Istio provide
> Wasm-based plugin support (i.e.:
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapisix.apache.org%2Fdocs%2Fapisix%2Fwasm%2F&amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=iJHoUOiV%2B%2FgD3VzOqhugsOnFrliTCQQChWQ%2Bdj5APwM%3D&amp;reserved=0 <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapisix.apache.org%2Fdocs%2Fapisix%2Fwasm%2F&amp;amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=iJHoUOiV%2B%2FgD3VzOqhugsOnFrliTCQQChWQ%2Bdj5APwM%3D&amp;amp;reserved=0>
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapisix.apache.org%2Fdocs%2Fapisix%2Fwasm%2F&amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=iJHoUOiV%2B%2FgD3VzOqhugsOnFrliTCQQChWQ%2Bdj5APwM%3D&amp;reserved=0> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapisix.apache.org%2Fdocs%2Fapisix%2Fwasm%2F&amp;amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=iJHoUOiV%2B%2FgD3VzOqhugsOnFrliTCQQChWQ%2Bdj5APwM%3D&amp;amp;reserved=0&gt;>).
>
> mod_wasm is a way to run WebAssembly modules inside Apache Server. This
> is similar to how mod_php embeds a PHP runtime to run PHP code. This
> enables any language that supports WebAssembly (including C++, Rust, Go
> but also Python, PHP, Ruby) to run with mod_wasm and take advantage of
> the extra level of security and sandboxing. To learn more about mod_wasm
> you can check out the following resources:
>
> * An overviewarticle
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwasmlabs.dev%2Farticles%2Fapache-mod-wasm%2F&amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=tUaQCURpeq%2BbvLC4Ibj6yjJN9bCblS0gmBSBoTZOI5A%3D&amp;reserved=0>for <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwasmlabs.dev%2Farticles%2Fapache-mod-wasm%2F&amp;amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=tUaQCURpeq%2BbvLC4Ibj6yjJN9bCblS0gmBSBoTZOI5A%3D&amp;amp;reserved=0&gt;for> the original
> release.
> * We presented mod_wasm at ApacheCon this year and here are theslides
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapachecon.com%2Facna2022%2Fslides%2F01_Gonz%25C3%25A1lez_mod-wasm_Bringing_WebAssembly.pdf&amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=3q4zWco%2F7lUOHpiNq6RZBFWpp3%2FEe2fsNrB%2FIdMGFVg%3D&amp;reserved=0>and <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapachecon.com%2Facna2022%2Fslides%2F01_Gonz%25C3%25A1lez_mod-wasm_Bringing_WebAssembly.pdf&amp;amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=3q4zWco%2F7lUOHpiNq6RZBFWpp3%2FEe2fsNrB%2FIdMGFVg%3D&amp;amp;reserved=0&gt;and> the source code:https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvmware-labs%2Fmod_wasm&amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=zFaAicFRHh%2BwCiE8ke%2FZ4Q79y8xlgONRbogtl%2FCX7%2Fg%3D&amp;reserved=0 <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvmware-labs%2Fmod_wasm&amp;amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=zFaAicFRHh%2BwCiE8ke%2FZ4Q79y8xlgONRbogtl%2FCX7%2Fg%3D&amp;amp;reserved=0> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvmware-labs%2Fmod_wasm&amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=zFaAicFRHh%2BwCiE8ke%2FZ4Q79y8xlgONRbogtl%2FCX7%2Fg%3D&amp;reserved=0> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvmware-labs%2Fmod_wasm&amp;amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=zFaAicFRHh%2BwCiE8ke%2FZ4Q79y8xlgONRbogtl%2FCX7%2Fg%3D&amp;amp;reserved=0&gt;>.
> * CNCF Talk on mod_wasm showcasing how to run
> WordPress:https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjXe8kulUscQ&amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=zqpz3y3c4L28baXjKKcyrmBd40YBU9o1K8FvS21wIpQ%3D&amp;reserved=0 <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjXe8kulUscQ&amp;amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=zqpz3y3c4L28baXjKKcyrmBd40YBU9o1K8FvS21wIpQ%3D&amp;amp;reserved=0>
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjXe8kulUscQ&amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=zqpz3y3c4L28baXjKKcyrmBd40YBU9o1K8FvS21wIpQ%3D&amp;reserved=0> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjXe8kulUscQ&amp;amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=zqpz3y3c4L28baXjKKcyrmBd40YBU9o1K8FvS21wIpQ%3D&amp;amp;reserved=0&gt;>
>
> In terms of mod_wasm architecture, the module is split into two parts:
>
> * /mod_wasm.so/is the extension module for Apache and it’s written in C.
> * An external dependency:/libwasm_runtime.so/, which is written in
> Rust and needs to be installed into the system.
>
> We modelled this after mod_tls, a module that is part of httpd and also
> has a Rust dependency.
>
> You can take a look at the architecture diagram and instructions on how
> to build the module
> here:https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvmware-labs%2Fmod_wasm%23%25EF%25B8%258F-building-mod_wasm&amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=2ayeUlhO%2FA3KOIFdUjP850OLGPmQAYi%2Blf%2FbNfDO1GY%3D&amp;reserved=0 <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvmware-labs%2Fmod_wasm%23%25EF%25B8%258F-building-mod_wasm&amp;amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=2ayeUlhO%2FA3KOIFdUjP850OLGPmQAYi%2Blf%2FbNfDO1GY%3D&amp;amp;reserved=0>
> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvmware-labs%2Fmod_wasm%23%25EF%25B8%258F-building-mod_wasm&amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=2ayeUlhO%2FA3KOIFdUjP850OLGPmQAYi%2Blf%2FbNfDO1GY%3D&amp;reserved=0> <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvmware-labs%2Fmod_wasm%23%25EF%25B8%258F-building-mod_wasm&amp;amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=2ayeUlhO%2FA3KOIFdUjP850OLGPmQAYi%2Blf%2FbNfDO1GY%3D&amp;amp;reserved=0&gt;>
>
> In terms of the actual contribution, please find a patch attached. We
> tried to follow all existing conventions in terms of autoconf/automake,
> providing module documentation, etc. Please let us know anything that
> you see missing or could be improved. In particular, we do not know yet
> if it is better to keep the Rust code separate, as an external
> dependency (like mod_tls does) or in the Apache source code repository.
>
> In summary, we believe mod_wasm is a worthy addition to httpd and it
> will allow us to catch up to some of the other web servers already
> supporting Wasm, like NGINX. We were encouraged by Rich Bowen, Jim
> Jagielski and Jean-Frederic Clere to submit it for contribution upstream
> and we are looking forward to your feedback.


Today I have send some time of mod_wasm, basically I have build the
module and the runtime and run the hello demo. Using
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvmware-labs%2Fmod_wasm.git&amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=MshS32XiCh0XPtIaVZpa%2Bm3%2BkXH6DdEBtDB3Q2YzQmA%3D&amp;reserved=0 <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvmware-labs%2Fmod_wasm.git&amp;amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=MshS32XiCh0XPtIaVZpa%2Bm3%2BkXH6DdEBtDB3Q2YzQmA%3D&amp;amp;reserved=0> (main)


Reviewing that from a diff is hard, probably probably a PR again httpd
(https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fhttpd%2Ftree%2Ftrunk&amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=BpmEHbMT8bBfyXzOCmITmbFBNWBcz5aEdLZlwjnGk4M%3D&amp;reserved=0 <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fhttpd%2Ftree%2Ftrunk&amp;amp;data=05%7C01%7Cjesusgm%40vmware.com%7Cb9252a6ca5404ddfd20008dadd337411%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C1%7C638065510315707067%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=BpmEHbMT8bBfyXzOCmITmbFBNWBcz5aEdLZlwjnGk4M%3D&amp;amp;reserved=0> for example) would more easy
to review.


When trying to run the hello I noted that requires a big runtime
(basically I had unresolved wasm_return_const_char_ownership() which
comes from a rust file).


I also noted that the headers in the c and h file needs to updated.


And to clarify your goal is to donate the modules code and help to
maintain it, correct?




>
> Cheers!
>
> Jesús
>


--
Cheers


Jean-Frederic




!! External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
On 12/13/22 7:58 PM, Jesús González wrote:
> Thank Jean-Frederic for your feedback!
>
> Regarding reviewing from the diff, I agree that a PR to GitHub will ease the review process.
> I'm afraid I don't have enough permission to do it. Who/where can I ask for it?

You don't need special permissions. Just create a fork of https://github.com/apache/httpd with your github account.
Branch trunk to your feature branch in this fork. Commit mod_wasm to it and create a PR against https://github.com/apache/httpd

Regards

Rüdiger
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Thanks, Ruediger!

mod_wasm code can be reviewed now on the PR: https://github.com/apache/httpd/pull/335
I will work on adding a Travis CI test for mod_wasm.

Cheers,
Jesús

?El 13/12/22, 20:45, "Ruediger Pluem" <rpluem@apache.org <mailto:rpluem@apache.org>> escribió:


!! External Email


On 12/13/22 7:58 PM, Jesús González wrote:
> Thank Jean-Frederic for your feedback!
>
> Regarding reviewing from the diff, I agree that a PR to GitHub will ease the review process.
> I'm afraid I don't have enough permission to do it. Who/where can I ask for it?


You don't need special permissions. Just create a fork of https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fhttpd&amp;data=05%7C01%7Cjesusgm%40vmware.com%7C47055f4dc74c4b83020f08dadd429a24%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638065575374911445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=8LaYxIvquVrH%2FrssQ%2Fl0vCE4T0hr0dRhh1quVybdSIY%3D&amp;reserved=0 <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fhttpd&amp;amp;data=05%7C01%7Cjesusgm%40vmware.com%7C47055f4dc74c4b83020f08dadd429a24%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638065575374911445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=8LaYxIvquVrH%2FrssQ%2Fl0vCE4T0hr0dRhh1quVybdSIY%3D&amp;amp;reserved=0> with your github account.
Branch trunk to your feature branch in this fork. Commit mod_wasm to it and create a PR against https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fhttpd&amp;data=05%7C01%7Cjesusgm%40vmware.com%7C47055f4dc74c4b83020f08dadd429a24%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638065575374911445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=8LaYxIvquVrH%2FrssQ%2Fl0vCE4T0hr0dRhh1quVybdSIY%3D&amp;reserved=0 <https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fhttpd&amp;amp;data=05%7C01%7Cjesusgm%40vmware.com%7C47055f4dc74c4b83020f08dadd429a24%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C638065575374911445%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=8LaYxIvquVrH%2FrssQ%2Fl0vCE4T0hr0dRhh1quVybdSIY%3D&amp;amp;reserved=0>


Regards


Rüdiger




!! External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
It is impossible to run mod_h2 without it or similar.

On Tue, Jan 24, 2023 at 3:37 PM Eric Covener <covener@gmail.com> wrote:

> > We are still very interested in contributing this module upstream and
> helping to maintain it. Please, let us know what improvements or changes
> would be needed for it to be considered ready for inclusion.
>
> As a pessimistic PMC member not caring about WASM or these languages,
> I worry that marrying the lifecycle together is not advantageous for
> either side. Of course I worry about being stuck with the pieces when
> employer interest wanes or after turnover. It does not seem like it's
> strictly necessary to be part of the server distribution (there are
> many examples of successful out-of-tree modules).
>
> However the above is no veto.
>
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Would be great to marry it to apreq, too.

On Tue, Jan 24, 2023 at 4:04 PM Joe Schaefer <joe@sunstarsys.com> wrote:

> It is impossible to run mod_h2 without it or similar.
>
> On Tue, Jan 24, 2023 at 3:37 PM Eric Covener <covener@gmail.com> wrote:
>
>> > We are still very interested in contributing this module upstream and
>> helping to maintain it. Please, let us know what improvements or changes
>> would be needed for it to be considered ready for inclusion.
>>
>> As a pessimistic PMC member not caring about WASM or these languages,
>> I worry that marrying the lifecycle together is not advantageous for
>> either side. Of course I worry about being stuck with the pieces when
>> employer interest wanes or after turnover. It does not seem like it's
>> strictly necessary to be part of the server distribution (there are
>> many examples of successful out-of-tree modules).
>>
>> However the above is no veto.
>>
>
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Looked at the PR- the IO is pretty primitive (no streaming anywhere). Probably not fatal for Webapps, but it could use some better relations with the filter stack and bucket brigades.

Joe Schaefer, Ph.D
<joe@sunstarsys.com>
+1 (954) 253-3732
SunStar Systems, Inc.
Orion - The Enterprise Jamstack Wiki

________________________________
From: Joe Schaefer <joe@sunstarsys.com>
Sent: Tuesday, January 24, 2023 4:06:13 PM
To: dev@httpd.apache.org <dev@httpd.apache.org>
Subject: Re: mod_wasm: Contributing Upstream to Apache

Would be great to marry it to apreq, too.

On Tue, Jan 24, 2023 at 4:04 PM Joe Schaefer <joe@sunstarsys.com<mailto:joe@sunstarsys.com>> wrote:
It is impossible to run mod_h2 without it or similar.

On Tue, Jan 24, 2023 at 3:37 PM Eric Covener <covener@gmail.com<mailto:covener@gmail.com>> wrote:
> We are still very interested in contributing this module upstream and helping to maintain it. Please, let us know what improvements or changes would be needed for it to be considered ready for inclusion.

As a pessimistic PMC member not caring about WASM or these languages,
I worry that marrying the lifecycle together is not advantageous for
either side. Of course I worry about being stuck with the pieces when
employer interest wanes or after turnover. It does not seem like it's
strictly necessary to be part of the server distribution (there are
many examples of successful out-of-tree modules).

However the above is no veto.
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Still, the idea is wicked cool if mod_wasm really can isolate the Python,
PHP, etc targets onto individual POSIX threads.

Very exciting stuff for HTTP/2 Webapps.

On Wed, Jan 25, 2023 at 4:31 AM Joe Schaefer <joe@sunstarsys.com> wrote:

> Looked at the PR- the IO is pretty primitive (no streaming anywhere).
> Probably not fatal for Webapps, but it could use some better relations with
> the filter stack and bucket brigades.
>
> Joe Schaefer, Ph.D
> <joe@sunstarsys.com>
> +1 (954) 253-3732
> SunStar Systems, Inc.
> *Orion - The Enterprise Jamstack Wiki*
>
> ------------------------------
> *From:* Joe Schaefer <joe@sunstarsys.com>
> *Sent:* Tuesday, January 24, 2023 4:06:13 PM
> *To:* dev@httpd.apache.org <dev@httpd.apache.org>
> *Subject:* Re: mod_wasm: Contributing Upstream to Apache
>
> Would be great to marry it to apreq, too.
>
> On Tue, Jan 24, 2023 at 4:04 PM Joe Schaefer <joe@sunstarsys.com> wrote:
>
> It is impossible to run mod_h2 without it or similar.
>
> On Tue, Jan 24, 2023 at 3:37 PM Eric Covener <covener@gmail.com> wrote:
>
> > We are still very interested in contributing this module upstream and
> helping to maintain it. Please, let us know what improvements or changes
> would be needed for it to be considered ready for inclusion.
>
> As a pessimistic PMC member not caring about WASM or these languages,
> I worry that marrying the lifecycle together is not advantageous for
> either side. Of course I worry about being stuck with the pieces when
> employer interest wanes or after turnover. It does not seem like it's
> strictly necessary to be part of the server distribution (there are
> many examples of successful out-of-tree modules).
>
> However the above is no veto.
>
> --
Joe Schaefer, Ph.D.
<https://sunstarsys.com/orion/features>
Orion - The Enterprise Jamstack Wiki <https://sunstarsys.com/orion/features>
<joe@sunstarsys.com>
954.253.3732 <//954.253.3732>
RE: Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Hi Eric,

Thanks for the feedback. Though Wasm is relatively new it is being adopted by other HTTP-related projects, like NGINX and Envoy proxy and even ASF projects like APISIX. We want to contribute upstream to bring some of these new features to the Apache web server, similarly to how we are working to contribute our changes to other projects upstream (SQLite, PHP). We plan to continue to development and maintenance regardless of future VMware involvement. In fact, the reason we started this project was because our manager Daniel Lopez was an early ASF member and he looks at this as a way to contribute back to the community. We are initially targeting support for regular web apps such as WordPress, but we plan for mod_wasm to enable safely extending Apache's own functionality, providing access to the module API from Wasm code.

On 2023/01/24 20:36:44 Eric Covener wrote:
> > We are still very interested in contributing this module upstream and helping to maintain it. Please, let us know what improvements or changes would be needed for it to be considered ready for inclusion.
>
> As a pessimistic PMC member not caring about WASM or these languages,
> I worry that marrying the lifecycle together is not advantageous for
> either side. Of course I worry about being stuck with the pieces when
> employer interest wanes or after turnover. It does not seem like it's
> strictly necessary to be part of the server distribution (there are
> many examples of successful out-of-tree modules).
>
> However the above is no veto.
>
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Thanks Joe. You are correct, this initial implementation is the simplest one to get it off the ground. We plan to continue development and add the streaming functionality, which we know we will need for things like large PDF file generation or support for Proxy-Wasm.

Yes, isolating language runtimes (PHP, Python, ...) per thread is a cool feature that enables new possibilities like simultaneously supporting multiple versions of PHP as well as better multi-tenancy (you will be able to keep user's code and assets separate from each other using Wasm built-in isolation mechanism).

Regarding apreq, right now we have not had a need to use it as we pass most of the headers and body to the runtimes themselves as the language runtimes code for handling requests, etc. takes care of it as part of the CGI implementation, etc. As we look to add different functionality (i.e. extending Apache itself) we will probably provide access to it from Wasm.


De: Joe Schaefer <joe@sunstarsys.com>
Responder a: "dev@httpd.apache.org" <dev@httpd.apache.org>
Fecha: jueves, 26 de enero de 2023, 5:17
Para: "dev@httpd.apache.org" <dev@httpd.apache.org>
Asunto: Re: mod_wasm: Contributing Upstream to Apache

Still, the idea is wicked cool if mod_wasm really can isolate the Python, PHP, etc targets onto individual POSIX threads.

Very exciting stuff for HTTP/2 Webapps.
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
A native interface outside of CGI compat for apreq would be a killer new
feature, because it really finishes our vision for apreq as the
one-HTML-spec-parser for all native apps, regardless of language choice. Of
course this would be a new opt-in feature for target languages to take
advantage of, but it will really set apart the speed freaks in your
userbase.
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Looking over the WASM Roadmap, it appears that they have a plan for
multithreading within a single target language. That would allow you to
fully support every silly GIL-addled language runtime out there, which
would be very compelling.

On Fri, Jan 27, 2023 at 1:33 PM Joe Schaefer <joe@sunstarsys.com> wrote:

> A native interface outside of CGI compat for apreq would be a killer new
> feature, because it really finishes our vision for apreq as the
> one-HTML-spec-parser for all native apps, regardless of language choice. Of
> course this would be a new opt-in feature for target languages to take
> advantage of, but it will really set apart the speed freaks in your
> userbase.
>
>
Re: Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Part of the really cool things you'd like to have as an app-server author
that knows the APR/APU/HTTPd runtime are subrequests, including the
portions that interact with the filter API.
I'm always writing home-grown app-specific SSI-ish filters via mod_perl to
process application pages as event-driven streams. It will be interesting
to compare mod_wasm with mod_perl2
in terms of security / sandbox models and weigh them against other
nonfunctional features (memory, latency, CPU, etc).


On Fri, Jan 27, 2023 at 12:28 PM Jesús González <jesusgm@vmware.com> wrote:

> Hi Eric,
>
> Thanks for the feedback. Though Wasm is relatively new it is being adopted
> by other HTTP-related projects, like NGINX and Envoy proxy and even ASF
> projects like APISIX. We want to contribute upstream to bring some of these
> new features to the Apache web server, similarly to how we are working to
> contribute our changes to other projects upstream (SQLite, PHP). We plan to
> continue to development and maintenance regardless of future VMware
> involvement. In fact, the reason we started this project was because our
> manager Daniel Lopez was an early ASF member and he looks at this as a way
> to contribute back to the community. We are initially targeting support for
> regular web apps such as WordPress, but we plan for mod_wasm to enable
> safely extending Apache's own functionality, providing access to the module
> API from Wasm code.
>
> On 2023/01/24 20:36:44 Eric Covener wrote:
> > > We are still very interested in contributing this module upstream and
> helping to maintain it. Please, let us know what improvements or changes
> would be needed for it to be considered ready for inclusion.
> >
> > As a pessimistic PMC member not caring about WASM or these languages,
> > I worry that marrying the lifecycle together is not advantageous for
> > either side. Of course I worry about being stuck with the pieces when
> > employer interest wanes or after turnover. It does not seem like it's
> > strictly necessary to be part of the server distribution (there are
> > many examples of successful out-of-tree modules).
> >
> > However the above is no veto.
> >
>
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Yes, the usage of Wasm for filters makes a lot of sense. This is why I previously mentioned the Envoy’s proxy-wasm spec<https://github.com/proxy-wasm/spec>, which is essentially an ABI specification for running WebAssembly in proxies. Beyond Envoy, you can find similar approaches in Nginx<https://wasmedge.org/book/en/use_cases/frameworks/mesh/wasm-nginx-module.html> and in APISIX<https://github.com/apache/apisix/blob/master/docs/en/latest/wasm.md>. One of our long term goals is to implement this specification for Apache itself.

mod_wasm’s initial goal is to allow running unmodified apps under WebAssembly in Apache (i.e.: WordPress, Drupal, etc.). Having said that, it is also a great fit to expose the internal Apache APIs, enabling safely building Apache modules using ANY language, not just filters but any functionality. Basically, a lot of the functionality you need to use mod_lua and mod_perl (or having to write your own C module) but language independence and with other benefits inherited by running Wasm code: sandboxing security, running at almost native, etc.
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Hola!

We just released a mod_wasm security update (v0.10.3<https://github.com/vmware-labs/mod_wasm/releases/tag/v0.10.3>) to address two recently disclosed CVEs (one critical) of Wasmtime, the WebAssembly runtime mod_wasm uses.

Further details can be found in this article<https://wasmlabs.dev/articles/wasmtime-6-0-1-security-update/> and in the mod_wasm changelog<https://github.com/vmware-labs/mod_wasm/blob/main/CHANGELOG.md>.

Let us know if you find any issues.

Cheers!
Jes?s
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Done, version 0.10.3 available on the VS17 download page.

Cheers, Steffen


On Thursday 09/03/2023 at 16:34, Jesús González wrote:
>
>
> Hola!
>
> We just released a mod_wasm security update (v0.10.3) to address two
> recently disclosed CVEs (one critical) of Wasmtime, the WebAssembly
> runtime mod_wasm uses.
>
> Further details can be found in this article and in the mod_wasm
> changelog.
>
> Let us know if you find any issues.
>
> Cheers!
> Jesús
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Great! Thanks Steffen.
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Hola!



We have released recent versions of mod_wasm allowing Wasm modules to return any output type via stdout, including binaries with non UTF-8 bytes sequences or \0 NULL terminators in the middle, among other fixes (see CHANGELOG<https://github.com/vmware-labs/mod_wasm/blob/main/CHANGELOG.md> for details).


These new versions allowed us to run new fully functional and unmodified applications (such as Drupal) in a safe WebAssembly environment. We will release a demo soon and a post with all the details.



We believe mod_wasm is getting ready for a v1.0.0 release. So, we really would like to get feedback from the HTTPD committers here. Still our plan is contributing this module upstream and helping to maintain it.



Cheers!

Jes?s
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Hola!

We just released a mod_wasm security update (v0.11.2) to address a recent CVE (low security). More details in the changelog<https://github.com/vmware-labs/mod_wasm/blob/main/CHANGELOG.md>.

Cheers,
Jes?s
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
I think not making WASM a first class concern in a proxy or server is missing out, more so in those platforms where extensibility isn't trivial. Apache will remain running in current setups but having limited extensibility is something concerning these days as systems are getting more and more complex. Writing an apache module isn't something you do every day and it probably takes quite some time, writing a wasm app following certain ABI is something you can do in minutes, hence supporting mod_wasm as a first class concern could be a good point in the sustainability of an ecosystem when it comes to moving forward out of the status quo.

On 2022/11/14 06:37:34 Jesús González wrote:
> Hi everyone,
>
>
>
> I’m Jesús González, and I am part of VMware’s Wasm Labs: wasmlabs.dev<https://wasmlabs.dev/>, a group focused on creating open source tools for WebAssembly.
>
> We have created mod_wasm, an Apache module for running WebAssembly binaries inside httpd, and we would like to contribute it upstream. Please see below for more details. We would love to get your feedback and understand what improvements would be needed (if any) before it could be considered for contribution to the project.
>
>
>
>
>
> The details:
>
>
>
> WebAssembly<https://webassembly.org/> (Wasm) is a new binary instruction format that is open, portable, efficient, secure, and polyglot. It originated in the browser but is increasingly used in server applications, in particular NGINX, Apache APISIX, Istio provide Wasm-based plugin support (i.e.: https://apisix.apache.org/docs/apisix/wasm/).
>
>
>
> mod_wasm is a way to run WebAssembly modules inside Apache Server. This is similar to how mod_php embeds a PHP runtime to run PHP code. This enables any language that supports WebAssembly (including C++, Rust, Go but also Python, PHP, Ruby) to run with mod_wasm and take advantage of the extra level of security and sandboxing. To learn more about mod_wasm you can check out the following resources:
>
> * An overview article<https://wasmlabs.dev/articles/apache-mod-wasm/> for the original release.
> * We presented mod_wasm at ApacheCon this year and here are the slides<https://apachecon.com/acna2022/slides/01_Gonz%c3%a1lez_mod-wasm_Bringing_WebAssembly.pdf> and the source code: https://github.com/vmware-labs/mod_wasm.
> * CNCF Talk on mod_wasm showcasing how to run WordPress: https://www.youtube.com/watch?v=jXe8kulUscQ
>
>
>
> In terms of mod_wasm architecture, the module is split into two parts:
>
> * mod_wasm.so is the extension module for Apache and it’s written in C.
> * An external dependency: libwasm_runtime.so, which is written in Rust and needs to be installed into the system.
>
>
>
> We modelled this after mod_tls, a module that is part of httpd and also has a Rust dependency.
>
> You can take a look at the architecture diagram and instructions on how to build the module here: https://github.com/vmware-labs/mod_wasm#%EF%B8%8F-building-mod_wasm
>
>
>
> In terms of the actual contribution, please find a patch attached. We tried to follow all existing conventions in terms of autoconf/automake, providing module documentation, etc. Please let us know anything that you see missing or could be improved. In particular, we do not know yet if it is better to keep the Rust code separate, as an external dependency (like mod_tls does) or in the Apache source code repository.
>
>
>
> In summary, we believe mod_wasm is a worthy addition to httpd and it will allow us to catch up to some of the other web servers already supporting Wasm, like NGINX. We were encouraged by Rich Bowen, Jim Jagielski and Jean-Frederic Clere to submit it for contribution upstream and we are looking forward to your feedback.
>
>
>
> Cheers!
>
> Jesús
>
>
>
>
>
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Huge fan, love that you are receptive to my feedback. If you get to the
point where the apreq_* (APR table-based) interfaces in trunk can be
exposed as read-only data structures in mod_wasm as an optional API for
power httpd users that like the sandboxed functionality you get OOTB, that
would justify a lot of the more conservative concerns that some devs have
for not putting incorporating this into the trunk codebase, which would be
my recommendation at that point for how to get it into a releasable tree at
some point.


On Tue, May 30, 2023 at 8:42?AM José Carlos Chávez <jcchavezs@apache.org>
wrote:

> I think not making WASM a first class concern in a proxy or server is
> missing out, more so in those platforms where extensibility isn't trivial.
> Apache will remain running in current setups but having limited
> extensibility is something concerning these days as systems are getting
> more and more complex. Writing an apache module isn't something you do
> every day and it probably takes quite some time, writing a wasm app
> following certain ABI is something you can do in minutes, hence supporting
> mod_wasm as a first class concern could be a good point in the
> sustainability of an ecosystem when it comes to moving forward out of the
> status quo.
>
> On 2022/11/14 06:37:34 Jesús González wrote:
> > Hi everyone,
> >
> >
> >
> > I’m Jesús González, and I am part of VMware’s Wasm Labs: wasmlabs.dev<
> https://wasmlabs.dev/>, a group focused on creating open source tools for
> WebAssembly.
> >
> > We have created mod_wasm, an Apache module for running WebAssembly
> binaries inside httpd, and we would like to contribute it upstream. Please
> see below for more details. We would love to get your feedback and
> understand what improvements would be needed (if any) before it could be
> considered for contribution to the project.
> >
> >
> >
> >
> >
> > The details:
> >
> >
> >
> > WebAssembly<https://webassembly.org/> (Wasm) is a new binary
> instruction format that is open, portable, efficient, secure, and polyglot.
> It originated in the browser but is increasingly used in server
> applications, in particular NGINX, Apache APISIX, Istio provide Wasm-based
> plugin support (i.e.: https://apisix.apache.org/docs/apisix/wasm/).
> >
> >
> >
> > mod_wasm is a way to run WebAssembly modules inside Apache Server. This
> is similar to how mod_php embeds a PHP runtime to run PHP code. This
> enables any language that supports WebAssembly (including C++, Rust, Go but
> also Python, PHP, Ruby) to run with mod_wasm and take advantage of the
> extra level of security and sandboxing. To learn more about mod_wasm you
> can check out the following resources:
> >
> > * An overview article<https://wasmlabs.dev/articles/apache-mod-wasm/>
> for the original release.
> > * We presented mod_wasm at ApacheCon this year and here are the
> slides<
> https://apachecon.com/acna2022/slides/01_Gonz%c3%a1lez_mod-wasm_Bringing_WebAssembly.pdf>
> and the source code: https://github.com/vmware-labs/mod_wasm.
> > * CNCF Talk on mod_wasm showcasing how to run WordPress:
> https://www.youtube.com/watch?v=jXe8kulUscQ
> >
> >
> >
> > In terms of mod_wasm architecture, the module is split into two parts:
> >
> > * mod_wasm.so is the extension module for Apache and it’s written in
> C.
> > * An external dependency: libwasm_runtime.so, which is written in
> Rust and needs to be installed into the system.
> >
> >
> >
> > We modelled this after mod_tls, a module that is part of httpd and also
> has a Rust dependency.
> >
> > You can take a look at the architecture diagram and instructions on how
> to build the module here:
> https://github.com/vmware-labs/mod_wasm#%EF%B8%8F-building-mod_wasm
> >
> >
> >
> > In terms of the actual contribution, please find a patch attached. We
> tried to follow all existing conventions in terms of autoconf/automake,
> providing module documentation, etc. Please let us know anything that you
> see missing or could be improved. In particular, we do not know yet if it
> is better to keep the Rust code separate, as an external dependency (like
> mod_tls does) or in the Apache source code repository.
> >
> >
> >
> > In summary, we believe mod_wasm is a worthy addition to httpd and it
> will allow us to catch up to some of the other web servers already
> supporting Wasm, like NGINX. We were encouraged by Rich Bowen, Jim
> Jagielski and Jean-Frederic Clere to submit it for contribution upstream
> and we are looking forward to your feedback.
> >
> >
> >
> > Cheers!
> >
> > Jesús
> >
> >
> >
> >
> >
>
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Hi:

Can I be unsubscribed from this list?

Have sent previous messages following all the instructions on this page but
to no avail:
https://httpd.apache.org/userslist.html.


Best,

Dan

On Fri, Jan 27, 2023 at 11:36 AM Jesús González <jesusgm@vmware.com> wrote:

> Thanks Joe. You are correct, this initial implementation is the simplest
> one to get it off the ground. We plan to continue development and add the
> streaming functionality, which we know we will need for things like large
> PDF file generation or support for Proxy-Wasm.
>
>
>
> Yes, isolating language runtimes (PHP, Python, ...) per thread is a cool
> feature that enables new possibilities like simultaneously supporting
> multiple versions of PHP as well as better multi-tenancy (you will be able
> to keep user's code and assets separate from each other using Wasm built-in
> isolation mechanism).
>
>
>
> Regarding apreq, right now we have not had a need to use it as we pass
> most of the headers and body to the runtimes themselves as the language
> runtimes code for handling requests, etc. takes care of it as part of the
> CGI implementation, etc. As we look to add different functionality (i.e.
> extending Apache itself) we will probably provide access to it from Wasm.
>
>
>
>
>
> *De: *Joe Schaefer <joe@sunstarsys.com>
> *Responder a: *"dev@httpd.apache.org" <dev@httpd.apache.org>
> *Fecha: *jueves, 26 de enero de 2023, 5:17
> *Para: *"dev@httpd.apache.org" <dev@httpd.apache.org>
> *Asunto: *Re: mod_wasm: Contributing Upstream to Apache
>
>
>
> Still, the idea is wicked cool if mod_wasm really can isolate the Python,
> PHP, etc targets onto individual POSIX threads.
>
>
>
> Very exciting stuff for HTTP/2 Webapps.
>
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
As per the instructions:

To unsubscribe, send a messages to *users-unsubscribe@httpd.apache.org
<users-unsubscribe@httpd.apache.org>* (or, if you are subscribed to the
digest version of the list, send to *users-digest-unsubscribe@httpd.apache.org
<users-digest-unsubscribe@httpd.apache.org>* ). You must send the
unsubscribe message from the same email address that you used to subscribe
to the list.

To complete the unsubscription process you must reply to a confirmation
email. If you do not receive this confirmation email, please check your
spam filters to see if they are capturing the message.


In this case, you would want to email dev-unsubscribe@httpd.apache.org





On Thu, Jun 1, 2023 at 4:32?PM Dan Ehrlich via dev <dev@httpd.apache.org>
wrote:

> Hi:
>
> Can I be unsubscribed from this list?
>
> Have sent previous messages following all the instructions on this page
> but to no avail:
> https://httpd.apache.org/userslist.html.
>
>
> Best,
>
> Dan
>
> On Fri, Jan 27, 2023 at 11:36 AM Jesús González <jesusgm@vmware.com>
> wrote:
>
>> Thanks Joe. You are correct, this initial implementation is the simplest
>> one to get it off the ground. We plan to continue development and add the
>> streaming functionality, which we know we will need for things like large
>> PDF file generation or support for Proxy-Wasm.
>>
>>
>>
>> Yes, isolating language runtimes (PHP, Python, ...) per thread is a cool
>> feature that enables new possibilities like simultaneously supporting
>> multiple versions of PHP as well as better multi-tenancy (you will be able
>> to keep user's code and assets separate from each other using Wasm built-in
>> isolation mechanism).
>>
>>
>>
>> Regarding apreq, right now we have not had a need to use it as we pass
>> most of the headers and body to the runtimes themselves as the language
>> runtimes code for handling requests, etc. takes care of it as part of the
>> CGI implementation, etc. As we look to add different functionality (i.e.
>> extending Apache itself) we will probably provide access to it from Wasm.
>>
>>
>>
>>
>>
>> *De: *Joe Schaefer <joe@sunstarsys.com>
>> *Responder a: *"dev@httpd.apache.org" <dev@httpd.apache.org>
>> *Fecha: *jueves, 26 de enero de 2023, 5:17
>> *Para: *"dev@httpd.apache.org" <dev@httpd.apache.org>
>> *Asunto: *Re: mod_wasm: Contributing Upstream to Apache
>>
>>
>>
>> Still, the idea is wicked cool if mod_wasm really can isolate the Python,
>> PHP, etc targets onto individual POSIX threads.
>>
>>
>>
>> Very exciting stuff for HTTP/2 Webapps.
>>
>
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Thanks Joe for your encouragement! And yes, your feedback was what inspired us to expand mod_wasm in this direction.

In the demo from my colleague Asen, we expose three wrapper functions to WebAssembly get_header, set_header, delete_header, that internally make use of apr_table_get, apr_table_set and apr_table_unset with the incoming request headers (r->headers_in). This shows read and write capabilities from a Wasm binary using internal Apache APIs. Is this what you are referring to with exposing apreq_*?

Limiting to read-only (ie: just get_header) implies that some functionality that is possible with other extension modules (mod_headers, mod_perl, mod_lua, etc.) won’t be available in mod_wasm. We would love to know more about those concerns, so we can understand better how to develop mod_wasm in a way that both allows you to develop fully capable modules but still address any concerns you may have.

BTW, here is a recent article showing how mod_wasm can help mitigating vulnerabilities https://wasmlabs.dev/articles/mitigating-php-vulnerabilities-with-webassembly/, proving how it adds an extra layer of security to traditional applications.

Looking forward to your feedback.

De: Joe Schaefer <joe@sunstarsys.com>
Fecha: jueves, 1 de junio de 2023, 22:16
Para: dev@httpd.apache.org <dev@httpd.apache.org>
Asunto: Re: mod_wasm: Contributing Upstream to Apache
!! External Email
Huge fan, love that you are receptive to my feedback. If you get to the point where the apreq_* (APR table-based) interfaces in trunk can be exposed as read-only data structures in mod_wasm as an optional API for power httpd users that like the sandboxed functionality you get OOTB, that would justify a lot of the more conservative concerns that some devs have for not putting incorporating this into the trunk codebase, which would be my recommendation at that point for how to get it into a releasable tree at some point.


On Tue, May 30, 2023 at 8:42?AM José Carlos Chávez <jcchavezs@apache.org<mailto:jcchavezs@apache.org>> wrote:
I think not making WASM a first class concern in a proxy or server is missing out, more so in those platforms where extensibility isn't trivial. Apache will remain running in current setups but having limited extensibility is something concerning these days as systems are getting more and more complex. Writing an apache module isn't something you do every day and it probably takes quite some time, writing a wasm app following certain ABI is something you can do in minutes, hence supporting mod_wasm as a first class concern could be a good point in the sustainability of an ecosystem when it comes to moving forward out of the status quo.

On 2022/11/14 06:37:34 Jesús González wrote:
> Hi everyone,
>
>
>
> I’m Jesús González, and I am part of VMware’s Wasm Labs: wasmlabs.dev<http://wasmlabs.dev/><https://wasmlabs.dev/>, a group focused on creating open source tools for WebAssembly.
>
> We have created mod_wasm, an Apache module for running WebAssembly binaries inside httpd, and we would like to contribute it upstream. Please see below for more details. We would love to get your feedback and understand what improvements would be needed (if any) before it could be considered for contribution to the project.
>
>
>
>
>
> The details:
>
>
>
> WebAssembly<https://webassembly.org/> (Wasm) is a new binary instruction format that is open, portable, efficient, secure, and polyglot. It originated in the browser but is increasingly used in server applications, in particular NGINX, Apache APISIX, Istio provide Wasm-based plugin support (i.e.: https://apisix.apache.org/docs/apisix/wasm/).
>
>
>
> mod_wasm is a way to run WebAssembly modules inside Apache Server. This is similar to how mod_php embeds a PHP runtime to run PHP code. This enables any language that supports WebAssembly (including C++, Rust, Go but also Python, PHP, Ruby) to run with mod_wasm and take advantage of the extra level of security and sandboxing. To learn more about mod_wasm you can check out the following resources:
>
> * An overview article<https://wasmlabs.dev/articles/apache-mod-wasm/> for the original release.
> * We presented mod_wasm at ApacheCon this year and here are the slides<https://apachecon.com/acna2022/slides/01_Gonz%c3%a1lez_mod-wasm_Bringing_WebAssembly.pdf<https://apachecon.com/acna2022/slides/01_Gonz%C3%A1lez_mod-wasm_Bringing_WebAssembly.pdf>> and the source code: https://github.com/vmware-labs/mod_wasm.
> * CNCF Talk on mod_wasm showcasing how to run WordPress: https://www.youtube.com/watch?v=jXe8kulUscQ
>
>
>
> In terms of mod_wasm architecture, the module is split into two parts:
>
> * mod_wasm.so is the extension module for Apache and it’s written in C.
> * An external dependency: libwasm_runtime.so, which is written in Rust and needs to be installed into the system.
>
>
>
> We modelled this after mod_tls, a module that is part of httpd and also has a Rust dependency.
>
> You can take a look at the architecture diagram and instructions on how to build the module here: https://github.com/vmware-labs/mod_wasm#%EF%B8%8F-building-mod_wasm
>
>
>
> In terms of the actual contribution, please find a patch attached. We tried to follow all existing conventions in terms of autoconf/automake, providing module documentation, etc. Please let us know anything that you see missing or could be improved. In particular, we do not know yet if it is better to keep the Rust code separate, as an external dependency (like mod_tls does) or in the Apache source code repository.
>
>
>
> In summary, we believe mod_wasm is a worthy addition to httpd and it will allow us to catch up to some of the other web servers already supporting Wasm, like NGINX. We were encouraged by Rich Bowen, Jim Jagielski and Jean-Frederic Clere to submit it for contribution upstream and we are looking forward to your feedback.
>
>
>
> Cheers!
>
> Jesús
>
>
>
>
>

!! External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Hola!

mod_wasm v0.12.1<https://github.com/vmware-labs/mod_wasm/releases/tag/v0.12.1> is now available!

This maintenance release bumps Wasmtime to 10.0.1, including preliminary support for WASI preview 2 among other improvements and fixes.

Best,
Jesús

De: Jesús González <jesusgm@vmware.com>
Fecha: viernes, 2 de junio de 2023, 19:09
Para: dev@httpd.apache.org <dev@httpd.apache.org>
Asunto: Re: mod_wasm: Contributing Upstream to Apache
Thanks Joe for your encouragement! And yes, your feedback was what inspired us to expand mod_wasm in this direction.

In the demo from my colleague Asen, we expose three wrapper functions to WebAssembly get_header, set_header, delete_header, that internally make use of apr_table_get, apr_table_set and apr_table_unset with the incoming request headers (r->headers_in). This shows read and write capabilities from a Wasm binary using internal Apache APIs. Is this what you are referring to with exposing apreq_*?

Limiting to read-only (ie: just get_header) implies that some functionality that is possible with other extension modules (mod_headers, mod_perl, mod_lua, etc.) won’t be available in mod_wasm. We would love to know more about those concerns, so we can understand better how to develop mod_wasm in a way that both allows you to develop fully capable modules but still address any concerns you may have.

BTW, here is a recent article showing how mod_wasm can help mitigating vulnerabilities https://wasmlabs.dev/articles/mitigating-php-vulnerabilities-with-webassembly/, proving how it adds an extra layer of security to traditional applications.

Looking forward to your feedback.


De: Joe Schaefer <joe@sunstarsys.com>
Fecha: jueves, 1 de junio de 2023, 22:16
Para: dev@httpd.apache.org <dev@httpd.apache.org>
Asunto: Re: mod_wasm: Contributing Upstream to Apache
!! External Email
Huge fan, love that you are receptive to my feedback. If you get to the point where the apreq_* (APR table-based) interfaces in trunk can be exposed as read-only data structures in mod_wasm as an optional API for power httpd users that like the sandboxed functionality you get OOTB, that would justify a lot of the more conservative concerns that some devs have for not putting incorporating this into the trunk codebase, which would be my recommendation at that point for how to get it into a releasable tree at some point.


On Tue, May 30, 2023 at 8:42?AM José Carlos Chávez <jcchavezs@apache.org<mailto:jcchavezs@apache.org>> wrote:
I think not making WASM a first class concern in a proxy or server is missing out, more so in those platforms where extensibility isn't trivial. Apache will remain running in current setups but having limited extensibility is something concerning these days as systems are getting more and more complex. Writing an apache module isn't something you do every day and it probably takes quite some time, writing a wasm app following certain ABI is something you can do in minutes, hence supporting mod_wasm as a first class concern could be a good point in the sustainability of an ecosystem when it comes to moving forward out of the status quo.

On 2022/11/14 06:37:34 Jesús González wrote:
> Hi everyone,
>
>
>
> I’m Jesús González, and I am part of VMware’s Wasm Labs: wasmlabs.dev<http://wasmlabs.dev/><https://wasmlabs.dev/>, a group focused on creating open source tools for WebAssembly.
>
> We have created mod_wasm, an Apache module for running WebAssembly binaries inside httpd, and we would like to contribute it upstream. Please see below for more details. We would love to get your feedback and understand what improvements would be needed (if any) before it could be considered for contribution to the project.
>
>
>
>
>
> The details:
>
>
>
> WebAssembly<https://webassembly.org/> (Wasm) is a new binary instruction format that is open, portable, efficient, secure, and polyglot. It originated in the browser but is increasingly used in server applications, in particular NGINX, Apache APISIX, Istio provide Wasm-based plugin support (i.e.: https://apisix.apache.org/docs/apisix/wasm/).
>
>
>
> mod_wasm is a way to run WebAssembly modules inside Apache Server. This is similar to how mod_php embeds a PHP runtime to run PHP code. This enables any language that supports WebAssembly (including C++, Rust, Go but also Python, PHP, Ruby) to run with mod_wasm and take advantage of the extra level of security and sandboxing. To learn more about mod_wasm you can check out the following resources:
>
> * An overview article<https://wasmlabs.dev/articles/apache-mod-wasm/> for the original release.
> * We presented mod_wasm at ApacheCon this year and here are the slides<https://apachecon.com/acna2022/slides/01_Gonz%c3%a1lez_mod-wasm_Bringing_WebAssembly.pdf<https://apachecon.com/acna2022/slides/01_Gonz%C3%A1lez_mod-wasm_Bringing_WebAssembly.pdf>> and the source code: https://github.com/vmware-labs/mod_wasm.
> * CNCF Talk on mod_wasm showcasing how to run WordPress: https://www.youtube.com/watch?v=jXe8kulUscQ
>
>
>
> In terms of mod_wasm architecture, the module is split into two parts:
>
> * mod_wasm.so is the extension module for Apache and it’s written in C.
> * An external dependency: libwasm_runtime.so, which is written in Rust and needs to be installed into the system.
>
>
>
> We modelled this after mod_tls, a module that is part of httpd and also has a Rust dependency.
>
> You can take a look at the architecture diagram and instructions on how to build the module here: https://github.com/vmware-labs/mod_wasm#%EF%B8%8F-building-mod_wasm
>
>
>
> In terms of the actual contribution, please find a patch attached. We tried to follow all existing conventions in terms of autoconf/automake, providing module documentation, etc. Please let us know anything that you see missing or could be improved. In particular, we do not know yet if it is better to keep the Rust code separate, as an external dependency (like mod_tls does) or in the Apache source code repository.
>
>
>
> In summary, we believe mod_wasm is a worthy addition to httpd and it will allow us to catch up to some of the other web servers already supporting Wasm, like NGINX. We were encouraged by Rich Bowen, Jim Jagielski and Jean-Frederic Clere to submit it for contribution upstream and we are looking forward to your feedback.
>
>
>
> Cheers!
>
> Jesús
>
>
>
>
>

!! External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
The more of the API you expose, the less value the sandbox has to end users. For Webapps, easy read/search / write/ iterate is essential. But also form data; which apreq stores in readonly apr tables.

Joe Schaefer, Ph.D
<joe@sunstarsys.com>
+1 (954) 253-3732
SunStar Systems, Inc.
Orion - The Enterprise Jamstack Wiki

________________________________
From: Jesús González <jesusgm@vmware.com>
Sent: Monday, July 3, 2023 8:49:33 AM
To: dev@httpd.apache.org <dev@httpd.apache.org>
Subject: Re: mod_wasm: Contributing Upstream to Apache


Hola!

mod_wasm v0.12.1<https://github.com/vmware-labs/mod_wasm/releases/tag/v0.12.1> is now available!

This maintenance release bumps Wasmtime to 10.0.1, including preliminary support for WASI preview 2 among other improvements and fixes.

Best,
Jesús



De: Jesús González <jesusgm@vmware.com>
Fecha: viernes, 2 de junio de 2023, 19:09
Para: dev@httpd.apache.org <dev@httpd.apache.org>
Asunto: Re: mod_wasm: Contributing Upstream to Apache

Thanks Joe for your encouragement! And yes, your feedback was what inspired us to expand mod_wasm in this direction.

In the demo from my colleague Asen, we expose three wrapper functions to WebAssembly get_header, set_header, delete_header, that internally make use of apr_table_get, apr_table_set and apr_table_unset with the incoming request headers (r->headers_in). This shows read and write capabilities from a Wasm binary using internal Apache APIs. Is this what you are referring to with exposing apreq_*?

Limiting to read-only (ie: just get_header) implies that some functionality that is possible with other extension modules (mod_headers, mod_perl, mod_lua, etc.) won’t be available in mod_wasm. We would love to know more about those concerns, so we can understand better how to develop mod_wasm in a way that both allows you to develop fully capable modules but still address any concerns you may have.

BTW, here is a recent article showing how mod_wasm can help mitigating vulnerabilities https://wasmlabs.dev/articles/mitigating-php-vulnerabilities-with-webassembly/, proving how it adds an extra layer of security to traditional applications.

Looking forward to your feedback.



De: Joe Schaefer <joe@sunstarsys.com>
Fecha: jueves, 1 de junio de 2023, 22:16
Para: dev@httpd.apache.org <dev@httpd.apache.org>
Asunto: Re: mod_wasm: Contributing Upstream to Apache

!! External Email

Huge fan, love that you are receptive to my feedback. If you get to the point where the apreq_* (APR table-based) interfaces in trunk can be exposed as read-only data structures in mod_wasm as an optional API for power httpd users that like the sandboxed functionality you get OOTB, that would justify a lot of the more conservative concerns that some devs have for not putting incorporating this into the trunk codebase, which would be my recommendation at that point for how to get it into a releasable tree at some point.





On Tue, May 30, 2023 at 8:42?AM José Carlos Chávez <jcchavezs@apache.org<mailto:jcchavezs@apache.org>> wrote:

I think not making WASM a first class concern in a proxy or server is missing out, more so in those platforms where extensibility isn't trivial. Apache will remain running in current setups but having limited extensibility is something concerning these days as systems are getting more and more complex. Writing an apache module isn't something you do every day and it probably takes quite some time, writing a wasm app following certain ABI is something you can do in minutes, hence supporting mod_wasm as a first class concern could be a good point in the sustainability of an ecosystem when it comes to moving forward out of the status quo.

On 2022/11/14 06:37:34 Jesús González wrote:
> Hi everyone,
>
>
>
> I’m Jesús González, and I am part of VMware’s Wasm Labs: wasmlabs.dev<http://wasmlabs.dev/><https://wasmlabs.dev/>, a group focused on creating open source tools for WebAssembly.
>
> We have created mod_wasm, an Apache module for running WebAssembly binaries inside httpd, and we would like to contribute it upstream. Please see below for more details. We would love to get your feedback and understand what improvements would be needed (if any) before it could be considered for contribution to the project.
>
>
>
>
>
> The details:
>
>
>
> WebAssembly<https://webassembly.org/> (Wasm) is a new binary instruction format that is open, portable, efficient, secure, and polyglot. It originated in the browser but is increasingly used in server applications, in particular NGINX, Apache APISIX, Istio provide Wasm-based plugin support (i.e.: https://apisix.apache.org/docs/apisix/wasm/).
>
>
>
> mod_wasm is a way to run WebAssembly modules inside Apache Server. This is similar to how mod_php embeds a PHP runtime to run PHP code. This enables any language that supports WebAssembly (including C++, Rust, Go but also Python, PHP, Ruby) to run with mod_wasm and take advantage of the extra level of security and sandboxing. To learn more about mod_wasm you can check out the following resources:
>
> * An overview article<https://wasmlabs.dev/articles/apache-mod-wasm/> for the original release.
> * We presented mod_wasm at ApacheCon this year and here are the slides<https://apachecon.com/acna2022/slides/01_Gonz%c3%a1lez_mod-wasm_Bringing_WebAssembly.pdf<https://apachecon.com/acna2022/slides/01_Gonz%C3%A1lez_mod-wasm_Bringing_WebAssembly.pdf>> and the source code: https://github.com/vmware-labs/mod_wasm.
> * CNCF Talk on mod_wasm showcasing how to run WordPress: https://www.youtube.com/watch?v=jXe8kulUscQ
>
>
>
> In terms of mod_wasm architecture, the module is split into two parts:
>
> * mod_wasm.so is the extension module for Apache and it’s written in C.
> * An external dependency: libwasm_runtime.so, which is written in Rust and needs to be installed into the system.
>
>
>
> We modelled this after mod_tls, a module that is part of httpd and also has a Rust dependency.
>
> You can take a look at the architecture diagram and instructions on how to build the module here: https://github.com/vmware-labs/mod_wasm#%EF%B8%8F-building-mod_wasm
>
>
>
> In terms of the actual contribution, please find a patch attached. We tried to follow all existing conventions in terms of autoconf/automake, providing module documentation, etc. Please let us know anything that you see missing or could be improved. In particular, we do not know yet if it is better to keep the Rust code separate, as an external dependency (like mod_tls does) or in the Apache source code repository.
>
>
>
> In summary, we believe mod_wasm is a worthy addition to httpd and it will allow us to catch up to some of the other web servers already supporting Wasm, like NGINX. We were encouraged by Rich Bowen, Jim Jagielski and Jean-Frederic Clere to submit it for contribution upstream and we are looking forward to your feedback.
>
>
>
> Cheers!
>
> Jesús
>
>
>
>
>



!! External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
The win with having an apr table api from httpd is that by sharing those
tables in the sandbox, various programming languages will be able to
interact with others without stealing the client form inputs.

Even if you don’t go that route, and just expose the form inputs on stdin
in your app, users can always configure apreq’s input filter to activate on
the protocol filter chain before wasm activates. That way other modules
still can access form input without breaking the Wasm app.

On Tue, Jul 4, 2023 at 10:48 PM Joe Schaefer <joe@sunstarsys.com> wrote:

> The more of the API you expose, the less value the sandbox has to end
> users. For Webapps, easy read/search / write/ iterate is essential. But
> also form data; which apreq stores in readonly apr tables.
>
> Joe Schaefer, Ph.D
> <joe@sunstarsys.com>
> +1 (954) 253-3732
> SunStar Systems, Inc.
> *Orion - The Enterprise Jamstack Wiki*
>
> ------------------------------
> *From:* Jesús González <jesusgm@vmware.com>
> *Sent:* Monday, July 3, 2023 8:49:33 AM
> *To:* dev@httpd.apache.org <dev@httpd.apache.org>
> *Subject:* Re: mod_wasm: Contributing Upstream to Apache
>
>
> Hola!
>
> mod_wasm v0.12.1
> <https://github.com/vmware-labs/mod_wasm/releases/tag/v0.12.1> is now
> available!
>
> This maintenance release bumps Wasmtime to 10.0.1, including preliminary
> support for WASI preview 2 among other improvements and fixes.
>
> Best,
> Jesús
>
>
>
> *De: *Jesús González <jesusgm@vmware.com>
> *Fecha: *viernes, 2 de junio de 2023, 19:09
> *Para: *dev@httpd.apache.org <dev@httpd.apache.org>
> *Asunto: *Re: mod_wasm: Contributing Upstream to Apache
>
> Thanks Joe for your encouragement! And yes, your feedback was what
> inspired us to expand mod_wasm in this direction.
>
> In the demo from my colleague Asen, we expose three wrapper functions to
> WebAssembly get_header, set_header, delete_header, that internally make use
> of apr_table_get, apr_table_set and apr_table_unset with the incoming
> request headers (r->headers_in). This shows read and write capabilities
> from a Wasm binary using internal Apache APIs. Is this what you are
> referring to with exposing apreq_*?
>
> Limiting to read-only (ie: just get_header) implies that some
> functionality that is possible with other extension modules (mod_headers,
> mod_perl, mod_lua, etc.) won’t be available in mod_wasm. We would love to
> know more about those concerns, so we can understand better how to develop
> mod_wasm in a way that both allows you to develop fully capable modules but
> still address any concerns you may have.
>
> BTW, here is a recent article showing how mod_wasm can help mitigating
> vulnerabilities
> https://wasmlabs.dev/articles/mitigating-php-vulnerabilities-with-webassembly/,
> proving how it adds an extra layer of security to traditional applications.
>
> Looking forward to your feedback.
>
>
> *De: *Joe Schaefer <joe@sunstarsys.com>
> *Fecha: *jueves, 1 de junio de 2023, 22:16
> *Para: *dev@httpd.apache.org <dev@httpd.apache.org>
> *Asunto: *Re: mod_wasm: Contributing Upstream to Apache
>
> *!! External Email*
>
> Huge fan, love that you are receptive to my feedback. If you get to the
> point where the apreq_* (APR table-based) interfaces in trunk can be
> exposed as read-only data structures in mod_wasm as an optional API for
> power httpd users that like the sandboxed functionality you get OOTB, that
> would justify a lot of the more conservative concerns that some devs have
> for not putting incorporating this into the trunk codebase, which would be
> my recommendation at that point for how to get it into a releasable tree at
> some point.
>
>
>
>
>
> On Tue, May 30, 2023 at 8:42?AM José Carlos Chávez <jcchavezs@apache.org>
> wrote:
>
> I think not making WASM a first class concern in a proxy or server is
> missing out, more so in those platforms where extensibility isn't trivial.
> Apache will remain running in current setups but having limited
> extensibility is something concerning these days as systems are getting
> more and more complex. Writing an apache module isn't something you do
> every day and it probably takes quite some time, writing a wasm app
> following certain ABI is something you can do in minutes, hence supporting
> mod_wasm as a first class concern could be a good point in the
> sustainability of an ecosystem when it comes to moving forward out of the
> status quo.
>
> On 2022/11/14 06:37:34 Jesús González wrote:
> > Hi everyone,
> >
> >
> >
> > I’m Jesús González, and I am part of VMware’s Wasm Labs: wasmlabs.dev<
> https://wasmlabs.dev/>, a group focused on creating open source tools for
> WebAssembly.
> >
> > We have created mod_wasm, an Apache module for running WebAssembly
> binaries inside httpd, and we would like to contribute it upstream. Please
> see below for more details. We would love to get your feedback and
> understand what improvements would be needed (if any) before it could be
> considered for contribution to the project.
> >
> >
> >
> >
> >
> > The details:
> >
> >
> >
> > WebAssembly<https://webassembly.org/> (Wasm) is a new binary
> instruction format that is open, portable, efficient, secure, and polyglot.
> It originated in the browser but is increasingly used in server
> applications, in particular NGINX, Apache APISIX, Istio provide Wasm-based
> plugin support (i.e.: https://apisix.apache.org/docs/apisix/wasm/).
> >
> >
> >
> > mod_wasm is a way to run WebAssembly modules inside Apache Server. This
> is similar to how mod_php embeds a PHP runtime to run PHP code. This
> enables any language that supports WebAssembly (including C++, Rust, Go but
> also Python, PHP, Ruby) to run with mod_wasm and take advantage of the
> extra level of security and sandboxing. To learn more about mod_wasm you
> can check out the following resources:
> >
> > * An overview article<https://wasmlabs.dev/articles/apache-mod-wasm/>
> for the original release.
> > * We presented mod_wasm at ApacheCon this year and here are the
> slides<
> https://apachecon.com/acna2022/slides/01_Gonz%c3%a1lez_mod-wasm_Bringing_WebAssembly.pdf
> <https://apachecon.com/acna2022/slides/01_Gonz%C3%A1lez_mod-wasm_Bringing_WebAssembly.pdf>>
> and the source code: https://github.com/vmware-labs/mod_wasm.
> > * CNCF Talk on mod_wasm showcasing how to run WordPress:
> https://www.youtube.com/watch?v=jXe8kulUscQ
> >
> >
> >
> > In terms of mod_wasm architecture, the module is split into two parts:
> >
> > * mod_wasm.so is the extension module for Apache and it’s written in
> C.
> > * An external dependency: libwasm_runtime.so, which is written in
> Rust and needs to be installed into the system.
> >
> >
> >
> > We modelled this after mod_tls, a module that is part of httpd and also
> has a Rust dependency.
> >
> > You can take a look at the architecture diagram and instructions on how
> to build the module here:
> https://github.com/vmware-labs/mod_wasm#%EF%B8%8F-building-mod_wasm
> >
> >
> >
> > In terms of the actual contribution, please find a patch attached. We
> tried to follow all existing conventions in terms of autoconf/automake,
> providing module documentation, etc. Please let us know anything that you
> see missing or could be improved. In particular, we do not know yet if it
> is better to keep the Rust code separate, as an external dependency (like
> mod_tls does) or in the Apache source code repository.
> >
> >
> >
> > In summary, we believe mod_wasm is a worthy addition to httpd and it
> will allow us to catch up to some of the other web servers already
> supporting Wasm, like NGINX. We were encouraged by Rich Bowen, Jim
> Jagielski and Jean-Frederic Clere to submit it for contribution upstream
> and we are looking forward to your feedback.
> >
> >
> >
> > Cheers!
> >
> > Jesús
> >
> >
> >
> >
> >
>
>
>
> *!! External Email:* This email originated from outside of the
> organization. Do not click links or open attachments unless you recognize
> the sender.
>
>
>
--
Joe Schaefer, Ph.D.
<https://sunstarsys.com/orion/features>
Orion - The Enterprise Jamstack Wiki <https://sunstarsys.com/orion/features>
<joe@sunstarsys.com>
954.253.3732 <//954.253.3732>
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
Joe, thanks for your feedback!

Just to make sure I understand this feedback, what you are mentioning is that exposing the internals of Apache diminishes the value of the sandbox because programs could potentially perform write operations into the internals of httpd state, tables, etc. Is that correct?

If my understanding is correct, this should not be an issue:

- The current incarnation of mod_wasm is implemented as a content-handler and does not have access to the internals of Apache or tables. All the information is passed through environment variables, similar to a traditional CGI binary, but running in the Wasm sandbox (so you can control tightly any access to filesystem, network, etc.).

- The proposed changes to mod_wasm that enable writing Apache modules in other languages would expose the API, but that’s the idea: to make it easy to build fully featured Apache modules using any language that can compile to Wasm (ie: Go, Python). Think of this as an ‘universal’ polyglot version of mod_lua with added sandboxing capabilities.

Which mode to use can be configured. You definitely don’t want random users having access to the internals of httpd when serving their regular application (ie: Drupal).

Having said all of this, regarding the read-only structs, a Wasm binary cannot access the host memory space. So, a pointer to an apr table in the httpd memory space cannot be dereferenced within the sandbox. There exist opaque reference types (ie: externref) to host objects that comply with WebAssembly sandboxing guarantees as explained in https://fitzgeraldnick.com/2020/08/27/reference-types-in-wasmtime.html. This is great in terms of security, but a drawback from a performance perspective. To manipulate data structs, either they are copied into the Wasm memory and copied back to the server, or we offer a set of limited interfaces to the Wasm binary to perform such actions. So yes, we believe your proposal of getting the apreq_* (ARP table-based) interfaces exposed as read-only data structures is doable and useful.

Cheers!

De: Joe Schaefer <joe@sunstarsys.com>
Fecha: miércoles, 5 de julio de 2023, 4:59
Para: dev@httpd.apache.org <dev@httpd.apache.org>
Asunto: Re: mod_wasm: Contributing Upstream to Apache
!! External Email
The win with having an apr table api from httpd is that by sharing those tables in the sandbox, various programming languages will be able to interact with others without stealing the client form inputs.

Even if you don’t go that route, and just expose the form inputs on stdin in your app, users can always configure apreq’s input filter to activate on the protocol filter chain before wasm activates. That way other modules still can access form input without breaking the Wasm app.

On Tue, Jul 4, 2023 at 10:48 PM Joe Schaefer <joe@sunstarsys.com<mailto:joe@sunstarsys.com>> wrote:
The more of the API you expose, the less value the sandbox has to end users. For Webapps, easy read/search / write/ iterate is essential. But also form data; which apreq stores in readonly apr tables.

Joe Schaefer, Ph.D
<joe@sunstarsys.com<mailto:joe@sunstarsys.com>>
+1 (954) 253-3732
SunStar Systems, Inc.
Orion - The Enterprise Jamstack Wiki

________________________________
From: Jesús González <jesusgm@vmware.com<mailto:jesusgm@vmware.com>>
Sent: Monday, July 3, 2023 8:49:33 AM
To: dev@httpd.apache.org<mailto:dev@httpd.apache.org> <dev@httpd.apache.org<mailto:dev@httpd.apache.org>>
Subject: Re: mod_wasm: Contributing Upstream to Apache


Hola!

mod_wasm v0.12.1<https://github.com/vmware-labs/mod_wasm/releases/tag/v0.12.1> is now available!

This maintenance release bumps Wasmtime to 10.0.1, including preliminary support for WASI preview 2 among other improvements and fixes.

Best,
Jesús



De: Jesús González <jesusgm@vmware.com<mailto:jesusgm@vmware.com>>
Fecha: viernes, 2 de junio de 2023, 19:09
Para: dev@httpd.apache.org<mailto:dev@httpd.apache.org> <dev@httpd.apache.org<mailto:dev@httpd.apache.org>>
Asunto: Re: mod_wasm: Contributing Upstream to Apache

Thanks Joe for your encouragement! And yes, your feedback was what inspired us to expand mod_wasm in this direction.

In the demo from my colleague Asen, we expose three wrapper functions to WebAssembly get_header, set_header, delete_header, that internally make use of apr_table_get, apr_table_set and apr_table_unset with the incoming request headers (r->headers_in). This shows read and write capabilities from a Wasm binary using internal Apache APIs. Is this what you are referring to with exposing apreq_*?

Limiting to read-only (ie: just get_header) implies that some functionality that is possible with other extension modules (mod_headers, mod_perl, mod_lua, etc.) won’t be available in mod_wasm. We would love to know more about those concerns, so we can understand better how to develop mod_wasm in a way that both allows you to develop fully capable modules but still address any concerns you may have.

BTW, here is a recent article showing how mod_wasm can help mitigating vulnerabilities https://wasmlabs.dev/articles/mitigating-php-vulnerabilities-with-webassembly/, proving how it adds an extra layer of security to traditional applications.

Looking forward to your feedback.


De: Joe Schaefer <joe@sunstarsys.com<mailto:joe@sunstarsys.com>>
Fecha: jueves, 1 de junio de 2023, 22:16
Para: dev@httpd.apache.org<mailto:dev@httpd.apache.org> <dev@httpd.apache.org<mailto:dev@httpd.apache.org>>
Asunto: Re: mod_wasm: Contributing Upstream to Apache

!! External Email

Huge fan, love that you are receptive to my feedback. If you get to the point where the apreq_* (APR table-based) interfaces in trunk can be exposed as read-only data structures in mod_wasm as an optional API for power httpd users that like the sandboxed functionality you get OOTB, that would justify a lot of the more conservative concerns that some devs have for not putting incorporating this into the trunk codebase, which would be my recommendation at that point for how to get it into a releasable tree at some point.





On Tue, May 30, 2023 at 8:42?AM José Carlos Chávez <jcchavezs@apache.org<mailto:jcchavezs@apache.org>> wrote:

I think not making WASM a first class concern in a proxy or server is missing out, more so in those platforms where extensibility isn't trivial. Apache will remain running in current setups but having limited extensibility is something concerning these days as systems are getting more and more complex. Writing an apache module isn't something you do every day and it probably takes quite some time, writing a wasm app following certain ABI is something you can do in minutes, hence supporting mod_wasm as a first class concern could be a good point in the sustainability of an ecosystem when it comes to moving forward out of the status quo.

On 2022/11/14 06:37:34 Jesús González wrote:
> Hi everyone,
>
>
>
> I’m Jesús González, and I am part of VMware’s Wasm Labs: wasmlabs.dev<http://wasmlabs.dev/><https://wasmlabs.dev/>, a group focused on creating open source tools for WebAssembly.
>
> We have created mod_wasm, an Apache module for running WebAssembly binaries inside httpd, and we would like to contribute it upstream. Please see below for more details. We would love to get your feedback and understand what improvements would be needed (if any) before it could be considered for contribution to the project.
>
>
>
>
>
> The details:
>
>
>
> WebAssembly<https://webassembly.org/> (Wasm) is a new binary instruction format that is open, portable, efficient, secure, and polyglot. It originated in the browser but is increasingly used in server applications, in particular NGINX, Apache APISIX, Istio provide Wasm-based plugin support (i.e.: https://apisix.apache.org/docs/apisix/wasm/).
>
>
>
> mod_wasm is a way to run WebAssembly modules inside Apache Server. This is similar to how mod_php embeds a PHP runtime to run PHP code. This enables any language that supports WebAssembly (including C++, Rust, Go but also Python, PHP, Ruby) to run with mod_wasm and take advantage of the extra level of security and sandboxing. To learn more about mod_wasm you can check out the following resources:
>
> * An overview article<https://wasmlabs.dev/articles/apache-mod-wasm/> for the original release.
> * We presented mod_wasm at ApacheCon this year and here are the slides<https://apachecon.com/acna2022/slides/01_Gonz%c3%a1lez_mod-wasm_Bringing_WebAssembly.pdf<https://apachecon.com/acna2022/slides/01_Gonz%C3%A1lez_mod-wasm_Bringing_WebAssembly.pdf>> and the source code: https://github.com/vmware-labs/mod_wasm.
> * CNCF Talk on mod_wasm showcasing how to run WordPress: https://www.youtube.com/watch?v=jXe8kulUscQ
>
>
>
> In terms of mod_wasm architecture, the module is split into two parts:
>
> * mod_wasm.so is the extension module for Apache and it’s written in C.
> * An external dependency: libwasm_runtime.so, which is written in Rust and needs to be installed into the system.
>
>
>
> We modelled this after mod_tls, a module that is part of httpd and also has a Rust dependency.
>
> You can take a look at the architecture diagram and instructions on how to build the module here: https://github.com/vmware-labs/mod_wasm#%EF%B8%8F-building-mod_wasm
>
>
>
> In terms of the actual contribution, please find a patch attached. We tried to follow all existing conventions in terms of autoconf/automake, providing module documentation, etc. Please let us know anything that you see missing or could be improved. In particular, we do not know yet if it is better to keep the Rust code separate, as an external dependency (like mod_tls does) or in the Apache source code repository.
>
>
>
> In summary, we believe mod_wasm is a worthy addition to httpd and it will allow us to catch up to some of the other web servers already supporting Wasm, like NGINX. We were encouraged by Rich Bowen, Jim Jagielski and Jean-Frederic Clere to submit it for contribution upstream and we are looking forward to your feedback.
>
>
>
> Cheers!
>
> Jesús
>
>
>
>
>



!! External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.


--
Joe Schaefer, Ph.D.
[Imagen quitada por el remitente.]<https://sunstarsys.com/orion/features>
Orion - The Enterprise Jamstack Wiki<https://sunstarsys.com/orion/features>
<joe@sunstarsys.com<mailto:joe@sunstarsys.com>>
954.253.3732<tel://954.253.3732>
Re: mod_wasm: Contributing Upstream to Apache [ In reply to ]
All good. Just didn’t want to see needless delays in getting this stuff
incorporated while you build out the non-content handler mode for mod_wasm
that IMO will never be in big demand (if it were, mod_perl wouldn’t be such
a stagnant community over the past two decades).

On Fri, Jul 7, 2023 at 4:07 PM Jesús González <jesusgm@vmware.com> wrote:

> Joe, thanks for your feedback!
>
>
>
> Just to make sure I understand this feedback, what you are mentioning is
> that exposing the internals of Apache diminishes the value of the sandbox
> because programs could potentially perform write operations into the
> internals of httpd state, tables, etc. Is that correct?
>
>
>
> If my understanding is correct, this should not be an issue:
>
>
>
> - The current incarnation of mod_wasm is implemented as a content-handler
> and does not have access to the internals of Apache or tables. All the
> information is passed through environment variables, similar to a
> traditional CGI binary, but running in the Wasm sandbox (so you can control
> tightly any access to filesystem, network, etc.).
>
>
>
> - The proposed changes to mod_wasm that enable writing Apache modules in
> other languages would expose the API, but that’s the idea: to make it easy
> to build fully featured Apache modules using any language that can compile
> to Wasm (ie: Go, Python). Think of this as an ‘universal’ polyglot version
> of mod_lua with added sandboxing capabilities.
>
>
>
> Which mode to use can be configured. You definitely don’t want random
> users having access to the internals of httpd when serving their regular
> application (ie: Drupal).
>
>
>
> Having said all of this, regarding the read-only structs, a Wasm binary
> cannot access the host memory space. So, a pointer to an apr table in the
> httpd memory space cannot be dereferenced within the sandbox. There exist
> opaque reference types (ie: externref) to host objects that comply with
> WebAssembly sandboxing guarantees as explained in
> https://fitzgeraldnick.com/2020/08/27/reference-types-in-wasmtime.html.
> This is great in terms of security, but a drawback from a performance
> perspective. To manipulate data structs, either they are copied into the
> Wasm memory and copied back to the server, or we offer a set of limited
> interfaces to the Wasm binary to perform such actions. So yes, we believe
> your proposal of getting the apreq_* (ARP table-based) interfaces exposed
> as read-only data structures is doable and useful.
>
> Cheers!
>
>
>
> *De: *Joe Schaefer <joe@sunstarsys.com>
> *Fecha: *miércoles, 5 de julio de 2023, 4:59
> *Para: *dev@httpd.apache.org <dev@httpd.apache.org>
> *Asunto: *Re: mod_wasm: Contributing Upstream to Apache
>
> *!! External Email*
>
> The win with having an apr table api from httpd is that by sharing those
> tables in the sandbox, various programming languages will be able to
> interact with others without stealing the client form inputs.
>
>
>
> Even if you don’t go that route, and just expose the form inputs on stdin
> in your app, users can always configure apreq’s input filter to activate on
> the protocol filter chain before wasm activates. That way other modules
> still can access form input without breaking the Wasm app.
>
>
>
> On Tue, Jul 4, 2023 at 10:48 PM Joe Schaefer <joe@sunstarsys.com> wrote:
>
> The more of the API you expose, the less value the sandbox has to end
> users. For Webapps, easy read/search / write/ iterate is essential. But
> also form data; which apreq stores in readonly apr tables.
>
>
>
> Joe Schaefer, Ph.D
>
> <joe@sunstarsys.com>
>
> +1 (954) 253-3732
>
> SunStar Systems, Inc.
>
> *Orion - The Enterprise Jamstack Wiki*
>
>
> ------------------------------
>
> *From:* Jesús González <jesusgm@vmware.com>
> *Sent:* Monday, July 3, 2023 8:49:33 AM
> *To:* dev@httpd.apache.org <dev@httpd.apache.org>
> *Subject:* Re: mod_wasm: Contributing Upstream to Apache
>
>
>
> Hola!
>
> mod_wasm v0.12.1
> <https://github.com/vmware-labs/mod_wasm/releases/tag/v0.12.1> is now
> available!
>
> This maintenance release bumps Wasmtime to 10.0.1, including preliminary
> support for WASI preview 2 among other improvements and fixes.
>
> Best,
> Jesús
>
>
>
> *De: *Jesús González <jesusgm@vmware.com>
> *Fecha: *viernes, 2 de junio de 2023, 19:09
> *Para: *dev@httpd.apache.org <dev@httpd.apache.org>
> *Asunto: *Re: mod_wasm: Contributing Upstream to Apache
>
> Thanks Joe for your encouragement! And yes, your feedback was what
> inspired us to expand mod_wasm in this direction.
>
> In the demo from my colleague Asen, we expose three wrapper functions to
> WebAssembly get_header, set_header, delete_header, that internally make use
> of apr_table_get, apr_table_set and apr_table_unset with the incoming
> request headers (r->headers_in). This shows read and write capabilities
> from a Wasm binary using internal Apache APIs. Is this what you are
> referring to with exposing apreq_*?
>
> Limiting to read-only (ie: just get_header) implies that some
> functionality that is possible with other extension modules (mod_headers,
> mod_perl, mod_lua, etc.) won’t be available in mod_wasm. We would love to
> know more about those concerns, so we can understand better how to develop
> mod_wasm in a way that both allows you to develop fully capable modules but
> still address any concerns you may have.
>
> BTW, here is a recent article showing how mod_wasm can help mitigating
> vulnerabilities
> https://wasmlabs.dev/articles/mitigating-php-vulnerabilities-with-webassembly/,
> proving how it adds an extra layer of security to traditional applications.
>
> Looking forward to your feedback.
>
> *De: *Joe Schaefer <joe@sunstarsys.com>
> *Fecha: *jueves, 1 de junio de 2023, 22:16
> *Para: *dev@httpd.apache.org <dev@httpd.apache.org>
> *Asunto: *Re: mod_wasm: Contributing Upstream to Apache
>
> *!! External Email*
>
> Huge fan, love that you are receptive to my feedback. If you get to the
> point where the apreq_* (APR table-based) interfaces in trunk can be
> exposed as read-only data structures in mod_wasm as an optional API for
> power httpd users that like the sandboxed functionality you get OOTB, that
> would justify a lot of the more conservative concerns that some devs have
> for not putting incorporating this into the trunk codebase, which would be
> my recommendation at that point for how to get it into a releasable tree at
> some point.
>
>
>
>
>
> On Tue, May 30, 2023 at 8:42?AM José Carlos Chávez <jcchavezs@apache.org>
> wrote:
>
> I think not making WASM a first class concern in a proxy or server is
> missing out, more so in those platforms where extensibility isn't trivial.
> Apache will remain running in current setups but having limited
> extensibility is something concerning these days as systems are getting
> more and more complex. Writing an apache module isn't something you do
> every day and it probably takes quite some time, writing a wasm app
> following certain ABI is something you can do in minutes, hence supporting
> mod_wasm as a first class concern could be a good point in the
> sustainability of an ecosystem when it comes to moving forward out of the
> status quo.
>
> On 2022/11/14 06:37:34 Jesús González wrote:
> > Hi everyone,
> >
> >
> >
> > I’m Jesús González, and I am part of VMware’s Wasm Labs: wasmlabs.dev<
> https://wasmlabs.dev/>, a group focused on creating open source tools for
> WebAssembly.
> >
> > We have created mod_wasm, an Apache module for running WebAssembly
> binaries inside httpd, and we would like to contribute it upstream. Please
> see below for more details. We would love to get your feedback and
> understand what improvements would be needed (if any) before it could be
> considered for contribution to the project.
> >
> >
> >
> >
> >
> > The details:
> >
> >
> >
> > WebAssembly<https://webassembly.org/> (Wasm) is a new binary
> instruction format that is open, portable, efficient, secure, and polyglot.
> It originated in the browser but is increasingly used in server
> applications, in particular NGINX, Apache APISIX, Istio provide Wasm-based
> plugin support (i.e.: https://apisix.apache.org/docs/apisix/wasm/).
> >
> >
> >
> > mod_wasm is a way to run WebAssembly modules inside Apache Server. This
> is similar to how mod_php embeds a PHP runtime to run PHP code. This
> enables any language that supports WebAssembly (including C++, Rust, Go but
> also Python, PHP, Ruby) to run with mod_wasm and take advantage of the
> extra level of security and sandboxing. To learn more about mod_wasm you
> can check out the following resources:
> >
> > * An overview article<https://wasmlabs.dev/articles/apache-mod-wasm/>
> for the original release.
> > * We presented mod_wasm at ApacheCon this year and here are the
> slides<
> https://apachecon.com/acna2022/slides/01_Gonz%c3%a1lez_mod-wasm_Bringing_WebAssembly.pdf
> <https://apachecon.com/acna2022/slides/01_Gonz%C3%A1lez_mod-wasm_Bringing_WebAssembly.pdf>>
> and the source code: https://github.com/vmware-labs/mod_wasm.
> > * CNCF Talk on mod_wasm showcasing how to run WordPress:
> https://www.youtube.com/watch?v=jXe8kulUscQ
> >
> >
> >
> > In terms of mod_wasm architecture, the module is split into two parts:
> >
> > * mod_wasm.so is the extension module for Apache and it’s written in
> C.
> > * An external dependency: libwasm_runtime.so, which is written in
> Rust and needs to be installed into the system.
> >
> >
> >
> > We modelled this after mod_tls, a module that is part of httpd and also
> has a Rust dependency.
> >
> > You can take a look at the architecture diagram and instructions on how
> to build the module here:
> https://github.com/vmware-labs/mod_wasm#%EF%B8%8F-building-mod_wasm
> >
> >
> >
> > In terms of the actual contribution, please find a patch attached. We
> tried to follow all existing conventions in terms of autoconf/automake,
> providing module documentation, etc. Please let us know anything that you
> see missing or could be improved. In particular, we do not know yet if it
> is better to keep the Rust code separate, as an external dependency (like
> mod_tls does) or in the Apache source code repository.
> >
> >
> >
> > In summary, we believe mod_wasm is a worthy addition to httpd and it
> will allow us to catch up to some of the other web servers already
> supporting Wasm, like NGINX. We were encouraged by Rich Bowen, Jim
> Jagielski and Jean-Frederic Clere to submit it for contribution upstream
> and we are looking forward to your feedback.
> >
> >
> >
> > Cheers!
> >
> > Jesús
> >
> >
> >
> >
> >
>
>
>
> *!! External Email:* This email originated from outside of the
> organization. Do not click links or open attachments unless you recognize
> the sender.
>
>
>
> --
>
> Joe Schaefer, Ph.D.
>
> [image: Imagen quitada por el remitente.]
> <https://sunstarsys.com/orion/features>
>
> Orion - The Enterprise Jamstack Wiki
> <https://sunstarsys.com/orion/features>
>
> <joe@sunstarsys.com>
>
> 954.253.3732 <//954.253.3732>
>
>
>
>
>
--
Joe Schaefer, Ph.D.
<https://sunstarsys.com/orion/features>
Orion - The Enterprise Jamstack Wiki <https://sunstarsys.com/orion/features>
<joe@sunstarsys.com>
954.253.3732 <//954.253.3732>