Skip to content

extensions: add http bandwidth limit filter - #16358

Merged
lizan merged 42 commits into
envoyproxy:mainfrom
nitgoy:bwlfilter
May 25, 2021
Merged

lizan merged 42 commits into
envoyproxy:mainfrom
nitgoy:bwlfilter

Conversation

@nitgoy

@nitgoy nitgoy commented May 6, 2021 •

Copy link
Copy Markdown
Contributor

Commit Message: adds bandwidth limit filter core functionality and UTs
Additional Description: the filter smoothens the flow of data in both direction up to the specified bandwidth limit.
Risk Level: Low, new filter
Testing: UTs added. Adding more UTs and integration tests.
Docs Changes: Added
Release Notes: Added
Fixes #13604

* Add bandwidthlimit filter skeleton

* fix build

* Add core logic

* fix build

* minor fix

* Add bandwidthlimit filter skeleton

* fix build

* Add core logic

* fix build

* minor fix

* minor

* add generated configs

* final build fixes

* config and test related changes

Signed-off-by: Nitin <[email protected]>

* fix spellings

Signed-off-by: Nitin <[email protected]>

* update generated config

Signed-off-by: Nitin <[email protected]>

* move configs to v3alpha

* bandwidth limit filter config

Signed-off-by: Nitin <[email protected]>

Signed-off-by: Nitin Goyal <[email protected]>

* Address comments: remove enforce threshold

Signed-off-by: Nitin <[email protected]>

Signed-off-by: Nitin Goyal <[email protected]>

* move proto to alpha

Signed-off-by: Nitin <[email protected]>

Signed-off-by: Nitin Goyal <[email protected]>

* bandwidth limit filter config

Signed-off-by: Nitin <[email protected]>

* Address comments: remove enforce threshold

Signed-off-by: Nitin <[email protected]>

* change limit field to optional

Signed-off-by: Nitin <[email protected]>

Signed-off-by: Nitin Goyal <[email protected]>

* delete v3 file

Signed-off-by: Nitin <[email protected]>

* generated configs

Signed-off-by: Nitin <[email protected]>

* add spelling

Signed-off-by: Nitin <[email protected]>

* Add v4alpha proto

Signed-off-by: Nitin <[email protected]>

* add generated v4alpha configs

Signed-off-by: Nitin <[email protected]>

* fix test and build

Signed-off-by: Nitin <[email protected]>

* fix config tests

Signed-off-by: Nitin <[email protected]>

* Add tests

Signed-off-by: Nitin <[email protected]>

* fix tests

Signed-off-by: Nitin <[email protected]>

* fix format

Signed-off-by: Nitin <[email protected]>

* Add bi-directional test

Signed-off-by: Nitin <[email protected]>

* proto format

Signed-off-by: Nitin <[email protected]>

* remove soft limit config

Signed-off-by: Nitin <[email protected]>

* extension: add http bandwidth limit filter (#3)

Add bandwidth limit filter core functionality and UTs. The filter smoothens the flow of data in both direction up to the specified bandwidth limit.

Signed-off-by: Nitin <[email protected]>

Signed-off-by: Nitin Goyal <[email protected]>

* make token bucket conditionally thread-safe and add comment for stream rate limiter

Signed-off-by: Nitin <[email protected]>

* fix reset

Signed-off-by: Nitin <[email protected]>

* remove some absl guards

Signed-off-by: Nitin <[email protected]>

* update filter

Signed-off-by: Nitin Goyal <[email protected]>

* update proto

Signed-off-by: Nitin Goyal <[email protected]>

* add docs

Signed-off-by: Nitin Goyal <[email protected]>

* proto and doc fixes

Signed-off-by: Nitin Goyal <[email protected]>

* test fix

Signed-off-by: Nitin Goyal <[email protected]>
@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/envoy/.
envoyproxy/api-shepherds assignee is @markdroth
CC @envoyproxy/api-watchers: FYI only for changes made to api/envoy/.

🐱

Caused by: #16358 was opened by nitgoy.

see: more, trace.

Signed-off-by: Nitin Goyal <[email protected]>
@yanavlasov yanavlasov self-assigned this May 6, 2021
@nitgoy

nitgoy commented May 6, 2021 •

Copy link
Copy Markdown
Contributor Author

Any idea about the format_pre and docs check failure? The tools/code_format/check_format.py fix and docs/build.sh commands are passing locally.

@nitgoy

nitgoy commented May 6, 2021

Copy link
Copy Markdown
Contributor Author

Actually found this warning with docs build command:
generated/rst/api-v3/extensions/filters/http/bandwidth_limit/v3alpha/bandwidth_limit.proto.rst: WARNING: document isn't included in any toctree
Not sure what am I missing since the file is auto-generated.

@adisuissa

Copy link
Copy Markdown
Contributor

Actually found this warning with docs build command:
generated/rst/api-v3/extensions/filters/http/bandwidth_limit/v3alpha/bandwidth_limit.proto.rst: WARNING: document isn't included in any toctree
Not sure what am I missing since the file is auto-generated.

Not an expert, but I think the idea is that the entire doc will be a tree (not a forest), and so everything can be reached from the main docs page.
Maybe something similar to envoy/docs/root/api-v3/config/accesslog/accesslog.rst will work in this case.

Signed-off-by: Nitin Goyal <[email protected]>
@nitgoy

nitgoy commented May 6, 2021 •

Copy link
Copy Markdown
Contributor Author

Actually found this warning with docs build command:
generated/rst/api-v3/extensions/filters/http/bandwidth_limit/v3alpha/bandwidth_limit.proto.rst: WARNING: document isn't included in any toctree
Not sure what am I missing since the file is auto-generated.

Not an expert, but I think the idea is that the entire doc will be a tree (not a forest), and so everything can be reached from the main docs page.
Maybe something similar to envoy/docs/root/api-v3/config/accesslog/accesslog.rst will work in this case.

I see. It didn't get picked up because http.rst only looks in the v3 folder but not v3alpha folder. Changed that one but not sure if it's acceptable. Please review.

@nitgoy

nitgoy commented May 6, 2021

Copy link
Copy Markdown
Contributor Author

@adisuissa The docs error got fixed. Any insight into the format_pre failure or how to reproduce it locally?

@adisuissa

Copy link
Copy Markdown
Contributor

@adisuissa The docs error got fixed. Any insight into the format_pre failure or how to reproduce it locally?

According to the pipelines errors:

mixed tabs and spaces: docs/root/configuration/http/http_filters/bandwidth_limit_filter.rst

To reproduce locally, you cant try running: ci/run_envoy_docker.sh 'ci/do_ci.sh format_pre'

nitgoy added 2 commits May 6, 2021 18:05
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
nitgoy added 4 commits May 7, 2021 17:00
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
@nitgoy
nitgoy requested a review from yanavlasov May 8, 2021 00:59
nitgoy added 3 commits May 9, 2021 18:32
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
Signed-off-by: Nitin Goyal <[email protected]>
@nitgoy

nitgoy commented May 11, 2021

Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #16358 (comment) was created by @nitgoy.

see: more, trace.

Signed-off-by: Nitin Goyal <[email protected]>
@nitgoy

nitgoy commented May 13, 2021

Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #16358 (comment) was created by @nitgoy.

see: more, trace.

Signed-off-by: Nitin Goyal <[email protected]>

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

lgtm from docs pov - thanks @nitgoy

yanavlasov
yanavlasov previously approved these changes May 24, 2021

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

Signed-off-by: Nitin Goyal <[email protected]>
yanavlasov
yanavlasov previously approved these changes May 24, 2021
Signed-off-by: Nitin Goyal <[email protected]>
@nitgoy

nitgoy commented May 24, 2021

Copy link
Copy Markdown
Contributor Author

/retest

@repokitteh-read-only

Copy link
Copy Markdown

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #16358 (comment) was created by @nitgoy.

see: more, trace.

yanavlasov
yanavlasov previously approved these changes May 25, 2021
Signed-off-by: Nitin Goyal <[email protected]>
phlax
phlax previously approved these changes May 25, 2021

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

lgtm for docs, thanks for cleanups @nitgoy

Signed-off-by: Nitin Goyal <[email protected]>
@lizan
lizan merged commit a467b0e into envoyproxy:main May 25, 2021
@nitgoy
nitgoy deleted the bwlfilter branch June 3, 2021 20:20
leyao-daily pushed a commit to leyao-daily/envoy that referenced this pull request Sep 30, 2021
the filter smoothens the flow of data in both direction up to the specified bandwidth limit.

Risk Level: Low, new filter
Testing: UTs added. Adding more UTs and integration tests.
Docs Changes: Added
Release Notes: Added
Fixes envoyproxy#13604

Signed-off-by: Nitin Goyal <[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.

how to config bandwidth limit

6 participants