Skip to content

Commit c6f5f87

Browse files
committed
PR from devlop for release v0.0.19
2 parents 22d112a + 9e9f0d8 commit c6f5f87

25 files changed

+876
-95
lines changed

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
CHANGELOG
33
=========
44

5+
0.0.19
6+
======
7+
* feature:``cli``: Added configure command; easy config setup
8+
* updates:``docs``: Addtional documentation for configuration options
9+
* updates:``ami``: Pulled latest CentOS6 errata
10+
* bugfix:``cfncluster``: Fixed issue with nodewatcher not scaling down
11+
512
0.0.18
613
======
714
* updates:``ami``: Custom CentOS 6 kernel repo added, support for >32 vCPUs

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ Documentation
77
=============
88

99
Documentation is part of the project and is published to - http://cfncluster.readthedocs.org/. Of most interest to new users is the Getting Started Guide - http://cfncluster.readthedocs.org/en/latest/getting_started.html.
10+
11+
Issues
12+
======
13+
14+
Any issues or feedback, should be posted in the AWS HPC forum - https://forums.aws.amazon.com/forum.jspa?forumID=192

amis.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
us-west-2 ami-87de82b7
2-
eu-central-1 ami-8c97a791
3-
sa-east-1 ami-2bdd6036
4-
ap-northeast-1 ami-a8d8c8a9
5-
eu-west-1 ami-f738be80
6-
us-east-1 ami-4ad6a522
7-
us-west-1 ami-298e916c
8-
ap-southeast-2 ami-efc4aed5
9-
ap-southeast-1 ami-705a7222
10-
us-gov-west-1 ami-5fcfa97c
1+
us-west-2 ami-ab7f599b
2+
eu-central-1 ami-b43705a9
3+
sa-east-1 ami-818b359c
4+
ap-northeast-1 ami-891bfb89
5+
eu-west-1 ami-87fd69f0
6+
us-east-1 ami-7660361e
7+
us-west-1 ami-86b0aac3
8+
ap-southeast-2 ami-7d730547
9+
ap-southeast-1 ami-fafcc8a8
10+
us-gov-west-1 ami-5d68097e

bootstrap/src/scripts/boot_as_compute

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ set -x
1515

1616
# Source config
1717
. /opt/cfncluster/cfnconfig
18+
cfn_master=$(echo $cfn_master|cut -d. -f1)
1819

1920
# Source functions
2021
. /opt/cfncluster/scripts/functions.shlib

bootstrap/src/scripts/openlava/boot_as_compute

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
set -x
1515

1616
. /opt/cfncluster/cfnconfig
17+
cfn_master=$(echo $cfn_master|cut -d. -f1)
1718

1819
function error_exit () {
1920
script=`basename $0`

bootstrap/src/scripts/sge/boot_as_compute

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
set -x
1515

1616
. /opt/cfncluster/cfnconfig
17+
cfn_master=$(echo $cfn_master|cut -d. -f1)
1718

1819
# Source functions
1920
. /opt/cfncluster/scripts/functions.shlib

bootstrap/src/scripts/torque/boot_as_compute

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
set -x
1515

1616
. /opt/cfncluster/cfnconfig
17+
cfn_master=$(echo $cfn_master|cut -d. -f1)
1718

1819
function error_exit () {
1920
script=`basename $0`

cli/cfncluster/cfnconfig.py

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,20 @@
1414
import sys
1515
import inspect
1616
import pkg_resources
17-
import logging
1817
import json
1918
import urllib2
2019
import config_sanity
20+
import boto.cloudformation
21+
22+
def getStackTemplate(region, aws_access_key_id, aws_secret_access_key, stack):
23+
24+
cfn_conn = boto.cloudformation.connect_to_region(region,aws_access_key_id=aws_access_key_id,
25+
aws_secret_access_key=aws_secret_access_key)
26+
__stack_name = ('cfncluster-' + stack)
27+
__stack = cfn_conn.describe_stacks(stack_name_or_id=__stack_name)[0]
28+
__cli_template = [p.value for p in __stack.parameters if p.key == 'CLITemplate'][0]
29+
30+
return __cli_template
2131

2232
class CfnClusterConfig:
2333

@@ -26,6 +36,7 @@ def __init__(self, args):
2636
self.parameters = []
2737
self.version = pkg_resources.get_distribution("cfncluster").version
2838
self.__DEFAULT_CONFIG = False
39+
__args_func = self.args.func.func_name
2940

3041
# Determine config file name based on args or default
3142
if args.config_file is not None:
@@ -50,12 +61,39 @@ def __init__(self, args):
5061
__config = ConfigParser.ConfigParser()
5162
__config.read(self.__config_file)
5263

64+
# Determine the EC2 region to used used or default to us-east-1
65+
# Order is 1) CLI arg 2) AWS_DEFAULT_REGION env 3) Config file 4) us-east-1
66+
if args.region:
67+
self.region = args.region
68+
else:
69+
if os.environ.get('AWS_DEFAULT_REGION'):
70+
self.region = os.environ.get('AWS_DEFAULT_REGION')
71+
else:
72+
try:
73+
self.region = __config.get('aws', 'aws_region_name')
74+
except ConfigParser.NoOptionError:
75+
self.region = 'us-east-1'
76+
77+
# Check if credentials have been provided in config
78+
try:
79+
self.aws_access_key_id = __config.get('aws', 'aws_access_key_id')
80+
except ConfigParser.NoOptionError:
81+
self.aws_access_key_id=None
82+
try:
83+
self.aws_secret_access_key = __config.get('aws', 'aws_secret_access_key')
84+
except ConfigParser.NoOptionError:
85+
self.aws_secret_access_key=None
86+
5387
# Determine which cluster template will be used
5488
try:
5589
if args.cluster_template is not None:
5690
self.__cluster_template = args.cluster_template
5791
else:
58-
self.__cluster_template = __config.get('global', 'cluster_template')
92+
if __args_func == 'update':
93+
self.__cluster_template = getStackTemplate(self.region,self.aws_access_key_id,
94+
self.aws_secret_access_key, self.args.cluster_name)
95+
else:
96+
self.__cluster_template = __config.get('global', 'cluster_template')
5997
except AttributeError:
6098
self.__cluster_template = __config.get('global', 'cluster_template')
6199
self.__cluster_section = ('cluster %s' % self.__cluster_template)
@@ -82,34 +120,11 @@ def __init__(self, args):
82120
self.__sanity_check = False
83121
# Only check config on calls that mutate it
84122
__args_func = self.args.func.func_name
85-
if (__args_func == 'create' or __args_func == 'update') and self.__sanity_check is True:
123+
if (__args_func == 'create' or __args_func == 'update' or __args_func == 'configure') and self.__sanity_check is True:
86124
pass
87125
else:
88126
self.__sanity_check = False
89127

90-
# Determine the EC2 region to used used or default to us-east-1
91-
# Order is 1) CLI arg 2) AWS_DEFAULT_REGION env 3) Config file 4) us-east-1
92-
if args.region:
93-
self.region = args.region
94-
else:
95-
if os.environ.get('AWS_DEFAULT_REGION'):
96-
self.region = os.environ.get('AWS_DEFAULT_REGION')
97-
else:
98-
try:
99-
self.region = __config.get('aws', 'aws_region_name')
100-
except ConfigParser.NoOptionError:
101-
self.region = 'us-east-1'
102-
103-
# Check if credentials have been provided in config
104-
try:
105-
self.aws_access_key_id = __config.get('aws', 'aws_access_key_id')
106-
except ConfigParser.NoOptionError:
107-
self.aws_access_key_id=None
108-
try:
109-
self.aws_secret_access_key = __config.get('aws', 'aws_secret_access_key')
110-
except ConfigParser.NoOptionError:
111-
self.aws_secret_access_key=None
112-
113128
# Get the EC2 keypair name to be used, exit if not set
114129
try:
115130
self.key_name = __config.get(self.__cluster_section, 'key_name')

cli/cfncluster/cli.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@
1616
import json
1717

1818
import cfncluster
19+
import easyconfig
1920

2021
def create(args):
2122
cfncluster.create(args)
2223

24+
def configure(args):
25+
easyconfig.configure(args)
26+
2327
def status(args):
2428
cfncluster.status(args)
2529

@@ -121,9 +125,12 @@ def main():
121125
help='show the status of cfncluster with the provided name.')
122126
pinstances.set_defaults(func=instances)
123127

128+
pconfigure = subparsers.add_parser('configure', help='creating initial cfncluster configuration')
129+
pconfigure.set_defaults(func=configure)
130+
124131
pversion = subparsers.add_parser('version', help='display version of cfncluster')
125132
pversion.set_defaults(func=version)
126133

127134
args = parser.parse_args()
128135
logging.debug(args)
129-
args.func(args)
136+
args.func(args)

cli/cfncluster/config_sanity.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ def check_resource(region, aws_access_key_id, aws_secret_access_key, resource_ty
3939
except boto.exception.BotoServerError as e:
4040
print('Config sanity error: %s' % e.message)
4141
sys.exit(1)
42+
# Check for DNS support in the VPC
43+
if not vpc_conn.describe_vpc_attribute(test[0].id, attribute='enableDnsSupport').enable_dns_support:
44+
print("DNS Support is not enabled in %s" % test[0].id)
45+
sys.exit(1)
46+
if not vpc_conn.describe_vpc_attribute(test[0].id, attribute='enableDnsHostnames').enable_dns_hostnames:
47+
print("DNS Hostnames not enabled in %s" % test[0].id)
48+
sys.exit(1)
4249
# VPC Subnet Id
4350
elif resource_type == 'VPCSubnet':
4451
try:

0 commit comments

Comments
 (0)