-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcluster_template.yml
79 lines (71 loc) · 2.46 KB
/
cluster_template.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
AWSTemplateFormatVersion: '2010-09-09'
Description: >
AWSParallelCluster CloudFormation Template
Parameters:
KeyName:
Description: KeyPair to login to the head node
Type: AWS::EC2::KeyPair::KeyName
AvailabilityZone:
Description: Availability zone where instances will be launched
Type: AWS::EC2::AvailabilityZone::Name
Default: us-east-1a
Mappings:
ParallelCluster:
Constants:
Version: 3.7.0
Resources:
PclusterClusterProvider:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub
- https://${AWS::Region}-aws-parallelcluster.s3.${AWS::Region}.${AWS::URLSuffix}/parallelcluster/${Version}/templates/custom_resource/cluster.yaml
- { Version: !FindInMap [ParallelCluster, Constants, Version] }
PclusterVpc:
Type: AWS::CloudFormation::Stack
Properties:
Parameters:
PublicCIDR: 10.0.0.0/24
PrivateCIDR: 10.0.16.0/20
AvailabilityZone: !Ref AvailabilityZone
TemplateURL: !Sub
- https://${AWS::Region}-aws-parallelcluster.s3.${AWS::Region}.${AWS::URLSuffix}/parallelcluster/${Version}/templates/networking/public-private-${Version}.cfn.json
- { Version: !FindInMap [ParallelCluster, Constants, Version ] }
PclusterCluster:
Type: Custom::PclusterCluster
Properties:
ServiceToken: !GetAtt [ PclusterClusterProvider , Outputs.ServiceToken ]
ClusterName: !Sub 'c-${AWS::StackName}'
ClusterConfiguration:
Image:
Os: alinux2
HeadNode:
InstanceType: t2.medium
Networking:
SubnetId: !GetAtt [ PclusterVpc , Outputs.PublicSubnetId ]
Ssh:
KeyName: !Ref KeyName
Scheduling:
Scheduler: slurm
SlurmQueues:
- Name: standard
ComputeResources:
- Name: queue1-cr
InstanceType: t2.micro
MinCount: 0
MaxCount: 1
Networking:
SubnetIds:
- !GetAtt [ PclusterVpc , Outputs.PrivateSubnetId ]
- Name: medium
ComputeResources:
- Name: queueu2-cr
InstanceType: t2.micro
MinCount: 0
MaxCount: 1
Networking:
SubnetIds:
- !GetAtt [ PclusterVpc , Outputs.PrivateSubnetId ]
Outputs:
HeadNodeIp:
Description: The Public IP address of the HeadNode
Value: !GetAtt [ PclusterCluster, headNode.publicIpAddress ]