forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ES-vector-retrieval-capabilities.yml
250 lines (245 loc) · 7.87 KB
/
ES-vector-retrieval-capabilities.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
CommonName:
Type: String
Default: Elasticsearch
AppUserName:
ConstraintDescription:
zh-cn: 3 到 63 个字母组成。
en: 3 to 63 letters.
Description:
zh-cn: 在浏览器中登录示例应用程序时的用户名。
en: Username when logging into the sample application in the browser.
Label:
zh-cn: 登录用户名
en: Login Username
AllowedPattern: '^[a-zA-Z-]{3,63}$'
Type: String
AssociationProperty: AutoCompleteInput
AssociationPropertyMetadata:
Length: 5
Prefix: demo-user-
CharacterClasses:
- Class: lowercase
min: 1
AppPassword:
Type: String
NoEcho: true
Description:
en: >-
Server login password, Length 8-30, must contain three(Capital letters,
lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special
symbol in)
zh-cn: >-
在浏览器中登录示例应用程序时的密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/
中的特殊符号)
Label:
en: Login Password
zh-cn: 登录密码
ConstraintDescription:
en: >-
Length 8-30, must contain three(Capital letters, lowercase letters,
numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in)
zh-cn: '长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;''<>,.?/ 中的特殊符号)'
AssociationProperty: 'ALIYUN::ECS::Instance::Password'
InstancePassword:
NoEcho: true
Type: String
Description:
en: Server login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in)
zh-cn: 服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)
Label:
en: ECS Instance Password
zh-cn: ECS实例密码
ConstraintDescription:
en: Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in)
zh-cn: 长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)
AssociationProperty: ALIYUN::ECS::Instance::Password
InstanceType:
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: ${ZoneId}
Type: String
Label:
zh-cn: 实例类型
en: Instance Type
ZoneId:
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
AssociationPropertyMetadata:
AutoSelectFirst: true
Type: String
Description:
zh-cn: 可用区ID。<br><b>注: <font color='blue'>选择可用区前请确认该可用区是否支持创建ECS资源的规格</font></b>
en: Availability Zone ID,<br><b>note: <font color='blue'>Before selecting, please confirm that the Availability Zone supports the specification of creating ECS resources</font></b>
Label:
zh-cn: 可用区ID
en: Available Zone ID
ElasticsearchPassword:
NoEcho: true
Type: String
Label:
en: Elasticsearch Instance Password
zh-cn: Elasticsearch实例密码
Description:
en: Server login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, !@#$%^&*()_+-= Special symbol in)
zh-cn: 服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 !@#$%^&*()_+-= 中的特殊符号)
AssociationProperty: ALIYUN::RDS::Instance::AccountPassword
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- ZoneId
- InstanceType
- InstancePassword
Label:
default: ECS
- Parameters:
- ElasticsearchPassword
Label:
default: Elasticsearch
- Parameters:
- AppUserName
- AppPassword
Label:
default: APP
TemplateTags:
- acs:technical-solution:ai:使用Elasticsearch的向量检索能力进行个性化推荐-tech_solu_153
Hidden:
- CommonName
Outputs:
Console@DemoUrl:
Description:
zh-cn: 应用程序访问域名。
en: URL of App.
Value:
Fn::Sub:
- http://${PublicIp}/elasticsearch-demo
- PublicIp:
Fn::Select:
- 0
- Fn::GetAtt:
- EcsInstance
- PublicIps
Resources:
InstallApp:
Type: 'ALIYUN::ECS::RunCommand'
Properties:
InstanceIds:
Fn::GetAtt:
- EcsInstance
- InstanceIds
Type: RunShellScript
Sync: true
Timeout: 7200
CommandContent:
Fn::Sub: |-
#!/bin/bash
echo "#########################"
echo "# Install JDK"
echo "#########################"
cat << EOF >> ~/.bash_profile
export DEMO_ES_HOST='${Elasticsearch.Domain}'
export DEMO_ES_PORT=9200
export DEMO_ES_USERNAME=elastic
export DEMO_ES_PASSWORD='${ElasticsearchPassword}'
export DEMO_USERNAME='${AppUserName}'
export DEMO_PASSWORD='${AppPassword}'
export ROS_DEPLOY=true
EOF
source ~/.bash_profile
echo "#########################"
echo "# Install App"
echo "#########################"
curl -fsSL https://help-static-aliyun-doc.aliyuncs.com/install-script/elasticsearch-server/install.sh|bash
echo "#########################"
echo "#App Install Success"
echo "#########################"
${WaitConditionHandle.CurlCli} --data-binary '{"status": "SUCCESS"}'
WaitConditionHandle:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: { }
WaitCondition:
Type: ALIYUN::ROS::WaitCondition
Properties:
Handle:
Ref: WaitConditionHandle
Timeout: 3720
Count: 1
EcsSecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
SecurityGroupIngress:
- Priority: 100
PortRange: 22/22
NicType: internet
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
- Priority: 100
PortRange: 80/80
NicType: internet
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
VpcId:
Ref: EcsVpc
SecurityGroupName:
Fn::Sub: ${CommonName}-sg
EcsVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
VpcId:
Ref: EcsVpc
CidrBlock: 192.168.1.0/24
ZoneId:
Ref: ZoneId
VSwitchName:
Fn::Sub: ${CommonName}-vsw
EcsInstance:
Type: ALIYUN::ECS::InstanceGroup
Properties:
InstanceName:
Fn::Sub: ${CommonName}-ecs
MaxAmount: 1
SystemDiskCategory: cloud_essd
VpcId:
Fn::GetAtt:
- EcsVpc
- VpcId
SecurityGroupId:
Ref: EcsSecurityGroup
ImageId: aliyun_3_9_x64_20G_alibase_
VSwitchId:
Ref: EcsVSwitch
Password:
Ref: InstancePassword
InstanceType:
Ref: InstanceType
InternetMaxBandwidthOut: 5
ZoneId:
Ref: ZoneId
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
VpcName:
Fn::Sub: ${CommonName}-vpc
CidrBlock: 192.168.0.0/16
Elasticsearch:
Type: ALIYUN::ElasticSearch::Instance
Properties:
InstanceChargeType: PostPaid
EnablePublic: true
KibanaNode:
Spec: elasticsearch.n4.small
VSwitchId:
Ref: EcsVSwitch
Version: 7.10_with_X-Pack
InstanceCategory: IS
ZoneCount: 1
ZoneId:
Ref: ZoneId
DataNode:
DiskType: cloud_essd
DiskSize: 20
Amount: 3
Spec: elasticsearch.sn1ne.large
Password:
Ref: ElasticsearchPassword