feat(lab5): implement reliable image pipeline and track 2

This commit is contained in:
sashadugina06
2026-11-20 18:43:47 +03:00
parent 276dbdad8a
commit b423b93e2a
62 changed files with 3799 additions and 38 deletions
+19
View File
@@ -0,0 +1,19 @@
"""Private S3 access; no automatic PUT retries, explicit bounded timeouts."""
import os
from pathlib import Path
import boto3
from botocore.config import Config
def secret(name):
return Path(os.environ[name + '_FILE']).read_text().strip()
BUCKET = os.getenv('S3_BUCKET', 'messenger-attachments')
s3 = boto3.client(
's3', endpoint_url=os.getenv('S3_ENDPOINT', 'http://s3:9000'),
region_name='us-east-1', aws_access_key_id=secret('S3_ACCESS_KEY_ID'),
aws_secret_access_key=secret('S3_SECRET_ACCESS_KEY'),
config=Config(connect_timeout=2, read_timeout=5, retries={'total_max_attempts': 1},
s3={'addressing_style': 'path'}),
)