From 39f55b0a1d52a9f2a477e53a691320f5e84756d7 Mon Sep 17 00:00:00 2001 From: bhvishal Date: Tue, 20 Aug 2024 11:28:11 +0200 Subject: [PATCH] Debug commit --- .env.example | 4 +--- docker-compose.yml | 4 +--- vectorizing/__init__.py | 1 + vectorizing/server/s3.py | 6 +++--- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.env.example b/.env.example index 30b50c1..e7f0514 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,3 @@ PORT="8000" -AWS_ACCESS_KEY_ID="AWS_ACCESS_KEY_ID" -AWS_SECRET_ACCESS_KEY="AWS_SECRET_ACCESS_KEY" S3_BUCKET="S3_BUCKET" -S3_TEST_BUCKET="S3_TEST_BUCKET" \ No newline at end of file +S3_TEST_BUCKET="S3_TEST_BUCKET" diff --git a/docker-compose.yml b/docker-compose.yml index 65c7e94..aa4c1e1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,8 +4,6 @@ x-build: &build x-env: &env environment: - PORT=${PORT} - - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} - - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} - S3_BUCKET=${S3_BUCKET} - S3_TEST_BUCKET=${S3_TEST_BUCKET} - SENTRY_DSN=${SENTRY_DSN} @@ -19,4 +17,4 @@ services: <<: [*build, *env] command: gunicorn -w 4 'vectorizing:create_app()' --timeout 0 -b 0.0.0.0:$PORT --log-level debug ports: - - ${PORT}:${PORT} \ No newline at end of file + - ${PORT}:${PORT} diff --git a/vectorizing/__init__.py b/vectorizing/__init__.py index 8079cd4..14eaf17 100644 --- a/vectorizing/__init__.py +++ b/vectorizing/__init__.py @@ -92,6 +92,7 @@ def index(): timer = Timer() timer.start_timer('Image Reading') + print(url) img = try_read_image_from_url(url) timer.end_timer() diff --git a/vectorizing/server/s3.py b/vectorizing/server/s3.py index a002585..2e942e8 100644 --- a/vectorizing/server/s3.py +++ b/vectorizing/server/s3.py @@ -1,7 +1,7 @@ import cuid import boto3 -S3 = boto3.client("s3") +S3 = boto3.client("s3", region_name="eu-central-1") def upload_markup (markup, s3_bucket_name): cuid_str = cuid.cuid() @@ -21,7 +21,7 @@ def get_object_url(s3_file_key, s3_bucket_name): Key=s3_file_key, Bucket=s3_bucket_name ) - + except(Exception): return None @@ -40,4 +40,4 @@ def upload_file( s3_bucket_name, s3_file_key, ) - return get_object_url(s3_file_key, s3_bucket_name) \ No newline at end of file + return get_object_url(s3_file_key, s3_bucket_name)