forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
hybrid-cloud-uses-ali-ai-acceleration-tools.yml
1510 lines (1510 loc) · 56.6 KB
/
hybrid-cloud-uses-ali-ai-acceleration-tools.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
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: This template is used to build Kubernetes services, create on-premises clusters,
and create elastic Alibaba Cloud GPU instances in the cloud. This template uses
AIACC and CPFS to run AI training and AI inference jobs. This template is suitable
for hybrid cloud scenarios.
zh-cn: 本文介绍了混合云场景中,自建Kubernetes服务,线下集群+云上弹性扩展阿里云GPU服务实例+飞天AI加速工具,并采用阿里云CPFS存储,运行AI训练+AI推理作业的操作步骤。
Conditions:
CreateCentOS:
Fn::Equals:
- centos_7
- Ref: ImageId
NotUseResourceGroupId:
Fn::Equals:
- default
- Ref: ResourceGroupId
Parameters:
VpcCidrBlock:
Type: String
Label:
en: VPC CIDR Block for Master Instance
zh-cn: 专有网络网段
Description:
en: Master instance proprietary network IP address segment range
zh-cn: 专有网络IP地址段范围
Default: 192.168.0.0/16
AllowedValues:
- 192.168.0.0/16
MasterVSwitchZoneId:
Type: String
Label:
en: VSwitch Zone ID for Master Instance
zh-cn: Master实例交换机可用区
Description:
en: Availability Zone ID.<br><b>note:<font color='blue'>before selecting the
available zone, please confirm that the available zone supports the specification
of creating Master ECS</font></b>
zh-cn: 可用区ID。<br><b>注:<font color='blue'><font color='blue'>选择可用区前请确认该可用区是否支持创建Master
ECS的规格。</font></b>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
MasterVSwitchCidrBlock:
Type: String
Label:
en: VSwitch CIDR Block for Master Instance
zh-cn: Master实例交换机网段
Description:
en: Must be a sub-network segment of the proprietary network and is not occupied
by other VSwitches.
zh-cn: 必须是专有网络的子网段,并且没有被其他交换机占用。
Default: 192.168.0.0/24
WorkerVSwitchZoneId:
Type: String
Label:
en: VSwitch Zone ID for Worker Instance
zh-cn: Worker实例交换机可用区
Description:
en: Availability Zone ID.<font color='red'><b>select a different availability
zone than other switches</font></b><br><b>note:<font color='blue'>before selecting
the available zone, please confirm that the available zone supports the specification
of creating Worker ECS</font></b>
zh-cn: 可用区ID,<font color='red'><b>选择与其他交换机不同的可用区</b></font><br><b>注:<font color='blue'><font
color='blue'>选择可用区前请确认该可用区是否支持创建Worker ECS的规格。</font></b>
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
WorkerVSwitchCidrBlock:
Type: String
Label:
en: VSwitch CIDR Block for Worker Instance
zh-cn: Worker实例交换机网段
Description:
en: Must be a sub-network segment of the proprietary network and is not occupied
by other VSwitches.
zh-cn: 必须是专有网络的子网段,并且没有被其他交换机占用。
Default: 192.168.10.0/24
MasterInstanceType:
Type: String
Label:
en: Master Instance Type
zh-cn: Master实例规格
Description:
en: 'Fill in the specifications that can be used under the master instance VSwitch
availability zone; master instances use common ECS specifications</b></font><br>general
specifications:<font color=''red''><b>ecs.c5.large</b></font><br>note: a few
zones do not support general specifications<br>see detail: <a href=''https://www.alibabacloud.com/help/en/doc-detail/25378.html''
target=''_blank''><b><font color=''blue''>Instance Specification Family</font></a></b>'
zh-cn: 填写Master实例交换机可用区下可使用的规格;Master实例使用通用型ECS规格<br>通用规格:<font color='red'><b>ecs.c5.large</b></font><br>注:可用区可能不支持通用规格<br>规格详见:<a
href='https://help.aliyun.com/document_detail/25378.html' target='_blank'><b><font
color='blue'>实例规格族</font></a></b>
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: MasterVSwitchZoneId
WorkerInstanceType:
Type: String
Label:
en: Worker Instance Type
zh-cn: Worker实例规格
Description:
en: 'Fill in the specifications that can be used under the worker instance VSwitch
availability zone; worker instances use GPU compute ECS specifications for
the gn4, gn5, gn5i, gn6v and gn6i series</b></font><br>recommended specifications:<font
color=''red''><b>ecs.gn5i-c2g1.large</b></font><br>note: a few zones do not
support recommended specifications<br>see detail: <a href=''https://www.alibabacloud.com/help/en/doc-detail/25378.html''
target=''_blank''><b><font color=''blue''>Instance Specification Family</font></a></b>'
zh-cn: 填写Worker实例交换机可用区下可使用的规格;Worker实例使用gn4、gn5、gn5i、gn6v及gn6i系列的GPU计算型ECS规格<br>推荐规格:<font
color='red'><b>ecs.gn5i-c2g1.large</b></font><br>注:可用区可能不支持推荐规格<br>规格详见:<a
href='https://help.aliyun.com/document_detail/25378.html' target='_blank'><b><font
color='blue'>实例规格族</font></a></b>
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: WorkerVSwitchZoneId
ImageId:
Type: String
Label:
en: Image
zh-cn: 镜像
Description:
en: Image ID, using other images does not install software such as the service
side, please use the centos_7; <br>see detail:<b><a href='https://www.alibabacloud.com/help/en/doc-detail/112977.html'
target='_blank'><font color='blue'>Find the mirror</font></a></b>
zh-cn: 镜像ID,使用其他镜像不会安装服务端等软件,请使用centos_7;<br>详见:<b><a href='https://help.aliyun.com/document_detail/112977.html'
target='_blank'><font color='blue'>查找镜像</font></a></b>
Default: centos_7
SystemDiskCategory:
Type: String
Label:
en: Disk Type
zh-cn: 磁盘类型
Description:
en: '<font color=''blue''><b>Optional values:</b></font><br>[cloud_efficiency:
<font color=''green''>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color=''green''>SSD
Cloud Disk</font>]<br>[cloud_essd: <font color=''green''>ESSD Cloud Disk</font>]<br>[cloud:
<font color=''green''>Cloud Disk</font>]<br>[ephemeral_ssd: <font color=''green''>Local
SSD Cloud Disk</font>]'
zh-cn: '<font color=''blue''><b>可选值:</b></font><br>[cloud_efficiency: <font
color=''green''>高效云盘</font>]<br>[cloud_ssd: <font color=''green''>SSD云盘</font>]<br>[cloud_essd:
<font color=''green''>ESSD云盘</font>]<br>[cloud: <font color=''green''>普通云盘</font>]<br>[ephemeral_ssd:
<font color=''green''>本地SSD盘</font>]'
Default: cloud_efficiency
AllowedValues:
- cloud_efficiency
- cloud_ssd
- cloud
- cloud_essd
- ephemeral_ssd
SystemDiskSize:
Type: Number
Label:
en: System Disk Space
zh-cn: 系统盘空间
Description:
en: 'System disk size, range of values: 40-500, units: GB.'
zh-cn: 系统盘大小, 取值范围:[40, 500], 单位:GB。
Default: 150
InternetBandwidth:
Type: Number
Label:
en: Public Network Bandwidth
zh-cn: 公网带宽
Description:
en: 'ECS public network bandwidth, value range: [1, 100], Unit: Mbps.'
zh-cn: 'ECS公网带宽,取值范围: [1, 100],单位: Mbps。'
Default: 5
MinValue: 1
MaxValue: 100
Password:
Type: String
Label:
en: Instance Password
zh-cn: 实例密码
Description:
en: Server login password, Length 8-30, must contain three(Capital letters,
lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol
in).
zh-cn: 服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
ConstraintDescription:
en: Length 8-30, must contain three(Capital letters, lowercase letters, numbers,
()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
zh-cn: 长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)。
AllowedPattern: '[0-9A-Za-z\_\-\&:;''<>,=%`~!@#\(\)\$\^\*\+\|\{\}\[\]\.\?\/]+$'
MinLength: 8
MaxLength: 30
NoEcho: true
ResourceGroupId:
Type: String
Label:
en: Resource Group Id
zh-cn: 资源组ID
Description:
en: Resource group ID, when default, ECS does not join the resource group.
zh-cn: 资源组ID,默认default时,ECS不加入资源组。
Default: default
Resources:
CenInstance:
Type: ALIYUN::CEN::CenInstance
Properties:
Name:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 6a33aba9-eb19-46ae-9920-cad31c9dd104
CommandWaitConditionHandle:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
Metadata:
ALIYUN::ROS::Designer:
id: dc97442a-0887-4682-9427-4d88faeb761d
CommandWaitCondition:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count: 2
Handle:
Ref: CommandWaitConditionHandle
Timeout: 3600
Metadata:
ALIYUN::ROS::Designer:
id: 1f44d11f-d9c5-43cb-b3ca-ba3a83107f29
MasterVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName:
Fn::Join:
- '-'
- - Master-ECS
- StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 6c3a91bc-0660-4abd-9729-f6eb8530d254
MasterVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: MasterVSwitchZoneId
VpcId:
Ref: MasterVpc
CidrBlock:
Ref: MasterVSwitchCidrBlock
VSwitchName:
Fn::Join:
- _
- - Worker-ECS
- StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 92513718-48d9-44a8-ae96-5550910ad4ac
NasAccessGroup:
Type: ALIYUN::NAS::AccessGroup
Properties:
AccessGroupName:
Fn::Join:
- '-'
- - StackId
- Ref: ALIYUN::StackId
AccessGroupType: Vpc
Metadata:
ALIYUN::ROS::Designer:
id: d2466e9e-2a0b-4255-98a0-1350b05cda06
NasAccessRule:
Type: ALIYUN::NAS::AccessRule
Properties:
AccessGroupName:
Ref: NasAccessGroup
SourceCidrIp: 0.0.0.0/0
DependsOn:
- NasAccessGroup
Metadata:
ALIYUN::ROS::Designer:
id: cdbd890c-aafe-4acd-b89c-f845552d94c7
NasFileSystem:
Type: ALIYUN::NAS::FileSystem
Properties:
ProtocolType: NFS
StorageType: Capacity
Metadata:
ALIYUN::ROS::Designer:
id: 966680bc-3c20-43e8-84e9-0af2226a043a
NasMountTarget:
Type: ALIYUN::NAS::MountTarget
Properties:
VpcId:
Ref: MasterVpc
VSwitchId:
Ref: MasterVSwitch
AccessGroupName:
Ref: NasAccessGroup
FileSystemId:
Ref: NasFileSystem
NetworkType: Vpc
DependsOn:
- NasAccessRule
- NasFileSystem
Metadata:
ALIYUN::ROS::Designer:
id: 9b95773b-6fae-47d5-96cc-33fabe1cea5e
EcsCommand:
Type: ALIYUN::ECS::Command
Properties:
CommandContent:
Fn::Base64Encode:
Fn::Replace:
- ros-notify:
Fn::GetAtt:
- CommandWaitConditionHandle
- CurlCli
- Fn::Join:
- ''
- - "#!/bin/sh \n"
- "sleep 20 && cd /root/tmp && bash mount.sh \n"
- "#param_name='worker001' \n"
- "#hostname=`hostname` \n"
- "#if [ $hostname == $param_name ];then \n"
- "# #copy model file \n"
- "# cd /099 && tar xzvf resnet50_tensorflow.tgz -C /mnt \n"
- "# ls /mnt \n"
- "#fi \n"
- "ros-notify \n"
Name:
Fn::Join:
- '-'
- - Master-Command
- StackId
- Ref: ALIYUN::StackId
Type: RunShellScript
DependsOn:
- NasMountTarget
Metadata:
ALIYUN::ROS::Designer:
id: dc52eb6d-8613-4e46-9e3d-4d99bf627166
WorkerEcsWaitConditionHandle:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
Metadata:
ALIYUN::ROS::Designer:
id: 4b27d03b-278a-4270-8ef7-3039a2ab7c25
WorkerEcsWaitCondition:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count: 1
Handle:
Ref: WorkerEcsWaitConditionHandle
Timeout: 3600
Metadata:
ALIYUN::ROS::Designer:
id: a94d64f0-e192-4e17-b5eb-680a4bc283aa
MasterCenInstanceAttachment:
Type: ALIYUN::CEN::CenInstanceAttachment
Properties:
CenId:
Ref: CenInstance
ChildInstanceId:
Ref: MasterVpc
ChildInstanceRegionId:
Ref: ALIYUN::Region
ChildInstanceType: VPC
DependsOn:
- MasterVSwitch
Metadata:
ALIYUN::ROS::Designer:
id: 0a181e46-4ef4-4529-b336-5071350d0570
WorkerVpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName:
Fn::Join:
- '-'
- - Worker-ECS
- StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 51a8d519-c529-473f-a6b9-a41435d5527f
WorkerVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: WorkerVSwitchZoneId
VpcId:
Ref: WorkerVpc
CidrBlock:
Ref: WorkerVSwitchCidrBlock
VSwitchName:
Fn::Join:
- _
- - Master-ECS
- StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 17213b8f-8cb6-4a79-9c27-39607c1d6087
WorkerCenInstanceAttachment:
Type: ALIYUN::CEN::CenInstanceAttachment
Properties:
CenId:
Ref: CenInstance
ChildInstanceId:
Ref: WorkerVpc
ChildInstanceRegionId:
Ref: ALIYUN::Region
ChildInstanceType: VPC
DependsOn:
- MasterCenInstanceAttachment
- WorkerVSwitch
Metadata:
ALIYUN::ROS::Designer:
id: f0349f72-db6c-4da6-a385-d52faf5fe15b
WorkerSecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: WorkerVpc
SecurityGroupIngress:
- IpProtocol: icmp
NicType: internet
PortRange: -1/-1
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: internet
PortRange: 3389/3389
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: internet
PortRange: 6443/6443
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: internet
PortRange: 443/443
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: internet
PortRange: 22/22
Priority: 1
SourceCidrIp: 0.0.0.0/0
SecurityGroupName:
Fn::Join:
- _
- - Worker-ECS
- StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: e6c78fdf-88d5-4a85-92f8-b41ed18f94e3
WorkerInstanceGroup:
Type: ALIYUN::ECS::InstanceGroup
Properties:
VpcId:
Ref: WorkerVpc
VSwitchId:
Ref: WorkerVSwitch
SecurityGroupId:
Ref: WorkerSecurityGroup
ImageId:
Ref: ImageId
AllocatePublicIP: true
HostName:
Fn::Join:
- ''
- - worker
- '[1,3]'
InstanceName:
Fn::Join:
- ''
- - worker
- '[1,3]'
InstanceType:
Ref: WorkerInstanceType
InternetMaxBandwidthOut:
Ref: InternetBandwidth
MaxAmount: 1
Password:
Ref: Password
ResourceGroupId:
Fn::If:
- NotUseResourceGroupId
- Ref: ALIYUN::NoValue
- Ref: ResourceGroupId
SystemDiskCategory:
Ref: SystemDiskCategory
SystemDiskSize:
Ref: SystemDiskSize
Tags:
- Key: best_practice
Value: 099
UserData:
Fn::If:
- CreateCentOS
- Fn::Replace:
- ros-notify:
Fn::GetAtt:
- WorkerEcsWaitConditionHandle
- CurlCli
- Fn::Join:
- ''
- - "#!/bin/bash \n"
- "worker_ip=`ip addr | grep eth0 | grep -o '[0-9]\\{1,3\\}\\.[0-9]\\\
{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}/' | cut -d '/' -f 1` \n"
- Fn::GetAtt:
- IpWaitConditionHandle
- CurlCli
- " -d \"{\\\"id\\\" : \\\"ip\\\", \\\"data\\\" : \\\"$worker_ip\\\"\
}\" \n"
- "yum -y install nfs-utils jq expect gcc git \n"
- "yum -y install yum-utils device-mapper-persistent-data lvm2 \n"
- "yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo\
\ stable-19.03 \n"
- "yum -y install docker-ce-19.03.8 \n"
- "systemctl enable docker && systemctl start docker \n"
- "##### gn5i ##### \n"
- "#wget https://${ossName}.oss-cn-beijing.aliyuncs.com/AI_k8s/gn5i_NVIDIA-Linux-x86_64-440.64.00.run\
\ \n"
- "#chmod +x gn5i_NVIDIA-Linux-x86_64-440.64.00.run \n"
- "#./gn5i_NVIDIA-Linux-x86_64-440.64.00.run -q -s \n"
- instance_type="
- Ref: WorkerInstanceType
- "\" \n"
- "if [[ `echo $instance_type | grep \"gn5i\"` != \"\" ]];then \n"
- " wget https://${ossName}.oss-cn-beijing.aliyuncs.com/AI_k8s/gn5i_NVIDIA-Linux-x86_64-440.64.00.run\
\ \n"
- " chmod +x gn5i_NVIDIA-Linux-x86_64-440.64.00.run \n"
- " ./gn5i_NVIDIA-Linux-x86_64-440.64.00.run -q -s \n"
- "elif [ `echo $instance_type | grep \"gn4\"` != \"\" ];then \n"
- " wget https://${ossName}.oss-cn-beijing.aliyuncs.com/AI_k8s/gn4_NVIDIA-Linux-x86_64-440.64.00.run\
\ \n"
- " chmod +x gn4_NVIDIA-Linux-x86_64-440.64.00.run \n"
- " ./gn4_NVIDIA-Linux-x86_64-440.64.00.run -q -s \n"
- "elif [ `echo $instance_type | grep \"gn5\"` != \"\" ];then \n"
- " wget https://${ossName}.oss-cn-beijing.aliyuncs.com/AI_k8s/gn5_NVIDIA-Linux-x86_64-440.64.00.run\
\ \n"
- " chmod +x gn5_NVIDIA-Linux-x86_64-440.64.00.run \n"
- " ./gn5_NVIDIA-Linux-x86_64-440.64.00.run -q -s \n"
- "elif [ `echo $instance_type | grep \"gn6i\"` != \"\" ];then \n"
- " wget https://${ossName}.oss-cn-beijing.aliyuncs.com/AI_k8s/gn6i_NVIDIA-Linux-x86_64-440.64.00.run\
\ \n"
- " chmod +x gn6i_NVIDIA-Linux-x86_64-440.64.00.run \n"
- " ./gn6i_NVIDIA-Linux-x86_64-440.64.00.run -q -s \n"
- "elif [ `echo $instance_type | grep \"gn6v\"` != \"\" ];then \n"
- " wget https://${ossName}.oss-cn-beijing.aliyuncs.com/AI_k8s/gn6v_NVIDIA-Linux-x86_64-440.64.00.run\
\ \n"
- " chmod +x gn6v_NVIDIA-Linux-x86_64-440.64.00.run \n"
- " ./gn6v_NVIDIA-Linux-x86_64-440.64.00.run -q -s \n"
- "else \n"
- " wget https://${ossName}.oss-cn-beijing.aliyuncs.com/AI_k8s/NVIDIA-Linux-x86_64-440.64.00.run\
\ \n"
- " chmod +x NVIDIA-Linux-x86_64-440.64.00.run \n"
- " ./NVIDIA-Linux-x86_64-440.64.00.run \n"
- "fi \n"
- "distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \n"
- "curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo\
\ | sudo tee /etc/yum.repos.d/nvidia-docker.repo \n"
- "yum install -y nvidia-container-toolkit \n"
- "#wget https://${ossName}.oss-cn-beijing.aliyuncs.com/AI_k8s/libnvidia-container1-1.0.7-1.x86_64.rpm\
\ \n"
- "#rpm -ivh libnvidia-container1-1.0.7-1.x86_64.rpm \n"
- "##wget https://${ossName}.oss-cn-beijing.aliyuncs.com/AI_k8s/nvidia-container-toolkit-1.0.5-2.x86_64.rpm\
\ \n"
- "#rpm -ivh nvidia-container-toolkit-1.0.5-2.x86_64.rpm \n"
- "##curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.repo\
\ | sudo tee /etc/yum.repos.d/nvidia-container-runtime.repo \n"
- "##yum -y install nvidia-container-runtime \n"
- "wget https://${ossName}.oss-cn-beijing.aliyuncs.com/AI_k8s/nvidia-container-runtime-3.1.4-1.x86_64.rpm\
\ \n"
- "rpm -ivh nvidia-container-runtime-3.1.4-1.x86_64.rpm \n"
- "##yum -y install nvidia-docker \n"
- "wget https://${ossName}.oss-cn-beijing.aliyuncs.com/AI_k8s/nvidia-docker-1.0.1-1.x86_64.rpm\
\ \n"
- "rpm -ivh nvidia-docker-1.0.1-1.x86_64.rpm \n"
- "echo '[plugins.linux]' >> /etc/containerd/config.toml \n"
- "echo ' runtime = \"/usr/bin/nvidia-container-runtime\"' >> /etc/containerd/config.toml\
\ \n"
- "mkdir -p /etc/systemd/system/docker.service.d \n"
- "echo '{' >> /etc/docker/daemon.json \n"
- "echo ' \"default-runtime\": \"nvidia\",' >> /etc/docker/daemon.json\
\ \n"
- "echo ' \"runtimes\": {' >> /etc/docker/daemon.json \n"
- "echo ' \"nvidia\": {' >> /etc/docker/daemon.json \n"
- "echo ' \"path\": \"/usr/bin/nvidia-container-runtime\",' >>\
\ /etc/docker/daemon.json \n"
- "echo ' \"runtimeArgs\": []' >> /etc/docker/daemon.json \n"
- "echo ' }' >> /etc/docker/daemon.json \n"
- "echo ' },' >> /etc/docker/daemon.json \n"
- "echo ' \"exec-opts\": [\"native.cgroupdriver=systemd\"],' >> /etc/docker/daemon.json\
\ \n"
- "echo ' \"log-driver\": \"json-file\",' >> /etc/docker/daemon.json\
\ \n"
- "echo ' \"log-opts\": {' >> /etc/docker/daemon.json \n"
- "echo ' \"max-size\": \"100m\"' >> /etc/docker/daemon.json \n"
- "echo ' },' >> /etc/docker/daemon.json \n"
- "echo ' \"storage-driver\": \"overlay2\",' >> /etc/docker/daemon.json\
\ \n"
- "echo ' \"storage-opts\": [' >> /etc/docker/daemon.json \n"
- "echo ' \"overlay2.override_kernel_check=true\"' >> /etc/docker/daemon.json\
\ \n"
- "echo ' ]' >> /etc/docker/daemon.json \n"
- "echo '}' >> /etc/docker/daemon.json \n"
- "systemctl daemon-reload && systemctl restart docker \n"
- "docker info | grep Cgroup \n"
- "docker info | grep nvidia \n"
- "#docker run --gpus all nvidia/cuda:9.0-base nvidia-smi \n"
- "echo 'net.ipv4.ip_forward = 1' >> /etc/sysctl.d/k8s.conf \n"
- "echo 'net.bridge.bridge-nf-call-ip6tables = 1' >> /etc/sysctl.d/k8s.conf\
\ \n"
- "echo 'net.bridge.bridge-nf-call-iptables = 1' >> /etc/sysctl.d/k8s.conf\
\ \n"
- "sysctl -p /etc/sysctl.d/k8s.conf \n"
- "echo '[kubernetes]' >> /etc/yum.repos.d/kubernetes.repo \n"
- "echo 'name=Kubernetes' >> /etc/yum.repos.d/kubernetes.repo \n"
- "echo 'baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/'\
\ >> /etc/yum.repos.d/kubernetes.repo \n"
- "echo 'enabled=1' >> /etc/yum.repos.d/kubernetes.repo \n"
- "echo 'gpgcheck=1' >> /etc/yum.repos.d/kubernetes.repo \n"
- "echo 'repo_gpgcheck=1' >> /etc/yum.repos.d/kubernetes.repo \n"
- "echo 'gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg\
\ https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg'\
\ >> /etc/yum.repos.d/kubernetes.repo \n"
- "yum install -y kubelet-1.15.3-0 kubeadm-1.15.3-0 kubectl-1.15.3-0\
\ \n"
- "systemctl enable kubelet && systemctl start kubelet \n"
- "systemctl restart containerd \n"
- "while true;do \n"
- " if [ -f '/master_ip.info' ];then \n"
- " echo 'get master_ip success' >> /root/master_ip.log \n"
- " break \n"
- " else \n"
- " echo 'master_ip is null' >> /root/master_ip.log \n"
- " continue \n"
- " fi \n"
- "done \n"
- "touch get_join_command.sh && chmod +x get_join_command.sh \n"
- "echo '#!/bin/bash' >> get_join_command.sh \n"
- "echo 'expect <<EOF' >> get_join_command.sh \n"
- "echo 'set timeout 10' >> get_join_command.sh \n"
- "echo 'spawn scp master001:/root/join_k8s_cmd.sh /root/' >> get_join_command.sh\
\ \n"
- "echo 'expect {' >> get_join_command.sh \n"
- "echo '\"yes/no\" {' >> get_join_command.sh \n"
- "echo 'send \"yes\\n\";exp_continue' >> get_join_command.sh \n"
- "echo '}' >> get_join_command.sh \n"
- "echo '\"*password\" {' >> get_join_command.sh \n"
- echo 'send "
- Ref: Password
- "\\n\"' >> get_join_command.sh \n"
- "echo '}' >> get_join_command.sh \n"
- "echo '}' >> get_join_command.sh \n"
- "echo 'expect eof' >> get_join_command.sh \n"
- "echo 'EOF' >> get_join_command.sh \n"
- "bash get_join_command.sh \n"
- "systemctl enable kubelet.service \n"
- "cd /root && /bin/bash join_k8s_cmd.sh \n"
- "sleep 30 \n"
- "touch after_worker_start.sh && chmod +x after_worker_start.sh \n"
- "echo '#!/bin/bash' >> after_worker_start.sh \n"
- "echo 'expect <<EOF' >> after_worker_start.sh \n"
- "echo 'set timeout 10' >> after_worker_start.sh \n"
- "echo 'spawn ssh master001 \"cd /root && /bin/bash after_worker.sh\
\ >> after_worker.log && /bin/bash install_arena.sh >> install_arena.log\"\
' >> after_worker_start.sh \n"
- "echo 'expect {' >> after_worker_start.sh \n"
- "echo '\"*password\" {' >> after_worker_start.sh \n"
- echo 'send "
- Ref: Password
- "\\n\"' >> after_worker_start.sh \n"
- "echo '}' >> after_worker_start.sh \n"
- "echo '}' >> after_worker_start.sh \n"
- "echo 'expect eof' >> after_worker_start.sh \n"
- "echo 'EOF' >> after_worker_start.sh \n"
- "sleep 30 \n"
- "bash after_worker_start.sh \n"
- "touch /root/start.sh && chmod +x /root/start.sh \n"
- "echo '#!/bin/bash' >> /root/start.sh \n"
- "echo 'systemctl daemon-reload && systemctl restart docker' >> /root/start.sh\
\ \n"
- "echo 'systemctl restart containerd' >> /root/start.sh \n"
- "###cd /root/ && bash join_k8s_cmd.sh \n"
- "##cd /root/ && bash join_k8s_cmd.sh \n"
- "##scp master001:/root/join_k8s_cmd.sh ./ \n"
- "##chmod +x join_k8s_cmd.sh && bash join_k8s_cmd.sh \n"
- "##wget https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v1.11/nvidia-device-plugin.yml\
\ \n"
- "##kubectl create -f nvidia-device-plugin.yml \n"
- "##kubectl get pods --all-namespaces \n"
- "sleep 30 \n"
- "mkdir /root/tmp \n"
- "echo '#!/bin/bash ' >> /root/tmp/mount.sh \n"
- 'echo ''sudo mount -t nfs -o vers=4,minorversion=0,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport '
- Fn::GetAtt:
- NasMountTarget
- MountTargetDomain
- ":/ /mnt' >> /root/tmp/mount.sh \n"
- "chmod +x /root/tmp/mount.sh \n"
- "echo 'install nfs /sbin/modprobe --ignore-install nfs nfs4_unique_id=`cat\
\ /sys/class/dmi/id/product_uuid`' >> /etc/modprobe.d/nfs.conf \n"
- "touch /install.sh && chmod +x /install.sh \n"
- "echo '#!/bin/bash' >> /install.sh \n"
- "echo \"if [ -f '/restart.txt' ];then\" >> /install.sh \n"
- "echo \" mv /restart.txt /restart.txt.old && cd /root && /bin/bash\
\ start.sh >> start.log\" >> /install.sh \n"
- "echo \"else\" >> /install.sh \n"
- "echo \" cd /\" >> /install.sh \n"
- "echo \"fi\" >> /install.sh \n"
- "sed -i '/# By default this script does nothing./a bash /install.sh'\
\ /etc/rc.local \n"
- "touch restart.txt \n"
- "#cd / && git clone https://code.aliyun.com/best-practice/099.git\
\ \n"
- "ros-notify \n"
- "#root \n"
- Ref: ALIYUN::NoValue
DependsOn:
- WorkerCenInstanceAttachment
Metadata:
ALIYUN::ROS::Designer:
id: 3a33cc57-0ac7-4467-9036-f3b8026a78a7
EcsInvocationWorker:
Type: ALIYUN::ECS::Invocation
Properties:
InstanceIds:
Fn::GetAtt:
- WorkerInstanceGroup
- InstanceIds
CommandId:
Ref: EcsCommand
DependsOn:
- EcsCommand
- WorkerEcsWaitCondition
Metadata:
ALIYUN::ROS::Designer:
id: 6d92e08b-362c-457b-a3e5-53c006138fdd
IpWaitConditionHandle:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
Metadata:
ALIYUN::ROS::Designer:
id: cf73f037-4151-4b3a-9c4a-22d9eac434b3
IpWaitCondition:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count: 1
Handle:
Ref: IpWaitConditionHandle
Timeout: 3600
Metadata:
ALIYUN::ROS::Designer:
id: de882c62-331f-44ef-8133-ed8ef37b3cbd
MasterEcsWaitConditionHandle:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
Metadata:
ALIYUN::ROS::Designer:
id: c7f05162-7643-4115-a404-7ab91f038da9
MasterEcsWaitCondition:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count: 1
Handle:
Ref: MasterEcsWaitConditionHandle
Timeout: 3600
Metadata:
ALIYUN::ROS::Designer:
id: dfaf7757-32f0-478f-a9f8-e56d96a12da5
MasterSecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: MasterVpc
SecurityGroupIngress:
- IpProtocol: icmp
NicType: internet
PortRange: -1/-1
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: internet
PortRange: 3389/3389
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: internet
PortRange: 6443/6443
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: internet
PortRange: 443/443
Priority: 1
SourceCidrIp: 0.0.0.0/0
- IpProtocol: tcp
NicType: internet
PortRange: 22/22
Priority: 1
SourceCidrIp: 0.0.0.0/0
SecurityGroupName:
Fn::Join:
- _
- - Master-ECS
- StackId
- Ref: ALIYUN::StackId
Metadata:
ALIYUN::ROS::Designer:
id: 90aa2317-ae44-4bac-bed6-939e0ab5916e
MasterInstanceGroup:
Type: ALIYUN::ECS::InstanceGroup
Properties:
VpcId:
Ref: MasterVpc
VSwitchId:
Ref: MasterVSwitch
SecurityGroupId:
Ref: MasterSecurityGroup
ImageId:
Ref: ImageId
AllocatePublicIP: true
HostName:
Fn::Join:
- ''
- - master
- '[1,3]'
InstanceName:
Fn::Join:
- ''
- - master
- '[1,3]'
InstanceType:
Ref: MasterInstanceType
InternetMaxBandwidthOut:
Ref: InternetBandwidth
MaxAmount: 1
Password:
Ref: Password
ResourceGroupId:
Fn::If:
- NotUseResourceGroupId
- Ref: ALIYUN::NoValue
- Ref: ResourceGroupId
SystemDiskCategory:
Ref: SystemDiskCategory
SystemDiskSize:
Ref: SystemDiskSize
Tags:
- Key: best_practice
Value: 099
UserData:
Fn::If:
- CreateCentOS
- Fn::Replace:
- ros-notify:
Fn::GetAtt:
- MasterEcsWaitConditionHandle
- CurlCli
- Fn::Join:
- ''
- - "#!/bin/sh \n"
- "yum -y install nfs-utils jq expect \n"
- "ossName='ros-template-resources' \n"
- "master_ip=`ip addr | grep eth0 | grep -o '[0-9]\\{1,3\\}\\.[0-9]\\\
{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}/' | cut -d '/' -f 1` \n"
- "mkdir /root/tmp \n"
- '#echo ''sudo mount -t nfs -o vers=4,minorversion=0,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport '
- Fn::GetAtt:
- NasMountTarget
- MountTargetDomain
- ":/ /mnt' >> /root/tmp/mount.sh \n"
- worker_ip_json='
- Fn::GetAtt:
- IpWaitCondition
- Data
- "' \n"
- "worker_ip=`echo $worker_ip_json | jq .ip | sed 's/\"//g'` \n"
- "echo \"$worker_ip worker001 worker001\" >> /etc/hosts\
\ \n"
- "master_ip=`ip addr | grep eth0 | grep -o '[0-9]\\{1,3\\}\\.[0-9]\\\
{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}/' | cut -d '/' -f 1` \n"
- "ssh-keygen -t rsa -P '' -f '/root/.ssh/id_rsa' \n"
- "touch ssh_copy.sh && chmod +x ssh_copy.sh \n"
- "echo '#!/bin/bash' >> ssh_copy.sh \n"
- "echo 'expect <<EOF' >> ssh_copy.sh \n"
- "echo 'set timeout 150' >> ssh_copy.sh \n"
- "echo 'spawn ssh-copy-id -i /root/.ssh/id_rsa.pub worker001' >> ssh_copy.sh\
\ \n"
- "echo 'expect {' >> ssh_copy.sh \n"
- "echo '\"yes/no\" {' >> ssh_copy.sh \n"
- "echo 'send \"yes\\n\";exp_continue' >> ssh_copy.sh \n"
- "echo '}' >> ssh_copy.sh \n"
- "echo '\"*password\" {' >> ssh_copy.sh \n"
- echo 'send "
- Ref: Password
- "\\n\"' >> ssh_copy.sh \n"
- "echo '}' >> ssh_copy.sh \n"
- "echo '}' >> ssh_copy.sh \n"
- "echo 'expect eof' >> ssh_copy.sh \n"
- "echo 'EOF' >> ssh_copy.sh \n"
- "sleep 60 \n"
- "bash ssh_copy.sh \n"
- "ssh worker001 \"echo \"$master_ip master001 master001\"\
\ >> /etc/hosts && exit \" \n"
- "yum -y install yum-utils device-mapper-persistent-data lvm2 \n"
- "yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo\
\ stable-19.03 \n"
- "yum -y install docker-ce-19.03.8 \n"
- "systemctl enable docker && systemctl start docker \n"
- "mkdir -p /etc/docker \n"
- "echo '{' >> /etc/docker/daemon.json \n"
- "echo ' \"exec-opts\": [\"native.cgroupdriver=systemd\"],' >> /etc/docker/daemon.json\
\ \n"
- "echo ' \"log-driver\": \"json-file\",' >> /etc/docker/daemon.json\
\ \n"
- "echo ' \"log-opts\": {' >> /etc/docker/daemon.json \n"
- "echo ' \"max-size\": \"100m\"' >> /etc/docker/daemon.json \n"
- "echo ' },' >> /etc/docker/daemon.json \n"
- "echo ' \"storage-driver\": \"overlay2\",' >> /etc/docker/daemon.json\
\ \n"
- "echo ' \"storage-opts\": [' >> /etc/docker/daemon.json \n"
- "echo ' \"overlay2.override_kernel_check=true\"' >> /etc/docker/daemon.json\
\ \n"
- "echo ' ]' >> /etc/docker/daemon.json \n"
- "echo '}' >> /etc/docker/daemon.json \n"
- "mkdir -p /etc/systemd/system/docker.service.d \n"
- "systemctl daemon-reload && systemctl restart docker \n"
- "docker info |grep Cgroup \n"
- "echo 'net.ipv4.ip_forward = 1' >> /etc/sysctl.d/k8s.conf \n"
- "echo 'net.bridge.bridge-nf-call-ip6tables = 1' >> /etc/sysctl.d/k8s.conf\
\ \n"
- "echo 'net.bridge.bridge-nf-call-iptables = 1' >> /etc/sysctl.d/k8s.conf\
\ \n"
- "sysctl -p /etc/sysctl.d/k8s.conf \n"
- "echo '[kubernetes]' >> /etc/yum.repos.d/kubernetes.repo \n"
- "echo 'name=Kubernetes' >> /etc/yum.repos.d/kubernetes.repo \n"
- "echo 'baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/'\
\ >> /etc/yum.repos.d/kubernetes.repo \n"
- "echo 'enabled=1' >> /etc/yum.repos.d/kubernetes.repo \n"
- "echo 'gpgcheck=1' >> /etc/yum.repos.d/kubernetes.repo \n"
- "echo 'repo_gpgcheck=1' >> /etc/yum.repos.d/kubernetes.repo \n"
- "echo 'gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg\
\ https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg'\
\ >> /etc/yum.repos.d/kubernetes.repo \n"
- "yum install -y kubelet-1.15.3-0 kubeadm-1.15.3-0 kubectl-1.15.3-0\
\ \n"
- "systemctl enable kubelet && systemctl start kubelet \n"
- "kubeadm init --pod-network-cidr=172.16.20.0/16 --image-repository\
\ registry.aliyuncs.com/google_containers --kubernetes-version=1.15.3\
\ >> /root/tmp/join_k8s_cmd.log \n"
- "wait \n"
- "cd / \n"
- "echo '#!/bin/bash' >> /root/join_k8s_cmd.sh \n"
- "cat /root/tmp/join_k8s_cmd.log | grep 'kubeadm join .*' >> /root/join_k8s_cmd.sh\
\ \n"
- "cat /root/tmp/join_k8s_cmd.log | grep 'discovery.*' >> /root/join_k8s_cmd.sh\
\ \n"
- "chmod +x /root/join_k8s_cmd.sh \n"
- "#scp /root/join_k8s_cmd.sh worker001:/root/ \n"
- "mkdir -p /root/.kube \n"
- "sudo cp -i /etc/kubernetes/admin.conf /root/.kube/config \n"
- "sudo chown $(id -u):$(id -g) /root/.kube/config \n"
- "echo \"export KUBECONFIG=/root/.kube/config\" >> ~/.bash_profile\
\ \n"
- "source ~/.bash_profile \n"
- "wget http://mirror.faasx.com/k8s/calico/v3.3.2/rbac-kdd.yaml \n"
- "wget http://mirror.faasx.com/k8s/calico/v3.3.2/calico.yaml \n"
- "sed -i 's/192.168.0.0/172.16.20.0/' calico.yaml \n"
- "sleep 60 \n"
- "kubectl create -f rbac-kdd.yaml \n"
- "kubectl create -f calico.yaml \n"
- "sudo kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml\
\ \n"
- "systemctl daemon-reload \n"
- "#kubectl get nodes \n"
- "sleep 60 \n"
- "sudo kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml\
\ \n"
- "#wget https://${ossName}.oss-cn-beijing.aliyuncs.com/AI_k8s/kube-flannel.yml\
\ \n"
- "#sudo kubectl apply -f kube-flannel.yml \n"
- "systemctl daemon-reload \n"
- "ssh worker001 \"echo \"$master_ip\" >> /master_ip.info && exit \"\
\ \n"
- "echo '#!/bin/bash ' >> /root/tmp/mount.sh \n"
- 'echo ''sudo mount -t nfs -o vers=4,minorversion=0,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport '
- Fn::GetAtt:
- NasMountTarget
- MountTargetDomain
- ":/ /mnt' >> /root/tmp/mount.sh \n"
- "chmod +x /root/tmp/mount.sh \n"
- "##### after worker node \n"
- "touch /root/after_worker.sh && chmod +x /root/after_worker.sh \n"
- "echo '#/bin/bash' >> /root/after_worker.sh \n"
- "echo 'kubectl get nodes' >> /root/after_worker.sh \n"
- "echo 'kubectl label node worker001 node-role.kubernetes.io/worker=worker'\
\ >> /root/after_worker.sh \n"
- "echo 'kubectl get nodes' >> /root/after_worker.sh \n"
- "echo \"wget https://${ossName}.oss-cn-beijing.aliyuncs.com/AI_k8s/nvidia-device-plugin.yml\"\
\ >> /root/after_worker.sh \n"