From 4a1f23102689cdacd82d8697c2e0e6a662f6fc91 Mon Sep 17 00:00:00 2001 From: Kay Date: Tue, 27 Feb 2024 19:27:30 +1100 Subject: [PATCH] Updated Bedrock notes (#546) * Updated ECR/test-ecr-pull-through-cache-pull.sh * Updated Bedrock --- Bedrock/README.md | 9 +++++++++ Bedrock/requirements.txt | 4 ++++ ECR/test-ecr-pull-through-cache-pull.sh | 9 +++++++++ ECR/test-ecr-pull-through-cache.sh | 11 +++++++---- EKS/list_open_id_providers.py | 1 - 5 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 Bedrock/README.md create mode 100644 Bedrock/requirements.txt create mode 100644 ECR/test-ecr-pull-through-cache-pull.sh diff --git a/Bedrock/README.md b/Bedrock/README.md new file mode 100644 index 00000000..1da5966b --- /dev/null +++ b/Bedrock/README.md @@ -0,0 +1,9 @@ +# Bedrock + +- Bedrock, LangChain, RAG (Retrieval Augmented Generation), streamlit +- Bedrock, Knowledge Base, Agents for Bedrock + +Using Knowledge base +1. AWS SDK/CLI - `Retrieve` and `RetrieveAndGenerate` +2. Opensource LangChain - Bedrock integration +3. Agent for Bedrock diff --git a/Bedrock/requirements.txt b/Bedrock/requirements.txt new file mode 100644 index 00000000..84ed32d5 --- /dev/null +++ b/Bedrock/requirements.txt @@ -0,0 +1,4 @@ +boto3==1.34.47 +langchain==0.1.8 +langchain-community==0.0.21 +streamlit==1.31.1 diff --git a/ECR/test-ecr-pull-through-cache-pull.sh b/ECR/test-ecr-pull-through-cache-pull.sh new file mode 100644 index 00000000..9b0171f7 --- /dev/null +++ b/ECR/test-ecr-pull-through-cache-pull.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -e + +AWS_REGION=ap-southeast-2 +PRIV_REGISTRY=123456789012.dkr.ecr.${AWS_REGION}.amazonaws.com + +aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${PRIV_REGISTRY} + +docker pull ${PRIV_REGISTRY}/ecr-public/amazonlinux/amazonlinux:latest diff --git a/ECR/test-ecr-pull-through-cache.sh b/ECR/test-ecr-pull-through-cache.sh index 9b0171f7..fe994a0d 100755 --- a/ECR/test-ecr-pull-through-cache.sh +++ b/ECR/test-ecr-pull-through-cache.sh @@ -1,9 +1,12 @@ #!/bin/bash set -e -AWS_REGION=ap-southeast-2 -PRIV_REGISTRY=123456789012.dkr.ecr.${AWS_REGION}.amazonaws.com +aws ecr describe-pull-through-cache-rules + +aws ecr create-pull-through-cache-rule --ecr-repository-prefix ecr-public --upstream-registry-url public.ecr.aws --region ap-southeast-2 + +# aws ecr create-pull-through-cache-rule --ecr-repository-prefix docker-hub --upstream-registry-url registry-1.docker.io --region ap-southeast-2 + +aws ecr validate-pull-through-cache-rule --ecr-repository-prefix ecr-public --region ap-southeast-2 -aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${PRIV_REGISTRY} -docker pull ${PRIV_REGISTRY}/ecr-public/amazonlinux/amazonlinux:latest diff --git a/EKS/list_open_id_providers.py b/EKS/list_open_id_providers.py index d79280de..3cd34848 100644 --- a/EKS/list_open_id_providers.py +++ b/EKS/list_open_id_providers.py @@ -36,7 +36,6 @@ class Helper(AwsApiHelper): def process_account(self, session, account_id, aws_region, service, kwargs): - results = [] for region in session.get_available_regions(service) if aws_region == "all" else [aws_region]: try: