├── README.md ├── post_install_script_tecplot.txt ├── DCV_config_mininal.ini ├── LICENSE ├── multiple_queue_config.ini └── RenewMacAddress.sh /README.md: -------------------------------------------------------------------------------- 1 | # AWS_helpers 2 | Useful scripts and config files for AWS 3 | 4 | RenewMacAddress.sh: 5 | This script automatically renews your local MAC address in your AWS security group to allow connecting to your VM's via ssh. 6 | 7 | post_install_script_tecplot.txt: 8 | This script gives an example for a post installation instance, when starting an AWS EC2 instance. You can call such a script with the option --user-data file://YOUR_SCRIPT.txt 9 | This example installs firefox and gedit and copies a Tecplot 360 installation from your S3 bucket to the new machine. 10 | -------------------------------------------------------------------------------- /post_install_script_tecplot.txt: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # install firefox 4 | cd /usr/local 5 | wget http://ftp.mozilla.org/pub/firefox/releases/83.0/linux-x86_64/en-US/firefox-83.0.tar.bz2 6 | tar xvjf firefox-83.0.tar.bz2 7 | ln -s /usr/local/firefox/firefox /usr/bin/firefox 8 | 9 | # install gedit 10 | yum -y install gedit 11 | 12 | # install tecplot 13 | aws s3 cp s3://YOUR_BUCKET/tecplot360ex2020r1.tgz tecplot360ex2020r1.tgz 14 | tar xzvf tecplot360ex2020r1.tgz 15 | 16 | # install python and PyTecplot 17 | # on AWS parallelcluster python2 and python 3 are installed by default 18 | python3 -m pip install pytecplot 19 | 20 | line="PATH=$PATH:/usr/local/tecplot360ex2020r1/bin" 21 | echo $line >> /home/ec2-user/.bashrc 22 | source /home/ec2-user/.bashrc 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /DCV_config_mininal.ini: -------------------------------------------------------------------------------- 1 | [aws] 2 | aws_region_name = eu-central-1 3 | 4 | [global] 5 | cluster_template = default 6 | update_check = false 7 | sanity_check = true 8 | 9 | [cluster default] 10 | key_name = [YOUR_KEY] 11 | base_os = alinux2 12 | vpc_settings = public 13 | ebs_settings = myebs 14 | compute_instance_type = t2.micro [ADAPT_TO_YOUR_NEEDS] 15 | master_instance_type = t2.micro [ADAPT_TO_YOUR_NEEDS] 16 | cluster_type = ondemand 17 | placement_group = DYNAMIC 18 | placement = compute 19 | initial_queue_size = 0 20 | max_queue_size = 8 21 | disable_hyperthreading = true 22 | s3_read_write_resource = * 23 | scheduler = slurm 24 | dcv_settings = default 25 | tags = {"KEY1":"VALUE1","KEY2":"VALUE2"} 26 | 27 | [dcv default] 28 | enable = master 29 | 30 | [vpc public] 31 | vpc_id = [YOUR_VPC] 32 | master_subnet_id = [YOUR_SUBNET] 33 | compute_subnet_id = [YOUR_SUBNET] 34 | 35 | [ebs myebs] 36 | shared_dir = /shared 37 | volume_type = gp2 38 | volume_size = 20 [ADAPT_TO_YOUR_NEEDS] 39 | 40 | [aliases] 41 | ssh = ssh {CFN_USER}@{MASTER_IP} {ARGS} 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Astrid Walle 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /multiple_queue_config.ini: -------------------------------------------------------------------------------- 1 | [aws] 2 | aws_region_name = $REGION 3 | 4 | [global] 5 | cluster_template = default 6 | update_check = true 7 | sanity_check = true 8 | 9 | [aliases] 10 | ssh = ssh {CFN_USER}@{MASTER_IP} {ARGS} 11 | 12 | [dcv default] 13 | enable = master 14 | 15 | [vpc public] 16 | vpc_id = $VPC 17 | master_subnet_id = $SUBNET 18 | additional_sg = $ADD_SG 19 | 20 | [ebs default] 21 | shared_dir = /shared 22 | volume_size = 100 23 | 24 | [cluster default] 25 | key_name = $SSH_KEY 26 | scheduler = slurm 27 | master_instance_type = c4.4xlarge 28 | base_os = alinux2 29 | s3_read_write_resource = * 30 | tags = {"project": "XXX", "purpose": "XXX"} 31 | vpc_settings = public 32 | ebs_settings = default 33 | dcv_settings = default 34 | queue_settings = compute, postprocess 35 | disable_hyperthreading = true 36 | 37 | [queue compute] 38 | enable_efa = false 39 | enable_efa_gdr = false 40 | placement_group = DYNAMIC 41 | compute_resource_settings = default 42 | 43 | [queue postprocess] 44 | enable_efa = false 45 | enable_efa_gdr = false 46 | placement_group = DYNAMIC 47 | compute_resource_settings = pp1, pp2 48 | 49 | [compute_resource default] 50 | instance_type = c4.4xlarge 51 | max_count = 64 52 | 53 | [compute_resource pp1] 54 | instance_type = r5d.4xlarge 55 | max_count = 24 56 | 57 | [compute_resource pp2] 58 | instance_type = r5d.2xlarge 59 | max_count = 32 60 | -------------------------------------------------------------------------------- /RenewMacAddress.sh: -------------------------------------------------------------------------------- 1 | ## Script for renewing the IP address in security group 2 | ## default region: eu-west-1 3 | ## default security group name: [YOUR_SECURITY_GROUP] 4 | ## usage: ./RenewMacAddress [-r DEFAULT_REGION_NAME] 5 | 6 | #!/bin/bash 7 | 8 | if [[ $1 = "-h" ]]; then 9 | echo "Usage:" 10 | echo "/RenewMacAddress [-r DEFAULT_REGION_NAME]" 11 | echo "If no -r option is given, the default region will be set to eu-west-1" 12 | exit 1 13 | elif [[ $1 = "-r" ]]; then 14 | export AWS_DEFAULT_REGION=$2 15 | echo "AWS_DEFAULT_REGION is set to $2" 16 | else 17 | export AWS_DEFAULT_REGION=eu-west-1 18 | echo "AWS_DEFAULT_REGION is set to eu-west-1" 19 | fi 20 | 21 | SG_NAME=[YOUR_SG_NAME] 22 | RC=0 23 | old_cidr=`aws ec2 describe-security-groups --group-names=${SG_NAME} --query 'SecurityGroups[*].IpPermissions[*].IpRanges' --output text` 24 | new_ip=`curl -s monip.org | sed -n 's/.*IP : \([0-9.]*\).*/\1/p'` 25 | new_cidr=`echo ${new_ip}/32` 26 | aws ec2 revoke-security-group-ingress \ 27 | --group-name ${SG_NAME} \ 28 | --cidr ${old_cidr} \ 29 | --protocol tcp \ 30 | --port 22 \ 31 | || RC=$? 32 | aws ec2 authorize-security-group-ingress \ 33 | --group-name ${SG_NAME} \ 34 | --cidr ${new_cidr} \ 35 | --protocol tcp \ 36 | --port 22 \ 37 | || RC=$? 38 | echo "old access ip " $old_cidr 39 | echo "new access ip " $new_cidr 40 | exit ${RC} 41 | --------------------------------------------------------------------------------