Skip to content

dynamic_modules: adds initial object loading logic - #35550

Merged
mattklein123 merged 4 commits into
envoyproxy:mainfrom
mathetake:dynamicmodulekickoff
Aug 6, 2024
Merged

mattklein123 merged 4 commits into
envoyproxy:mainfrom
mathetake:dynamicmodulekickoff

Conversation

@mathetake

@mathetake mathetake commented Aug 1, 2024 •

Copy link
Copy Markdown
Member

Commit Message: dynamic_modules: adds initial object loading logic
Additional Description:
This is the very first commit of the dynamic loading feature discussed among community
members. This is the effort to upstream the playground repository
https://github.com/mathetake/envoy-dynamic-modules as an Envoy core extension.
Series of commits will follow this little by little.

#2053, #24230, #32502

Risk Level: N/A (not compiled into the final build yet)
Testing: unit
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #35550 was opened by mathetake.

see: more, trace.

Comment on lines +12 to +19
/**
* A class for loading and managing dynamic modules. This corresponds to a single dlopen handle.
* When the DynamicModule object is destroyed, the dlopen handle is closed.
*
* This class is supposed to be initialized once in the main thread and can be shared with other
* threads.
*/
class DynamicModule {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

note: this should be utilized in contrib/golang, and relatively easy, but then the changes in this patch end up across many places, so I chose not to do that right now. - I could take a shot after this PR.

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.

Yes please do, thanks.

Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Takeshi Yoneda <[email protected]>
Comment thread CODEOWNERS
# Generic proxy and related extensions
/*/extensions/filters/network/generic_proxy/ @wbpcode @soulxu

/*/extensions/health_checkers/common @zuercher @botengyao

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

moved this up as it looked like it was misplaced

@mathetake
mathetake marked this pull request as ready for review August 1, 2024 19:43
@mathetake

Copy link
Copy Markdown
Member Author

cc @mattklein123 @marc-barry

@soulxu

soulxu commented Aug 2, 2024

Copy link
Copy Markdown
Member

/assign @mattklein123

@marc-barry marc-barry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks great and as it stands doesn't pose a risk (yet) as it isn't compiled into the final Envoy build at this time. 👍 to the approach of adding this little by little and starting with the initial object loading logic as the foundation for future PRs which will include code from https://github.com/mathetake/envoy-dynamic-modules. I really like the approach and simplicity of the ABI as defined in https://github.com/mathetake/envoy-dynamic-modules/tree/main/abi.

I didn't want to approve without this being reviewed by @mattklein123 who is the one assigned to this pull request.

@mattklein123 mattklein123 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.

Thanks LGTM with small nits.

/wait

Comment on lines +12 to +19
/**
* A class for loading and managing dynamic modules. This corresponds to a single dlopen handle.
* When the DynamicModule object is destroyed, the dlopen handle is closed.
*
* This class is supposed to be initialized once in the main thread and can be shared with other
* threads.
*/
class DynamicModule {

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.

Yes please do, thanks.

@mathetake

Copy link
Copy Markdown
Member Author

/retest

@mathetake
mathetake requested a review from mattklein123 August 6, 2024 00:56
@mathetake

mathetake commented Aug 6, 2024 •

Copy link
Copy Markdown
Member Author

(CI is flaky as usual for unrelated reasons - the same coverage upload failure is happening to other PRs)

@mattklein123
mattklein123 merged commit 6bdb8ff into envoyproxy:main Aug 6, 2024
@mathetake
mathetake deleted the dynamicmodulekickoff branch August 6, 2024 22:57
martinduke pushed a commit to martinduke/envoy that referenced this pull request Aug 8, 2024
Commit Message: dynamic_modules: adds initial object loading logic
Additional Description:
This is the very first commit of the dynamic loading feature discussed
among community
members. This is the effort to upstream the playground repository
https://github.com/mathetake/envoy-dynamic-modules as an Envoy core
extension.
Series of commits will follow this little by little.

envoyproxy#2053, envoyproxy#24230, envoyproxy#32502

Risk Level: N/A (not compiled into the final build yet)
Testing: unit
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

---------

Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: Martin Duke <[email protected]>
asingh-g pushed a commit to asingh-g/envoy that referenced this pull request Aug 20, 2024
Commit Message: dynamic_modules: adds initial object loading logic
Additional Description:
This is the very first commit of the dynamic loading feature discussed
among community
members. This is the effort to upstream the playground repository
https://github.com/mathetake/envoy-dynamic-modules as an Envoy core
extension.
Series of commits will follow this little by little.

envoyproxy#2053, envoyproxy#24230, envoyproxy#32502

Risk Level: N/A (not compiled into the final build yet)
Testing: unit
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]

---------

Signed-off-by: Takeshi Yoneda <[email protected]>
Signed-off-by: asingh-g <[email protected]>
absl::StatusOr<DynamicModuleSharedPtr> result = newDynamicModule("invalid_name", false);
EXPECT_FALSE(result.ok());
EXPECT_EQ(result.status().code(), absl::StatusCode::kInvalidArgument);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just drive by review: you should add a test which loads a file which exists, but is not a valid library.

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.

5 participants