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

Upgrade the wasm demo developed by AssemblyScript #256

Closed
zhenjunMa opened this issue Oct 14, 2021 · 2 comments · Fixed by #486
Closed

Upgrade the wasm demo developed by AssemblyScript #256

zhenjunMa opened this issue Oct 14, 2021 · 2 comments · Fixed by #486
Assignees
Labels
help wanted Extra attention is needed kind/enhancement New feature or request

Comments

@zhenjunMa
Copy link
Contributor

1. What would you like to be added

The old version of Layotto already supports the functions combined with WebAssembly, and provides demos implemented in three languages, golang, rust, and AssemblyScript. The new version of Layotto has refactored the support for WebAssembly and realized the expected FaaS prototype. The process of processing the request of the new version of the demo is as follows:
image

2. Why is this needed

  1. Improve Layotto + WebAssembly to realize the FaaS ecosystem.
  2. Developers can learn how to develop WebAssembly with AssemblyScript.

3. Design draft

  1. code
    Need to develop the client and server functions. The client receives the http request and calls the server. The server obtains data from redis and returns the results in turn.
    For implementation details, please refer to the golang version of the demo: demo/faas/code/golang

  2. test
    After Layotto is started, configure and load two wasm files in demo/faas/config.json, and then send request as follows:

> curl -H 'id:id_1' '127.0.0.1:2045?name=book1'
There are 100 inventories for book1.

中文

一、需要实现什么功能

旧版的Layotto已经支持了跟WebAssembly结合的的功能,并且提供了golang, rust, assemblyScript三种语言实现的demo,新版的Layotto重构了对WebAssembly的支持,实现了预期的FaaS雏形,新版demo处理请求的流程如下:

image

目前整套流程已经用Go语言实现,代码路径:demo/faas/code/golang,而rust跟assemblyScript两种demo还停留在以前的状态,因此需要进行升级。

二、做这个功能的价值

  1. 完善Layotto + WebAssembly实现FaaS的生态。
  2. 开发者可以学习如何用AssemblyScript开发WebAssembly。

三、方案概述

  1. 代码开发
    需要开发client, server两个function,client端接收http请求并调用server端,server端从redis中获取数据然后依次返回结果。
    实现细节可以参考golang版demo:demo/faas/code/golang

  2. 自测方法
    Layotto启动以后,在demo/faas/config.json中配置加载两个wasm文件,然后进行验证:

> curl -H 'id:id_1' '127.0.0.1:2045?name=book1'
There are 100 inventories for book1.
@nanjingboy
Copy link
Contributor

@seeflood does this isssue have been assigned? if not, i want to pick it up

@seeflood
Copy link
Member

@nanjingboy Cool ! assigned to u.

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.

3 participants