Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
CHANGELOG
=========

0.0.16
======
* feature:``cfncluster``: Support for GovCloud region
* updates:``cli``: Improved error messages parsing config file

0.0.15
======

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ everything is done using CloudFormation or resources within AWS.

### Installation

The current working version is cfncluster-0.0.15. 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.16. The CLI is written in python and uses BOTO for AWS actions. You can install the CLI with the following command:

#### Linux/OSX

Expand Down
45 changes: 33 additions & 12 deletions cli/cfncluster/cfnconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ def __init__(self, args):
try:
self.key_name = __config.get(self.__cluster_section, 'key_name')
if not self.key_name:
raise Exception
print("ERROR: key_name set in [%s] section but not defined." % self.__cluster_section)
sys.exit(1)
if self.__sanity_check:
config_sanity.check_resource(self.region,self.aws_access_key_id, self.aws_secret_access_key,
'EC2KeyPair', self.key_name)
except ConfigParser.NoOptionError:
raise Exception
print("ERROR: Missing key_name option in [%s] section." % self.__cluster_section)
sys.exit(1)
self.parameters.append(('KeyName', self.key_name))

# Determine the CloudFormation URL to be used
Expand All @@ -130,15 +132,21 @@ def __init__(self, args):
self.template_url = __config.get(self.__cluster_section,
'template_url')
if not self.template_url:
raise Exception
print("ERROR: template_url set in [%s] section but not defined." % self.__cluster_section)
sys.exit(1)
if self.__sanity_check:
config_sanity.check_resource(self.region,self.aws_access_key_id, self.aws_secret_access_key,
'URL', self.template_url)
except ConfigParser.NoOptionError:
if self.region == 'eu-central-1':
self.template_url = ('https://s3.%s.amazonaws.com/cfncluster-%s/templates/cfncluster-%s.cfn.json' % (self.region, self.region, self.version))
self.template_url = ('https://s3.%s.amazonaws.com/cfncluster-%s/templates/cfncluster-%s.cfn.json'
% (self.region, self.region, self.version))
elif self.region == 'us-gov-west-1':
self.template_url = ('https://s3-%s.amazonaws.com/cfncluster-%s/templates/cfncluster-%s.cfn.json'
% (self.region, self.region, self.version))
else:
self.template_url = ('https://s3.amazonaws.com/cfncluster-%s/templates/cfncluster-%s.cfn.json' % (self.region, self.version))
self.template_url = ('https://s3.amazonaws.com/cfncluster-%s/templates/cfncluster-%s.cfn.json'
% (self.region, self.version))
except AttributeError:
pass

Expand All @@ -149,15 +157,18 @@ def __init__(self, args):
# Dictionary list of all VPC options
self.__vpc_options = dict(vpc_id=('VPCId','VPC'), master_subnet_id=('MasterSubnetId', 'VPCSubnet'),
compute_subnet_cidr=('ComputeSubnetCidr',None),
compute_subnet_id=('ComputeSubnetId', 'VPCSubnet'), use_public_ips=('UsePublicIps', None),
compute_subnet_id=('ComputeSubnetId', 'VPCSubnet'), use_public_ips=('UsePublicIps',
None),
ssh_from=('SSHFrom', None))

# Loop over all VPC options and add define to parameters, raise Exception is defined but null
for key in self.__vpc_options:
try:
__temp__ = __config.get(self.__vpc_section, key)
if not __temp__:
raise Exception
print("ERROR: %s defined but not set in [%s] section"
% (key, self.__vpc_section))
sys.exit(1)
if self.__sanity_check and self.__vpc_options.get(key)[1] is not None:
config_sanity.check_resource(self.region,self.aws_access_key_id, self.aws_secret_access_key,
self.__vpc_options.get(key)[1],__temp__)
Expand All @@ -182,7 +193,9 @@ def __init__(self, args):
try:
__temp__ = __config.get(self.__cluster_section, key)
if not __temp__:
raise Exception
print("ERROR: %s defined but not set in [%s] section"
% (key, self.__cluster_section))
sys.exit(1)
if self.__sanity_check and self.__cluster_options.get(key)[1] is not None:
config_sanity.check_resource(self.region,self.aws_access_key_id, self.aws_secret_access_key,
self.__cluster_options.get(key)[1],__temp__)
Expand All @@ -194,7 +207,9 @@ def __init__(self, args):
try:
self.__ebs_settings = __config.get(self.__cluster_section, 'ebs_settings')
if not self.__ebs_settings:
raise Exception
print("ERROR: ebs_settings defined by not set in [%s] section"
% self.__cluster_section)
sys.exit(1)
self.__ebs_section = ('ebs %s' % self.__ebs_settings)
except ConfigParser.NoOptionError:
pass
Expand All @@ -210,7 +225,9 @@ def __init__(self, args):
try:
__temp__ = __config.get(self.__ebs_section, key)
if not __temp__:
raise Exception
print("ERROR: %s defined but not set in [%s] section"
% (key, self.__ebs_section))
sys.exit(1)
if self.__sanity_check and self.__ebs_options.get(key)[1] is not None:
config_sanity.check_resource(self.region,self.aws_access_key_id, self.aws_secret_access_key,
self.__ebs_options.get(key)[1],__temp__)
Expand All @@ -224,7 +241,9 @@ def __init__(self, args):
try:
self.__scaling_settings = __config.get(self.__cluster_section, 'scaling_settings')
if not self.__scaling_settings:
raise Exception
print("ERROR: scaling_settings defined by not set in [%s] section"
% self.__cluster_section)
sys.exit(1)
self.__scaling_section = ('scaling %s' % self.__scaling_settings)
except ConfigParser.NoOptionError:
pass
Expand All @@ -241,7 +260,9 @@ def __init__(self, args):
try:
__temp__ = __config.get(self.__scaling_section, key)
if not __temp__:
raise Exception
print("ERROR: %s defined but not set in [%s] section"
% (key, self.__scaling_section))
sys.exit(1)
if self.__sanity_check and self.__scaling_options.get(key)[1] is not None:
config_sanity.check_resource(self.region,self.aws_access_key_id, self.aws_secret_access_key,
self.__scaling_options.get(key)[1],__temp__)
Expand Down
2 changes: 1 addition & 1 deletion cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()

console_scripts = ['cfncluster = cfncluster.cli:main']
version = "0.0.15"
version = "0.0.16"
requires = ['boto>=2.34']

if sys.version_info[:2] == (2, 6):
Expand Down
177 changes: 177 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = build

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

clean:
rm -rf $(BUILDDIR)/*

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/cfncluster.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/cfncluster.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/cfncluster"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/cfncluster"
@echo "# devhelp"

epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."

info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."

changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

xml:
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
@echo
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."

pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
Loading