forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pai-dsw.yml
172 lines (172 loc) · 4.38 KB
/
pai-dsw.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
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建PAI工作空间、NAS文件系统、ECS实例与VPC环境,配置数据集挂载,支持模型训练。
en: Create a PAI workspace, NAS file system, ECS instances, and VPC environment,
configure dataset mounting, facilitating model training support.
Parameters:
WorkspaceName:
Type: String
Label:
zh-cn: 工作空间名
en: workspace name
InstanceSpec:
Type: String
Label:
zh-cn: PAI实例的规格
en: The ECS specification of the instance
AllowedValues:
- ecs.gn7i-c8g1.2xlarge
ZoneId:
Type: String
Label:
en: VSwitch Availability Zone
zh-cn: 交换机可用区
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
VpcCidrBlock:
Type: String
Label:
en: VPC CIDR IPv4 Block
zh-cn: 专有网络IPv4网段
Description:
zh-cn: VPC的ip地址段范围,<br>您可以使用以下的ip地址段或其子网:<br><font color='green'>[10.0.0.0/8]</font><br><font
color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>
en: 'The ip address range of the VPC in the CidrBlock form; <br>You can use
the following ip address ranges and their subnets: <br><font color=''green''>[10.0.0.0/8]</font><br><font
color=''green''>[172.16.0.0/12]</font><br><font color=''green''>[192.168.0.0/16]</font>'
AssociationProperty: ALIYUN::VPC::VPC::CidrBlock
Default: 192.168.0.0/16
VSwitchCidrBlock:
Type: String
Label:
en: VSwitch CIDR Block
zh-cn: 交换机子网网段
Description:
zh-cn: 必须属于VPC的子网段。
en: Must belong to the subnet segment of VPC.
AssociationProperty: ALIYUN::VPC::VSwitch::CidrBlock
AssociationPropertyMetadata:
VpcCidrBlock: VpcCidrBlock
Default: 192.168.1.0/24
Resources:
EcsVpc:
Type: ALIYUN::ECS::VPC
Properties:
VpcName:
Ref: ALIYUN::StackName
CidrBlock:
Ref: VpcCidrBlock
EcsVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: EcsVpc
VSwitchName:
Ref: ALIYUN::StackName
CidrBlock:
Ref: VSwitchCidrBlock
FileSystem:
Type: ALIYUN::NAS::FileSystem
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: EcsVpc
VSwitchId:
Ref: EcsVSwitch
ProtocolType: NFS
StorageType: Capacity
Workspace:
Type: ALIYUN::PAI::Workspace
Properties:
EnvTypes:
- prod
Description: modelscope
WorkspaceName:
Ref: WorkspaceName
Dataset:
Type: ALIYUN::PAI::Dataset
Properties:
DatasetName:
Ref: ALIYUN::StackName
DataSourceType: NAS
WorkspaceId:
Fn::GetAtt:
- Workspace
- WorkspaceId
Property: DIRECTORY
Uri:
Fn::Join:
- ''
- - nas://
- Fn::GetAtt:
- FileSystem
- FileSystemId
- .
- Ref: ALIYUN::Region
- /
DSW:
Type: ALIYUN::PaiDswApi::Instance
Properties:
ImageUrl: registry.cn-beijing.aliyuncs.com/pai-dlc/pytorch-training:1.12-cpu-py39-ubuntu20.04
WorkspaceId:
Fn::GetAtt:
- Workspace
- WorkspaceId
InstanceName:
Ref: ALIYUN::StackName
EcsSpec:
Ref: InstanceSpec
Datasets:
- MountPath: /mnt
DatasetId:
Fn::GetAtt:
- Dataset
- DatasetId
Outputs:
InstanceId:
Description:
zh-cn: 实例id
en: instance id
Value:
Fn::GetAtt:
- DSW
- InstanceId
WorkspaceId:
Description:
zh-cn: 工作空间的ID
en: The ID of the workspace.
Value:
Fn::GetAtt:
- Workspace
- WorkspaceId
Creator:
Description:
zh-cn: 创建者的用户ID
en: The user ID of the creator.
Value:
Fn::GetAtt:
- Workspace
- Creator
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- WorkspaceName
- InstanceSpec
Label:
default: PAI
- Parameters:
- ZoneId
Label:
default:
zh-cn: 可用区配置
en: Zone Configuration
- Parameters:
- VpcCidrBlock
- VSwitchCidrBlock
Label:
default:
zh-cn: 选择网络配置
en: Choose existing Infrastructure Configuration