forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecs-ai-face-detection-solution.yml
137 lines (134 loc) · 3.49 KB
/
ecs-ai-face-detection-solution.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
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 一键部署基于视觉智能开放平台的人脸检测与对比方案,涵盖VPC、VSwitch、安全组、ECS。
en: One-click deployment of a face detection and comparison solution based on the Visual Intelligence Open Platform, covering VPC, VSwitch, Security Group, and ECS.
Parameters:
ZoneId:
Type: String
Label:
en: Zone ID.
zh-cn: 可用区ID。
Description:
en: Zone ID.
zh-cn: 可用区ID。
AssociationProperty: ZoneId
EcsInstanceType:
Type: String
Label:
en: Instance Type
zh-cn: 实例类型
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
InstanceChargeType: PostPaid
SystemDiskCategory: cloud_essd
ZoneId: ${ZoneId}
Resources:
Vpc:
Type: 'ALIYUN::ECS::VPC'
Properties:
VpcName: vpc
CidrBlock: 192.168.0.0/16
VSwitch:
Type: 'ALIYUN::ECS::VSwitch'
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
VSwitchName: vsw
CidrBlock: 192.168.0.0/24
SecurityGroup:
Type: 'ALIYUN::ECS::SecurityGroup'
Properties:
VpcId:
Ref: Vpc
SecurityGroupName: sg
SecurityGroupType: normal
SecurityGroupIngress:
- Priority: 1
PortRange: 80/80
NicType: internet
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
EcsInstanceGroup:
Type: ALIYUN::ECS::InstanceGroup
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
VSwitchId:
Ref: VSwitch
SecurityGroupId:
Ref: SecurityGroup
ImageId: aliyun_3_x64_20G_alibase_20240819.vhd
InstanceName: ecs
InstanceType:
Ref: EcsInstanceType
SystemDiskCategory: cloud_essd
SystemDiskSize: 40
MaxAmount: 1
InternetMaxBandwidthOut: 5
User:
Type: ALIYUN::RAM::User
Properties:
UserName:
Fn::Sub: create_by_solution-${ALIYUN::StackId}
PolicyAttachments:
System:
- AliyunVIAPIFullAccess
AccessKey:
Type: ALIYUN::RAM::AccessKey
Properties:
UserName:
Ref: User
InstanceRunCommand:
Type: 'ALIYUN::ECS::RunCommand'
Properties:
CommandContent:
Fn::Sub: |-
#!/bin/bash
cat << EOF >> ~/.bash_profile
export ALIBABA_CLOUD_ACCESS_KEY_ID="${AccessKey.AccessKeyId}"
export ALIBABA_CLOUD_ACCESS_KEY_SECRET="${AccessKey.AccessKeySecret}"
EOF
source ~/.bash_profile
curl -fsSL https://help-static-aliyun-doc.aliyuncs.com/install-script/face-detection/install.sh|bash
Type: RunShellScript
Sync: True
InstanceIds:
'Fn::GetAtt':
- EcsInstanceGroup
- InstanceIds
Timeout: 2400
RandomString:
Type: 'ALIYUN::RandomString'
Properties:
length: 5
character_classes:
- class: lowercase
min: 1
- class: digits
min: 1
Outputs:
Url:
Description:
en: Public Ip of ECS.
zh-cn: ECS公网IP。
Value:
Fn::Sub:
- http://${IP}
- IP:
Fn::Select:
- '0'
- Fn::GetAtt:
- EcsInstanceGroup
- PublicIps
Metadata:
'ALIYUN::ROS::Interface':
ParameterGroups:
- Parameters:
- ZoneId
- EcsInstanceType
TemplateTags:
- acs:technical-solution:ai:基于视觉智能开放平台的人脸检测与对比