Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.wasm module hot reload #165

Closed
seeflood opened this issue Aug 6, 2021 · 0 comments · Fixed by #168
Closed

.wasm module hot reload #165

seeflood opened this issue Aug 6, 2021 · 0 comments · Fixed by #168
Labels
help wanted Extra attention is needed kind/enhancement New feature or request

Comments

@seeflood
Copy link
Member

seeflood commented Aug 6, 2021

What would you like to be added:
Let Layotto monitor whether the .wasm file has changed, and reload the .wasm file if there is a change.
Achieve the effect of dynamically replacing .wasm at runtime

Why is this needed:
In order to implement subsequent functions:

  1. FaaS based on wasm
  2. Let developers change from developing sdk to developing wasm in the future, so that they can operate and maintain their wasm module independently

How ​​to implement it

  1. After startup, monitor whether the specified .wasm file has changed. You can use some open source libraries, such as https://github.com/fsnotify/fsnotify
  2. Once the file changed, call wasm related API to reload the file

Reference
Multilingual programming based on WASM
The WASM engine used by Layotto is WASMER .You can refer to official documents and examples to use API

chinese

需要实现什么功能
让Layotto能监听.wasm文件有没有变更,有变更的话重新热加载.wasm文件
达到运行时动态替换.wasm的效果

做这个功能的价值
为了实现后续功能:

  1. 基于wasm做FaaS
  2. 让开发者以后从开发sdk改成开发wasm,能够独立运维.见 [Proposal]Dynamic mecha:Let business logic sink to sidecar #166

大致方案

  1. 启动后监听指定.wasm文件有没有变更。可以使用一些开源库,例如https://github.com/fsnotify/fsnotify
  2. 监听到变更后,调wasm相关API重新加载该文件

Reference
使用WASM进行多语言编程
Layotto使用的WASM引擎是WASMER 可以参考官方文档和example使用API

@seeflood seeflood added kind/enhancement New feature or request help wanted Extra attention is needed labels Aug 6, 2021
@seeflood seeflood changed the title Support hot reloading .wasm module .wasm module hot reload Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant