Skip to content

Commit

Permalink
Release 1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-smith authored Jul 24, 2018
2 parents be9bda1 + 9a85915 commit 0432d01
Show file tree
Hide file tree
Showing 32 changed files with 139 additions and 126 deletions.
12 changes: 6 additions & 6 deletions .kitchen.cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ driver_config:

provisioner:
name: chef_zero
require_chef_omnibus: 12.19.36
require_chef_omnibus: 14.2.0
retry_on_exit_code:
- 35 # 35 is the exit code signaling that the node is rebooting
max_retries: 1
Expand All @@ -28,7 +28,7 @@ platforms:
- name: amazon-linux-latest
driver_plugin: ec2
driver_config:
image_id: ami-55ef662f
image_id: <%= ENV['ALINUX_IMAGE_ID'] || "ami-55ef662f" %>
block_device_mappings:
- device_name: /dev/xvda
ebs:
Expand Down Expand Up @@ -89,7 +89,7 @@ platforms:
- name: centos-6-minimal
driver_plugin: ec2
driver_config:
image_id: ami-9ff841e5
image_id: <%= ENV['CENTOS6_IMAGE_ID'] || "ami-44f1aa3e" %>
block_device_mappings:
- device_name: /dev/sda1
ebs:
Expand Down Expand Up @@ -150,7 +150,7 @@ platforms:
- name: centos-7-minimal
driver_plugin: ec2
driver_config:
image_id: ami-01098c7b
image_id: <%= ENV['CENTOS7_IMAGE_ID'] || "ami-06fea57c" %>
block_device_mappings:
- device_name: /dev/sda1
ebs:
Expand Down Expand Up @@ -211,7 +211,7 @@ platforms:
- name: ubuntu-14-04-lts
driver_plugin: ec2
driver_config:
image_id: ami-c29e1cb8
image_id: <%= ENV['UBUNTU1404_IMAGE_ID'] || "ami-c29e1cb8" %>
block_device_mappings:
- device_name: /dev/sda1
ebs:
Expand Down Expand Up @@ -272,7 +272,7 @@ platforms:
- name: ubuntu-16-04-lts
driver_plugin: ec2
driver_config:
image_id: ami-aa2ea6d0
image_id: <%= ENV['UBUNTU1604_IMAGE_ID'] || "ami-aa2ea6d0" %>
block_device_mappings:
- device_name: /dev/sda1
ebs:
Expand Down
2 changes: 1 addition & 1 deletion .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ driver:

provisioner:
name: chef_zero
require_chef_omnibus: 12.19.36
require_chef_omnibus: 14.2.0

platforms:
- name: centos-6.6
Expand Down
16 changes: 11 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ cfncluster-cookbook CHANGELOG

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

1.5.2
-----

- Fix bug that prevented c5d/m5d instances from working
- Set CPU as a consumable resource in slurm config

1.5.1
-----

Major new features/updates:
Major new features/updates:

- Added parameter to specify custom cfncluster-node package

Expand All @@ -27,21 +33,21 @@ Major new features/updates:
1.4.0
-----

Major new features/updates:
Major new features/updates:

- Updated to Amazon Linux 2017.09.1
- Applied patches to Ubuntu 16.04
- Applied patches to Ubuntu 14.04
- Updated to Centos 7.4
- Upgraded Centos 6 AMI
- Updated to Nvidia driver 384
- Updated to Nvidia driver 384
- Updated to CUDA 9
- Updated to latest cfncluster-node 1.4.2
- Updated to latest cfncluster-node 1.4.2

Bug fixes/minor improvements:

- Added support for NVMe-based instance store
- Fixed ganglia plotting issue on ubuntu
- Fixed ganglia plotting issue on ubuntu
- Fixed slow SLURM scaling times on systemd platforms.

1.3.2
Expand Down
2 changes: 1 addition & 1 deletion amis/build_ami.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public=$3
build_date=$4

available_os="centos6 centos7 alinux ubuntu1404 ubuntu1604"
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"
available_regions="$(aws ec2 --region us-east-1 describe-regions --query Regions[].RegionName --output text | tr '\t' ',')"
cwd="$(dirname $0)"
export VENDOR_PATH="${cwd}/../../vendor/cookbooks"

Expand Down
19 changes: 8 additions & 11 deletions amis/build_env_setup.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
#!/bin/bash

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

# Get latest packages and Development tools
sudo yum -y update
sudo yum -y groupinstall 'Development Tools'

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

# Get Packer - tool used to build ami
# As of now we use 1.1.1
wget https://releases.hashicorp.com/packer/1.1.1/packer_1.1.1_linux_amd64.zip
unzip packer_1.1.1_linux_amd64.zip
wget https://releases.hashicorp.com/packer/1.2.4/packer_1.2.4_linux_amd64.zip
unzip packer_1.2.4_linux_amd64.zip
# Copy packer to PATH
sudo cp packer /usr/local/bin/
packer --version
Expand All @@ -28,7 +25,7 @@ packer --version
# git clone https://github.com/awslabs/cfncluster-cookbook.git
# cd cfncluster-cookbook

# Run ami builder script
# Run ami builder script
# ./build_ami.sh <operating_system> <region> <public/private>
# example
# ./build_ami.sh all us-east-1 private
8 changes: 3 additions & 5 deletions amis/centos-upgrade-first-stage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,12 @@ set +e
echo "Disabling SELinux"
sudo /bin/sed -r -i -e 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config

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

Expand Down
5 changes: 3 additions & 2 deletions amis/packer_alinux.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"nvidia_enabled" : "{{env `NVIDIA_ENABLED`}}",
"instance_type" : "{{env `AWS_FLAVOR_ID`}}",
"subnet_id" : "{{env `AWS_SUBNET_ID`}}",
"vpc_id" : "{{env `AWS_VPC_ID`}}"
"vpc_id" : "{{env `AWS_VPC_ID`}}",
"ami_name_prefix" : "{{env `AMI_NAME_PREFIX`}}"
},
"builders" : [
{
Expand All @@ -24,7 +25,7 @@
"instance_type" : "{{user `instance_type`}}",
"ssh_username" : "ec2-user",
"ssh_pty" : true,
"ami_name" : "cfncluster-{{user `cfncluster_version`}}-amzn-hvm-{{user `build_date`}}",
"ami_name" : "{{user `ami_name_prefix`}}cfncluster-{{user `cfncluster_version`}}-amzn-hvm-{{user `build_date`}}",
"subnet_id" : "{{user `subnet_id`}}",
"vpc_id" : "{{user `vpc_id`}}",
"skip_region_validation" : true,
Expand Down
5 changes: 3 additions & 2 deletions amis/packer_centos6.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"nvidia_enabled" : "{{env `NVIDIA_ENABLED`}}",
"instance_type" : "{{env `AWS_FLAVOR_ID`}}",
"subnet_id" : "{{env `AWS_SUBNET_ID`}}",
"vpc_id" : "{{env `AWS_VPC_ID`}}"
"vpc_id" : "{{env `AWS_VPC_ID`}}",
"ami_name_prefix" : "{{env `AMI_NAME_PREFIX`}}"
},
"builders" : [
{
Expand All @@ -24,7 +25,7 @@
"instance_type" : "{{user `instance_type`}}",
"ssh_username" : "centos",
"ssh_pty" : true,
"ami_name" : "cfncluster-{{user `cfncluster_version`}}-centos6-hvm-{{user `build_date`}}",
"ami_name" : "{{user `ami_name_prefix`}}cfncluster-{{user `cfncluster_version`}}-centos6-hvm-{{user `build_date`}}",
"subnet_id" : "{{user `subnet_id`}}",
"vpc_id" : "{{user `vpc_id`}}",
"skip_region_validation" : true,
Expand Down
5 changes: 3 additions & 2 deletions amis/packer_centos7.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"nvidia_enabled" : "{{env `NVIDIA_ENABLED`}}",
"instance_type" : "{{env `AWS_FLAVOR_ID`}}",
"subnet_id" : "{{env `AWS_SUBNET_ID`}}",
"vpc_id" : "{{env `AWS_VPC_ID`}}"
"vpc_id" : "{{env `AWS_VPC_ID`}}",
"ami_name_prefix" : "{{env `AMI_NAME_PREFIX`}}"
},
"builders" : [
{
Expand All @@ -24,7 +25,7 @@
"instance_type" : "{{user `instance_type`}}",
"ssh_username" : "centos",
"ssh_pty" : true,
"ami_name" : "cfncluster-{{user `cfncluster_version`}}-centos7-hvm-{{user `build_date`}}",
"ami_name" : "{{user `ami_name_prefix`}}cfncluster-{{user `cfncluster_version`}}-centos7-hvm-{{user `build_date`}}",
"subnet_id" : "{{user `subnet_id`}}",
"vpc_id" : "{{user `vpc_id`}}",
"skip_region_validation" : true,
Expand Down
5 changes: 3 additions & 2 deletions amis/packer_ubuntu1404.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"nvidia_enabled" : "{{env `NVIDIA_ENABLED`}}",
"instance_type" : "{{env `AWS_FLAVOR_ID`}}",
"subnet_id" : "{{env `AWS_SUBNET_ID`}}",
"vpc_id" : "{{env `AWS_VPC_ID`}}"
"vpc_id" : "{{env `AWS_VPC_ID`}}",
"ami_name_prefix" : "{{env `AMI_NAME_PREFIX`}}"
},
"builders" : [
{
Expand All @@ -24,7 +25,7 @@
"instance_type" : "{{user `instance_type`}}",
"ssh_username" : "ubuntu",
"ssh_pty" : true,
"ami_name" : "cfncluster-{{user `cfncluster_version`}}-ubuntu-1404-lts-hvm-{{user `build_date`}}",
"ami_name" : "{{user `ami_name_prefix`}}cfncluster-{{user `cfncluster_version`}}-ubuntu-1404-lts-hvm-{{user `build_date`}}",
"subnet_id" : "{{user `subnet_id`}}",
"vpc_id" : "{{user `vpc_id`}}",
"skip_region_validation" : true,
Expand Down
5 changes: 3 additions & 2 deletions amis/packer_ubuntu1604.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"nvidia_enabled" : "{{env `NVIDIA_ENABLED`}}",
"instance_type" : "{{env `AWS_FLAVOR_ID`}}",
"subnet_id" : "{{env `AWS_SUBNET_ID`}}",
"vpc_id" : "{{env `AWS_VPC_ID`}}"
"vpc_id" : "{{env `AWS_VPC_ID`}}",
"ami_name_prefix" : "{{env `AMI_NAME_PREFIX`}}"
},
"builders" : [
{
Expand All @@ -24,7 +25,7 @@
"instance_type" : "{{user `instance_type`}}",
"ssh_username" : "ubuntu",
"ssh_pty" : true,
"ami_name" : "cfncluster-{{user `cfncluster_version`}}-ubuntu-1604-lts-hvm-{{user `build_date`}}",
"ami_name" : "{{user `ami_name_prefix`}}cfncluster-{{user `cfncluster_version`}}-ubuntu-1604-lts-hvm-{{user `build_date`}}",
"subnet_id" : "{{user `subnet_id`}}",
"vpc_id" : "{{user `vpc_id`}}",
"skip_region_validation" : true,
Expand Down
10 changes: 5 additions & 5 deletions amis/packer_variables.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"cfncluster_version": "1.5.1",
"cfncluster_cookbook_version": "1.5.1",
"chef_version": "12.19.36",
"ridley_version": "5.1.0",
"berkshelf_version": "5.6.4"
"cfncluster_version": "1.5.2",
"cfncluster_cookbook_version": "1.5.2",
"chef_version": "14.2.0",
"ridley_version": "5.1.1",
"berkshelf_version": "7.0.4"
}
6 changes: 3 additions & 3 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
default['cfncluster']['scripts_dir'] = "#{node['cfncluster']['base_dir']}/scripts"
default['cfncluster']['license_dir'] = "#{node['cfncluster']['base_dir']}/licenses"
# Python packages
default['cfncluster']['cfncluster-node-version'] = '1.5.1'
default['cfncluster']['cfncluster-node-version'] = '1.5.2'
default['cfncluster']['cfncluster-supervisor-version'] = '3.3.1'
# URLs to software packages used during install receipes
# Gridengine software
Expand Down Expand Up @@ -60,10 +60,10 @@

# Platform defaults
case node['platform_family']
when 'rhel'
when 'rhel', 'amazon'

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

case node['platform']
when 'centos', 'redhat', 'scientific' # ~FC024
Expand Down
23 changes: 13 additions & 10 deletions files/default/attachVolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
import parted
import urllib2
import boto.ec2
import boto3
import time

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

# Connect to AWS using boto
conn = boto.ec2.connect_to_region(region)
ec2 = boto3.client('ec2', region_name=region)

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

# Poll for volume to attach
vol = conn.get_all_volumes([volumeId])[0]
state = response.get("State")

x = 0
while vol.attachment_state() != "attached":
while state != "attached":
if x == 36:
print "Volume %s failed to mount in 180 seconds." % (volumeId)
exit(1)
if vol.attachment_state() in ["busy" or "detached"]:
print "Volume %s in bad state %s" % (volumeId, vol.attachment_state())
if state in ["busy" or "detached"]:
print "Volume %s in bad state %s" % (volumeId, state)
exit(1)
print "Volume %s in state %s ... waiting to be 'attached'" % (volumeId, vol.attachment_state())
print "Volume %s in state %s ... waiting to be 'attached'" % (volumeId, state)
time.sleep(5)
vol = conn.get_all_volumes([volumeId])[0]
x += 1

try:
state = ec2.describe_volumes(VolumeIds=[volumeId]).get('Volumes')[0].get('Attachments')[0].get('State')
except IndexError as e:
continue
26 changes: 18 additions & 8 deletions files/default/configure-pat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,39 @@
# limitations under the License.

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


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

VPC_CIDR_RANGE=`curl --retry 3 --retry-delay 0 --silent --fail ${VPC_CIDR_URI}`
VPC_CIDR_RANGE=$(curl --retry 3 --retry-delay 0 --silent --fail ${VPC_CIDR_URI})
if [ $? -ne 0 ] ; then
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"
VPC_CIDR_RANGE="0.0.0.0/0"
else
echo "Retrived the VPC CIDR range: ${VPC_CIDR_RANGE} from meta-data" |logger -t "ec2"
fi


echo "Determining Network Interface name"
INTERFACE_NAME=$(ip -o link | grep -i ${MAC} | cut -d' ' -f2 | sed 's/://')
if [ $? -ne 0 ] ; then
echo "Unable to determine Network Interface name" | logger -t "ec2"
exit 1
fi
echo "Found Interface name: ${INTERFACE_NAME} associated to MAC ${MAC}" | logger -t "ec2"


echo 1 > /proc/sys/net/ipv4/ip_forward && \
echo 0 > /proc/sys/net/ipv4/conf/eth0/send_redirects && \
/sbin/iptables -t nat -A POSTROUTING -o eth0 -s ${VPC_CIDR_RANGE} -j MASQUERADE
echo 0 > /proc/sys/net/ipv4/conf/${INTERFACE_NAME}/send_redirects && \
/sbin/iptables -t nat -A POSTROUTING -o ${INTERFACE_NAME} -s ${VPC_CIDR_RANGE} -j MASQUERADE

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

0 comments on commit 0432d01

Please sign in to comment.