Skip to content

Commit 662960c

Browse files
committed
Lets make sure bootstrap scripts are not executed more than once.
1 parent 33f6efa commit 662960c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Templates/AWS-HPC-Cluster.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ Resources:
438438
inputs:
439439
runCommand:
440440
- "#!/bin/bash"
441+
- if [[ -f /home/ec2-user/environment/lambda.log ]]; then exit 1; fi
441442
- set -x
442443
- exec >/home/ec2-user/environment/lambda.log; exec 2>&1
443444
- echo LANG=en_US.utf-8 >> /etc/environment

scripts/Cloud9-Bootstrap.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22

3+
if [[ -f /home/ec2-user/environment/bootstrap.log ]]; then
4+
exit 1
5+
fi
6+
37
set -x
48
exec >/home/ec2-user/environment/bootstrap.log; exec 2>&1
59

@@ -44,8 +48,12 @@ fi
4448
/usr/bin/envsubst < "1click-hpc/parallelcluster/config.${AWS_REGION_NAME}.sample" > cluster.config
4549
/usr/bin/envsubst '${SLURM_DB_ENDPOINT}' < "1click-hpc/sacct/mysql/db.config" > db.config
4650
/usr/bin/envsubst '${SLURM_DB_ENDPOINT}' < "1click-hpc/sacct/slurm/slurmdbd.conf" > slurmdbd.conf
51+
/usr/bin/envsubst '${S3_BUCKET}' < "1click-hpc/enginframe/fm.browse.ui" > fm.browse.ui
52+
4753
aws s3 cp db.config "s3://${S3_BUCKET}/1click-hpc/sacct/mysql/db.config" --region "${AWS_REGION_NAME}"
4854
aws s3 cp slurmdbd.conf "s3://${S3_BUCKET}/1click-hpc/sacct/slurm/slurmdbd.conf" --region "${AWS_REGION_NAME}"
55+
aws s3 cp fm.browse.ui "s3://${S3_BUCKET}/1click-hpc/enginframe/fm.browse.ui" --region "${AWS_REGION_NAME}"
56+
rm -f db.config slurmdbd.conf fm.browse.ui
4957
sudo chown -R ec2-user:ec2-user /home/ec2-user/
5058

5159
#Create the cluster

0 commit comments

Comments
 (0)