From ebf3189f874a62293f84fed2dfd101ae865e966a Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Fri, 1 Dec 2023 06:39:23 +0000 Subject: [PATCH] add README --- scripts/aws/README.ja.md | 44 +++++++++++++++++++++++++++++++++++++++ scripts/aws/README.md | 29 +++++++++++++------------- scripts/aws/delete-ecr.sh | 6 +++--- 3 files changed, 62 insertions(+), 17 deletions(-) create mode 100644 scripts/aws/README.ja.md diff --git a/scripts/aws/README.ja.md b/scripts/aws/README.ja.md new file mode 100644 index 000000000..f62de113b --- /dev/null +++ b/scripts/aws/README.ja.md @@ -0,0 +1,44 @@ +# Langflow on AWS + +Langflow on AWS では、 Langflow を AWS 上にデプロイする方法を学べます。 + +このチュートリアルは、AWS アカウントと AWS に関する基本的な知識を有していることを前提としています。 + + +# 環境構築とデプロイ方法 +1. [CloudShell](https://us-east-1.console.aws.amazon.com/cloudshell/home?region=us-east-1)を開きます。 + +1. 以下のコマンドを実行します。 +```shell +git clone https://github.com/aws-samples/cloud9-setup-for-prototyping +cd cloud9-setup-for-prototyping +./bin/bootstrap +``` + +1. `Done!` と表示されたら [Cloud9](https://us-east-1.console.aws.amazon.com/cloud9control/home?region=us-east-1#/) から `cloud9-for-prototyping` を開きます。 +![make-cloud9](./img/langflow-cloud9.png) + +1. 以下のコマンドを実行します。 +```shell +git clone -b aws-cdk-dev2 https://github.com/kazuki306/langflow +cd langflow/scripts/aws +cp .env.example .env # 環境設定を変える場合はこのファイル(.env)を編集してください。 +npm ci +cdk bootstrap +cdk deploy +``` +1. 表示される URL にアクセスします。 +```shell +Outputs: +LangflowAppStack.NetworkURLXXXXXX = http://alb-XXXXXXXXXXX.elb.amazonaws.com +``` + +# 環境の削除 +1. `Cloud9` で以下のコマンドを実行します。 +```shell +cdk destroy +``` + + +1. [CloudFormation](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/getting-started)を開き、`aws-cloud9-cloud9-for-prototyping-XXXX` を選択して削除します。 +![delete-cfn](./img/langflow-cfn.png) \ No newline at end of file diff --git a/scripts/aws/README.md b/scripts/aws/README.md index a7be98720..00eb0eff8 100644 --- a/scripts/aws/README.md +++ b/scripts/aws/README.md @@ -1,43 +1,44 @@ -# Langflow on AWS +# Deploy Langflow on AWS -Langflow on AWS は、 Langflow を AWS 上に展開する Project になります。 -この Branch では、AWS CDK を用いて 各種 Dockerfile からコンテナイメージを ECR に展開し、ECS、Aurora MySQL を用いて Langflow を構築します。 +In this tutorial, you will learn how to deploy langflow on AWS using CDK. -# デプロイ -[CloudShell](https://us-east-1.console.aws.amazon.com/cloudshell/home?region=us-east-1)を開きます。 +This tutorial assumes you have an AWS account and basic knowledge of AWS. -以下のコマンドを実行します。 +# How to set up your environment and deploy langflow +1. Open [CloudShell](https://us-east-1.console.aws.amazon.com/cloudshell/home?region=us-east-1). + +1. Run the following commands in Cloudshell: ```shell git clone https://github.com/aws-samples/cloud9-setup-for-prototyping cd cloud9-setup-for-prototyping ./bin/bootstrap ``` -`Done!` と表示されたら [Cloud9](https://us-east-1.console.aws.amazon.com/cloud9control/home?region=us-east-1#/) から `cloud9-for-prototyping` を開きます。 +1. When you see `Done!`, open `cloud9-for-prototyping` from [Cloud9](https://us-east-1.console.aws.amazon.com/cloud9control/home?region=us-east-1#/). ![make-cloud9](./img/langflow-cloud9.png) -以下のコマンドを実行します。 +1. Run the following command in the Cloud9 terminal. ```shell git clone -b aws-cdk-dev2 https://github.com/kazuki306/langflow cd langflow/scripts/aws -cp .env.example .env # この後envの設定が必要ならここで追記 +cp .env.example .env # Edit this file if you need environment settings npm ci cdk bootstrap cdk deploy ``` -表示される URL にアクセスします。 +1. Access the URL displayed. ```shell Outputs: LangflowAppStack.NetworkURLXXXXXX = http://alb-XXXXXXXXXXX.elb.amazonaws.com ``` -# 環境の削除 -`Cloud9` で以下のコマンドを実行します。 +# Cleanup +1. `Cloud9` で以下のコマンドを実行します。 ```shell cdk destroy +bash delete-ecr.sh ``` - -[CloudFormation](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/getting-started)を開き、`aws-cloud9-cloud9-for-prototyping-XXXX` を選択して削除します。 +1. Open [CloudFormation](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/getting-started), select `aws-cloud9-cloud9-for-prototyping-XXXX` and remove it. ![delete-cfn](./img/langflow-cfn.png) \ No newline at end of file diff --git a/scripts/aws/delete-ecr.sh b/scripts/aws/delete-ecr.sh index ebe837a8a..8e3b6a261 100644 --- a/scripts/aws/delete-ecr.sh +++ b/scripts/aws/delete-ecr.sh @@ -1,4 +1,4 @@ # aws cloudformation delete-stack --stack-name LangflowAppStack -# aws ecr delete-repository --repository-name langflow-backend-repository --force -# aws ecr delete-repository --repository-name langflow-frontend-repository --force -# aws ecr describe-repositories --output json | jq -re ".repositories[].repositoryName" \ No newline at end of file +aws ecr delete-repository --repository-name langflow-backend-repository --force +aws ecr delete-repository --repository-name langflow-frontend-repository --force +aws ecr describe-repositories --output json | jq -re ".repositories[].repositoryName" \ No newline at end of file