Add a `dynamic-mod-rust` example (Rust dynamic module HTTP filter)
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
Summary
This repo currently has two examples of extending Envoy with custom code, both in C++:
filter-cc— a statically linked in-tree filter, built with Bazel against the Envoy sourcewasm-cc— a proxy-wasm filter
What is missing is an example of a dynamic module, which is the more common pattern for out-of-tree extensions these days. Dynamic modules are shared libraries loaded at runtime via envoy.filters.http.dynamic_modules and have an official Rust SDK (envoy-proxy-dynamic-modules-rust-sdk). We should add a dynamic-mod-rust sandbox alongside the existing two.
Proposed layout
Mirror the wasm-cc sandbox structure so it slots into the existing docs/verify tooling:
dynamic-mod-rust/
Cargo.toml
Cargo.lock
src/lib.rs # minimal HTTP filter: add a response header + append to body
Dockerfile-proxy # multi-stage: build the .so, copy into envoyproxy/envoy:dev
Dockerfile-echo # same echo backend as wasm-cc
docker-compose.yaml
envoy.yaml # DynamicModuleFilter config
example.rst
verify.sh
README.md
envoy.yamlusesenvoy.filters.http.dynamic_moduleswithDynamicModuleFilter(dynamic_module_config.name,filter_name,filter_configasgoogle.protobuf.Struct).Dockerfile-proxybuilds the module in arust:stage and copieslib<name>.sointo the Envoy image, settingENVOY_DYNAMIC_MODULES_SEARCH_PATHaccordingly.verify.shfollows the same shape aswasm-cc/verify.sh(check header/body from the filter, then optionally modify → rebuild → re-check).example.rstshould link to the dynamic modules arch overview and the Rust SDK docs, and note that the SDK version must match the Envoy ABI version of the image being used.
No committed binaries
Unlike wasm-cc, which ships a prebuilt x86_64 .wasm in lib/, this example should not commit any built artifacts. Committing binaries is generally bad practice, and a Rust dynamic module build is lightweight enough (no Bazel, no Envoy source checkout) that it can be built as part of docker compose up --build in reasonable time. This also removes the arch-specific caveat that wasm-cc carries.
Wiring
- Add
dynamic-mod-rusttoEXAMPLE_TESTSin the rootBUILDso it runs with the normalenvoy_examplesverification. Since it builds with cargo rather than Bazel, it should not need to be added to the_verify_build.ymlmatrix, and noMODULE.bazel/ rootbazel_depis required. :configsanddocs_rstglobs should pick upenvoy.yamlandexample.rstautomatically.- Consider adding a
cargoecosystem entry fordynamic-mod-rust/to.github/dependabot.yaml.
References
- Dynamic modules arch overview: https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/advanced/dynamic_modules
- Rust SDK: https://github.com/envoyproxy/envoy/tree/main/source/extensions/dynamic_modules/sdk/rust
- Reference examples: https://github.com/envoyproxy/dynamic-modules-examples (note its
release/v<version>branching for ABI compatibility) - Upstream tracking issue: https://github.com/envoyproxy/envoy/issues/38392
- 主要言語
- Shell
- スター
- 75
- フォーク
- 39
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 31
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
envoyproxy/examples のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
envoyproxy/examples#1640 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
envoyproxy/examples#1629 · コメント 7 件 ·
メンテナーはふだん 1 日以内に返信
-
ci: Allocate example host ports dynamically instead of the static 1LLBN scheme再び着手できるかも @phlax が 49 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンenhancement
envoyproxy/examples#1516 · リアクション 1 件 · 担当者 2 名 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
envoyproxy/examples#1515 ·
メンテナーはふだん 1 日以内に返信
-
ai-transcoder sandbox: requirements for resubmission再び着手できるかも @phlax が 49 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンenhancement
envoyproxy/examples#1499 · コメント 3 件 · リアクション 1 件 · 担当者 2 名 ·
メンテナーはふだん 1 日以内に返信
envoyproxy/examples の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
github/gh-aw-firewall#12415 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 92/100
tldr-pages/tldr#25620 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
source:reader type:content-error
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
stephrobert/blog-roadmap#251 ·