From eeca41b3330c3406032472c434ab199edf7fd4ac Mon Sep 17 00:00:00 2001 From: Fabio Nonato Date: Thu, 7 Nov 2024 13:44:37 -0800 Subject: [PATCH 1/5] added timeout Config to boto3 --- src/api/models/bedrock.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/models/bedrock.py b/src/api/models/bedrock.py index ce0a609..3240826 100644 --- a/src/api/models/bedrock.py +++ b/src/api/models/bedrock.py @@ -7,6 +7,7 @@ from typing import AsyncIterable, Iterable, Literal import boto3 +from botocore.config import Config import numpy as np import requests import tiktoken @@ -42,9 +43,12 @@ logger = logging.getLogger(__name__) +config = Config(connect_timeout=1, read_timeout=120, retries={"max_attempts": 1}) + bedrock_runtime = boto3.client( service_name="bedrock-runtime", region_name=AWS_REGION, + config=config, ) SUPPORTED_BEDROCK_EMBEDDING_MODELS = { From 8ec13f26de60ef87178dd40d4ad5c28683067049 Mon Sep 17 00:00:00 2001 From: Fabio Nonato Date: Tue, 3 Dec 2024 10:47:49 -0800 Subject: [PATCH 2/5] fix for image --- .DS_Store | Bin 0 -> 6148 bytes src/api/models/bedrock.py | 2 +- src/build.sh | 6 ++++++ src/run.sh | 12 ++++++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .DS_Store create mode 100755 src/build.sh create mode 100755 src/run.sh diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..9a874b5768f336915163bb88cd434575b859f936 GIT binary patch literal 6148 zcmeH~Jr2S!425ml0g0s}V-^m;4I%_5-~tF3k&vj^b9A16778<}(6eNJu~Vz<8=6`~ zboab&MFtUB!i}=AFfm2m$tVxGT*u4pe81nUlA49C} z?O@64YO)2RT{MRe%{!}2F))pG(Sih~)xkgosK7*lF7m<7{{#Hn{6A@7N(HFEpDCdI z{ Date: Fri, 6 Dec 2024 09:29:22 -0800 Subject: [PATCH 3/5] Delete src/run.sh --- src/run.sh | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100755 src/run.sh diff --git a/src/run.sh b/src/run.sh deleted file mode 100755 index 132118b..0000000 --- a/src/run.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -echo "Starting Bedrock Gateway..." - -docker run -v $HOME/.aws:/root/.aws \ ---add-host=host.docker.internal:host-gateway \ ---restart always \ --e AWS_REGION=us-west-2 \ --e DEBUG=true \ --d -p 8000:80 \ ---name bedrock-gateway \ -bedrock_gateway \ No newline at end of file From 0a514fbee4b67f54dbd945ffbc49ccea2c174f6c Mon Sep 17 00:00:00 2001 From: Fabio Nonato <66026716+nonatofabio@users.noreply.github.com> Date: Fri, 6 Dec 2024 09:29:37 -0800 Subject: [PATCH 4/5] Delete src/build.sh --- src/build.sh | 6 ------ 1 file changed, 6 deletions(-) delete mode 100755 src/build.sh diff --git a/src/build.sh b/src/build.sh deleted file mode 100755 index db9778e..0000000 --- a/src/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -export IMAGE_NAME=bedrock_gateway - -docker build . -f Dockerfile_ecs -t $IMAGE_NAME - From 7fcac5f4a6c6956f9c8ca7deb2541da36938cf0f Mon Sep 17 00:00:00 2001 From: Fabio Nonato <66026716+nonatofabio@users.noreply.github.com> Date: Fri, 6 Dec 2024 09:29:50 -0800 Subject: [PATCH 5/5] Delete .DS_Store --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 9a874b5768f336915163bb88cd434575b859f936..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425ml0g0s}V-^m;4I%_5-~tF3k&vj^b9A16778<}(6eNJu~Vz<8=6`~ zboab&MFtUB!i}=AFfm2m$tVxGT*u4pe81nUlA49C} z?O@64YO)2RT{MRe%{!}2F))pG(Sih~)xkgosK7*lF7m<7{{#Hn{6A@7N(HFEpDCdI z{