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

feat: dynamic load wasm file(#191) #577

Merged
merged 32 commits into from
Jul 16, 2022
Merged

feat: dynamic load wasm file(#191) #577

merged 32 commits into from
Jul 16, 2022

Conversation

nanjingboy
Copy link
Contributor

@nanjingboy nanjingboy commented May 19, 2022

What this PR does:

Special notes for your reviewer:

there are three apis to install, update instance number, and unintall WASM file.

  • install
curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"name":"id_1","instance_num":2,"vm_config":{"engine":"wasmer","path":"demo/faas/code/golang/client/function_1.wasm"}}'  http://127.0.0.1:34998/wasm/install
  • update instance number
curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"name":"id_1","instance_num":2}'  http://127.0.0.1:34998/wasm/update
  • uninstall
curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"name":"id_1"}' http://127.0.0.1:34998/wasm/uninstall

@nanjingboy
Copy link
Contributor Author

@seeflood

@zhenjunMa
Copy link
Contributor

Cool👏👍

@seeflood
Copy link
Member

Coool!

@seeflood seeflood requested review from zhenjunMa and zu1k May 19, 2022 07:05
@codecov
Copy link

codecov bot commented May 20, 2022

Codecov Report

Merging #577 (9fa167e) into main (41d3720) will decrease coverage by 0.27%.
The diff coverage is 32.29%.

@@            Coverage Diff             @@
##             main     #577      +/-   ##
==========================================
- Coverage   60.89%   60.62%   -0.28%     
==========================================
  Files         122      125       +3     
  Lines        6432     6539     +107     
==========================================
+ Hits         3917     3964      +47     
- Misses       2133     2195      +62     
+ Partials      382      380       -2     
Impacted Files Coverage Δ
pkg/filter/stream/common/http/dispatch_filter.go 0.00% <0.00%> (ø)
pkg/filter/stream/common/http/factory.go 0.00% <0.00%> (ø)
pkg/filter/stream/common/http/path_resolver.go 100.00% <ø> (ø)
pkg/wasm/dispatch.go 23.80% <0.00%> (+23.80%) ⬆️
pkg/wasm/filter.go 0.00% <0.00%> (ø)
pkg/wasm/factory.go 18.18% <23.23%> (-6.31%) ⬇️
pkg/actuator/actuator.go 100.00% <100.00%> (ø)
pkg/actuator/health/endpoint.go 77.50% <100.00%> (ø)
pkg/actuator/info/endpoint.go 75.00% <100.00%> (ø)
pkg/filter/stream/common/http/request_handler.go 100.00% <100.00%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e83f05...9fa167e. Read the comment docs.

pkg/wasm/endpoint.go Outdated Show resolved Hide resolved
pkg/wasm/path_resolver.go Outdated Show resolved Hide resolved
pkg/wasm/wasm.go Show resolved Hide resolved
pkg/wasm/watcher.go Show resolved Hide resolved
pkg/wasm/filter.go Outdated Show resolved Hide resolved
demo/faas/config_dynamic_load.json Outdated Show resolved Hide resolved
@nanjingboy
Copy link
Contributor Author

@zhenjunMa 做了以下修改:

  1. 所以接口独立出单独的端口,不再属于 2045 端口。
  2. 尽量达到代码复用。

有空再 review 下哈 ^ _ ^

@seeflood seeflood linked an issue Jun 4, 2022 that may be closed by this pull request
@seeflood seeflood added the wasm WebAssembly technology label Jun 4, 2022
@seeflood seeflood added this to the v0.5 milestone Jun 11, 2022
@zhenjunMa
Copy link
Contributor

@nanjingboy I'm so sorry for the delay, I have finished the review, please add some unit tests to pass the codecov check👀

@nanjingboy
Copy link
Contributor Author

@nanjingboy I'm so sorry for the delay, I have finished the review, please add some unit tests to pass the codecov check👀

OK,I'll deal with it as soon as possible

@seeflood seeflood requested a review from zhenjunMa June 23, 2022 06:50
@seeflood seeflood closed this Jun 23, 2022
@seeflood seeflood reopened this Jun 23, 2022
zhenjunMa
zhenjunMa previously approved these changes Jun 24, 2022
zhenjunMa
zhenjunMa previously approved these changes Jun 24, 2022
docs/en/start/wasm/start.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
pkg/actuator/info/endpoint.go Outdated Show resolved Hide resolved
pkg/filter/stream/common/http/const.go Outdated Show resolved Hide resolved
pkg/wasm/install/endpoint.go Show resolved Hide resolved
pkg/wasm/filter.go Outdated Show resolved Hide resolved
pkg/wasm/wasm.go Show resolved Hide resolved
pkg/wasm/watcher.go Outdated Show resolved Hide resolved
@nanjingboy
Copy link
Contributor Author

@zhenjunMa the code is updated,please review it again

@zu1k
Copy link
Member

zu1k commented Jun 29, 2022

LGTM

zu1k
zu1k previously approved these changes Jun 29, 2022
zhenjunMa
zhenjunMa previously approved these changes Jul 2, 2022
@Xunzhuo Xunzhuo dismissed stale reviews from zhenjunMa and zu1k via ded0caa July 4, 2022 08:29
Copy link
Member

@seeflood seeflood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

@seeflood seeflood merged commit 917485d into mosn:main Jul 16, 2022
@seeflood
Copy link
Member

@nanjingboy Thanks for this great feature!

@nanjingboy
Copy link
Contributor Author

@nanjingboy Thanks for this great feature!

😄

@nanjingboy nanjingboy deleted the feat/dynamic_wasm branch July 17, 2022 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes size/XXL wasm WebAssembly technology
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Feature: dynamic load wasm file
5 participants