Skip to content

dynamic modules: add asyncDataSource for the module binary using local.filename#43333

Merged
wbpcode merged 26 commits into
envoyproxy:mainfrom
kanurag94:dym-loading
Mar 4, 2026
Merged

dynamic modules: add asyncDataSource for the module binary using local.filename#43333
wbpcode merged 26 commits into
envoyproxy:mainfrom
kanurag94:dym-loading

Conversation

@kanurag94
Copy link
Copy Markdown
Contributor

@kanurag94 kanurag94 commented Feb 5, 2026

Commit Message: dynamic modules: add asyncDataSource for the module binary using local.filename
Additional Description: The PR adds support for fetching dynamic module binary from one of the RemoteDataSource. This currently implements local.filename support. Remote fetching will be added in follow up PRs.
Risk Level: Low
Testing: Added unit tests + Manually tested different scenarios.
Docs Changes: API docs already a part of this PR
Release Notes: Added
Platform Specific Features: NA
[Optional Runtime guard:] Not needed
[Optional Fixes #Issue]: NA
[Optional Fixes commit #PR or SHA]: NA
[Optional Deprecated:]: NA
[Optional API Considerations:] NA


The API usage is like below:

http_filters:
  - name: envoy.extensions.filters.http.dynamic_modules
    typed_config:
      "@type": type.googleapis.com/envoy.extensions.filters.http.dynamic_modules.v3.DynamicModuleFilter
      filter_name: "hello"
      filter_config:
        "@type": "type.googleapis.com/google.protobuf.StringValue"
        value: |
      dynamic_module_config:
        module:
          local:
            filename: "/path/to/libhello.so"
        do_not_close: true

AI Disclaimer: Some of the UTs have been generated using Claude Code

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
@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: #43333 was opened by kanurag94.

see: more, trace.

@wbpcode
Copy link
Copy Markdown
Member

wbpcode commented Feb 5, 2026

this should be helpful to distribute dynamic module without customize the image. cc @agrawroh @mathetake what do you think about this API?

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
@mathetake
Copy link
Copy Markdown
Member

I don't remember exactly what happens there but are we going to have a same issue as Wasm remote fetch bug or are we good here?

@wbpcode
Copy link
Copy Markdown
Member

wbpcode commented Feb 6, 2026

I don't remember exactly what happens there but are we going to have a same issue as Wasm remote fetch bug or are we good here?

I think bug is bug, although we don't care wasm too much, but we can fix bug for dynamic module. The key is do we want this feature. I inclined to keep it because my previously referred reasons. But still open to listen you and @agrawroh 's suggestion.

@mathetake
Copy link
Copy Markdown
Member

No I meant I remember there was a fundamental limitation in remote resource but maybe I am mistaken. If you see no problem then I think this is useful

@agrawroh
Copy link
Copy Markdown
Member

agrawroh commented Feb 9, 2026

+1 This would be a really useful feature to have!

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
@kanurag94
Copy link
Copy Markdown
Contributor Author

/retest

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
@kanurag94
Copy link
Copy Markdown
Contributor Author

/retest

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
@kanurag94 kanurag94 requested review from mathetake and wbpcode March 3, 2026 14:56
@wbpcode
Copy link
Copy Markdown
Member

wbpcode commented Mar 4, 2026

Could we split the local.filename support and the remote fetcher and keep the simplest local.filename support in this PR because it would be easier to get agreement on that.
Then, we can make another PR to support actual remote source fetching?

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
@wbpcode
Copy link
Copy Markdown
Member

wbpcode commented Mar 4, 2026

you can move test/extensions/filters/http/dynamic_modules/config_test.cc test to test/extensions/dynamic_modules/http/config_test.cc because we put all tests of dynamic modules there.

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
// via ``local.filename``.
//
// When both ``name`` and ``module`` are set, ``module`` takes precedence.
config.core.v3.AsyncDataSource module = 6;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I named it module instead of source as per the patterns we have in the existing code where a datasource signifies what it is fetching. Reading dynamic_module_config.module also seemed better than dynamic_module_config.source which might mean configSource and not moduleSource.

@kanurag94 kanurag94 changed the title dynamic modules: add remote fetching for the module binary dynamic modules: add asyncDataSource for the module binary using local.filename Mar 4, 2026
@kanurag94
Copy link
Copy Markdown
Contributor Author

Thank you again for the review @wbpcode. Apologies that I wasn't able to understand that we wanted to split out remote mode from this PR.
I have now kept the PR very minimal (thanks to your suggestions). Will create a new PR for remote support.

@repokitteh-read-only repokitteh-read-only Bot removed the api label Mar 4, 2026
@wbpcode wbpcode dismissed mathetake’s stale review March 4, 2026 12:27

I think this PR is cleanup and all previous comments from Takeshi were addressed

@wbpcode wbpcode merged commit 059d8c6 into envoyproxy:main Mar 4, 2026
29 of 30 checks passed
wbpcode pushed a commit that referenced this pull request Mar 11, 2026
…inary (#43818)

**Commit Message**: dynamic_modules: add remote HTTP support for
asyncDataSource module binary
**Additional Description**: Extends the asyncDataSource support (added
in #43333 for local.filename) to support fetching dynamic module
binaries from remote HTTP sources via module.remote in
DynamicModuleConfig. The module is downloaded asynchronously during
listener initialization with SHA256 verification, written to a temporary
file, and loaded via dlopen. If the remote fetch fails, the filter is
not installed and requests pass through (fail-open).
**Risk Level**: Low
**Testing**: Added unit tests + Manually tested
**Docs Changes**: API docs already a part of this PR
**Release Notes**: Added

---------

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
bmjask pushed a commit to bmjask/envoy that referenced this pull request Mar 14, 2026
…l.filename (envoyproxy#43333)

**Commit Message**: dynamic modules: add asyncDataSource for the module
binary using local.filename
**Additional Description**: The PR adds support for fetching dynamic
module binary from one of the RemoteDataSource. This currently
implements local.filename support. Remote fetching will be added in
follow up PRs.
**Risk Level**: Low
**Testing**: Added unit tests + Manually tested different scenarios.
**Docs Changes**: API docs already a part of this PR
**Release Notes**: Added
Platform Specific Features: NA
[Optional Runtime guard:] Not needed
[Optional Fixes #Issue]: NA
[Optional Fixes commit #PR or SHA]: NA
[Optional Deprecated:]: NA
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]
NA

---

The API usage is like below:

```
http_filters:
  - name: envoy.extensions.filters.http.dynamic_modules
    typed_config:
      "@type": type.googleapis.com/envoy.extensions.filters.http.dynamic_modules.v3.DynamicModuleFilter
      filter_name: "hello"
      filter_config:
        "@type": "type.googleapis.com/google.protobuf.StringValue"
        value: |
      dynamic_module_config:
        module:
          local:
            filename: "/path/to/libhello.so"
        do_not_close: true
```

*AI Disclaimer*: Some of the UTs have been generated using Claude Code

---------

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
Signed-off-by: bjmask <11672696+bjmask@users.noreply.github.com>
bmjask pushed a commit to bmjask/envoy that referenced this pull request Mar 14, 2026
…inary (envoyproxy#43818)

**Commit Message**: dynamic_modules: add remote HTTP support for
asyncDataSource module binary
**Additional Description**: Extends the asyncDataSource support (added
in envoyproxy#43333 for local.filename) to support fetching dynamic module
binaries from remote HTTP sources via module.remote in
DynamicModuleConfig. The module is downloaded asynchronously during
listener initialization with SHA256 verification, written to a temporary
file, and loaded via dlopen. If the remote fetch fails, the filter is
not installed and requests pass through (fail-open).
**Risk Level**: Low
**Testing**: Added unit tests + Manually tested
**Docs Changes**: API docs already a part of this PR
**Release Notes**: Added

---------

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
Signed-off-by: bjmask <11672696+bjmask@users.noreply.github.com>
bvandewalle pushed a commit to bvandewalle/envoy that referenced this pull request Mar 17, 2026
…l.filename (envoyproxy#43333)

**Commit Message**: dynamic modules: add asyncDataSource for the module
binary using local.filename
**Additional Description**: The PR adds support for fetching dynamic
module binary from one of the RemoteDataSource. This currently
implements local.filename support. Remote fetching will be added in
follow up PRs.
**Risk Level**: Low
**Testing**: Added unit tests + Manually tested different scenarios.
**Docs Changes**: API docs already a part of this PR
**Release Notes**: Added
Platform Specific Features: NA
[Optional Runtime guard:] Not needed
[Optional Fixes #Issue]: NA
[Optional Fixes commit #PR or SHA]: NA
[Optional Deprecated:]: NA
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]
NA

---

The API usage is like below:

```
http_filters:
  - name: envoy.extensions.filters.http.dynamic_modules
    typed_config:
      "@type": type.googleapis.com/envoy.extensions.filters.http.dynamic_modules.v3.DynamicModuleFilter
      filter_name: "hello"
      filter_config:
        "@type": "type.googleapis.com/google.protobuf.StringValue"
        value: |
      dynamic_module_config:
        module:
          local:
            filename: "/path/to/libhello.so"
        do_not_close: true
```


*AI Disclaimer*: Some of the UTs have been generated using Claude Code

---------

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
wbpcode pushed a commit that referenced this pull request Mar 18, 2026
**Commit Message**: dynamic_modules: remote source: add caching for
fetched modules

**Motivation**
Follow up from #43818 and #43333
Next PR: `nack_on_cache_miss` support (NACK on cache miss + background
fetch)

**Additional Description**: 

`newDynamicModuleFromBytes` already writes fetched modules to a
deterministic path based on SHA256. This PR adds a check before the
async fetch: if the file already exists on disk, load it directly and
skip the HTTP fetch entirely.

It is a simple approach that forms base for the next PR.

**Risk Level**: Low
**Testing**: Added unit tests
**Docs Changes**: NA
**Release Notes**: Added
Platform Specific Features: NA
[Optional Runtime guard:] Not needed
[Optional Fixes #Issue]: NA
[Optional Fixes commit #PR or SHA]: NA
[Optional Deprecated:]: NA
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]
NA

---------

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
fishcakez pushed a commit to fishcakez/envoy that referenced this pull request Mar 25, 2026
…l.filename (envoyproxy#43333)

**Commit Message**: dynamic modules: add asyncDataSource for the module
binary using local.filename
**Additional Description**: The PR adds support for fetching dynamic
module binary from one of the RemoteDataSource. This currently
implements local.filename support. Remote fetching will be added in
follow up PRs.
**Risk Level**: Low
**Testing**: Added unit tests + Manually tested different scenarios.
**Docs Changes**: API docs already a part of this PR
**Release Notes**: Added
Platform Specific Features: NA
[Optional Runtime guard:] Not needed
[Optional Fixes #Issue]: NA
[Optional Fixes commit #PR or SHA]: NA
[Optional Deprecated:]: NA
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]
NA

---

The API usage is like below:

```
http_filters:
  - name: envoy.extensions.filters.http.dynamic_modules
    typed_config:
      "@type": type.googleapis.com/envoy.extensions.filters.http.dynamic_modules.v3.DynamicModuleFilter
      filter_name: "hello"
      filter_config:
        "@type": "type.googleapis.com/google.protobuf.StringValue"
        value: |
      dynamic_module_config:
        module:
          local:
            filename: "/path/to/libhello.so"
        do_not_close: true
```


*AI Disclaimer*: Some of the UTs have been generated using Claude Code

---------

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
fishcakez pushed a commit to fishcakez/envoy that referenced this pull request Mar 25, 2026
…inary (envoyproxy#43818)

**Commit Message**: dynamic_modules: add remote HTTP support for
asyncDataSource module binary
**Additional Description**: Extends the asyncDataSource support (added
in envoyproxy#43333 for local.filename) to support fetching dynamic module
binaries from remote HTTP sources via module.remote in
DynamicModuleConfig. The module is downloaded asynchronously during
listener initialization with SHA256 verification, written to a temporary
file, and loaded via dlopen. If the remote fetch fails, the filter is
not installed and requests pass through (fail-open).
**Risk Level**: Low
**Testing**: Added unit tests + Manually tested
**Docs Changes**: API docs already a part of this PR
**Release Notes**: Added

---------

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
fishcakez pushed a commit to fishcakez/envoy that referenced this pull request Mar 25, 2026
…yproxy#43974)

**Commit Message**: dynamic_modules: remote source: add caching for
fetched modules

**Motivation**
Follow up from envoyproxy#43818 and envoyproxy#43333
Next PR: `nack_on_cache_miss` support (NACK on cache miss + background
fetch)

**Additional Description**: 

`newDynamicModuleFromBytes` already writes fetched modules to a
deterministic path based on SHA256. This PR adds a check before the
async fetch: if the file already exists on disk, load it directly and
skip the HTTP fetch entirely.

It is a simple approach that forms base for the next PR.

**Risk Level**: Low
**Testing**: Added unit tests
**Docs Changes**: NA
**Release Notes**: Added
Platform Specific Features: NA
[Optional Runtime guard:] Not needed
[Optional Fixes #Issue]: NA
[Optional Fixes commit #PR or SHA]: NA
[Optional Deprecated:]: NA
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]
NA

---------

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
TAOXUY pushed a commit to TAOXUY/envoy that referenced this pull request Apr 1, 2026
…yproxy#43974)

**Commit Message**: dynamic_modules: remote source: add caching for
fetched modules

**Motivation**
Follow up from envoyproxy#43818 and envoyproxy#43333
Next PR: `nack_on_cache_miss` support (NACK on cache miss + background
fetch)

**Additional Description**:

`newDynamicModuleFromBytes` already writes fetched modules to a
deterministic path based on SHA256. This PR adds a check before the
async fetch: if the file already exists on disk, load it directly and
skip the HTTP fetch entirely.

It is a simple approach that forms base for the next PR.

**Risk Level**: Low
**Testing**: Added unit tests
**Docs Changes**: NA
**Release Notes**: Added
Platform Specific Features: NA
[Optional Runtime guard:] Not needed
[Optional Fixes #Issue]: NA
[Optional Fixes commit #PR or SHA]: NA
[Optional Deprecated:]: NA
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]
NA

---------

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
Signed-off-by: Xuyang Tao <taoxuy@google.com>
nshipilov pushed a commit to nshipilov/envoy that referenced this pull request Apr 13, 2026
…yproxy#43974)

**Commit Message**: dynamic_modules: remote source: add caching for
fetched modules

**Motivation**
Follow up from envoyproxy#43818 and envoyproxy#43333
Next PR: `nack_on_cache_miss` support (NACK on cache miss + background
fetch)

**Additional Description**:

`newDynamicModuleFromBytes` already writes fetched modules to a
deterministic path based on SHA256. This PR adds a check before the
async fetch: if the file already exists on disk, load it directly and
skip the HTTP fetch entirely.

It is a simple approach that forms base for the next PR.

**Risk Level**: Low
**Testing**: Added unit tests
**Docs Changes**: NA
**Release Notes**: Added
Platform Specific Features: NA
[Optional Runtime guard:] Not needed
[Optional Fixes #Issue]: NA
[Optional Fixes commit #PR or SHA]: NA
[Optional Deprecated:]: NA
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]
NA

---------

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
Signed-off-by: Nick Shipilov <nick.shipilov.n@gmail.com>
kpramesh2212 pushed a commit to kpramesh2212/envoy that referenced this pull request Apr 14, 2026
…yproxy#43974)

**Commit Message**: dynamic_modules: remote source: add caching for
fetched modules

**Motivation**
Follow up from envoyproxy#43818 and envoyproxy#43333
Next PR: `nack_on_cache_miss` support (NACK on cache miss + background
fetch)

**Additional Description**: 

`newDynamicModuleFromBytes` already writes fetched modules to a
deterministic path based on SHA256. This PR adds a check before the
async fetch: if the file already exists on disk, load it directly and
skip the HTTP fetch entirely.

It is a simple approach that forms base for the next PR.

**Risk Level**: Low
**Testing**: Added unit tests
**Docs Changes**: NA
**Release Notes**: Added
Platform Specific Features: NA
[Optional Runtime guard:] Not needed
[Optional Fixes #Issue]: NA
[Optional Fixes commit #PR or SHA]: NA
[Optional Deprecated:]: NA
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]
NA

---------

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
krinkinmu pushed a commit to grnmeira/envoy that referenced this pull request Apr 20, 2026
…l.filename (envoyproxy#43333)

**Commit Message**: dynamic modules: add asyncDataSource for the module
binary using local.filename
**Additional Description**: The PR adds support for fetching dynamic
module binary from one of the RemoteDataSource. This currently
implements local.filename support. Remote fetching will be added in
follow up PRs.
**Risk Level**: Low
**Testing**: Added unit tests + Manually tested different scenarios.
**Docs Changes**: API docs already a part of this PR
**Release Notes**: Added
Platform Specific Features: NA
[Optional Runtime guard:] Not needed
[Optional Fixes #Issue]: NA
[Optional Fixes commit #PR or SHA]: NA
[Optional Deprecated:]: NA
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]
NA

---

The API usage is like below:

```
http_filters:
  - name: envoy.extensions.filters.http.dynamic_modules
    typed_config:
      "@type": type.googleapis.com/envoy.extensions.filters.http.dynamic_modules.v3.DynamicModuleFilter
      filter_name: "hello"
      filter_config:
        "@type": "type.googleapis.com/google.protobuf.StringValue"
        value: |
      dynamic_module_config:
        module:
          local:
            filename: "/path/to/libhello.so"
        do_not_close: true
```


*AI Disclaimer*: Some of the UTs have been generated using Claude Code

---------

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
krinkinmu pushed a commit to grnmeira/envoy that referenced this pull request Apr 20, 2026
…inary (envoyproxy#43818)

**Commit Message**: dynamic_modules: add remote HTTP support for
asyncDataSource module binary
**Additional Description**: Extends the asyncDataSource support (added
in envoyproxy#43333 for local.filename) to support fetching dynamic module
binaries from remote HTTP sources via module.remote in
DynamicModuleConfig. The module is downloaded asynchronously during
listener initialization with SHA256 verification, written to a temporary
file, and loaded via dlopen. If the remote fetch fails, the filter is
not installed and requests pass through (fail-open).
**Risk Level**: Low
**Testing**: Added unit tests + Manually tested
**Docs Changes**: API docs already a part of this PR
**Release Notes**: Added

---------

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
krinkinmu pushed a commit to grnmeira/envoy that referenced this pull request Apr 20, 2026
…yproxy#43974)

**Commit Message**: dynamic_modules: remote source: add caching for
fetched modules

**Motivation**
Follow up from envoyproxy#43818 and envoyproxy#43333
Next PR: `nack_on_cache_miss` support (NACK on cache miss + background
fetch)

**Additional Description**: 

`newDynamicModuleFromBytes` already writes fetched modules to a
deterministic path based on SHA256. This PR adds a check before the
async fetch: if the file already exists on disk, load it directly and
skip the HTTP fetch entirely.

It is a simple approach that forms base for the next PR.

**Risk Level**: Low
**Testing**: Added unit tests
**Docs Changes**: NA
**Release Notes**: Added
Platform Specific Features: NA
[Optional Runtime guard:] Not needed
[Optional Fixes #Issue]: NA
[Optional Fixes commit #PR or SHA]: NA
[Optional Deprecated:]: NA
[Optional [API
Considerations](https://github.com/envoyproxy/envoy/blob/main/api/review_checklist.md):]
NA

---------

Signed-off-by: Anurag Aggarwal <kanurag94@gmail.com>
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