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

[Question] How to reload plugin with new wasm file? #631

Open
fangzhengjin opened this issue Dec 13, 2023 · 6 comments
Open

[Question] How to reload plugin with new wasm file? #631

fangzhengjin opened this issue Dec 13, 2023 · 6 comments
Assignees

Comments

@fangzhengjin
Copy link

How to reload plugin with new wasm file?

@nilslice
Copy link
Member

@fangzhengjin - which SDK are you using?

Also, what are you hoping to preserve by reloading a plug-in? If there's nothing about the previous plug-in needed, you should just create a new plug-in with the new wasm.

depending on the SDK you may also want to free the previous plug-in.

@fangzhengjin
Copy link
Author

fangzhengjin commented Dec 14, 2023

@fangzhengjin - which SDK are you using?

Also, what are you hoping to preserve by reloading a plug-in? If there's nothing about the previous plug-in needed, you should just create a new plug-in with the new wasm.

depending on the SDK you may also want to free the previous plug-in.

I use Rust SDK.
I want to upgrade the plugin without ending the main process and replace the WASM file. For upper users, they are still the same plugin.
I saw that Rust SDK provided some running methods, but they were all marked as unsafe, and lack of detailed explanation and use examples. Should I use them?

@fangzhengjin
Copy link
Author

Maybe extism can provide a way to upgrade the plugin?
Block new plug-in call requests during the upgrade process, clean up old plug-in resources and resume plug-in call execution after the upgrade.

@mhmd-azeez
Copy link
Collaborator

I want to upgrade the plugin without ending the main process and replace the WASM file. For upper users, they are still the same plugin.

Can you elaborate on that please?

@fangzhengjin
Copy link
Author

I want to upgrade the plugin without ending the main process and replace the WASM file. For upper users, they are still the same plugin.

Can you elaborate on that please?

I plan to plug-in some system functions and dynamically load them into the system. At this time, a single plug-in will be upgraded, but the main service will not be shut down.
Just like the Jenkins plug-in system, I can modularly update system functions online without restarting the service. For users, they have no perception. The only place where lags may occur is the blocking of requests during plug-in upgrades. New call requests and uninstalling old plug-ins, loading new plug-ins, and resuming blocked requests. If the operation goes smoothly, the user should not notice anything.

@neuronicnobody neuronicnobody self-assigned this Dec 18, 2023
@extism extism deleted a comment from cycle-app bot Dec 18, 2023
@neuronicnobody
Copy link
Contributor

@fangzhengjin you should just be able to instantiate a new Extism Plugin and replace it with the old one as @nilslice suggested above. There shouldn't be a need to restart your service to do this.

Can you share a bit more about your architecture? (e.g., is this a multi-threaded app where different threads are sharing the Plugin object)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants