You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36-16Lines changed: 36 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Intelligent BI Demo
1
+
# Generative BI Demo Application
2
2
3
3
[中文文档](README_CN.md)
4
4
## Introduction
@@ -12,14 +12,24 @@ A NLQ(Natural Language Query) demo using Amazon Bedrock, Amazon OpenSearch with
12
12
### 1. Prepare EC2 Instance
13
13
Create an EC2 with following configuration:
14
14
15
-
- Software Image (AMI): Amazon Linux 2023
16
-
- Virtual server type (instance type): t3.large or higher
17
-
- Firewall (security group): Allow 22, 80 port
15
+
- OS Image (AMI): Amazon Linux 2023
16
+
- Instance type: t3.large or higher
17
+
- VPC: use default one and choose a public subnet
18
+
- Security group: Allow access to 22, 80 port from anywhere (Select "Allow SSH traffic from Anywhere" and "Allow HTTP traffic from the internet")
18
19
- Storage (volumes): 1 GP3 volume(s) - 30 GiB
19
20
20
21
### 2. Config Permission
21
-
Bind an IAM Role to your EC2 instance.
22
-
And attach an inline policy to this IAM Role with following permissions:
22
+
23
+
2.1 IAM Role's permission
24
+
25
+
Create a new IAM role with name genbirag-service-role and settings below:
26
+
- Trusted entity type: AWS Service
27
+
- Service: EC2
28
+
- Use Case: EC2 - Allows EC2 instances to call AWS services on your behalf.
29
+
30
+
Skip "Add permission" and create this role first.
31
+
32
+
After the role is created, and then add permission by creating inline policy as below:
23
33
```json
24
34
{
25
35
"Version": "2012-10-17",
@@ -29,7 +39,6 @@ And attach an inline policy to this IAM Role with following permissions:
29
39
"Effect": "Allow",
30
40
"Action": [
31
41
"bedrock:*",
32
-
"secretsmanager:GetSecretValue",
33
42
"dynamodb:*"
34
43
],
35
44
"Resource": "*"
@@ -38,21 +47,27 @@ And attach an inline policy to this IAM Role with following permissions:
38
47
}
39
48
```
40
49
50
+
Finally, Bind this IAM instance profile (IAM Role) to your EC2 instance.
51
+
52
+
2.2 Amazon Bedrock's Model Permission
53
+
41
54
Make sure you have enabled model access in AWS Console in us-west-2 (Oregon) region for Anthropic Claude model and Amazon Titan embedding model.
55
+

42
56
43
57
### 3. Install Docker and Docker Compose
44
58
45
-
On the EC2 instance, log in to the SSH command line as the ec2-user user or use the AWS EC2 Instance Connect feature in the EC2 console to log in to the command line. In the session, execute the following commands. If you are not this user, you can switch with the following command:
59
+
Log in to the EC2 instance using SSH command as the ec2-user user or use the AWS EC2 Instance Connect feature in the EC2 console to log in to the command line.
46
60
47
-
Note: Execute each command one line at a time.
61
+
In the session, execute the following commands. **Note: Execute each command one line at a time.**
48
62
63
+
If you are not this user, you can switch with the following command:
cd generative-bi-using-rag/application && cp .env.template .env && docker-compose build
97
+
# Config the Environment Variable in .env file, modify AWS_DEFAULT_REGION to the region same as the EC2 instance.
98
+
cd generative-bi-using-rag/application && cp .env.template .env
99
+
100
+
# Build docker images locally
101
+
docker-compose build
84
102
85
103
# Start all services
86
104
docker-compose up -d
87
105
88
106
# Wait 3 minutes for MySQL and OpenSearch to initialize
89
107
sleep 180
90
108
```
91
-
Here is the English translation:
92
109
93
110
### 5. Initialize MySQL
94
111
95
112
In the terminal, continue executing the following commands:
96
113
97
114
```bash
98
-
cd initial_data && unzip init_mysql_db.sql.zip &&cd ..
115
+
cd initial_data && wget https://github.com/fengxu1211/generative-bi-using-rag/raw/demo_data/application/initial_data/init_mysql_db.sql.zip
cd generative-bi-using-rag/application && cp .env.template .env
96
+
80
97
# 在本地构建docker镜像
81
-
cd generative-bi-using-rag/application && cp .env.template .env &&docker-compose build
98
+
docker-compose build
82
99
83
100
# 启动所有服务
84
101
docker-compose up -d
@@ -90,11 +107,14 @@ sleep 180
90
107
### 5. 初始化MySQL
91
108
在终端里继续执行以下命令:
92
109
```bash
93
-
cd initial_data && unzip init_mysql_db.sql.zip &&cd ..
110
+
cd initial_data && wget https://github.com/fengxu1211/generative-bi-using-rag/raw/demo_data/application/initial_data/init_mysql_db.sql.zip
0 commit comments