Skip to content

Commit

Permalink
Merge pull request #10 from awslabs/develop
Browse files Browse the repository at this point in the history
Pull from develop for v0.0.10 release
  • Loading branch information
dougalb committed Aug 12, 2014
2 parents 998ac18 + 1cdb12b commit bbdf1b6
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 30 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
CHANGELOG
=========

0.0.10
======

* updates:``ami``: Pulled latest CentOS errata
* updates:``ami``: Updated packages to match base RHEL AMI's
* feature:``cli``: Improved region handling and added support for AWS_DEFAULT_REGION

0.0.9
=====

Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
cfncluster
==========

cfncluster is a sample code framework that deploys and maintains clusters on
cfncluster is a framework that deploys and maintains HPC clusters on
AWS. It is reasonably agnostic to what the cluster is for and can easily be
extended to support different frameworks. The the CLI is stateless,
everything is done using CloudFormation or resources within AWS.

### Installation

The current working version is cfncluster-0.0.8. The CLI is written in python and uses BOTO for AWS actions. You can install the CLI with the following command:
The current working version is cfncluster-0.0.10. The CLI is written in python and uses BOTO for AWS actions. You can install the CLI with the following command:

#### Linux/OSX

Expand All @@ -27,8 +27,6 @@ Install the following packages:

Python2.7 - https://www.python.org/download/

pyCrypto - http://www.voidspace.org.uk/python/modules.shtml#pycrypto

setuptools - https://pypi.python.org/pypi/setuptools#windows-7-or-graphical-install

Once installed, you should update the Environment Variables to have the Python install directory and Python Scripts directory in the PATH, for example: C:\Python27;C:\Python27\Scripts
Expand Down
16 changes: 8 additions & 8 deletions amis.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
us-west-2 ami-750f7645
eu-west-1 ami-7df5220a
sa-east-1 ami-7753fd6a
us-east-1 ami-0c458764
ap-northeast-1 ami-4f38684e
us-west-1 ami-1b8c8c5e
ap-southeast-1 ami-da4e1788
ap-southeast-2 ami-e5a9cedf
us-west-2 ami-ed5822dd
eu-west-1 ami-b04290c7
sa-east-1 ami-fde54de0
us-east-1 ami-208a5b48
ap-northeast-1 ami-75411874
us-west-1 ami-1b78755e
ap-southeast-1 ami-220e5570
ap-southeast-2 ami-c181e7fb
3 changes: 2 additions & 1 deletion cli/cfncluster/cfncluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ def create(args):
config.parameters.append(('ComputeWaitConditionCount', initial_queue_size))
except ValueError:
pass

capabilities = ["CAPABILITY_IAM"]
cfnconn = boto.cloudformation.connect_to_region(config.region,aws_access_key_id=config.aws_access_key_id,
aws_secret_access_key=config.aws_secret_access_key)
try:
logger.debug((config.template_url, config.parameters))
stack = cfnconn.create_stack(('cfncluster-' + args.cluster_name),template_url=config.template_url,
parameters=config.parameters, capabilities=capabilities,
disable_rollback=args.norollback)
disable_rollback=args.norollback, tags=args.tags)
status = cfnconn.describe_stacks(stack)[0].stack_status
if not args.nowait:
while status == 'CREATE_IN_PROGRESS':
Expand Down
13 changes: 8 additions & 5 deletions cli/cfncluster/cfnconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,17 @@ def __init__(self, args):
raise Exception

# Determine the EC2 region to used used or default to us-east-1
# Order is 1) CLI arg 2) Config file 3) us-east-1
# Order is 1) CLI arg 2) AWS_DEFAULT_REGION env 3) Config file 4) us-east-1
if args.region:
self.region = args.region
else:
try:
self.region = __config.get('aws', 'aws_region_name')
except ConfigParser.NoOptionError:
self.region = 'us-east-1'
if os.environ.get('AWS_DEFAULT_REGION'):
self.region = os.environ.get('AWS_DEFAULT_REGION')
else:
try:
self.region = __config.get('aws', 'aws_region_name')
except ConfigParser.NoOptionError:
self.region = 'us-east-1'

# Check if credentials have been provided in config
try:
Expand Down
2 changes: 1 addition & 1 deletion cli/cfncluster/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def main():
# add the handler to the root logger
logging.getLogger('cfncluster.cli').addHandler(console)

parser = argparse.ArgumentParser(description='cfncluster is the a tool to launch and manage cluster.')
parser = argparse.ArgumentParser(description='cfncluster is a tool to launch and manage a cluster.')
parser.add_argument("--config", "-c", dest="config_file", help='specify a alternative config file')
parser.add_argument( "--region", "-r", dest="region", help='specify a specific region to connect to',
default=None)
Expand Down
12 changes: 9 additions & 3 deletions cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and
# limitations under the License.

import os
import os, sys
from setuptools import setup, find_packages

# Utility function to read the README file.
Expand All @@ -20,7 +20,13 @@ def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()

console_scripts = ['cfncluster = cfncluster.cli:main']
version = "0.0.9"
version = "0.0.10"
requires = ['boto', 'botocore']

if sys.version_info[:2] == (2, 6):
# For python2.6 we have to require argparse since it
# was not in stdlib until 2.7.
requires.append('argparse>=1.1')

setup(
name = "cfncluster",
Expand All @@ -31,7 +37,7 @@ def read(fname):
url = ("https://github.com/awslabs/cfncluster"),
license = "Amazon Software License",
packages = find_packages(),
install_requires=['boto', 'argparse'],
install_requires = requires,
entry_points=dict(console_scripts=console_scripts),
include_package_data = True,
zip_safe = False,
Expand Down
16 changes: 8 additions & 8 deletions cloudformation/cfncluster.cfn.json
Original file line number Diff line number Diff line change
Expand Up @@ -588,28 +588,28 @@
},
"AWSRegionArch2AMI" : {
"eu-west-1" : {
"64HVM" : "ami-7df5220a"
"64HVM" : "ami-b04290c7"
},
"us-east-1" : {
"64HVM" : "ami-0c458764"
"64HVM" : "ami-208a5b48"
},
"ap-northeast-1" : {
"64HVM" : "ami-4f38684e"
"64HVM" : "ami-75411874"
},
"us-west-2" : {
"64HVM" : "ami-750f7645"
"64HVM" : "ami-ed5822dd"
},
"sa-east-1" : {
"64HVM" : "ami-7753fd6a"
"64HVM" : "ami-fde54de0"
},
"us-west-1" : {
"64HVM" : "ami-1b8c8c5e"
"64HVM" : "ami-1b78755e"
},
"ap-southeast-1" : {
"64HVM" : "ami-da4e1788"
"64HVM" : "ami-220e5570"
},
"ap-southeast-2" : {
"64HVM" : "ami-e5a9cedf"
"64HVM" : "ami-c181e7fb"
}
}
},
Expand Down

0 comments on commit bbdf1b6

Please sign in to comment.