Skip to content

DynVm Implementation: Dynamically loaded native modules - #379

Closed
Protryon wants to merge 5 commits into
proxy-wasm:mainfrom
nginxinc:master
Closed

Protryon wants to merge 5 commits into
proxy-wasm:mainfrom
nginxinc:master

Conversation

@Protryon

Copy link
Copy Markdown

This PR adds a variant of NullVm, DynVM, that can load in native modules as dynamically linked modules.

Haven't written any automated tests yet, wanted to check if any design changes were going to be needed first, since the tests are going to be a bit more complicated than NullVM.

We've been testing this internally in an Envoy integration.

@PiotrSikora

Copy link
Copy Markdown
Member

@mpwarres @kyessenov could one of you look at it? Thanks!

@PiotrSikora

Copy link
Copy Markdown
Member

This PR adds a variant of NullVm, DynVM, that can load in native modules as dynamically linked modules.

Nitpicking, but if we're still talking about the NullVM, then I'd rather use "dynamically-loaded NullVM plugins" or similar, instead of adding another name for the NullVM.

@Protryon

Protryon commented Feb 2, 2024

Copy link
Copy Markdown
Author

@mpwarres @kyessenov Any updates on this?

@kyessenov kyessenov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I scanned through it, and it looks reasonable to me. I think you could probably add a few more macros to make it smaller. I like this approach since it's closer to full-Wasm - globals and shared libraries are directly visible in the library binary, and it allows separating the release/code management.

@PiotrSikora A lot of this is mechanical code - I think we just need to have enough test coverage for this to be accepted.

@Protryon

Copy link
Copy Markdown
Author

@kyessenov @PiotrSikora I've pushed up some tests for DynVM.

Comment thread .github/workflows/test.yml Resolved
@martijneken

Copy link
Copy Markdown
Contributor

This is a very cool approach, let's get this merged. @PiotrSikora @kyessenov @mpwarres any other feedback here?

@kyessenov

Copy link
Copy Markdown
Collaborator

I'm fine with the PR. Please stamp the approval :)

@PiotrSikora PiotrSikora left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Other than the comments above, I think this still needs some tests and a PR with Envoy integration.

Comment thread src/dyn/dyn_ffi.cc Resolved
Comment thread include/proxy-wasm/exports.h Resolved
Comment thread src/exports.cc Resolved
Comment thread include/proxy-wasm/exports.h Resolved
Comment thread test/utility.cc Resolved
Comment thread test/BUILD Resolved
fix comments

format and lints

Signed-off-by: Protryon <[email protected]>
Signed-off-by: Protryon <[email protected]>
Signed-off-by: Protryon <[email protected]>
Signed-off-by: Protryon <[email protected]>
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

Successfully merging this pull request may close these issues.

4 participants