Skip to content

Commit 9432283

Browse files
authored
Merge branch 'master' into docs-connect-release
2 parents 718923b + adae9cd commit 9432283

File tree

5 files changed

+50
-4
lines changed

5 files changed

+50
-4
lines changed

lambdas/access_counts/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ where verb is one of
1717

1818
## Changes
1919

20+
- [Added] Make `s3.copy()` chunk size and concurrency configurable via env vars ([#4746](https://github.com/quiltdata/quilt/pull/4746))
21+
- [Added] Bundle `awscrt` via `boto3[crt]` for improved S3 transfer performance ([#4746](https://github.com/quiltdata/quilt/pull/4746))
2022
- [Changed] Migrate to proper package structure ([#4618](https://github.com/quiltdata/quilt/pull/4618))
2123
- [Changed] Switch to uv ([#4618](https://github.com/quiltdata/quilt/pull/4618))
2224
- [Changed] Upgrade to Python 3.13 ([#4618](https://github.com/quiltdata/quilt/pull/4618))

lambdas/access_counts/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "t4_lambda_access_counts"
33
version = "0.1.0"
44
requires-python = "==3.13.*"
55
dependencies = [
6-
"boto3~=1.40",
6+
"boto3[crt]~=1.40",
77
"t4_lambda_shared",
88
]
99

lambdas/access_counts/pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ env =
77
CLOUDTRAIL_BUCKET = cloudtrail-bucket
88
QUERY_RESULT_BUCKET = results-bucket
99
ACCESS_COUNTS_OUTPUT_DIR = AccessCounts
10+
S3_COPY_CHUNKSIZE_MIB = 128
11+
S3_COPY_MAX_CONCURRENCY = 100

lambdas/access_counts/src/t4_lambda_access_counts/index.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from datetime import datetime, timedelta, timezone
1010

1111
import boto3
12+
from boto3.s3.transfer import TransferConfig
1213

1314
from t4_lambda_shared.utils import sql_escape
1415

@@ -20,6 +21,14 @@
2021
# Directory where the summary files will be stored.
2122
ACCESS_COUNTS_OUTPUT_DIR = os.environ['ACCESS_COUNTS_OUTPUT_DIR']
2223

24+
MiB = 1024 * 1024
25+
S3_COPY_CHUNKSIZE = int(os.environ['S3_COPY_CHUNKSIZE_MIB']) * MiB
26+
S3_COPY_CONFIG = TransferConfig(
27+
multipart_chunksize=S3_COPY_CHUNKSIZE,
28+
multipart_threshold=S3_COPY_CHUNKSIZE,
29+
max_concurrency=int(os.environ['S3_COPY_MAX_CONCURRENCY']),
30+
)
31+
2332
# A temporary directory where Athena query results will be written.
2433
QUERY_TEMP_DIR = 'AthenaQueryResults'
2534

@@ -453,5 +462,6 @@ def handler(event, context):
453462
Key=src_key
454463
),
455464
Bucket=QUERY_RESULT_BUCKET,
456-
Key=dest_key
465+
Key=dest_key,
466+
Config=S3_COPY_CONFIG,
457467
)

lambdas/access_counts/uv.lock

Lines changed: 34 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)