-
Notifications
You must be signed in to change notification settings - Fork 35
/
drawing_with_tongyi_wanxiang_new.yml
312 lines (310 loc) · 10 KB
/
drawing_with_tongyi_wanxiang_new.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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建VPC、ECS实例、OSS存储桶、RAM用户及策略,配置安全组和登录凭据,部署Java应用,支持文本绘图与人像美化功能。
en: Create a Virtual Private Cloud (VPC), Elastic Compute Service (ECS) instances,
Object Storage Service (OSS) buckets, Resource Access Management (RAM) users and
policies, configure security groups and login credentials, deploy Java applications
with support for text drawing and portrait beautification functionalities.
Parameters:
DemoUserName:
ConstraintDescription:
zh-cn: 3 到 63 个字母或数字组成。
en: 3 to 63 letters or numbers.
Description:
zh-cn: 在浏览器中登录示例应用程序时的用户名。
en: Username when logging into the sample application in the browser.
Label:
zh-cn: 登录用户名
en: Login Username
AllowedPattern: '^[a-zA-Z\d-]{3,63}$'
Type: String
AssociationProperty: AutoCompleteInput
AssociationPropertyMetadata:
Length: 5
Prefix: demo-user-
CharacterClasses:
- Class: lowercase
min: 1
DemoUserPassword:
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'
BucketName:
ConstraintDescription:
zh-cn: 3 到 63 个字符,不以连字符 (-) 开头和结尾,可以包含小写字母、数字和连字符 (-)
en: >-
3 to 63 characters, not beginning and ending with a hyphen (-), can
contain lowercase letters, Numbers and hyphens (-)
Description:
zh-cn: >-
3到63个字符,不以连字符(-)开头和结尾,可以包含小写字母、数字和连字符(-);<br>备注:<font
color='blue'><b>需要保证bucket名称的唯一性,已经存在的无法创建。</b></font>
en: >-
3 to 63 characters, not beginning and ending with a hyphen (-), can
contain lowercase letters, Numbers and hyphens (-);<br>Note: <font
color='blue'><b>bucket name must be unique,existing one cannot be created again.</b></font>
MinLength: 3
Label:
zh-cn: OSS BUCKET
en: OSS BUCKE
AllowedPattern: '^[a-z0-9]+[a-z0-9\-]*[a-z0-9]+$'
MaxLength: 63
Type: String
AssociationProperty: AutoCompleteInput
AssociationPropertyMetadata:
Length: 5
Prefix: drawing-with-tongyi-wanxiang-
CharacterClasses:
- Class: lowercase
min: 1
BaiLianApiKey:
Type: String
NoEcho: true
Label:
en: BaiLian API-KEY
zh-cn: 百炼 API-KEY
Description:
zh-cn: >-
开通百炼模型服务,并获得 API-KEY。请参考:
<a href="https://help.aliyun.com/zh/model-studio/getting-started/first-api-call-to-qwen"
target="_blank">首次调用通义千问API</a>。
en: >-
Activate BaiLian and obtain the API-KEY. Please refer to:
<a href="https://help.aliyun.com/zh/model-studio/getting-started/first-api-call-to-qwen"
target="_blank">First call to Tongyi Qianwen API</a>.
ZoneId:
Type: String
Default: null
Required: true
Label:
en: Availability Zone
zh-cn: 可用区
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
AssociationPropertyMetadata:
AutoSelectFirst: true
InstanceType:
Type: String
Default: ecs.c7.large
Required: true
Label:
en: Instance Type
zh-cn: 实例类型
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: ${ZoneId}
InstanceChargeType: PostPaid
SystemDiskCategory: cloud_essd
Constraints:
Architecture:
- X86
vCPU:
- 2
Memory:
- 4
InstancePassword:
Type: String
NoEcho: true
Default: null
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: Instance 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'
CommonName:
Type: String
Default: wanxiang
Resources:
Vpc:
Type: 'ALIYUN::ECS::VPC'
Properties:
CidrBlock: 192.168.0.0/16
VpcName:
Fn::Sub: ${CommonName}-vpc
VSwitch:
Type: 'ALIYUN::ECS::VSwitch'
Properties:
VpcId:
Ref: Vpc
CidrBlock: 192.168.0.0/24
ZoneId:
Ref: ZoneId
VSwitchName:
Fn::Sub: ${CommonName}-vsw
SecurityGroup:
Type: 'ALIYUN::ECS::SecurityGroup'
Properties:
VpcId:
Ref: Vpc
SecurityGroupName:
Fn::Sub: ${CommonName}-sg
SecurityGroupIngress:
- PortRange: 80/80
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
EcsInstance:
Type: 'ALIYUN::ECS::InstanceGroup'
Properties:
VpcId:
Ref: Vpc
ZoneId:
Ref: ZoneId
VSwitchId:
Ref: VSwitch
SecurityGroupId:
Ref: SecurityGroup
ImageId: aliyun_3_9_x64_20G_alibase_
InstanceName:
Fn::Sub: ${CommonName}-ecs
InstanceType:
Ref: InstanceType
SystemDiskCategory: cloud_essd
MaxAmount: 1
InternetMaxBandwidthOut: 5
Password:
Ref: InstancePassword
Bucket:
Type: 'ALIYUN::OSS::Bucket'
Properties:
BucketName:
Ref: BucketName
DeletionForce: true
User:
Type: ALIYUN::RAM::User
Properties:
UserName:
Fn::Sub: create_by_solution-${ALIYUN::StackId}
PolicyAttachments:
Custom:
- Ref: CustomPolicy
AccessKey:
Type: ALIYUN::RAM::AccessKey
Properties:
UserName:
Ref: User
CustomPolicy:
Type: ALIYUN::RAM::ManagedPolicy
Properties:
PolicyName:
Fn::Sub: create_by_solution-${ALIYUN::StackId}
PolicyDocument:
Version: '1'
Statement:
- Effect: Allow
Action:
- oss:GetObject
- oss:PutObject
Resource:
- Fn::Sub: acs:oss:oss-${ALIYUN::Region}:${ALIYUN::TenantId}:${BucketName}/*
ModuleInstallJava:
Version: default
Type: 'MODULE::ACS::OOS::Extension'
Properties:
EcsInstanceIds:
- Ref: EcsInstance
PackageName: ACS-Extension-java-1853370294850618
InstallApp:
Type: 'ALIYUN::ECS::RunCommand'
DependsOn: ModuleInstallJava
Properties:
InstanceIds:
- Ref: EcsInstance
Type: RunShellScript
Sync: true
Timeout: 3600
CommandContent:
Fn::Sub: |-
#!/bin/bash
cat << EOF >> ~/.bash_profile
export BAILIAN_API_KEY="${BaiLianApiKey}"
export OSS_ACCESS_KEY_ID="${AccessKey.AccessKeyId}"
export OSS_ACCESS_KEY_SECRET="${AccessKey.AccessKeySecret}"
export WANX_DEMO_OSS_BUCKET="${BucketName}"
export WANX_DEMO_USERNAME="${DemoUserName}"
export WANX_DEMO_PASSWORD="${DemoUserPassword}"
export WANX_DEMO_OSS_ENDPOINT="https://oss-${ALIYUN::Region}.aliyuncs.com"
export ROS_DEPLOY=true
EOF
source ~/.bash_profile
curl -fsSL https://help-static-aliyun-doc.aliyuncs.com/install-script/tongyi-wanxiang/install.sh|bash
Outputs:
EcsLoginAddress:
Description:
en: Ecs login address.
zh-cn: ECS登录地址。
Value:
Fn::Sub: https://ecs-workbench.aliyun.com/?from=EcsConsole&instanceType=ecs®ionId=${ALIYUN::Region}&instanceId=${EcsInstance}
Console@DemoUrl:
Description:
en: Experience address.
zh-cn: 体验地址。
Label:
zh-cn: 体验地址
en: Experience Addresses
Value:
Fn::Sub:
- http://${PublicIp}/wanx-demo
- PublicIp:
Fn::Select:
- 0
- Fn::GetAtt:
- EcsInstance
- PublicIps
Console@DemoUserName:
Description:
zh-cn: 在浏览器中登录示例应用程序时的用户名。
en: Username when logging into the sample application in the browser.
Label:
zh-cn: 登录用户名
en: Login Username
Value:
Ref: DemoUserName
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- DemoUserName
- DemoUserPassword
Label:
en: Application login information configuration
zh-cn: 应用登录信息配置
- Parameters:
- BaiLianApiKey
- BucketName
- ZoneId
- InstanceType
- InstancePassword
Label:
en: Cloud resource information configuration
zh-cn: 云资源信息配置
Hidden:
- CommonName
TemplateTags:
- acs:technical-solution:ai:通义万相的文本绘图与人像美化之旅-tech_solu_128