Skip to content

Commit b1bf99d

Browse files
committed
[R] Different rate limits depending on HTTP method (#5555, PR #5869)
2 parents e4652f5 + f16a7ea commit b1bf99d

28 files changed

+381
-236
lines changed
Binary file not shown.
Binary file not shown.

common.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ git_list_dirt: check_env
116116
@$(call list_dirt)
117117

118118
%.json: %.json.template.py check_python .FORCE
119-
python $< $@
119+
python -m azul.template $< $@
120120
.FORCE:
121121

122122
# The template output file depends on the template file, of course, as well as

deployments/prod/environment.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,20 +1842,6 @@ def env() -> Mapping[str, Optional[str]]:
18421842

18431843
'AZUL_ENABLE_REPLICAS': '1',
18441844

1845-
# HCA allocates a daily budget for file downloads. To avoid exceeding
1846-
# that budget, we limit the download rate as follows:
1847-
#
1848-
# r = b/d/f/24/60*w
1849-
#
1850-
# where `r` is the rate limit (downloads/window), `b` is the daily
1851-
# download budget (dollars/day), `d` is the download cost (dollars/
1852-
# gibibyte/download), `f` is the average file size (gibibytes), and `w`
1853-
# is the evaluation window (minutes) (=10). The value for `d` varies by
1854-
# region, so a weighted average is calculated based on the observed
1855-
# number of daily downloads per region.
1856-
#
1857-
# 'azul_waf_download_rate_limit': '59/[email protected]'
1858-
18591845
'AZUL_ENABLE_VERBATIM_RELATIONS': '0',
18601846

18611847
'AZUL_ENABLE_MIRRORING': '1',

environment.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -950,22 +950,6 @@ def env() -> Mapping[str, Optional[str]]:
950950
#
951951
'azul_it_flags': None,
952952

953-
# A global rate limit on file downloads across all regions and IP
954-
# addresses, enforced by AWS WAF.
955-
#
956-
# The syntax is `<limit>/<window>@<concurrency>` where `<limit>` is the
957-
# maximum allowed number of download requests made every `<window>`
958-
# seconds, and `<concurrency>` is the expected number of distinct IPs
959-
# making at least one download request during that time. The concurrency
960-
# does not need to be an integer. See
961-
#
962-
# https://docs.aws.amazon.com/waf/latest/developerguide/waf-rule-statement-type-rate-based-high-level-settings.html
963-
#
964-
# for restrictions on the supported values for `<limit>` ("Rate limit")
965-
# and `<window>` ("Evaluation window").
966-
#
967-
'azul_waf_download_rate_limit': None,
968-
969953
# Wether to enable bot control in AWS WAF. Setting this to 1 will enable
970954
# two rules aimed at blocking requests from suspected and verified bots.
971955
# As of January 2024, this will incur monthly cost of $10 per ACL plus

lambdas/indexer/app.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ def log_controller(self) -> LogForwardingController:
7777

7878
def __init__(self):
7979
super().__init__(app_name=config.indexer_name,
80-
app_module_path=__file__,
81-
# see LocalAppTestCase.setUpClass()
82-
unit_test=globals().get('unit_test', False),
80+
globals=globals(),
8381
spec=spec)
8482

8583
def log_forwarder(self, prefix: str):

lambdas/layer/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
# package and is removed from the final result.
1010

1111
app = AzulChaliceApp(app_name=config.qualified_resource_name('dependencies'),
12-
app_module_path=__file__,
13-
unit_test=False,
12+
globals=globals(),
1413
spec={})
1514

1615

lambdas/service/app.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,7 @@ def synthetic_fields(self) -> Sequence[str]:
355355

356356
def __init__(self):
357357
super().__init__(app_name=config.service_name,
358-
app_module_path=__file__,
359-
# see LocalAppTestCase.setUpClass()
360-
unit_test=globals().get('unit_test', False),
358+
globals=globals(),
361359
spec=spec)
362360

363361
@attr.s(kw_only=True, auto_attribs=True, frozen=True)

requirements.all.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ google-crc32c==1.7.1
4545
google-resumable-media==2.7.2
4646
googleapis-common-protos==1.70.0
4747
greenlet==3.2.3
48-
grpcio==1.73.1
48+
grpcio==1.74.0rc1
4949
grpcio-status==1.62.3
5050
http-message-signatures==0.6.1
5151
http_sfv==0.9.9

requirements.trans.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ google-cloud-core==2.4.3
99
google-crc32c==1.7.1
1010
google-resumable-media==2.7.2
1111
googleapis-common-protos==1.70.0
12-
grpcio==1.73.1
12+
grpcio==1.74.0rc1
1313
grpcio-status==1.62.3
1414
http_sfv==0.9.9
1515
idna==3.10

0 commit comments

Comments
 (0)