-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path6-create-cluster.sh
executable file
·30 lines (17 loc) · 1.43 KB
/
6-create-cluster.sh
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
#!/bin/bash
# Get Private Subnet ID
export private_subnet_id=$(aws cloudformation --region us-west-2 describe-stacks --query "Stacks[?StackName=='create-large-scale-vpc-stack'][].Outputs[?OutputKey=='PrivateSubnet'].OutputValue" --output text)
echo "Private Subnet ID: ${private_subnet_id}"
# Get Public Subnet ID
export public_subnet_id=$(aws cloudformation --region us-west-2 describe-stacks --query "Stacks[?StackName=='create-large-scale-vpc-stack'][].Outputs[?OutputKey=='PublicSubnet'].OutputValue" --output text)
echo "Public Subnet ID: ${public_subnet_id}"
# Get AMI ID
export ami_id=$( aws ec2 describe-images --region us-west-2 --filters "Name=name,Values=pcluster-dist-training-ami-*" --query 'Images[*].[ImageId]' --output text)
echo "AMI ID: ${ami_id}"
#List Keys
aws ec2 describe-key-pairs --query "KeyPairs[*].{KeyPairId:KeyPairId,KeyName:KeyName,KeyType:KeyType}" --output table
# Update Cluster creation config template
cat create-cluster-template.yaml | envsubst > create-cluster.yaml
# Create Cluster
#pcluster create-cluster --cluster-configuration create-cluster.yaml --cluster-name pcluster-ml --region us-west-2 --suppress-validators "type:InstanceTypeBaseAMICompatibleValidator" --rollback-on-failure "false"
pcluster create-cluster --cluster-configuration create-cluster-3-14.yaml --cluster-name pcluster-ml --region us-west-2 --suppress-validators "type:InstanceTypeBaseAMICompatibleValidator" --rollback-on-failure "false"