Skip to content

Commit 0432d01

Browse files
authored
Release 1.5.2
2 parents be9bda1 + 9a85915 commit 0432d01

32 files changed

+139
-126
lines changed

.kitchen.cloud.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ driver_config:
1515

1616
provisioner:
1717
name: chef_zero
18-
require_chef_omnibus: 12.19.36
18+
require_chef_omnibus: 14.2.0
1919
retry_on_exit_code:
2020
- 35 # 35 is the exit code signaling that the node is rebooting
2121
max_retries: 1
@@ -28,7 +28,7 @@ platforms:
2828
- name: amazon-linux-latest
2929
driver_plugin: ec2
3030
driver_config:
31-
image_id: ami-55ef662f
31+
image_id: <%= ENV['ALINUX_IMAGE_ID'] || "ami-55ef662f" %>
3232
block_device_mappings:
3333
- device_name: /dev/xvda
3434
ebs:
@@ -89,7 +89,7 @@ platforms:
8989
- name: centos-6-minimal
9090
driver_plugin: ec2
9191
driver_config:
92-
image_id: ami-9ff841e5
92+
image_id: <%= ENV['CENTOS6_IMAGE_ID'] || "ami-44f1aa3e" %>
9393
block_device_mappings:
9494
- device_name: /dev/sda1
9595
ebs:
@@ -150,7 +150,7 @@ platforms:
150150
- name: centos-7-minimal
151151
driver_plugin: ec2
152152
driver_config:
153-
image_id: ami-01098c7b
153+
image_id: <%= ENV['CENTOS7_IMAGE_ID'] || "ami-06fea57c" %>
154154
block_device_mappings:
155155
- device_name: /dev/sda1
156156
ebs:
@@ -211,7 +211,7 @@ platforms:
211211
- name: ubuntu-14-04-lts
212212
driver_plugin: ec2
213213
driver_config:
214-
image_id: ami-c29e1cb8
214+
image_id: <%= ENV['UBUNTU1404_IMAGE_ID'] || "ami-c29e1cb8" %>
215215
block_device_mappings:
216216
- device_name: /dev/sda1
217217
ebs:
@@ -272,7 +272,7 @@ platforms:
272272
- name: ubuntu-16-04-lts
273273
driver_plugin: ec2
274274
driver_config:
275-
image_id: ami-aa2ea6d0
275+
image_id: <%= ENV['UBUNTU1604_IMAGE_ID'] || "ami-aa2ea6d0" %>
276276
block_device_mappings:
277277
- device_name: /dev/sda1
278278
ebs:

.kitchen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ driver:
44

55
provisioner:
66
name: chef_zero
7-
require_chef_omnibus: 12.19.36
7+
require_chef_omnibus: 14.2.0
88

99
platforms:
1010
- name: centos-6.6

CHANGELOG.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ cfncluster-cookbook CHANGELOG
33

44
This file is used to list changes made in each version of the cfncluster cookbook.
55

6+
1.5.2
7+
-----
8+
9+
- Fix bug that prevented c5d/m5d instances from working
10+
- Set CPU as a consumable resource in slurm config
11+
612
1.5.1
713
-----
814

9-
Major new features/updates:
15+
Major new features/updates:
1016

1117
- Added parameter to specify custom cfncluster-node package
1218

@@ -27,21 +33,21 @@ Major new features/updates:
2733
1.4.0
2834
-----
2935

30-
Major new features/updates:
36+
Major new features/updates:
3137

3238
- Updated to Amazon Linux 2017.09.1
3339
- Applied patches to Ubuntu 16.04
3440
- Applied patches to Ubuntu 14.04
3541
- Updated to Centos 7.4
3642
- Upgraded Centos 6 AMI
37-
- Updated to Nvidia driver 384
43+
- Updated to Nvidia driver 384
3844
- Updated to CUDA 9
39-
- Updated to latest cfncluster-node 1.4.2
45+
- Updated to latest cfncluster-node 1.4.2
4046

4147
Bug fixes/minor improvements:
4248

4349
- Added support for NVMe-based instance store
44-
- Fixed ganglia plotting issue on ubuntu
50+
- Fixed ganglia plotting issue on ubuntu
4551
- Fixed slow SLURM scaling times on systemd platforms.
4652

4753
1.3.2

amis/build_ami.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public=$3
2525
build_date=$4
2626

2727
available_os="centos6 centos7 alinux ubuntu1404 ubuntu1604"
28-
available_regions="eu-west-1,eu-west-2,eu-west-3,ap-southeast-1,ap-southeast-2,eu-central-1,ap-northeast-1,ap-northeast-2,ap-northeast-3,us-west-2,sa-east-1,us-west-1,us-east-2,ap-south-1,ca-central-1"
28+
available_regions="$(aws ec2 --region us-east-1 describe-regions --query Regions[].RegionName --output text | tr '\t' ',')"
2929
cwd="$(dirname $0)"
3030
export VENDOR_PATH="${cwd}/../../vendor/cookbooks"
3131

amis/build_env_setup.sh

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

33
# This script sets up environment for building cfncluster ami
4-
# Launch Ec2 machine with amazon linux and run this script
4+
# Launch EC2 machine with amazon linux and run this script
55

66
# Get latest packages and Development tools
77
sudo yum -y update
88
sudo yum -y groupinstall 'Development Tools'
99

10-
# Get chefdk - As of now we use 1.4.3
11-
# Verify cookbook chef version in metadata.rb file
12-
# In case you see version mismatch, Please install
13-
# chefdk version referred in metadata file
14-
wget https://packages.chef.io/files/stable/chefdk/1.4.3/el/7/chefdk-1.4.3-1.el7.x86_64.rpm
15-
sudo rpm --install chefdk-1.4.3-1.el7.x86_64.rpm
10+
# Get chefdk
11+
# Verify cookbook chef version in packer_variables.json file
12+
wget https://packages.chef.io/files/stable/chefdk/3.0.36/el/7/chefdk-3.0.36-1.el7.x86_64.rpm
13+
sudo rpm --install chefdk-3.0.36-1.el7.x86_64.rpm
1614
chef -v
1715

1816
# Get Packer - tool used to build ami
19-
# As of now we use 1.1.1
20-
wget https://releases.hashicorp.com/packer/1.1.1/packer_1.1.1_linux_amd64.zip
21-
unzip packer_1.1.1_linux_amd64.zip
17+
wget https://releases.hashicorp.com/packer/1.2.4/packer_1.2.4_linux_amd64.zip
18+
unzip packer_1.2.4_linux_amd64.zip
2219
# Copy packer to PATH
2320
sudo cp packer /usr/local/bin/
2421
packer --version
@@ -28,7 +25,7 @@ packer --version
2825
# git clone https://github.com/awslabs/cfncluster-cookbook.git
2926
# cd cfncluster-cookbook
3027

31-
# Run ami builder script
28+
# Run ami builder script
3229
# ./build_ami.sh <operating_system> <region> <public/private>
3330
# example
3431
# ./build_ami.sh all us-east-1 private

amis/centos-upgrade-first-stage.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,12 @@ set +e
7676
echo "Disabling SELinux"
7777
sudo /bin/sed -r -i -e 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
7878

79-
# Updating GRUB to blacklist the neuvou driver (so the nVidia driver can
80-
# install) and turning off ifnames, because a bunch of the scripts expect
81-
# to find eth0. Should handle the eth naming better, but that's todo.
79+
# Updating GRUB to blacklist the nouveau driver (so the nVidia driver can install)
8280
echo "Updating Grub command line"
8381
if test $is_centos6 -eq 1; then
84-
sudo grubby --update-kernel=ALL --args="net.ifnames=0 rd.driver.blacklist=nouveau nouveau.modeset=0"
82+
sudo grubby --update-kernel=ALL --args="rd.driver.blacklist=nouveau nouveau.modeset=0"
8583
else
86-
sudo /bin/sed -r -i -e 's/GRUB_CMDLINE_LINUX="(.*)"/GRUB_CMDLINE_LINUX="\1 net.ifnames=0 rd.driver.blacklist=nouveau nouveau.modeset=0"/' /etc/default/grub
84+
sudo /bin/sed -r -i -e 's/GRUB_CMDLINE_LINUX="(.*)"/GRUB_CMDLINE_LINUX="\1 rd.driver.blacklist=nouveau nouveau.modeset=0"/' /etc/default/grub
8785
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
8886
fi
8987

amis/packer_alinux.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"nvidia_enabled" : "{{env `NVIDIA_ENABLED`}}",
1313
"instance_type" : "{{env `AWS_FLAVOR_ID`}}",
1414
"subnet_id" : "{{env `AWS_SUBNET_ID`}}",
15-
"vpc_id" : "{{env `AWS_VPC_ID`}}"
15+
"vpc_id" : "{{env `AWS_VPC_ID`}}",
16+
"ami_name_prefix" : "{{env `AMI_NAME_PREFIX`}}"
1617
},
1718
"builders" : [
1819
{
@@ -24,7 +25,7 @@
2425
"instance_type" : "{{user `instance_type`}}",
2526
"ssh_username" : "ec2-user",
2627
"ssh_pty" : true,
27-
"ami_name" : "cfncluster-{{user `cfncluster_version`}}-amzn-hvm-{{user `build_date`}}",
28+
"ami_name" : "{{user `ami_name_prefix`}}cfncluster-{{user `cfncluster_version`}}-amzn-hvm-{{user `build_date`}}",
2829
"subnet_id" : "{{user `subnet_id`}}",
2930
"vpc_id" : "{{user `vpc_id`}}",
3031
"skip_region_validation" : true,

amis/packer_centos6.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"nvidia_enabled" : "{{env `NVIDIA_ENABLED`}}",
1313
"instance_type" : "{{env `AWS_FLAVOR_ID`}}",
1414
"subnet_id" : "{{env `AWS_SUBNET_ID`}}",
15-
"vpc_id" : "{{env `AWS_VPC_ID`}}"
15+
"vpc_id" : "{{env `AWS_VPC_ID`}}",
16+
"ami_name_prefix" : "{{env `AMI_NAME_PREFIX`}}"
1617
},
1718
"builders" : [
1819
{
@@ -24,7 +25,7 @@
2425
"instance_type" : "{{user `instance_type`}}",
2526
"ssh_username" : "centos",
2627
"ssh_pty" : true,
27-
"ami_name" : "cfncluster-{{user `cfncluster_version`}}-centos6-hvm-{{user `build_date`}}",
28+
"ami_name" : "{{user `ami_name_prefix`}}cfncluster-{{user `cfncluster_version`}}-centos6-hvm-{{user `build_date`}}",
2829
"subnet_id" : "{{user `subnet_id`}}",
2930
"vpc_id" : "{{user `vpc_id`}}",
3031
"skip_region_validation" : true,

amis/packer_centos7.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"nvidia_enabled" : "{{env `NVIDIA_ENABLED`}}",
1313
"instance_type" : "{{env `AWS_FLAVOR_ID`}}",
1414
"subnet_id" : "{{env `AWS_SUBNET_ID`}}",
15-
"vpc_id" : "{{env `AWS_VPC_ID`}}"
15+
"vpc_id" : "{{env `AWS_VPC_ID`}}",
16+
"ami_name_prefix" : "{{env `AMI_NAME_PREFIX`}}"
1617
},
1718
"builders" : [
1819
{
@@ -24,7 +25,7 @@
2425
"instance_type" : "{{user `instance_type`}}",
2526
"ssh_username" : "centos",
2627
"ssh_pty" : true,
27-
"ami_name" : "cfncluster-{{user `cfncluster_version`}}-centos7-hvm-{{user `build_date`}}",
28+
"ami_name" : "{{user `ami_name_prefix`}}cfncluster-{{user `cfncluster_version`}}-centos7-hvm-{{user `build_date`}}",
2829
"subnet_id" : "{{user `subnet_id`}}",
2930
"vpc_id" : "{{user `vpc_id`}}",
3031
"skip_region_validation" : true,

amis/packer_ubuntu1404.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"nvidia_enabled" : "{{env `NVIDIA_ENABLED`}}",
1313
"instance_type" : "{{env `AWS_FLAVOR_ID`}}",
1414
"subnet_id" : "{{env `AWS_SUBNET_ID`}}",
15-
"vpc_id" : "{{env `AWS_VPC_ID`}}"
15+
"vpc_id" : "{{env `AWS_VPC_ID`}}",
16+
"ami_name_prefix" : "{{env `AMI_NAME_PREFIX`}}"
1617
},
1718
"builders" : [
1819
{
@@ -24,7 +25,7 @@
2425
"instance_type" : "{{user `instance_type`}}",
2526
"ssh_username" : "ubuntu",
2627
"ssh_pty" : true,
27-
"ami_name" : "cfncluster-{{user `cfncluster_version`}}-ubuntu-1404-lts-hvm-{{user `build_date`}}",
28+
"ami_name" : "{{user `ami_name_prefix`}}cfncluster-{{user `cfncluster_version`}}-ubuntu-1404-lts-hvm-{{user `build_date`}}",
2829
"subnet_id" : "{{user `subnet_id`}}",
2930
"vpc_id" : "{{user `vpc_id`}}",
3031
"skip_region_validation" : true,

amis/packer_ubuntu1604.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"nvidia_enabled" : "{{env `NVIDIA_ENABLED`}}",
1313
"instance_type" : "{{env `AWS_FLAVOR_ID`}}",
1414
"subnet_id" : "{{env `AWS_SUBNET_ID`}}",
15-
"vpc_id" : "{{env `AWS_VPC_ID`}}"
15+
"vpc_id" : "{{env `AWS_VPC_ID`}}",
16+
"ami_name_prefix" : "{{env `AMI_NAME_PREFIX`}}"
1617
},
1718
"builders" : [
1819
{
@@ -24,7 +25,7 @@
2425
"instance_type" : "{{user `instance_type`}}",
2526
"ssh_username" : "ubuntu",
2627
"ssh_pty" : true,
27-
"ami_name" : "cfncluster-{{user `cfncluster_version`}}-ubuntu-1604-lts-hvm-{{user `build_date`}}",
28+
"ami_name" : "{{user `ami_name_prefix`}}cfncluster-{{user `cfncluster_version`}}-ubuntu-1604-lts-hvm-{{user `build_date`}}",
2829
"subnet_id" : "{{user `subnet_id`}}",
2930
"vpc_id" : "{{user `vpc_id`}}",
3031
"skip_region_validation" : true,

amis/packer_variables.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"cfncluster_version": "1.5.1",
3-
"cfncluster_cookbook_version": "1.5.1",
4-
"chef_version": "12.19.36",
5-
"ridley_version": "5.1.0",
6-
"berkshelf_version": "5.6.4"
2+
"cfncluster_version": "1.5.2",
3+
"cfncluster_cookbook_version": "1.5.2",
4+
"chef_version": "14.2.0",
5+
"ridley_version": "5.1.1",
6+
"berkshelf_version": "7.0.4"
77
}

attributes/default.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
default['cfncluster']['scripts_dir'] = "#{node['cfncluster']['base_dir']}/scripts"
2020
default['cfncluster']['license_dir'] = "#{node['cfncluster']['base_dir']}/licenses"
2121
# Python packages
22-
default['cfncluster']['cfncluster-node-version'] = '1.5.1'
22+
default['cfncluster']['cfncluster-node-version'] = '1.5.2'
2323
default['cfncluster']['cfncluster-supervisor-version'] = '3.3.1'
2424
# URLs to software packages used during install receipes
2525
# Gridengine software
@@ -60,10 +60,10 @@
6060

6161
# Platform defaults
6262
case node['platform_family']
63-
when 'rhel'
63+
when 'rhel', 'amazon'
6464

6565
default['cfncluster']['kernel_devel_pkg']['name'] = "kernel-devel"
66-
default['cfncluster']['kernel_devel_pkg']['version'] = node['kernel']['release'].chomp!('.x86_64')
66+
default['cfncluster']['kernel_devel_pkg']['version'] = node['kernel']['release'].chomp('.x86_64')
6767

6868
case node['platform']
6969
when 'centos', 'redhat', 'scientific' # ~FC024

files/default/attachVolume.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44
import parted
55
import urllib2
6-
import boto.ec2
6+
import boto3
77
import time
88

99
# Get volumeId
@@ -30,24 +30,27 @@
3030
availableDevices = [a for a in blockDevices if a not in paths]
3131

3232
# Connect to AWS using boto
33-
conn = boto.ec2.connect_to_region(region)
33+
ec2 = boto3.client('ec2', region_name=region)
3434

3535
# Attach the volume
3636
dev = availableDevices[0].replace('xvd', 'sd')
37-
conn.attach_volume(volumeId,instanceId,dev)
37+
response = ec2.attach_volume(VolumeId=volumeId, InstanceId=instanceId, Device=dev)
3838

3939
# Poll for volume to attach
40-
vol = conn.get_all_volumes([volumeId])[0]
40+
state = response.get("State")
41+
4142
x = 0
42-
while vol.attachment_state() != "attached":
43+
while state != "attached":
4344
if x == 36:
4445
print "Volume %s failed to mount in 180 seconds." % (volumeId)
4546
exit(1)
46-
if vol.attachment_state() in ["busy" or "detached"]:
47-
print "Volume %s in bad state %s" % (volumeId, vol.attachment_state())
47+
if state in ["busy" or "detached"]:
48+
print "Volume %s in bad state %s" % (volumeId, state)
4849
exit(1)
49-
print "Volume %s in state %s ... waiting to be 'attached'" % (volumeId, vol.attachment_state())
50+
print "Volume %s in state %s ... waiting to be 'attached'" % (volumeId, state)
5051
time.sleep(5)
51-
vol = conn.get_all_volumes([volumeId])[0]
5252
x += 1
53-
53+
try:
54+
state = ec2.describe_volumes(VolumeIds=[volumeId]).get('Volumes')[0].get('Attachments')[0].get('State')
55+
except IndexError as e:
56+
continue

files/default/configure-pat.sh

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,39 @@
1212
# limitations under the License.
1313

1414
set -x
15-
echo "Determining the MAC address on eth0"
16-
ETH0_MAC=`ip addr show eth0 | grep -Po 'link/ether \K[\w:]+'`
15+
echo "Determining the MAC address"
16+
MAC=$(curl --retry 3 --retry-delay 0 --silent --fail http://169.254.169.254/latest/meta-data/mac)
1717
if [ $? -ne 0 ] ; then
18-
echo "Unable to determine MAC address on eth0" | logger -t "ec2"
18+
echo "Unable to determine MAC address" | logger -t "ec2"
1919
exit 1
2020
fi
21-
echo "Found MAC: ${ETH0_MAC} on eth0" | logger -t "ec2"
21+
echo "Found MAC: ${MAC} on the first network device" | logger -t "ec2"
2222

2323

24-
VPC_CIDR_URI="http://169.254.169.254/latest/meta-data/network/interfaces/macs/${ETH0_MAC}/vpc-ipv4-cidr-block"
24+
VPC_CIDR_URI="http://169.254.169.254/latest/meta-data/network/interfaces/macs/${MAC}/vpc-ipv4-cidr-block"
2525
echo "Metadata location for vpc ipv4 range: ${VPC_CIDR_URI}" | logger -t "ec2"
2626

27-
VPC_CIDR_RANGE=`curl --retry 3 --retry-delay 0 --silent --fail ${VPC_CIDR_URI}`
27+
VPC_CIDR_RANGE=$(curl --retry 3 --retry-delay 0 --silent --fail ${VPC_CIDR_URI})
2828
if [ $? -ne 0 ] ; then
2929
echo "Unable to retrive VPC CIDR range from meta-data. Using 0.0.0.0/0 instead. PAT may not function correctly" | logger -t "ec2"
3030
VPC_CIDR_RANGE="0.0.0.0/0"
3131
else
3232
echo "Retrived the VPC CIDR range: ${VPC_CIDR_RANGE} from meta-data" |logger -t "ec2"
3333
fi
3434

35+
36+
echo "Determining Network Interface name"
37+
INTERFACE_NAME=$(ip -o link | grep -i ${MAC} | cut -d' ' -f2 | sed 's/://')
38+
if [ $? -ne 0 ] ; then
39+
echo "Unable to determine Network Interface name" | logger -t "ec2"
40+
exit 1
41+
fi
42+
echo "Found Interface name: ${INTERFACE_NAME} associated to MAC ${MAC}" | logger -t "ec2"
43+
44+
3545
echo 1 > /proc/sys/net/ipv4/ip_forward && \
36-
echo 0 > /proc/sys/net/ipv4/conf/eth0/send_redirects && \
37-
/sbin/iptables -t nat -A POSTROUTING -o eth0 -s ${VPC_CIDR_RANGE} -j MASQUERADE
46+
echo 0 > /proc/sys/net/ipv4/conf/${INTERFACE_NAME}/send_redirects && \
47+
/sbin/iptables -t nat -A POSTROUTING -o ${INTERFACE_NAME} -s ${VPC_CIDR_RANGE} -j MASQUERADE
3848

3949
if [ $? -ne 0 ] ; then
4050
echo "Configuration of PAT failed" | logger -t "ec2"

0 commit comments

Comments
 (0)