Skip to content

Commit 68c0eb3

Browse files
committed
add admin home for unifying behavior with GPU clus
1 parent e1845ba commit 68c0eb3

File tree

5 files changed

+51
-2
lines changed

5 files changed

+51
-2
lines changed

Templates/AWS-HPC-Cluster.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Metadata:
1515
- PrivateSubnetAId
1616
- ODCRGroupName
1717
- FSx
18+
- AdminFSx
1819
- AD
1920
- ADDNS0
2021
- ADDNS1
@@ -38,6 +39,8 @@ Metadata:
3839
default: 'ODCR Group Name:'
3940
FSx:
4041
default: 'FSx:'
42+
AdminFSx:
43+
default: 'Admin FSx:'
4144
AD:
4245
default: 'Active Directory:'
4346
ADDNS0:
@@ -101,6 +104,12 @@ Parameters:
101104
AllowedPattern: ^(AUTO|fs-[0-9a-z]+)$
102105
Default : AUTO
103106

107+
AdminFSx:
108+
Description: 'Please, enter your Admin FSx ID, or just leave "AUTO" if you want to re-use an existing one.'
109+
Type: String
110+
AllowedPattern: ^(AUTO|fs-[0-9a-z]+)$
111+
Default : AUTO
112+
104113
AD:
105114
Description: 'Please, enter your Active Directory ID, or just leave "AUTO" if you want to create a new one.'
106115
Type: String
@@ -567,6 +576,7 @@ Resources:
567576
- !Sub echo "export AWS_ACCOUNT=${AWS::AccountId}" >> cluster_env
568577
- !Sub echo "export S3_BUCKET=${Cloud9OutputBucket}" >> cluster_env
569578
- !Sub echo "export FSX_ID=${FSx}" >> cluster_env
579+
- !Sub echo "export ADMINFSX_ID=${AdminFSx}" >> cluster_env
570580
- !Sub
571581
- echo "export MAP_MIGRATED=${mapmigrated}" >> cluster_env
572582
- mapmigrated: !Ref MapMigrated

modules-ubuntu/02.activate.passwordless.AD.headnode.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44
source "/etc/parallelcluster/cfnconfig"
55

66
activateSSH() {
7-
sed -i 's/fallback_homedir = \/home\/%u/override_homedir = \/fsx\/home-%u/g' /etc/sssd/sssd.conf
7+
sed -i 's/fallback_homedir = \/home\/%u/override_homedir = \/admin\/home-%u/g' /etc/sssd/sssd.conf
88
ROU_PW=$(aws secretsmanager get-secret-value --secret-id "${stack_name}-ROU" --query SecretString --output text --region "${cfn_region}")
99
sed -E -i "s|^#?(ldap_default_authtok\s=)\s.*|\1 ${ROU_PW}|" /etc/sssd/sssd.conf
1010

modules-ubuntu/02.activate.passwordless.sudo.compute.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44
source "/etc/parallelcluster/cfnconfig"
55

66
activateSSSD() {
7-
sed -i 's/fallback_homedir = \/home\/%u/override_homedir = \/fsx\/home-%u/g' /etc/sssd/sssd.conf
7+
sed -i 's/fallback_homedir = \/home\/%u/override_homedir = \/admin\/home-%u/g' /etc/sssd/sssd.conf
88
searchstring="-ComputeFleet"
99
stack=${stack_name%$searchstring*}
1010
ROU_PW=$(aws secretsmanager get-secret-value --secret-id "${stack}-ROU" --query SecretString --output text --region "${cfn_region}")

parallelcluster/config.us-west-2.sample.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ Scheduling:
393393
AssignPublicIp: ${USE_PUBLIC_IPS}
394394
SharedStorage:
395395
${FSX}
396+
${ADMINFSX}
396397
Tags:
397398
- Key: 1Click-HPC
398399
Value: 'true'

scripts/Cloud9-Bootstrap.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,31 @@ FSX=$(cat <<EOF
8080
EOF
8181
)
8282
fi
83+
84+
if [[ $ADMINFSX_ID == "AUTO" ]];then
85+
ADMINFSX=$(cat <<EOF
86+
- MountDir: /admin
87+
Name: new
88+
StorageType: FsxLustre
89+
FsxLustreSettings:
90+
StorageCapacity: 1200
91+
DeploymentType: SCRATCH_2
92+
DataCompressionType: LZ4
93+
EOF
94+
)
95+
else
96+
ADMINFSX=$(cat <<EOF
97+
- MountDir: /admin
98+
Name: existing
99+
StorageType: FsxLustre
100+
FsxLustreSettings:
101+
FileSystemId: ${ADMINFSX_ID}
102+
EOF
103+
)
104+
fi
105+
83106
export FSX
107+
export ADMINFSX
84108

85109
if [[ $PRIVATE_SUBNET_ID == "NONE" ]];then
86110
export SUBNET_ID="${PUBLIC_SUBNET_ID}"
@@ -140,15 +164,29 @@ if [[ $FSX_ID == "AUTO" ]];then
140164
FSX_ID=$(aws cloudformation describe-stack-resources --stack-name "hpc-1click-${CLUSTER_NAME}" --logical-resource-id FSX0 --query "StackResources[*].PhysicalResourceId" --output text)
141165
fi
142166

167+
if [[ $ADMINFSX_ID == "AUTO" ]];then
168+
ADMINFSX_ID=$(aws cloudformation describe-stack-resources --stack-name "hpc-1click-${CLUSTER_NAME}" --logical-resource-id FSX0 --query "StackResources[*].PhysicalResourceId" --output text)
169+
fi
170+
171+
143172
FSX_DNS_NAME=$(aws fsx describe-file-systems --file-system-ids $FSX_ID --query "FileSystems[*].DNSName" --output text)
144173
FSX_MOUNT_NAME=$(aws fsx describe-file-systems --file-system-ids $FSX_ID --query "FileSystems[*].LustreConfiguration.MountName" --output text)
145174

175+
ADMINFSX_DNS_NAME=$(aws fsx describe-file-systems --file-system-ids $ADMINFSX_ID --query "FileSystems[*].DNSName" --output text)
176+
ADMINFSX_MOUNT_NAME=$(aws fsx describe-file-systems --file-system-ids $ADMINFSX_ID --query "FileSystems[*].LustreConfiguration.MountName" --output text)
177+
178+
146179
#mount the same FSx created for the HPC Cluster
147180
mkdir fsx
181+
mkdir admin
148182
sudo mount -t lustre -o noatime,flock $FSX_DNS_NAME@tcp:/$FSX_MOUNT_NAME fsx
183+
sudo mount -t lustre -o noatime,flock $ADMINFSX_DNS_NAME@tcp:/$ADMINFSX_MOUNT_NAME admin
149184
sudo bash -c "echo \"$FSX_DNS_NAME@tcp:/$FSX_MOUNT_NAME /home/ec2-user/environment/fsx lustre defaults,noatime,flock,_netdev 0 0\" >> /etc/fstab"
185+
sudo bash -c "echo \"$ADMINFSX_DNS_NAME@tcp:/$ADMINFSX_MOUNT_NAME /home/ec2-user/environment/admin lustre defaults,noatime,flock,_netdev 0 0\" >> /etc/fstab"
150186
sudo chmod 755 fsx
187+
sudo chmod 755 admin
151188
sudo chown ec2-user:ec2-user fsx
189+
sudo chown ec2-user:ec2-user admin
152190

153191
aws s3 cp --quiet bootstrap.log "s3://${S3_BUCKET}/install.log" --region "${AWS_REGION_NAME}"
154192
aws s3 cp --quiet config.${AWS_REGION_NAME}.yaml "s3://${S3_BUCKET}/config.${AWS_REGION_NAME}.yaml" --region "${AWS_REGION_NAME}"

0 commit comments

Comments
 (0)