diff --git a/scripts/aws/.env.example b/scripts/aws/.env.example index 6ff0702f4..4778f7ca7 100644 --- a/scripts/aws/.env.example +++ b/scripts/aws/.env.example @@ -1,3 +1,11 @@ +# Description: Example of .env file +# Usage: Copy this file to .env and change the values +# according to your needs +# Do not commit .env file to git +# Do not change .env.example file +#     You can set up a superuser's username and password +# If there is no need for user management, set LANGFLOW_AUTO_LOGIN=true and delete LANGFLOW_SUPERUSER and LANGFLOW_SUPERUSER_PASSWORD. + LANGFLOW_AUTO_LOGIN=false -LANGFLOW_SUPERUSER=langflow -LANGFLOW_SUPERUSER_PASSWORD=654321 \ No newline at end of file +LANGFLOW_SUPERUSER=admin +LANGFLOW_SUPERUSER_PASSWORD=123456 \ No newline at end of file diff --git a/scripts/aws/README.ja.md b/scripts/aws/README.ja.md index f62de113b..d7fa5b0a4 100644 --- a/scripts/aws/README.ja.md +++ b/scripts/aws/README.ja.md @@ -4,41 +4,50 @@ Langflow on AWS では、 Langflow を AWS 上にデプロイする方法を学 このチュートリアルは、AWS アカウントと AWS に関する基本的な知識を有していることを前提としています。 +作成するアプリケーションのアーキテクチャです。 +![langflow-archi](./img/langflow-archi.png) +[AWS CDK](https://aws.amazon.com/cdk/?nc2=type_a) によって [Application Load Balancer](https://aws.amazon.com/elasticloadbalancing/application-load-balancer/?nc1=h_ls), [AWS Fargate](https://aws.amazon.com/fargate/?nc2=type_a) and [Amazon Aurora](https://aws.amazon.com/rds/aurora/?nc2=type_a) を作成します。 +Auroraのシークレットは [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/?nc2=type_a) によって管理されます。 +Fargate のタスクはフロントエンドとバックエンドに分かれており、サービス検出によって通信します。 +リソースをデプロイするだけであれば、上記の各サービスについて深い知識は必要ありません。 # 環境構築とデプロイ方法 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 -``` + ```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) + ![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 + ```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 -``` + ```shell + Outputs: + LangflowAppStack.NetworkURLXXXXXX = http://alb-XXXXXXXXXXX.elb.amazonaws.com + ``` +1. サインイン画面でユーザー名とパスワードを入力します。`.env`ファイルでユーザー名とパスワードを設定していない場合、ユーザー名は`admin`、パスワードは`123456`で設定されます。 + ![make-cloud9](./img/langflow-signin.png) # 環境の削除 1. `Cloud9` で以下のコマンドを実行します。 -```shell -cdk destroy -``` + ```shell + cdk destroy + bash delete-ecr.sh + ``` 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 + ![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 ddbccb10b..3912d5792 100644 --- a/scripts/aws/README.md +++ b/scripts/aws/README.md @@ -4,6 +4,12 @@ In this tutorial, you will learn how to deploy langflow on AWS using CDK. This tutorial assumes you have an AWS account and basic knowledge of AWS. +The architecture of the application to be created: [Application Load Balancer](https://aws.amazon.com/elasticloadbalancing/application-load-balancer/?nc1=h_ls), [AWS Fargate](https://aws.amazon.com/fargate/?nc2=type_a) and [Amazon Aurora](https://aws.amazon.com/rds/aurora/?nc2=type_a) are created by [AWS CDK](https://aws.amazon.com/cdk/?nc2=type_a). +![langflow-archi](./img/langflow-archi.png) +The aurora's secrets are managed by [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/?nc2=type_a). +The Fargate task is divided into a frontend and a backend, which communicate through service discovery. +If you just want to deploy resources, you do not need in-depth knowledge of each of the above services. + # 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: @@ -28,6 +34,8 @@ This tutorial assumes you have an AWS account and basic knowledge of AWS. Outputs: LangflowAppStack.NetworkURLXXXXXX = http://alb-XXXXXXXXXXX.elb.amazonaws.com ``` +1. Enter your user name and password to sign in. If you have not set a user name and password in your `.env` file, the user name will be set to `admin` and the password to `123456`. + ![signin-langflow](./img/langflow-signin.png) # Cleanup 1. Run the following command in the Cloud9 terminal. diff --git a/scripts/aws/img/langflow-archi.png b/scripts/aws/img/langflow-archi.png new file mode 100644 index 000000000..c46ae811d Binary files /dev/null and b/scripts/aws/img/langflow-archi.png differ diff --git a/scripts/aws/img/langflow-signin.png b/scripts/aws/img/langflow-signin.png new file mode 100644 index 000000000..3a8691a18 Binary files /dev/null and b/scripts/aws/img/langflow-signin.png differ