From 49bde0e712910759a24cc7df93611b84bd4d848e Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Wed, 29 Oct 2014 10:51:39 -0700 Subject: [PATCH 1/5] setting version to 0.0.99 for develop --- cli/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/setup.py b/cli/setup.py index 474292eaab..f481403ec3 100644 --- a/cli/setup.py +++ b/cli/setup.py @@ -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.99" requires = ['boto>=2.34'] if sys.version_info[:2] == (2, 6): From 7f7973d3d71da59d29eb09972383d4164b8cf1a0 Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Tue, 4 Nov 2014 21:16:19 -0800 Subject: [PATCH 2/5] Support for GovCloud, improved error messages parsing config. --- CHANGELOG.rst | 5 +++++ README.md | 2 +- cli/cfncluster/cfnconfig.py | 45 +++++++++++++++++++++++++++---------- cli/setup.py | 2 +- 4 files changed, 40 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a1cc2226e0..cfa5005d86 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 ====== diff --git a/README.md b/README.md index c264ec2b2b..993ecc2af3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/cli/cfncluster/cfnconfig.py b/cli/cfncluster/cfnconfig.py index dc188d3e6e..0517779c4d 100644 --- a/cli/cfncluster/cfnconfig.py +++ b/cli/cfncluster/cfnconfig.py @@ -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 @@ -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 @@ -149,7 +157,8 @@ 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 @@ -157,7 +166,9 @@ def __init__(self, args): 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__) @@ -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__) @@ -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 @@ -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__) @@ -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 @@ -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__) diff --git a/cli/setup.py b/cli/setup.py index f481403ec3..5d5e9f1cf9 100644 --- a/cli/setup.py +++ b/cli/setup.py @@ -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.99" +version = "0.0.16" requires = ['boto>=2.34'] if sys.version_info[:2] == (2, 6): From 559bff5f0fa45eda84180ce0891295f232f79fee Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Wed, 5 Nov 2014 07:43:16 -0800 Subject: [PATCH 3/5] Initial stub for docs, publishing to cfncluster.readthedocs.org --- docs/Makefile | 95 +++++++++++++++++++++++++++++++++++++++++++ docs/source/index.rst | 12 ++++++ 2 files changed, 107 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/source/index.rst diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000000..40ab48ad08 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,95 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source + +.PHONY: help clean html dirhtml pickle json epub htmlhelp qthelp latex changes linkcheck doctest + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " epub to make ePub files (sphinx >= v1.2b2)" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " changes to make an overview of all changed/added/deprecated items" + @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." + +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." + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The e-Pub pages are in $(BUILDDIR)/epub." + +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/boto.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/boto.qhc" + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ + "run these through (pdf)latex." + +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." \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000000..d21938a433 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,12 @@ +.. _index: + +======================================================================= +cfncluster: A framework that deploys and maintains HPC clusters on AWS. +======================================================================= + +Getting Started +--------------- + +If you've never used ``cfncluster`` before, you should read the +:doc:`Getting Started with cfncluster ` guide to get familiar +with ``cfncluster`` & its usage. \ No newline at end of file From 873dd7d1e045bbe0ff9f30bfb7b5991fecb3db83 Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Wed, 5 Nov 2014 07:57:44 -0800 Subject: [PATCH 4/5] Correctly initalized docs with sphinx-quickstart --- docs/Makefile | 128 +++++++++++++--- docs/make.bat | 242 +++++++++++++++++++++++++++++++ docs/source/conf.py | 330 ++++++++++++++++++++++++++++++++++++++++++ docs/source/index.rst | 28 ++-- 4 files changed, 696 insertions(+), 32 deletions(-) create mode 100644 docs/make.bat create mode 100644 docs/source/conf.py diff --git a/docs/Makefile b/docs/Makefile index 40ab48ad08..c2d9be9aa1 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -7,29 +7,47 @@ 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 pickle json epub htmlhelp qthelp latex changes linkcheck doctest +.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 ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " epub to make ePub files (sphinx >= v1.2b2)" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @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)/* + rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @@ -41,6 +59,11 @@ 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 @@ -51,11 +74,6 @@ json: @echo @echo "Build finished; now you can process the JSON files." -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The e-Pub pages are in $(BUILDDIR)/epub." - htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @@ -67,16 +85,70 @@ qthelp: @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/boto.qhcp" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/cfncluster.qhcp" @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/boto.qhc" + @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 all-pdf' or \`make all-ps' in that directory to" \ - "run these through (pdf)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 @@ -92,4 +164,14 @@ linkcheck: doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." \ No newline at end of file + "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." diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000000..26171d16ce --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,242 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source +set I18NSPHINXOPTS=%SPHINXOPTS% source +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ 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. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over 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 + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + + +%SPHINXBUILD% 2> nul +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + 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.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdf" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf + cd %BUILDDIR%/.. + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdfja" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf-ja + cd %BUILDDIR%/.. + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +if "%1" == "xml" ( + %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The XML files are in %BUILDDIR%/xml. + goto end +) + +if "%1" == "pseudoxml" ( + %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. + goto end +) + +:end diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000000..be3eeeca44 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,330 @@ +# -*- coding: utf-8 -*- +# +# cfncluster documentation build configuration file, created by +# sphinx-quickstart on Wed Nov 5 07:56:13 2014. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.todo', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'cfncluster' +copyright = u'2014, Dougal Ballantyne' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '0.0' +# The full version, including alpha/beta/rc tags. +release = '16' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = [] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +#keep_warnings = False + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +#html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'cfnclusterdoc' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ('index', 'cfncluster.tex', u'cfncluster Documentation', + u'Dougal Ballantyne', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'cfncluster', u'cfncluster Documentation', + [u'Dougal Ballantyne'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'cfncluster', u'cfncluster Documentation', + u'Dougal Ballantyne', 'cfncluster', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +#texinfo_no_detailmenu = False + + +# -- Options for Epub output ---------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = u'cfncluster' +epub_author = u'Dougal Ballantyne' +epub_publisher = u'Dougal Ballantyne' +epub_copyright = u'2014, Dougal Ballantyne' + +# The basename for the epub file. It defaults to the project name. +#epub_basename = u'cfncluster' + +# The HTML theme for the epub output. Since the default themes are not optimized +# for small screen space, using the same theme for HTML and epub output is +# usually not wise. This defaults to 'epub', a theme designed to save visual +# space. +#epub_theme = 'epub' + +# The language of the text. It defaults to the language option +# or en if the language is not set. +#epub_language = '' + +# The scheme of the identifier. Typical schemes are ISBN or URL. +#epub_scheme = '' + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +#epub_identifier = '' + +# A unique identification for the text. +#epub_uid = '' + +# A tuple containing the cover image and cover page html template filenames. +#epub_cover = () + +# A sequence of (type, uri, title) tuples for the guide element of content.opf. +#epub_guide = () + +# HTML files that should be inserted before the pages created by sphinx. +# The format is a list of tuples containing the path and title. +#epub_pre_files = [] + +# HTML files shat should be inserted after the pages created by sphinx. +# The format is a list of tuples containing the path and title. +#epub_post_files = [] + +# A list of files that should not be packed into the epub file. +epub_exclude_files = ['search.html'] + +# The depth of the table of contents in toc.ncx. +#epub_tocdepth = 3 + +# Allow duplicate toc entries. +#epub_tocdup = True + +# Choose between 'default' and 'includehidden'. +#epub_tocscope = 'default' + +# Fix unsupported image types using the PIL. +#epub_fix_images = False + +# Scale large images. +#epub_max_image_width = 0 + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#epub_show_urls = 'inline' + +# If false, no index is generated. +#epub_use_index = True diff --git a/docs/source/index.rst b/docs/source/index.rst index d21938a433..f86aa325c2 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,12 +1,22 @@ -.. _index: +.. cfncluster documentation master file, created by + sphinx-quickstart on Wed Nov 5 07:56:13 2014. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. -======================================================================= -cfncluster: A framework that deploys and maintains HPC clusters on AWS. -======================================================================= +Welcome to cfncluster's documentation! +====================================== -Getting Started ---------------- +Contents: + +.. toctree:: + :maxdepth: 2 + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` -If you've never used ``cfncluster`` before, you should read the -:doc:`Getting Started with cfncluster ` guide to get familiar -with ``cfncluster`` & its usage. \ No newline at end of file From ef41f7a33d15ec72a4a48e4d72d69be10e11c018 Mon Sep 17 00:00:00 2001 From: Dougal Ballantyne Date: Wed, 5 Nov 2014 10:58:59 -0800 Subject: [PATCH 5/5] First draft of getting started. --- docs/source/conf.py | 4 +- docs/source/getting_started.rst | 105 ++++++++++++++++++++++++++++++++ docs/source/index.rst | 11 +++- 3 files changed, 117 insertions(+), 3 deletions(-) create mode 100644 docs/source/getting_started.rst diff --git a/docs/source/conf.py b/docs/source/conf.py index be3eeeca44..044fe991c9 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -46,7 +46,7 @@ # General information about the project. project = u'cfncluster' -copyright = u'2014, Dougal Ballantyne' +copyright = u'2014, Amazon Web Services' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -199,7 +199,7 @@ # author, documentclass [howto, manual, or own class]). latex_documents = [ ('index', 'cfncluster.tex', u'cfncluster Documentation', - u'Dougal Ballantyne', 'manual'), + u'Dougal Ballantyne', u'Amazon Web Services', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst new file mode 100644 index 0000000000..96ae37a843 --- /dev/null +++ b/docs/source/getting_started.rst @@ -0,0 +1,105 @@ +.. _getting-started: + +=============================== +Getting started with cfncluster +=============================== + +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 CLI is stateless, +everything is done using CloudFormation or resources within AWS. + +Installing cfncluster +--------------------- + +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 + +``` +$ sudo pip install cfncluster +``` +or +``` +$ sudo easy_install cfncluster +``` + +#### Windows +Windows support is experimental!! + +Install the following packages: + +Python2.7 - https://www.python.org/download/ + +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 + +Now it should be possible to run the following within a command prompt window: + +``` +C:\> easy_install cfncluster +``` + +#### Upgrading + +To upgrade an older version of cfncluster, you can use either of the following commands, +depening on how it was originally installed: + +``` +$ sudo pip install --upgrade cfncluster +``` +or +``` +$ sudo easy_install -U cfncluster +``` + +** Remember when upgrading to check that the exiting config is compatible with the latest +version installed. + +====================== +Configuring cfncluster +====================== + +Once installed you will need to setup some initial config. The easiest way to do this is below: + +``` +$ cfncluster create mycluster +Starting: mycluster +Default config /home/ec2-user/.cfncluster/config not found +You can copy a template from here: /usr/lib/python2.6/site-packages/cfncluster/examples/config +$ +$ cp /usr/lib/python2.6/site-packages/cfncluster/examples/config ~/.cfncluster +``` + +You should now edit the config and set some defaults before launching the cluster. First define +a keypair that already exists in EC2. If you do not already have a keypair, refer to the EC2 +documentation on EC2 Key Pairs - http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html + +Then you should associate your choosen keypair with the cluster template. +```` +[cluster default] +# Name of an existing EC2 KeyPair to enable SSH access to the instances. +key_name = mykey +``` + +Next, a simple cluster launches into a VPC and uses an existing subnet which supports public +IP's i.e. the route table for the subnet is 0.0.0.0/0 => igw-xxxxxx. The VPC must have +"DNS Resolution = yes" and "DNS Hostnames = yes". It should also have DHCP options with the +correct "domain-name" for the region, as defined in the docs: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html + +``` +## VPC Settings +[vpc public] +# ID of the VPC you want to provision cluster into. +vpc_id = CHANGE ME, for example vpc-a1b2c3d4 +# ID of the Subnet you want to provision the Master server into +master_subnet_id = CHANGE ME, for exaple subnet-1ab2c3d4 +``` + +Once all of those settings contain valid values, you can launch the cluster by repeating the command that was used at the start. +``` +$ cfncluster create mycluster +``` +Once the cluster reaches the "CREATE_COMPLETE" status, you can connect using your normal SSH client/settings. For more details on connecting to EC2 instances, check the EC2 User Guide - http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-connect-to-instance-linux.html#using-ssh-client diff --git a/docs/source/index.rst b/docs/source/index.rst index f86aa325c2..44a439f400 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -6,6 +6,16 @@ Welcome to cfncluster's documentation! ====================================== +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 CLI is stateless, everything is done using CloudFormation or resources within AWS. + +Getting Started +--------------- + +If you've never used ``cfncluster`` before, you should read the +:doc:`Getting Started with cfncluster ` guide to get familiar +with ``cfncluster`` & its usage. + + Contents: .. toctree:: @@ -17,6 +27,5 @@ Indices and tables ================== * :ref:`genindex` -* :ref:`modindex` * :ref:`search`