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

dynamic_modules: adds initial object loading logic #35550

Merged
merged 4 commits into from
Aug 6, 2024

Conversation

mathetake
Copy link
Member

@mathetake mathetake commented Aug 1, 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.

#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:]

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Copy link

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
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
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 <t.y.mathetake@gmail.com>
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
@@ -345,8 +346,8 @@ extensions/filters/http/oauth2 @derekargueta @mattklein123
/*/extensions/filters/http/match_delegate @wbpcode @jstraceski @tyxia
# Generic proxy and related extensions
/*/extensions/filters/network/generic_proxy/ @wbpcode @soulxu

/*/extensions/health_checkers/common @zuercher @botengyao
Copy link
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
Member Author

cc @mattklein123 @marc-barry

@soulxu
Copy link
Member

soulxu commented Aug 2, 2024

/assign @mattklein123

Copy link
Contributor

@marc-barry marc-barry left a comment

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.

Copy link
Member

@mattklein123 mattklein123 left a comment

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
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 <t.y.mathetake@gmail.com>
@mathetake
Copy link
Member Author

/retest

@mathetake mathetake requested a review from mattklein123 August 6, 2024 00:56
@mathetake
Copy link
Member Author

mathetake commented Aug 6, 2024

(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
47 of 49 checks passed
@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 <t.y.mathetake@gmail.com>
Signed-off-by: Martin Duke <martin.h.duke@gmail.com>
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 <t.y.mathetake@gmail.com>
Signed-off-by: asingh-g <abhisinghx@google.com>
absl::StatusOr<DynamicModuleSharedPtr> result = newDynamicModule("invalid_name", false);
EXPECT_FALSE(result.ok());
EXPECT_EQ(result.status().code(), absl::StatusCode::kInvalidArgument);
}
Copy link
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